@picked/client 0.0.1-dev.1773724362573 → 0.0.1-dev.1773804563218

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.
Files changed (95) hide show
  1. package/dist/{api-Z3Hn2Kw-.cjs → api-C90ugp6M.cjs} +1 -1
  2. package/dist/{api-B3x8PEp4.js → api-CQ1Lb-dB.js} +1 -1
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/plugins/create-experience/index.js +1 -1
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  7. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  9. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  10. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  11. package/dist/cjs/server/index.js +1 -1
  12. package/dist/esm/index.js +738 -742
  13. package/dist/esm/plugins/create-experience/index.js +359 -286
  14. package/dist/esm/plugins/dynamic-experiences/index.js +146 -80
  15. package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
  16. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  17. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  18. package/dist/esm/plugins/responses-indexeddb/index.js +46 -51
  19. package/dist/esm/plugins/single-page-app/index.js +24 -24
  20. package/dist/esm/server/index.js +1 -1
  21. package/dist/{experience-instance-DTyL1fNb.js → experience-instance-8P1fJuPC.js} +306 -312
  22. package/dist/experience-instance-Bi3-1tP5.cjs +1 -0
  23. package/dist/object-BbFTsGh3.cjs +1 -0
  24. package/dist/{object-CJssU1Pm.js → object-JwZ58NOH.js} +1 -1
  25. package/dist/storage-Be5xWNPC.cjs +1 -0
  26. package/dist/{storage-B2d81EOI.js → storage-Co_LbKr_.js} +30 -35
  27. package/dist/types/entities/action/action.d.ts +2 -5
  28. package/dist/types/entities/action/action.d.ts.map +1 -1
  29. package/dist/types/entities/condition/condition.d.ts +17 -0
  30. package/dist/types/entities/condition/condition.d.ts.map +1 -0
  31. package/dist/types/entities/experience/experience.d.ts +46 -31
  32. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  33. package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
  34. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  35. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  36. package/dist/types/entities/field/field.d.ts +23 -52
  37. package/dist/types/entities/field/field.d.ts.map +1 -1
  38. package/dist/types/entities/history/history.d.ts.map +1 -1
  39. package/dist/types/entities/project/project.d.ts.map +1 -1
  40. package/dist/types/entities/response/response.d.ts +9 -7
  41. package/dist/types/entities/response/response.d.ts.map +1 -1
  42. package/dist/types/entities/step/step.d.ts +20 -0
  43. package/dist/types/entities/step/step.d.ts.map +1 -0
  44. package/dist/types/index.d.ts +2 -1
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/types/logic-engine.d.ts +8 -2
  47. package/dist/types/logic-engine.d.ts.map +1 -1
  48. package/dist/types/picked.d.ts +41 -32
  49. package/dist/types/picked.d.ts.map +1 -1
  50. package/dist/types/plugins/create-experience/create-experience.d.ts +70 -39
  51. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  52. package/dist/types/plugins/create-experience/index.d.ts +1 -1
  53. package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
  54. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  55. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +20 -5
  56. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  57. package/dist/types/plugins/dynamic-experiences/types.d.ts +46 -0
  58. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  59. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -2
  60. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  61. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -2
  62. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  63. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -2
  64. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  65. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
  66. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  67. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  68. package/dist/types/utils/dom.d.ts +3 -0
  69. package/dist/types/utils/dom.d.ts.map +1 -1
  70. package/dist/types/utils/events.d.ts +2 -2
  71. package/dist/types/utils/events.d.ts.map +1 -1
  72. package/dist/types/utils/global-obj.d.ts +1 -0
  73. package/dist/types/utils/global-obj.d.ts.map +1 -1
  74. package/dist/types/utils/indexed-db.d.ts +1 -2
  75. package/dist/types/utils/indexed-db.d.ts.map +1 -1
  76. package/dist/types/utils/key.d.ts +12 -0
  77. package/dist/types/utils/key.d.ts.map +1 -0
  78. package/dist/types/utils/logger.d.ts.map +1 -1
  79. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  80. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  81. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
  82. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  83. package/dist/types/utils/nodes.d.ts +2 -2
  84. package/dist/types/utils/nodes.d.ts.map +1 -1
  85. package/dist/types/utils/object.d.ts +8 -0
  86. package/dist/types/utils/object.d.ts.map +1 -1
  87. package/dist/types/utils/picked-config.d.ts +1 -1
  88. package/dist/types/utils/picked-config.d.ts.map +1 -1
  89. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  90. package/dist/types/utils/search-params.d.ts.map +1 -1
  91. package/dist/types/utils/storage.d.ts.map +1 -1
  92. package/package.json +2 -16
  93. package/dist/experience-instance-BX0aqKsC.cjs +0 -1
  94. package/dist/object-mwaxtjLG.cjs +0 -1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GACnB,oBAAoB,GACpB,oBAAoB,CAAA;AAGxB,QAAA,MAAM,uBAAuB;sBAkBF,KAAK,KAAG,IAAI;2BAaP,SAAS,CAAC,KAAK,CAAC,WAAW,OAAO,CAAC,KAAK,CAAC,KAAG,IAAI;kBA6BzD,SAAS,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;oBAQnC,SAAS,CAAC,KAAK,CAAC,KAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;;sBAQpC,SAAS,CAAC,MAAM,CAAC,KAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;CAahE,CAAA;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAE7E;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,EAAE,QAAQ,WAAW,KAAG,IAE9D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAM9D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;CACrB;AA4FD,wBAAgB,aAAa;;sBA3EsB,MAAM;cAAQ,cAAc;;;sBACzB,MAAM;cAAQ,cAAc;;;uBAC9B,MAAM;;;iBACT,YAAY,EAAE;;;EA0E9D"}
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../src/entities/history/history.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAM9D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;CACrB;AA2FD,wBAAgB,aAAa;;sBA1EsB,MAAM;cAAQ,cAAc;;;sBACzB,MAAM;cAAQ,cAAc;;;uBAC9B,MAAM;;;iBACT,YAAY,EAAE;;;EAyE9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../../src/entities/project/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;CAC/B;AAGD,eAAO,MAAM,iBAAiB,GAC5B,gBAAgB,MAAM,EACtB,WAAW,MAAM,KAChB,OAAO,CAAC,OAAO,CAOjB,CAAA"}
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../../src/entities/project/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;CAC/B;AAED,eAAO,MAAM,iBAAiB,GAC5B,gBAAgB,MAAM,EACtB,WAAW,MAAM,KAChB,OAAO,CAAC,OAAO,CAOjB,CAAA"}
@@ -1,10 +1,12 @@
1
1
  import { Store } from 'effector';
2
2
  import { Picked } from '../../picked';
3
- import { Field, FieldValue, JsonValue } from '../field/field';
3
+ import { Field, FieldValue } from '../field/field';
4
4
  export type ResponsesStore = ReturnType<typeof createResponseIndex>;
5
5
  export type Response = FieldValue;
6
6
  export interface ResponseListItem {
7
+ /** @deprecated Use `fieldKey` instead. */
7
8
  fieldId: string;
9
+ fieldKey: string;
8
10
  value: Response | undefined;
9
11
  }
10
12
  declare const createResponseIndexFactory: ({ client }: {
@@ -25,19 +27,19 @@ declare const createResponseIndexFactory: ({ client }: {
25
27
  }>;
26
28
  listStore: Store<{
27
29
  fieldId: string;
28
- value: FieldValue | undefined;
30
+ fieldKey: string;
31
+ value: FieldValue;
29
32
  }[]>;
30
33
  getAllStore: Store<{
31
34
  [fieldId: string]: FieldValue;
32
35
  }>;
33
- getByFieldId: {
34
- (fieldId: Field["id"]): Store<FieldValue>;
35
- <T extends JsonValue>(fieldId: Field["id"]): Store<T | null>;
36
- };
36
+ getByFieldId: (fieldId: Field["id"]) => Store<FieldValue>;
37
+ getByFieldKey: (key: Field["key"]) => Store<FieldValue>;
37
38
  getByFieldName: (fieldName: Field["name"]) => Store<FieldValue>;
38
39
  };
39
40
  export declare function createResponseIndex<T extends Parameters<typeof createResponseIndexFactory>[0]>(params: T): ReturnType<typeof createResponseIndexFactory>;
40
- export type CommitResponses = Record<Field['id'], FieldValue>;
41
+ /** Record keyed by either field `id` or field `key`. Normalized to `field.id` internally on commit. */
42
+ export type CommitResponses = Record<string, FieldValue>;
41
43
  export interface ValidationError {
42
44
  fieldId: Field['id'];
43
45
  userMessage: string;
@@ -1 +1 @@
1
- {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/entities/response/response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE5F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAA;AA8CvF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAInE,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAA;AAGjC,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,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AM,EAAE,UAAU,CAAC,CAAA;AAExD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAGpB,WAAW,EAAE,MAAM,CAAA;IAGnB,aAAa,EAAE,MAAM,CAAA;IAGrB,KAAK,EAAE,UAAU,CAAA;CAClB"}
@@ -0,0 +1,20 @@
1
+ export type StepsStore = ReturnType<typeof createStepIndex>;
2
+ export interface ExperienceStep {
3
+ id: string;
4
+ key?: string;
5
+ name?: string;
6
+ /** @deprecated Use `name` instead. Populated for backwards compatibility. */
7
+ label: string;
8
+ /** @deprecated Use `fieldKeys` instead. */
9
+ fieldIds?: string[];
10
+ fieldKeys?: string[];
11
+ }
12
+ declare const createStepIndexFactory: () => {
13
+ register: (step: ExperienceStep) => void;
14
+ getById: (id: ExperienceStep["id"]) => import('effector').Store<ExperienceStep | null>;
15
+ listStore: import('effector').Store<ExperienceStep[]>;
16
+ };
17
+ export declare function createStepIndex(): ReturnType<typeof createStepIndexFactory>;
18
+ export declare function setupStep(step: ExperienceStep, index: ReturnType<typeof createStepIndex>): void;
19
+ export {};
20
+ //# sourceMappingURL=step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/entities/step/step.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI3D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAGD,QAAA,MAAM,sBAAsB;qBAcF,cAAc,KAAG,IAAI;kBAQxB,cAAc,CAAC,IAAI,CAAC;;CASzC,CAAA;AAEF,wBAAgB,eAAe,IAAI,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAE3E;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAE/F"}
@@ -1,10 +1,12 @@
1
1
  export * from './exports';
2
2
  export type * from './client';
3
3
  export type * from './entities/action/action';
4
+ export type * from './entities/condition/condition';
4
5
  export type * from './entities/component/component';
5
6
  export type * from './entities/component/lazyComponent';
6
7
  export type * from './entities/experience-instance/experience-instance';
7
8
  export type * from './entities/experience/experience';
9
+ export type * from './entities/step/step';
8
10
  export type * from './entities/feature/feature';
9
11
  export type * from './entities/field/field';
10
12
  export type * from './entities/framework/framework';
@@ -14,7 +16,6 @@ export type * from './entities/predicate/predicate';
14
16
  export type * from './entities/project/project';
15
17
  export type * from './utils/state-snaphot';
16
18
  export type * from './utils/events';
17
- export type * from './utils/search-params';
18
19
  export type * from './entities/response/response';
19
20
  export { Picked } from './picked';
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oCAAoC,CAAA;AACvD,mBAAmB,oDAAoD,CAAA;AACvE,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oCAAoC,CAAA;AACvD,mBAAmB,oDAAoD,CAAA;AACvE,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
@@ -8,14 +8,20 @@ export type LogicValue = SyncLogicValue | (() => LogicValue) | (() => Promise<Sy
8
8
  export interface LogicObject {
9
9
  [key: string]: LogicValue;
10
10
  }
11
- type LogicArray = Array<LogicValue>;
11
+ export type LogicArray = Array<LogicValue>;
12
12
  export type LogicRuleValue = string | number | boolean | null | undefined | LogicRule | LogicRule[] | LogicRuleValue[];
13
13
  export interface LogicRule {
14
14
  [key: string]: LogicRuleValue | LogicRuleValue[];
15
15
  }
16
+ export type ComparisonOperation = (a: LogicValue, b: LogicValue) => boolean;
17
+ export type NumericOperation = (a: number, b: number, c?: number) => boolean | number;
18
+ export type UnaryOperation = (a: LogicValue) => LogicValue;
19
+ export type StringOperation = (source: LogicValue, start: number, end?: number) => string;
20
+ export type ArrayOperation = (...args: LogicValue[]) => LogicValue[];
21
+ export type MathOperation = (...args: number[]) => number;
16
22
  export type LogicContext = {
17
23
  [key: string]: LogicValue;
18
24
  } | LogicValue;
25
+ export type Operation = (this: LogicContext, ...args: LogicValue[]) => LogicValue | Promise<SyncLogicValue>;
19
26
  export declare function apply(logic: LogicObject | LogicValue | undefined, data?: LogicContext): Promise<LogicValue>;
20
- export {};
21
27
  //# sourceMappingURL=logic-engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logic-engine.d.ts","sourceRoot":"","sources":["../../src/logic-engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAA;AAEpG,MAAM,MAAM,UAAU,GAClB,cAAc,GACd,CAAC,MAAM,UAAU,CAAC,GAClB,CAAC,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC,GAC/B,OAAO,CAAC,cAAc,CAAC,CAAA;AAE3B,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAC1B;AAED,KAAK,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAA;AAEnC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,SAAS,GACT,SAAS,EAAE,GACX,cAAc,EAAE,CAAA;AAEpB,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,EAAE,CAAA;CACjD;AAED,MAAM,MAAM,YAAY,GACpB;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAC1B,GACD,UAAU,CAAA;AA8Od,wBAAsB,KAAK,CACzB,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,EAC3C,IAAI,CAAC,EAAE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,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,CAAA;AACpE,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAA;AAEzD,MAAM,MAAM,YAAY,GACpB;IACE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAC1B,GACD,UAAU,CAAA;AAqCd,MAAM,MAAM,SAAS,GAAG,CACtB,IAAI,EAAE,YAAY,EAClB,GAAG,IAAI,EAAE,UAAU,EAAE,KAClB,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;AAuMzC,wBAAsB,KAAK,CACzB,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,EAC3C,IAAI,CAAC,EAAE,YAAY,GAClB,OAAO,CAAC,UAAU,CAAC,CAoJrB"}
@@ -8,7 +8,9 @@ import { Predicate } from './entities/predicate/predicate';
8
8
  import { Feature } from './entities/feature/feature';
9
9
  import { EventBusPayload, EventHistoryStore } from './utils/events';
10
10
  import { Field } from './entities/field/field';
11
+ import { ExperienceStep } from './entities/step/step';
11
12
  import { Action } from './entities/action/action';
13
+ import { Condition } from './entities/condition/condition';
12
14
  import { SessionStore } from './utils/user-session';
13
15
  import { LogicRule } from './logic-engine';
14
16
  export declare class Picked {
@@ -29,7 +31,7 @@ export declare class Picked {
29
31
  readonly precondition?: LogicRule | boolean;
30
32
  readonly condition?: LogicRule | boolean;
31
33
  preconditionPassed?: boolean;
32
- readonly searchParams: import('.').PickedSearchParams;
34
+ readonly searchParams: import('./utils/search-params').PickedSearchParams;
33
35
  readonly history: {
34
36
  push: import('effector').EventCallable<{
35
37
  experienceId: string;
@@ -66,8 +68,10 @@ export declare class Picked {
66
68
  };
67
69
  readonly experiences: {
68
70
  register: (experience: Experience) => void;
69
- get: (id: Experience["id"]) => import('effector').Store<{
71
+ get: (idOrKey: string) => import('effector').Store<{
70
72
  id: string;
73
+ key: string | undefined;
74
+ name: string;
71
75
  configStore: import('effector').Store<{
72
76
  name: string;
73
77
  decisionLogic: import('./logic-engine').LogicValue | LogicRule;
@@ -75,12 +79,11 @@ export declare class Picked {
75
79
  initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
76
80
  }>;
77
81
  treeStore: import('effector').Store<{
78
- steps: import('.').ExperienceStep[];
82
+ steps: string[];
79
83
  nodes: import('.').ExperienceNode[];
80
84
  edges: import('.').ExperienceEdge[];
81
- conditionals: import('.').ExperienceConditional[];
85
+ conditions: import('.').ExperienceCondition[];
82
86
  }>;
83
- fieldsStore: import('effector').Store<Field[]>;
84
87
  componentStore: import('effector').Store<{
85
88
  name: string;
86
89
  component: AdaptedComponent<string, unknown>;
@@ -92,8 +95,10 @@ export declare class Picked {
92
95
  strategy: "override";
93
96
  }>;
94
97
  } | undefined>;
95
- getById: (id: Experience["id"]) => import('effector').Store<{
98
+ getById: (idOrKey: string) => import('effector').Store<{
96
99
  id: string;
100
+ key: string | undefined;
101
+ name: string;
97
102
  configStore: import('effector').Store<{
98
103
  name: string;
99
104
  decisionLogic: import('./logic-engine').LogicValue | LogicRule;
@@ -101,12 +106,11 @@ export declare class Picked {
101
106
  initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
102
107
  }>;
103
108
  treeStore: import('effector').Store<{
104
- steps: import('.').ExperienceStep[];
109
+ steps: string[];
105
110
  nodes: import('.').ExperienceNode[];
106
111
  edges: import('.').ExperienceEdge[];
107
- conditionals: import('.').ExperienceConditional[];
112
+ conditions: import('.').ExperienceCondition[];
108
113
  }>;
109
- fieldsStore: import('effector').Store<Field[]>;
110
114
  componentStore: import('effector').Store<{
111
115
  name: string;
112
116
  component: AdaptedComponent<string, unknown>;
@@ -128,6 +132,8 @@ export declare class Picked {
128
132
  }, void, Error>;
129
133
  listStore: import('effector').Store<{
130
134
  id: string;
135
+ key: string | undefined;
136
+ name: string;
131
137
  configStore: import('effector').Store<{
132
138
  name: string;
133
139
  decisionLogic: import('./logic-engine').LogicValue | LogicRule;
@@ -135,12 +141,11 @@ export declare class Picked {
135
141
  initializeOpenLogic: import('./logic-engine').LogicValue | LogicRule;
136
142
  }>;
137
143
  treeStore: import('effector').Store<{
138
- steps: import('.').ExperienceStep[];
144
+ steps: string[];
139
145
  nodes: import('.').ExperienceNode[];
140
146
  edges: import('.').ExperienceEdge[];
141
- conditionals: import('.').ExperienceConditional[];
147
+ conditions: import('.').ExperienceCondition[];
142
148
  }>;
143
- fieldsStore: import('effector').Store<Field[]>;
144
149
  componentStore: import('effector').Store<{
145
150
  name: string;
146
151
  component: AdaptedComponent<string, unknown>;
@@ -174,6 +179,20 @@ export declare class Picked {
174
179
  listStore: import('effector').Store<import('.').FeatureBucket[]>;
175
180
  getEvokableFeature: (featureName: string) => import('effector').Store<() => Promise<boolean | string | undefined>>;
176
181
  };
182
+ readonly conditions: {
183
+ register: (condition: Condition) => void;
184
+ getById: (id: Condition["id"]) => import('effector').Store<Condition | null>;
185
+ getByKey: (key: Condition["key"]) => import('effector').Store<Condition | null>;
186
+ listStore: import('effector').Store<Condition[]>;
187
+ };
188
+ readonly fields: {
189
+ register: (field: Field) => void;
190
+ update: (fieldKeyOrId: import('.').FieldBase["key"], updates: Partial<Field>) => void;
191
+ getById: (id: import('.').FieldBase["id"]) => import('effector').Store<Field | null>;
192
+ getByKey: (key: import('.').FieldBase["key"]) => import('effector').Store<Field | null>;
193
+ listStore: import('effector').Store<Field[]>;
194
+ getByName: (name: import('.').FieldBase["name"]) => import('effector').Store<Field | null>;
195
+ };
177
196
  readonly responses: {
178
197
  register: {
179
198
  (fieldId: Field["id"], response: import('.').Response): void;
@@ -190,32 +209,20 @@ export declare class Picked {
190
209
  }>;
191
210
  listStore: import('effector').Store<{
192
211
  fieldId: string;
193
- value: import('.').FieldValue | undefined;
212
+ fieldKey: string;
213
+ value: import('.').FieldValue;
194
214
  }[]>;
195
215
  getAllStore: import('effector').Store<{
196
216
  [fieldId: string]: import('.').FieldValue;
197
217
  }>;
198
- getByFieldId: {
199
- (fieldId: Field["id"]): import('effector').Store<import('.').FieldValue>;
200
- <T extends import('.').JsonValue>(fieldId: Field["id"]): import('effector').Store<T | null>;
201
- };
218
+ getByFieldId: (fieldId: Field["id"]) => import('effector').Store<import('.').FieldValue>;
219
+ getByFieldKey: (key: Field["key"]) => import('effector').Store<import('.').FieldValue>;
202
220
  getByFieldName: (fieldName: Field["name"]) => import('effector').Store<import('.').FieldValue>;
203
221
  };
204
- readonly fields: {
205
- register: (field: Field) => void;
206
- update: (fieldId: import('.').FieldBase["id"], updates: Partial<Field>) => void;
207
- getById: (id: import('.').FieldBase["id"]) => import('effector').Store<import('.').FieldWithStatus | null>;
208
- listStore: import('effector').Store<import('.').FieldWithStatus[]>;
209
- getByName: (name: import('.').FieldBase["name"]) => import('effector').Store<import('.').FieldWithStatus | null>;
210
- resolve: (fieldId: string, opts?: {
211
- force?: boolean;
212
- context?: import('./logic-engine').LogicObject;
213
- }) => void;
214
- resolveAll: (fieldIds: string[], opts?: {
215
- force?: boolean;
216
- context?: import('./logic-engine').LogicObject;
217
- }) => void;
218
- setWaiting: import('effector').EventCallable<string>;
222
+ readonly steps: {
223
+ register: (step: ExperienceStep) => void;
224
+ getById: (id: ExperienceStep["id"]) => import('effector').Store<ExperienceStep | null>;
225
+ listStore: import('effector').Store<ExperienceStep[]>;
219
226
  };
220
227
  readonly actions: {
221
228
  register: (name: string, action: Action) => void;
@@ -230,7 +237,9 @@ export declare class Picked {
230
237
  registerPlugin: (plugin: Plugin) => void;
231
238
  registerFeature: (name: string, feature: Feature) => void;
232
239
  registerPredicate: (name: string, predicate: Predicate) => void;
240
+ registerCondition: (condition: Condition) => void;
233
241
  registerField: (field: Field) => void;
242
+ registerStep: (step: ExperienceStep) => void;
234
243
  registerAction: (name: string, action: Action) => void;
235
244
  registerExperience: (experience: Experience) => void;
236
245
  getStateSnapshot: () => StateSnapshot;
@@ -1 +1 @@
1
- {"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/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,IAAI,CAEvD;IAED,iBAAiB,GAAI,MAAM,MAAM,EAAE,WAAW,SAAS,KAAG,IAAI,CAE7D;IAED,iBAAiB,GAAI,WAAW,SAAS,KAAG,IAAI,CAE/C;IAED,aAAa,GAAI,OAAO,KAAK,KAAG,IAAI,CAEnC;IAED,YAAY,GAAI,MAAM,cAAc,KAAG,IAAI,CAE1C;IAED,cAAc,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,IAAI,CAEpD;IAED,kBAAkB,GAAI,YAAY,UAAU,KAAG,IAAI,CAMlD;IAED,gBAAgB,QAAO,aAAa,CAEnC;IAED,iFAAiF;IACjF,oBAAoB,GAClB,cAAc,MAAM,EACpB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED,+EAA+E;IAC/E,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;YAEa,mBAAmB;YAMnB,YAAY;IAc1B,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,GAAI,YAAY,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,YAAY,GAAI,UAAU,MAAM,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MAAM,CAY3E;CACF"}
@@ -1,29 +1,37 @@
1
- import { ActionNode, Experience, ExperienceConditional, ExperienceEdge, ExperienceNode, ExperienceStep, ExperienceTarget } from '../../entities/experience/experience';
1
+ import { ActionNode, Experience, ExperienceCondition, ExperienceEdge, ExperienceNode, ExperienceTarget } from '../../entities/experience/experience';
2
+ import { ExperienceStep } from '../../entities/step/step';
2
3
  import { AdaptedComponent } from '../../entities/component/component';
3
4
  import { LogicRule, LogicValue } from '../../logic-engine';
4
- import { Field, JsonValue, FieldOptionValue, FieldOption, FieldOptionArray, FieldOptions } from '../../entities/field/field';
5
+ import { Field, FieldBooleanMultiple, FieldBooleanSingular, FieldNumberMultiple, FieldNumberSingular, FieldObjectMultiple, FieldObjectSingular, FieldTextMultiple, FieldTextSingular, JsonValue } from '../../entities/field/field';
5
6
  import { Serialized } from './serialization';
6
- export type { FieldOptionValue, FieldOption, FieldOptionArray, FieldOptions };
7
7
  export interface Nodeable {
8
8
  node: SerializableNode | null;
9
9
  }
10
10
  export interface SerializableStep extends Nodeable {
11
11
  id: string;
12
+ name: string;
13
+ key: string;
14
+ /** @deprecated Use `name` instead. */
12
15
  label: string;
13
16
  fields: SerializableField[];
14
17
  experience: SerializableExperience;
15
18
  nextStep: (stepOptions: CreateStepOptions | SerializableStep) => SerializableStep;
16
- nextConditional: (conditionalOptions: CreateConditionalOptions | SerializableConditional) => SerializableConditional;
19
+ nextCondition: (conditionOptions: CreateConditionOptions | SerializableCondition) => SerializableCondition;
20
+ /** @deprecated Use `nextCondition` instead. */
21
+ nextConditional: (conditionOptions: CreateConditionOptions | SerializableCondition) => SerializableCondition;
17
22
  addNextExperience: (experience: SerializableExperience) => SerializableExperience;
18
23
  addField: (fieldOptions: CreateFieldOptions | SerializableField) => SerializableField;
19
24
  serialize: () => Serialized<ExperienceStep>;
20
25
  }
21
26
  export interface CreateStepOptions {
22
27
  id?: string;
23
- label: string;
28
+ name?: string;
29
+ key?: string;
30
+ /** @deprecated Use `name` instead. */
31
+ label?: string;
24
32
  fields?: SerializableField[];
25
33
  }
26
- export type SerializableNode = SerializableStepNode | SerializableConditionalNode | SerializableLaunchExperienceNode | SerializableOriginNode | SerializableActionNode;
34
+ export type SerializableNode = SerializableStepNode | SerializableConditionNode | SerializableLaunchExperienceNode | SerializableOriginNode | SerializableActionNode;
27
35
  export interface SerializableActionNode extends SerializableBaseNode {
28
36
  type: 'action';
29
37
  action: string;
@@ -45,10 +53,12 @@ export interface SerializableStepNode extends SerializableBaseNode {
45
53
  type: 'step';
46
54
  connectedStep: SerializableStep;
47
55
  }
48
- export interface SerializableConditionalNode extends SerializableBaseNode {
56
+ export interface SerializableConditionNode extends SerializableBaseNode {
49
57
  type: 'conditional';
50
- connectedConditional: SerializableConditional;
58
+ connectedCondition: SerializableCondition;
51
59
  }
60
+ /** @deprecated Use {@link SerializableConditionNode} instead. */
61
+ export type SerializableConditionalNode = SerializableConditionNode;
52
62
  export interface SerializableLaunchExperienceNode extends SerializableBaseNode {
53
63
  type: 'experience';
54
64
  connectedExperience: SerializableExperience;
@@ -60,7 +70,7 @@ export type CreateNodeOptions = {
60
70
  step: SerializableStep;
61
71
  type: 'step';
62
72
  } | {
63
- conditional: SerializableConditional;
73
+ conditional: SerializableCondition;
64
74
  type: 'conditional';
65
75
  } | {
66
76
  type: 'origin';
@@ -84,70 +94,81 @@ export interface CreateEdgeOptions {
84
94
  sourceNodeHandle: 'true' | 'false' | null;
85
95
  destinationNode: SerializableNode;
86
96
  }
87
- export interface SerializableConditional extends Nodeable {
97
+ export interface SerializableCondition extends Nodeable {
88
98
  id: string;
89
99
  label?: string;
90
100
  condition: LogicRule;
91
101
  experience: SerializableExperience;
92
102
  addTrue: (nodeable: Nodeable) => undefined;
93
103
  addFalse: (nodeable: Nodeable) => undefined;
94
- serialize: () => Serialized<ExperienceConditional>;
104
+ serialize: () => Serialized<ExperienceCondition>;
95
105
  }
96
- export interface CreateConditionalOptions {
106
+ /** @deprecated Use {@link SerializableCondition} instead. */
107
+ export type SerializableConditional = SerializableCondition;
108
+ export interface CreateConditionOptions {
97
109
  condition: LogicRule;
98
110
  label?: string;
99
111
  }
100
- export interface CreateFieldOptions<T extends JsonValue = JsonValue> {
101
- id: string;
102
- name: string;
103
- type: 'text' | 'number' | 'boolean' | 'object';
104
- label: string;
112
+ /** @deprecated Use {@link CreateConditionOptions} instead. */
113
+ export type CreateConditionalOptions = CreateConditionOptions;
114
+ export type CreateFieldOptions = Omit<Field, 'id' | 'key' | 'options' | 'placeholder' | 'description' | 'helpText' | 'validation' | 'policies' | 'defaultValue'> & {
115
+ /**
116
+ * @deprecated Provide `key` instead. If omitted, a stable key is auto-generated from `name`.
117
+ * The internal `id` is derived from `key` when not explicitly set.
118
+ */
119
+ id?: string;
120
+ key?: string;
121
+ defaultValue?: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
105
122
  placeholder?: string;
106
123
  description?: string;
107
124
  helpText?: string;
108
- defaultValue?: T | T[] | null;
109
- multiple: boolean;
110
125
  validation?: LogicRule;
111
- condition?: LogicRule;
112
- required: boolean;
113
- options?: FieldOptions<JsonValue>;
114
- dependsOn?: string[];
115
126
  policies?: {
116
127
  doNotTrackValue?: boolean;
117
128
  doNotStoreValue?: boolean;
118
129
  };
119
- }
120
- export interface SerializableField<T extends JsonValue = JsonValue> {
130
+ options?: NonNullable<FieldTextSingular['options']>[number][] | NonNullable<FieldTextMultiple['options']>[number][] | NonNullable<FieldNumberSingular['options']>[number][] | NonNullable<FieldNumberMultiple['options']>[number][] | NonNullable<FieldBooleanSingular['options']>[number][] | NonNullable<FieldBooleanMultiple['options']>[number][] | Omit<NonNullable<FieldObjectSingular['options']>[number], 'id'>[] | Omit<NonNullable<FieldObjectMultiple['options']>[number], 'id'>[];
131
+ };
132
+ export type SerializableField<T extends JsonValue = JsonValue> = {
121
133
  id: string;
134
+ key: string;
122
135
  name: string;
123
- type: 'text' | 'number' | 'boolean' | 'object';
124
136
  label: string;
137
+ type: 'text' | 'number' | 'object' | 'boolean';
138
+ multiple: boolean;
139
+ required: boolean;
140
+ defaultValue: string | number | boolean | object | null | string[] | number[] | boolean[] | object[];
125
141
  placeholder?: string;
126
142
  description?: string;
127
143
  helpText?: string;
128
- defaultValue?: JsonValue | JsonValue[] | null;
129
- multiple: boolean;
130
- validation?: LogicRule;
144
+ validation: LogicRule;
131
145
  condition?: LogicRule;
132
- required: boolean;
133
- options: FieldOptionArray<JsonValue> | LogicRule | null;
134
- dependsOn?: string[];
135
146
  policies?: {
136
147
  doNotTrackValue?: boolean;
137
148
  doNotStoreValue?: boolean;
138
149
  };
150
+ options: {
151
+ id: string;
152
+ label: string;
153
+ description?: string;
154
+ value: JsonValue;
155
+ condition?: LogicRule;
156
+ }[] | null;
139
157
  /**
140
158
  * Phantom type property for TypeScript type inference.
141
159
  * This property never exists at runtime but enables type-safe field value access.
160
+ *
142
161
  * @internal
143
162
  */
144
163
  __fieldType?: T;
164
+ } & {
145
165
  serialize: () => Serialized<Field>;
146
- }
166
+ };
147
167
  export interface SerializableExperience {
148
168
  id: string;
149
169
  component?: AdaptedComponent;
150
170
  name: string;
171
+ /** Decision logic that controls whether this experience is initialised. */
151
172
  condition?: LogicRule | LogicValue;
152
173
  initializeOpen?: LogicRule | LogicValue;
153
174
  targets: ExperienceTarget[];
@@ -155,13 +176,19 @@ export interface SerializableExperience {
155
176
  nodes: SerializableNode[];
156
177
  edges: SerializableEdge[];
157
178
  fields: SerializableField[];
158
- conditionals: SerializableConditional[];
179
+ conditions: SerializableCondition[];
180
+ /** @deprecated Use `conditions` instead. */
181
+ conditionals: SerializableCondition[];
159
182
  addStep: (stepOptions: CreateStepOptions | SerializableStep | OrphanStep, after?: {
160
183
  node: SerializableNode | null;
161
184
  }) => SerializableStep;
162
- addConditional: (conditionalOptions: CreateConditionalOptions | SerializableConditional, after?: {
185
+ addCondition: (conditionOptions: CreateConditionOptions | SerializableCondition, after?: {
163
186
  node: SerializableNode | null;
164
- }) => SerializableConditional;
187
+ }) => SerializableCondition;
188
+ /** @deprecated Use `addCondition` instead. */
189
+ addConditional: (conditionOptions: CreateConditionOptions | SerializableCondition, after?: {
190
+ node: SerializableNode | null;
191
+ }) => SerializableCondition;
165
192
  addExperience: (experience: SerializableExperience, after?: {
166
193
  node: SerializableNode | null;
167
194
  }) => SerializableExperience;
@@ -174,21 +201,25 @@ export interface SerializableExperience {
174
201
  export interface CreateExperienceOptions {
175
202
  id: string;
176
203
  name: string;
204
+ /** Decision logic that controls whether this experience is initialised. */
177
205
  condition?: LogicRule | LogicValue;
178
206
  initializeOpen?: LogicRule | LogicValue;
179
207
  targets: ExperienceTarget[];
180
208
  component?: AdaptedComponent;
181
209
  }
182
- export type OrphanStep = Omit<SerializableStep, 'nextStep' | 'nextConditional' | 'addNextExperience' | 'node' | 'serialize' | 'addField' | 'experience'> & {
210
+ export type OrphanStep = Omit<SerializableStep, 'nextStep' | 'nextCondition' | 'nextConditional' | 'addNextExperience' | 'node' | 'serialize' | 'addField' | 'experience'> & {
183
211
  addField: (fieldOrFieldOptions: CreateFieldOptions | SerializableField) => void;
184
212
  };
185
213
  export declare const createStep: (stepOptions: CreateStepOptions) => OrphanStep;
186
214
  export declare const bindExperienceStep: (stepOptions: CreateStepOptions | OrphanStep, experience: SerializableExperience) => SerializableStep;
187
215
  export declare const createNode: (nodeOptions: CreateNodeOptions, experience: SerializableExperience) => SerializableNode;
188
216
  export declare const createEdge: (edgeOptions: CreateEdgeOptions, experience: SerializableExperience) => SerializableEdge;
189
- export declare const createConditional: (conditionalOptions: CreateConditionalOptions, experience: SerializableExperience) => SerializableConditional;
217
+ export declare const createCondition: (conditionOptions: CreateConditionOptions, experience: SerializableExperience) => SerializableCondition;
218
+ /** @deprecated Use `createCondition` instead. */
219
+ export declare function createConditional(...args: Parameters<typeof createCondition>): ReturnType<typeof createCondition>;
190
220
  /**
191
221
  * Creates a field with optional generic type parameter for object field type safety.
222
+ *
192
223
  * @template T - The type of the object field value (only applicable for type: 'object')
193
224
  * @param fieldOptions - The field configuration options
194
225
  * @returns A serializable field with type information
@@ -202,6 +233,6 @@ export declare const createConditional: (conditionalOptions: CreateConditionalOp
202
233
  * const typedField = createField<MyData>({ type: 'object', ... })
203
234
  * ```
204
235
  */
205
- export declare const createField: <T extends JsonValue = JsonValue>(fieldOptions: CreateFieldOptions<T>) => SerializableField<T>;
236
+ export declare const createField: <T extends JsonValue = JsonValue>(fieldOptions: CreateFieldOptions) => SerializableField<T>;
206
237
  export declare const createExperience: (experience: CreateExperienceOptions) => SerializableExperience;
207
238
  //# sourceMappingURL=create-experience.d.ts.map