@walkeros/web-source-datalayer 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,49 @@
1
- import { Source, WalkerOS, Elb, Mapping as Mapping$1 } from '@walkeros/core';
1
+ import { z, Source, WalkerOS, Elb, Mapping as Mapping$1 } from '@walkeros/core';
2
+ import * as zod_to_json_schema from 'zod-to-json-schema';
3
+
4
+ /**
5
+ * JavaScript variable name
6
+ * Used for dataLayer variable naming
7
+ */
8
+ declare const JavaScriptVarName: z.ZodString;
9
+ /**
10
+ * Event prefix
11
+ * Used for filtering dataLayer events
12
+ */
13
+ declare const EventPrefix: z.ZodString;
14
+
15
+ /**
16
+ * DataLayer source settings schema
17
+ */
18
+ declare const SettingsSchema: z.ZodObject<{
19
+ name: z.ZodOptional<z.ZodDefault<z.ZodString>>;
20
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
21
+ filter: z.ZodOptional<z.ZodAny>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ name?: string | undefined;
24
+ prefix?: string | undefined;
25
+ filter?: any;
26
+ }, {
27
+ name?: string | undefined;
28
+ prefix?: string | undefined;
29
+ filter?: any;
30
+ }>;
31
+ type Settings$1 = z.infer<typeof SettingsSchema>;
32
+
33
+ declare const settings: zod_to_json_schema.JsonSchema7Type & {
34
+ $schema?: string | undefined;
35
+ definitions?: {
36
+ [key: string]: zod_to_json_schema.JsonSchema7Type;
37
+ } | undefined;
38
+ };
39
+
40
+ declare const index$1_EventPrefix: typeof EventPrefix;
41
+ declare const index$1_JavaScriptVarName: typeof JavaScriptVarName;
42
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
43
+ declare const index$1_settings: typeof settings;
44
+ declare namespace index$1 {
45
+ export { index$1_EventPrefix as EventPrefix, index$1_JavaScriptVarName as JavaScriptVarName, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_settings as settings };
46
+ }
2
47
 
3
48
  declare global {
4
49
  interface Window {
@@ -7,7 +52,8 @@ declare global {
7
52
  }
8
53
  }
9
54
  type DataLayer = Array<unknown>;
10
- interface Settings extends Record<string, unknown> {
55
+ type BaseSettings = z.infer<typeof SettingsSchema>;
56
+ interface Settings extends Omit<BaseSettings, 'filter'> {
11
57
  name?: string;
12
58
  prefix?: string;
13
59
  filter?: (event: unknown) => WalkerOS.PromiseOrValue<boolean>;
@@ -151,4 +197,4 @@ declare namespace mapping {
151
197
  */
152
198
  declare const sourceDataLayer: Source.Init<Types>;
153
199
 
154
- export { events as Events, mapping as Mapping, index as SourceDataLayer, consentOnlyMapping, consentUpdate$1 as consentUpdateEvent, config as dataLayerExamples, sourceDataLayer as default, env, sourceDataLayer };
200
+ export { events as Events, mapping as Mapping, index as SourceDataLayer, consentOnlyMapping, consentUpdate$1 as consentUpdateEvent, config as dataLayerExamples, sourceDataLayer as default, env, index$1 as schemas, sourceDataLayer };