@rxova/journey-core 1.0.0-rc.3 → 1.0.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/README.md +182 -186
- package/dist/connectors/immer/immer.cjs +2 -0
- package/dist/connectors/immer/immer.cjs.map +7 -0
- package/dist/connectors/immer/immer.d.cts +11 -0
- package/dist/connectors/immer/immer.d.ts +11 -0
- package/dist/connectors/immer/immer.js +2 -0
- package/dist/connectors/immer/immer.js.map +7 -0
- package/dist/connectors/immer/immer.types.d.cts +9 -0
- package/dist/connectors/immer/immer.types.d.ts +9 -0
- package/dist/core/errors.d.cts +57 -0
- package/dist/core/errors.d.ts +57 -0
- package/dist/core/helpers.d.cts +46 -0
- package/dist/core/helpers.d.ts +46 -0
- package/dist/core/machine.d.cts +9 -0
- package/dist/core/machine.d.ts +9 -0
- package/dist/core/runtime.d.cts +115 -0
- package/dist/core/runtime.d.ts +115 -0
- package/dist/core/runtime.types.d.cts +112 -0
- package/dist/core/runtime.types.d.ts +112 -0
- package/dist/core/store.d.cts +31 -0
- package/dist/core/store.d.ts +31 -0
- package/dist/core/types.d.cts +481 -0
- package/dist/core/types.d.ts +481 -0
- package/dist/diagnostics/diagnostics.helpers.d.cts +17 -0
- package/dist/diagnostics/diagnostics.helpers.d.ts +17 -0
- package/dist/diagnostics/diagnostics.types.d.cts +22 -0
- package/dist/diagnostics/diagnostics.types.d.ts +22 -0
- package/dist/graph/bag.types.d.cts +91 -0
- package/dist/graph/bag.types.d.ts +91 -0
- package/dist/graph/graph.d.cts +63 -0
- package/dist/graph/graph.d.ts +63 -0
- package/dist/graph/graph.types.d.cts +212 -0
- package/dist/graph/graph.types.d.ts +212 -0
- package/dist/graph/work.d.cts +81 -0
- package/dist/graph/work.d.ts +81 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/linear/linear.d.cts +33 -0
- package/dist/linear/linear.d.ts +33 -0
- package/dist/linear/linear.types.d.cts +28 -0
- package/dist/linear/linear.types.d.ts +28 -0
- package/dist/plugins/analytics/analytics.d.cts +8 -0
- package/dist/plugins/analytics/analytics.d.ts +8 -0
- package/dist/plugins/analytics/analytics.helpers.d.cts +2 -0
- package/dist/plugins/analytics/analytics.helpers.d.ts +2 -0
- package/dist/plugins/analytics/analytics.types.d.cts +27 -0
- package/dist/plugins/analytics/analytics.types.d.ts +27 -0
- package/dist/plugins/execution-paths/execution-paths.d.cts +7 -4
- package/dist/plugins/execution-paths/execution-paths.d.ts +7 -4
- package/dist/plugins/execution-paths/execution-paths.types.d.cts +21 -0
- package/dist/plugins/execution-paths/execution-paths.types.d.ts +21 -0
- package/dist/plugins/index.cjs +2 -0
- package/dist/plugins/index.cjs.map +7 -0
- package/dist/plugins/index.d.cts +19 -0
- package/dist/plugins/index.d.ts +19 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/index.js.map +7 -0
- package/dist/plugins/persistence/persistence.d.cts +16 -0
- package/dist/plugins/persistence/persistence.d.ts +16 -0
- package/dist/plugins/persistence/persistence.helpers.d.cts +34 -0
- package/dist/plugins/persistence/persistence.helpers.d.ts +34 -0
- package/dist/plugins/persistence/persistence.types.d.cts +63 -0
- package/dist/plugins/persistence/persistence.types.d.ts +63 -0
- package/dist/plugins/replay/replay.d.cts +7 -0
- package/dist/plugins/replay/replay.d.ts +7 -0
- package/dist/plugins/replay/replay.helpers.d.cts +22 -0
- package/dist/plugins/replay/replay.helpers.d.ts +22 -0
- package/dist/plugins/replay/replay.types.d.cts +28 -0
- package/dist/plugins/replay/replay.types.d.ts +28 -0
- package/package.json +61 -79
- package/dist/journey-builder/index.d.cts +0 -5
- package/dist/journey-builder/index.d.ts +0 -5
- package/dist/journey-builder/types.d.cts +0 -126
- package/dist/journey-builder/types.d.ts +0 -126
- package/dist/journey-machine/async-state.d.cts +0 -12
- package/dist/journey-machine/async-state.d.ts +0 -12
- package/dist/journey-machine/computed.d.cts +0 -2
- package/dist/journey-machine/computed.d.ts +0 -2
- package/dist/journey-machine/controls.d.cts +0 -17
- package/dist/journey-machine/controls.d.ts +0 -17
- package/dist/journey-machine/helpers.d.cts +0 -52
- package/dist/journey-machine/helpers.d.ts +0 -52
- package/dist/journey-machine/index.d.cts +0 -3
- package/dist/journey-machine/index.d.ts +0 -3
- package/dist/journey-machine/navigation.d.cts +0 -32
- package/dist/journey-machine/navigation.d.ts +0 -32
- package/dist/journey-machine/plugin-controller.d.cts +0 -15
- package/dist/journey-machine/plugin-controller.d.ts +0 -15
- package/dist/journey-machine/resolve-journey-definition.d.cts +0 -2
- package/dist/journey-machine/resolve-journey-definition.d.ts +0 -2
- package/dist/journey-machine/runtime.d.cts +0 -33
- package/dist/journey-machine/runtime.d.ts +0 -33
- package/dist/journey-machine/send.d.cts +0 -9
- package/dist/journey-machine/send.d.ts +0 -9
- package/dist/plugins/analytics/index.cjs +0 -2
- package/dist/plugins/analytics/index.cjs.map +0 -7
- package/dist/plugins/analytics/index.d.cts +0 -25
- package/dist/plugins/analytics/index.d.ts +0 -25
- package/dist/plugins/analytics/index.js +0 -2
- package/dist/plugins/analytics/index.js.map +0 -7
- package/dist/plugins/autosave/index.cjs +0 -2
- package/dist/plugins/autosave/index.cjs.map +0 -7
- package/dist/plugins/autosave/index.d.cts +0 -17
- package/dist/plugins/autosave/index.d.ts +0 -17
- package/dist/plugins/autosave/index.js +0 -2
- package/dist/plugins/autosave/index.js.map +0 -7
- package/dist/plugins/diagnostics/diagnostics.d.cts +0 -3
- package/dist/plugins/diagnostics/diagnostics.d.ts +0 -3
- package/dist/plugins/diagnostics/index.cjs +0 -2
- package/dist/plugins/diagnostics/index.cjs.map +0 -7
- package/dist/plugins/diagnostics/index.d.cts +0 -15
- package/dist/plugins/diagnostics/index.d.ts +0 -15
- package/dist/plugins/diagnostics/index.js +0 -2
- package/dist/plugins/diagnostics/index.js.map +0 -7
- package/dist/plugins/execution-paths/index.cjs +0 -2
- package/dist/plugins/execution-paths/index.cjs.map +0 -7
- package/dist/plugins/execution-paths/index.d.cts +0 -18
- package/dist/plugins/execution-paths/index.d.ts +0 -18
- package/dist/plugins/execution-paths/index.js +0 -2
- package/dist/plugins/execution-paths/index.js.map +0 -7
- package/dist/plugins/persistence/controller.d.cts +0 -17
- package/dist/plugins/persistence/controller.d.ts +0 -17
- package/dist/plugins/persistence/index.cjs +0 -2
- package/dist/plugins/persistence/index.cjs.map +0 -7
- package/dist/plugins/persistence/index.d.cts +0 -12
- package/dist/plugins/persistence/index.d.ts +0 -12
- package/dist/plugins/persistence/index.js +0 -2
- package/dist/plugins/persistence/index.js.map +0 -7
- package/dist/plugins/replay/index.cjs +0 -2
- package/dist/plugins/replay/index.cjs.map +0 -7
- package/dist/plugins/replay/index.d.cts +0 -27
- package/dist/plugins/replay/index.d.ts +0 -27
- package/dist/plugins/replay/index.js +0 -2
- package/dist/plugins/replay/index.js.map +0 -7
- package/dist/types/analytics.types.d.cts +0 -33
- package/dist/types/analytics.types.d.ts +0 -33
- package/dist/types/autosave.types.d.cts +0 -23
- package/dist/types/autosave.types.d.ts +0 -23
- package/dist/types/diagnostics.types.d.cts +0 -38
- package/dist/types/diagnostics.types.d.ts +0 -38
- package/dist/types/index.d.cts +0 -9
- package/dist/types/index.d.ts +0 -9
- package/dist/types/journey.types.d.cts +0 -191
- package/dist/types/journey.types.d.ts +0 -191
- package/dist/types/machine.types.d.cts +0 -104
- package/dist/types/machine.types.d.ts +0 -104
- package/dist/types/observation.types.d.cts +0 -83
- package/dist/types/observation.types.d.ts +0 -83
- package/dist/types/persistence.types.d.cts +0 -34
- package/dist/types/persistence.types.d.ts +0 -34
- package/dist/types/replay.types.d.cts +0 -35
- package/dist/types/replay.types.d.ts +0 -35
- package/dist/types/transitions.types.d.cts +0 -122
- package/dist/types/transitions.types.d.ts +0 -122
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxova/journey-core",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Journey core state machine.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"journey",
|
|
@@ -41,6 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"author": "Jonatan Kruszewski",
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=20.11.0"
|
|
46
|
+
},
|
|
44
47
|
"type": "module",
|
|
45
48
|
"main": "./dist/index.cjs",
|
|
46
49
|
"module": "./dist/index.js",
|
|
@@ -54,53 +57,21 @@
|
|
|
54
57
|
"import": "./dist/index.js",
|
|
55
58
|
"require": "./dist/index.cjs"
|
|
56
59
|
},
|
|
57
|
-
"./
|
|
58
|
-
"types": {
|
|
59
|
-
"import": "./dist/plugins/analytics/index.d.ts",
|
|
60
|
-
"require": "./dist/plugins/analytics/index.d.cts"
|
|
61
|
-
},
|
|
62
|
-
"import": "./dist/plugins/analytics/index.js",
|
|
63
|
-
"require": "./dist/plugins/analytics/index.cjs"
|
|
64
|
-
},
|
|
65
|
-
"./autosave": {
|
|
66
|
-
"types": {
|
|
67
|
-
"import": "./dist/plugins/autosave/index.d.ts",
|
|
68
|
-
"require": "./dist/plugins/autosave/index.d.cts"
|
|
69
|
-
},
|
|
70
|
-
"import": "./dist/plugins/autosave/index.js",
|
|
71
|
-
"require": "./dist/plugins/autosave/index.cjs"
|
|
72
|
-
},
|
|
73
|
-
"./diagnostics": {
|
|
74
|
-
"types": {
|
|
75
|
-
"import": "./dist/plugins/diagnostics/index.d.ts",
|
|
76
|
-
"require": "./dist/plugins/diagnostics/index.d.cts"
|
|
77
|
-
},
|
|
78
|
-
"import": "./dist/plugins/diagnostics/index.js",
|
|
79
|
-
"require": "./dist/plugins/diagnostics/index.cjs"
|
|
80
|
-
},
|
|
81
|
-
"./persistence": {
|
|
60
|
+
"./plugins": {
|
|
82
61
|
"types": {
|
|
83
|
-
"import": "./dist/plugins/
|
|
84
|
-
"require": "./dist/plugins/
|
|
62
|
+
"import": "./dist/plugins/index.d.ts",
|
|
63
|
+
"require": "./dist/plugins/index.d.cts"
|
|
85
64
|
},
|
|
86
|
-
"import": "./dist/plugins/
|
|
87
|
-
"require": "./dist/plugins/
|
|
65
|
+
"import": "./dist/plugins/index.js",
|
|
66
|
+
"require": "./dist/plugins/index.cjs"
|
|
88
67
|
},
|
|
89
|
-
"./
|
|
68
|
+
"./connectors/immer": {
|
|
90
69
|
"types": {
|
|
91
|
-
"import": "./dist/
|
|
92
|
-
"require": "./dist/
|
|
70
|
+
"import": "./dist/connectors/immer/immer.d.ts",
|
|
71
|
+
"require": "./dist/connectors/immer/immer.d.cts"
|
|
93
72
|
},
|
|
94
|
-
"import": "./dist/
|
|
95
|
-
"require": "./dist/
|
|
96
|
-
},
|
|
97
|
-
"./execution-paths": {
|
|
98
|
-
"types": {
|
|
99
|
-
"import": "./dist/plugins/execution-paths/index.d.ts",
|
|
100
|
-
"require": "./dist/plugins/execution-paths/index.d.cts"
|
|
101
|
-
},
|
|
102
|
-
"import": "./dist/plugins/execution-paths/index.js",
|
|
103
|
-
"require": "./dist/plugins/execution-paths/index.cjs"
|
|
73
|
+
"import": "./dist/connectors/immer/immer.js",
|
|
74
|
+
"require": "./dist/connectors/immer/immer.cjs"
|
|
104
75
|
}
|
|
105
76
|
},
|
|
106
77
|
"files": [
|
|
@@ -109,67 +80,78 @@
|
|
|
109
80
|
"LICENSE"
|
|
110
81
|
],
|
|
111
82
|
"sideEffects": false,
|
|
83
|
+
"devDependencies": {
|
|
84
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
85
|
+
"@rxova/journey-common": "0.0.0",
|
|
86
|
+
"immer": "^11.1.15",
|
|
87
|
+
"publint": "^0.3.24"
|
|
88
|
+
},
|
|
89
|
+
"peerDependencies": {
|
|
90
|
+
"immer": "^11.1.15"
|
|
91
|
+
},
|
|
92
|
+
"peerDependenciesMeta": {
|
|
93
|
+
"immer": {
|
|
94
|
+
"optional": true
|
|
95
|
+
}
|
|
96
|
+
},
|
|
112
97
|
"size-limit": [
|
|
113
98
|
{
|
|
114
|
-
"name": "core/
|
|
99
|
+
"name": "core/createLinearJourney",
|
|
115
100
|
"path": "dist/index.js",
|
|
116
|
-
"import": "{
|
|
117
|
-
"limit": "
|
|
101
|
+
"import": "{ createLinearJourney }",
|
|
102
|
+
"limit": "6.2 kB"
|
|
118
103
|
},
|
|
119
104
|
{
|
|
120
|
-
"name": "core/
|
|
105
|
+
"name": "core/createGraphJourney",
|
|
121
106
|
"path": "dist/index.js",
|
|
122
|
-
"import": "{
|
|
123
|
-
"limit": "
|
|
107
|
+
"import": "{ createGraphJourney }",
|
|
108
|
+
"limit": "6.5 kB"
|
|
124
109
|
},
|
|
125
110
|
{
|
|
126
|
-
"name": "core/
|
|
127
|
-
"path": "dist/
|
|
128
|
-
"import": "{
|
|
129
|
-
"limit": "
|
|
111
|
+
"name": "core/immerConnector",
|
|
112
|
+
"path": "dist/connectors/immer/immer.js",
|
|
113
|
+
"import": "{ immerConnector }",
|
|
114
|
+
"limit": "100 B"
|
|
130
115
|
},
|
|
131
116
|
{
|
|
132
|
-
"name": "core/
|
|
133
|
-
"path": "dist/plugins/
|
|
134
|
-
"import": "{
|
|
135
|
-
"limit": "
|
|
117
|
+
"name": "core/createExecutionPathsPlugin",
|
|
118
|
+
"path": "dist/plugins/index.js",
|
|
119
|
+
"import": "{ createExecutionPathsPlugin }",
|
|
120
|
+
"limit": "300 B"
|
|
136
121
|
},
|
|
137
122
|
{
|
|
138
|
-
"name": "core/
|
|
139
|
-
"path": "dist/plugins/
|
|
140
|
-
"import": "{
|
|
141
|
-
"limit": "
|
|
123
|
+
"name": "core/createAnalyticsPlugin",
|
|
124
|
+
"path": "dist/plugins/index.js",
|
|
125
|
+
"import": "{ createAnalyticsPlugin }",
|
|
126
|
+
"limit": "500 B"
|
|
142
127
|
},
|
|
143
128
|
{
|
|
144
|
-
"name": "core/
|
|
145
|
-
"path": "dist/
|
|
146
|
-
"import": "{
|
|
147
|
-
"limit": "
|
|
129
|
+
"name": "core/analyzeStructure",
|
|
130
|
+
"path": "dist/index.js",
|
|
131
|
+
"import": "{ analyzeStructure }",
|
|
132
|
+
"limit": "1.5 kB"
|
|
148
133
|
},
|
|
149
134
|
{
|
|
150
|
-
"name": "core/
|
|
151
|
-
"path": "dist/plugins/
|
|
152
|
-
"import": "{
|
|
153
|
-
"limit": "
|
|
135
|
+
"name": "core/createPersistencePlugin",
|
|
136
|
+
"path": "dist/plugins/index.js",
|
|
137
|
+
"import": "{ createPersistencePlugin }",
|
|
138
|
+
"limit": "1.15 kB"
|
|
154
139
|
},
|
|
155
140
|
{
|
|
156
141
|
"name": "core/createReplayPlugin",
|
|
157
|
-
"path": "dist/plugins/
|
|
142
|
+
"path": "dist/plugins/index.js",
|
|
158
143
|
"import": "{ createReplayPlugin }",
|
|
159
|
-
"limit": "
|
|
144
|
+
"limit": "850 B"
|
|
160
145
|
}
|
|
161
146
|
],
|
|
162
|
-
"devDependencies": {
|
|
163
|
-
"@arethetypeswrong/cli": "^0.18.5",
|
|
164
|
-
"publint": "^0.3.18"
|
|
165
|
-
},
|
|
166
147
|
"scripts": {
|
|
167
|
-
"build": "pnpm run clean && node --import tsx ./scripts/build.ts && tsc -p tsconfig.build.json && node --import tsx
|
|
168
|
-
"clean": "node --import tsx
|
|
169
|
-
"coverage": "pnpm --workspace-root vitest run
|
|
148
|
+
"build": "pnpm run clean && node --import tsx ./scripts/build.ts && tsc -p tsconfig.build.json && node --import tsx ../common/tooling/copy-types.ts dist",
|
|
149
|
+
"clean": "node --import tsx ../common/tooling/clean-paths.ts dist tsconfig.build.tsbuildinfo",
|
|
150
|
+
"coverage": "JOURNEY_COVERAGE_INCLUDE=packages/core/src/** JOURNEY_COVERAGE_DIR=coverage/core pnpm --workspace-root vitest run packages/core/src --coverage --coverage.reporter=text-summary",
|
|
151
|
+
"test": "pnpm --workspace-root vitest run packages/core/src --coverage.enabled=false",
|
|
170
152
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
171
153
|
"check:exports": "publint --strict",
|
|
172
|
-
"attw": "attw --pack .",
|
|
154
|
+
"attw": "attw --pack . --profile node16",
|
|
173
155
|
"size": "size-limit"
|
|
174
156
|
}
|
|
175
157
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { JourneyJsonObject } from "../types";
|
|
2
|
-
import type { JourneyBuilder } from "./types";
|
|
3
|
-
export type { JourneyBuilder, JourneyBuilderCustomEventKey, JourneyBuilderDefinition, JourneyBuilderDefinitionMetadata, JourneyBuilderGuard, JourneyBuilderLifecycle, JourneyBuilderOnEntry, JourneyBuilderTerminalCandidate, JourneyBuilderTerminalEntry, JourneyBuilderUpdateContext, JourneyStepBuilder, JourneyToBuilder } from "./types";
|
|
4
|
-
/** Creates a typed builder for authoring journey definitions with `createStep`, `to`, and `build` helpers. */
|
|
5
|
-
export declare function createJourneyBuilder<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown> = Record<never, never>, TStepMeta = unknown, THandlers extends Record<string, unknown> = Record<never, never>>(): JourneyBuilder<TContext, TStepId, TEventMap, TStepMeta, THandlers>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { JourneyJsonObject } from "../types";
|
|
2
|
-
import type { JourneyBuilder } from "./types";
|
|
3
|
-
export type { JourneyBuilder, JourneyBuilderCustomEventKey, JourneyBuilderDefinition, JourneyBuilderDefinitionMetadata, JourneyBuilderGuard, JourneyBuilderLifecycle, JourneyBuilderOnEntry, JourneyBuilderTerminalCandidate, JourneyBuilderTerminalEntry, JourneyBuilderUpdateContext, JourneyStepBuilder, JourneyToBuilder } from "./types";
|
|
4
|
-
/** Creates a typed builder for authoring journey definitions with `createStep`, `to`, and `build` helpers. */
|
|
5
|
-
export declare function createJourneyBuilder<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown> = Record<never, never>, TStepMeta = unknown, THandlers extends Record<string, unknown> = Record<never, never>>(): JourneyBuilder<TContext, TStepId, TEventMap, TStepMeta, THandlers>;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import type { JourneyDefaultEventType, JourneyDefinition, JourneyFullEventType, JourneyJsonObject } from "../types";
|
|
2
|
-
import type { JourneyStepLifecycleCallback, JourneyTransitionArgsForEvent, JourneyTransitionUpdateContextArgsForEvent } from "../types";
|
|
3
|
-
export type JourneyBuilderStepEventKey<TEventMap extends Record<string, unknown>> = Exclude<JourneyFullEventType<TEventMap>, "completeJourney" | "terminateJourney">;
|
|
4
|
-
export type JourneyBuilderTerminalEventKey<TEventMap extends Record<string, unknown>> = Extract<JourneyFullEventType<TEventMap>, "completeJourney" | "terminateJourney">;
|
|
5
|
-
export type JourneyBuilderCustomEventKey<TEventMap extends Record<string, unknown>> = Exclude<keyof TEventMap & string, JourneyDefaultEventType>;
|
|
6
|
-
export type JourneyBuilderGuard<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = (args: JourneyTransitionArgsForEvent<TContext, TStepId, TEventMap, THandlers, TEventType>) => boolean | Promise<boolean>;
|
|
7
|
-
export type JourneyBuilderUpdateContext<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = (args: JourneyTransitionUpdateContextArgsForEvent<TContext, TStepId, TEventMap, TEventType>) => TContext;
|
|
8
|
-
export type JourneyBuilderLifecycle<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>> = JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers>;
|
|
9
|
-
export type JourneyBuilderCandidate<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = {
|
|
10
|
-
readonly _to: TStepId;
|
|
11
|
-
readonly _when: JourneyBuilderGuard<TContext, TStepId, TEventMap, THandlers, TEventType> | undefined;
|
|
12
|
-
readonly _updateContext: JourneyBuilderUpdateContext<TContext, TStepId, TEventMap, TEventType> | undefined;
|
|
13
|
-
readonly _onEnter: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
14
|
-
readonly _onLeave: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
15
|
-
readonly _label: string | undefined;
|
|
16
|
-
readonly _timeoutMs: number | undefined;
|
|
17
|
-
};
|
|
18
|
-
export type JourneyToBuilderUsage = {
|
|
19
|
-
readonly when: boolean;
|
|
20
|
-
readonly updateContext: boolean;
|
|
21
|
-
readonly onEnter: boolean;
|
|
22
|
-
readonly onLeave: boolean;
|
|
23
|
-
readonly label: boolean;
|
|
24
|
-
readonly timeoutMs: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type JourneyToBuilderUnused = {
|
|
27
|
-
readonly when: false;
|
|
28
|
-
readonly updateContext: false;
|
|
29
|
-
readonly onEnter: false;
|
|
30
|
-
readonly onLeave: false;
|
|
31
|
-
readonly label: false;
|
|
32
|
-
readonly timeoutMs: false;
|
|
33
|
-
};
|
|
34
|
-
type JourneyDuplicateModifierCall<TName extends string> = (...args: [
|
|
35
|
-
`Duplicate transition modifier ${TName}() is invalid. If several are present, the last one wins at runtime.`
|
|
36
|
-
]) => never;
|
|
37
|
-
export type JourneyToBuilder<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>, TUsed extends JourneyToBuilderUsage = JourneyToBuilderUnused> = {
|
|
38
|
-
readonly _candidate: JourneyBuilderCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
39
|
-
when: TUsed["when"] extends true ? JourneyDuplicateModifierCall<"when"> : (guard: JourneyBuilderGuard<TContext, TStepId, TEventMap, THandlers, TEventType>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "when"> & {
|
|
40
|
-
readonly when: true;
|
|
41
|
-
}>;
|
|
42
|
-
updateContext: TUsed["updateContext"] extends true ? JourneyDuplicateModifierCall<"updateContext"> : (fn: JourneyBuilderUpdateContext<TContext, TStepId, TEventMap, TEventType>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "updateContext"> & {
|
|
43
|
-
readonly updateContext: true;
|
|
44
|
-
}>;
|
|
45
|
-
onEnter: TUsed["onEnter"] extends true ? JourneyDuplicateModifierCall<"onEnter"> : (fn: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "onEnter"> & {
|
|
46
|
-
readonly onEnter: true;
|
|
47
|
-
}>;
|
|
48
|
-
onLeave: TUsed["onLeave"] extends true ? JourneyDuplicateModifierCall<"onLeave"> : (fn: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "onLeave"> & {
|
|
49
|
-
readonly onLeave: true;
|
|
50
|
-
}>;
|
|
51
|
-
label: TUsed["label"] extends true ? JourneyDuplicateModifierCall<"label"> : (label: string) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "label"> & {
|
|
52
|
-
readonly label: true;
|
|
53
|
-
}>;
|
|
54
|
-
timeoutMs: TUsed["timeoutMs"] extends true ? JourneyDuplicateModifierCall<"timeoutMs"> : (ms: number) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "timeoutMs"> & {
|
|
55
|
-
readonly timeoutMs: true;
|
|
56
|
-
}>;
|
|
57
|
-
};
|
|
58
|
-
type JourneyBuiltTransitionCandidate<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = {
|
|
59
|
-
readonly _candidate: JourneyBuilderCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
60
|
-
};
|
|
61
|
-
export type JourneyBuilderOnEntry<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyBuilderStepEventKey<TEventMap>> = readonly JourneyBuiltTransitionCandidate<TContext, TStepId, TEventMap, THandlers>[] | ((helpers: {
|
|
62
|
-
to: (stepId: TStepId) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
63
|
-
}) => readonly JourneyBuiltTransitionCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>[]);
|
|
64
|
-
export type JourneyBuilderTerminalCandidate<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyBuilderTerminalEventKey<TEventMap>> = {
|
|
65
|
-
when?: JourneyBuilderGuard<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
66
|
-
updateContext?: JourneyBuilderUpdateContext<TContext, TStepId, TEventMap, TEventType>;
|
|
67
|
-
onEnter?: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>;
|
|
68
|
-
onLeave?: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>;
|
|
69
|
-
label?: string;
|
|
70
|
-
timeoutMs?: number;
|
|
71
|
-
};
|
|
72
|
-
export type JourneyBuilderTerminalEntry<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyBuilderTerminalEventKey<TEventMap>> = true | readonly [] | readonly JourneyBuilderTerminalCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>[];
|
|
73
|
-
type JourneyBuilderEventEntry<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap>> = TEventType extends JourneyBuilderTerminalEventKey<TEventMap> ? JourneyBuilderTerminalEntry<TContext, TStepId, TEventMap, THandlers, TEventType> : JourneyBuilderOnEntry<TContext, TStepId, TEventMap, THandlers, Extract<TEventType, JourneyBuilderStepEventKey<TEventMap>>>;
|
|
74
|
-
type JourneyStepBuilderOnConfig<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>> = Partial<{
|
|
75
|
-
[TEventType in JourneyFullEventType<TEventMap>]: JourneyBuilderEventEntry<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
76
|
-
}>;
|
|
77
|
-
type JourneyStepBuilderHandledCustomEventKey<TEventMap extends Record<string, unknown>, TOn> = Extract<keyof NonNullable<TOn>, JourneyBuilderCustomEventKey<TEventMap>>;
|
|
78
|
-
type JourneyStepBuilderConfig<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>, TOn extends JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined> = {
|
|
79
|
-
meta?: TStepMeta;
|
|
80
|
-
onEnter?: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers>;
|
|
81
|
-
onLeave?: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers>;
|
|
82
|
-
on?: TOn;
|
|
83
|
-
};
|
|
84
|
-
export type JourneyStepBuilder<TContext extends JourneyJsonObject, TStepId extends string, TStepKey extends TStepId, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>, THandledCustomEventType extends JourneyBuilderCustomEventKey<TEventMap> = never> = {
|
|
85
|
-
readonly id: TStepKey;
|
|
86
|
-
readonly _meta: TStepMeta | undefined;
|
|
87
|
-
readonly _onEnter: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
88
|
-
readonly _onLeave: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
89
|
-
readonly _on: Record<string, JourneyBuilderEventEntry<TContext, TStepId, TEventMap, THandlers, JourneyFullEventType<TEventMap>>> | undefined;
|
|
90
|
-
readonly _handledCustomEventType?: THandledCustomEventType;
|
|
91
|
-
};
|
|
92
|
-
type JourneyStepBuilderHandledCustomEventMap<TStepId extends string, TEventMap extends Record<string, unknown>, TSteps extends readonly {
|
|
93
|
-
readonly id: TStepId;
|
|
94
|
-
readonly _handledCustomEventType?: JourneyBuilderCustomEventKey<TEventMap>;
|
|
95
|
-
}[]> = {
|
|
96
|
-
[TCurrentStepId in TStepId]: Extract<Extract<TSteps[number], {
|
|
97
|
-
readonly id: TCurrentStepId;
|
|
98
|
-
}> extends {
|
|
99
|
-
readonly _handledCustomEventType?: infer THandledCustomEventType;
|
|
100
|
-
} ? THandledCustomEventType : never, JourneyBuilderCustomEventKey<TEventMap>>;
|
|
101
|
-
};
|
|
102
|
-
type JourneyBuilderGlobalHandledCustomEventKey<TEventMap extends Record<string, unknown>, TGlobal> = Extract<keyof NonNullable<TGlobal>, JourneyBuilderCustomEventKey<TEventMap>>;
|
|
103
|
-
declare const journeyBuilderDefinitionBrand: unique symbol;
|
|
104
|
-
export type JourneyBuilderDefinitionMetadata<TStepId extends string, TEventMap extends Record<string, unknown>, TStepHandledCustomEventMap extends Record<TStepId, JourneyBuilderCustomEventKey<TEventMap>> = Record<TStepId, never>, TGlobalHandledCustomEventType extends JourneyBuilderCustomEventKey<TEventMap> = never> = {
|
|
105
|
-
readonly [journeyBuilderDefinitionBrand]?: {
|
|
106
|
-
readonly stepHandledCustomEvents: TStepHandledCustomEventMap;
|
|
107
|
-
readonly globalHandledCustomEvents: TGlobalHandledCustomEventType;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
export type JourneyBuilderDefinition<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta = unknown, THandlers extends Record<string, unknown> = Record<never, never>, TStepHandledCustomEventMap extends Record<TStepId, JourneyBuilderCustomEventKey<TEventMap>> = Record<TStepId, never>, TGlobalHandledCustomEventType extends JourneyBuilderCustomEventKey<TEventMap> = never> = JourneyDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers> & JourneyBuilderDefinitionMetadata<TStepId, TEventMap, TStepHandledCustomEventMap, TGlobalHandledCustomEventType>;
|
|
111
|
-
type JourneyBuilderGlobalConfig<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>> = Partial<{
|
|
112
|
-
[TEventType in JourneyFullEventType<TEventMap>]: TEventType extends JourneyBuilderTerminalEventKey<TEventMap> ? JourneyBuilderTerminalEntry<TContext, TStepId, TEventMap, THandlers, TEventType> : readonly JourneyBuiltTransitionCandidate<TContext, TStepId, TEventMap, THandlers>[];
|
|
113
|
-
}>;
|
|
114
|
-
type JourneyBuilderBuildInput<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>, TSteps extends readonly JourneyStepBuilder<TContext, TStepId, TStepId, TEventMap, TStepMeta, THandlers, JourneyBuilderCustomEventKey<TEventMap>>[], TGlobal extends JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined> = {
|
|
115
|
-
initial: TStepId;
|
|
116
|
-
context: TContext;
|
|
117
|
-
handlers?: THandlers;
|
|
118
|
-
steps: TSteps;
|
|
119
|
-
global?: TGlobal;
|
|
120
|
-
};
|
|
121
|
-
export type JourneyBuilder<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown> = Record<never, never>, TStepMeta = unknown, THandlers extends Record<string, unknown> = Record<never, never>> = {
|
|
122
|
-
createStep: <TStepKey extends TStepId, TOn extends JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined>(id: TStepKey, config?: JourneyStepBuilderConfig<TContext, TStepId, TEventMap, TStepMeta, THandlers, TOn>) => JourneyStepBuilder<TContext, TStepId, TStepKey, TEventMap, TStepMeta, THandlers, JourneyStepBuilderHandledCustomEventKey<TEventMap, TOn>>;
|
|
123
|
-
to: (stepId: TStepId) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers>;
|
|
124
|
-
build: <TSteps extends readonly JourneyStepBuilder<TContext, TStepId, TStepId, TEventMap, TStepMeta, THandlers, JourneyBuilderCustomEventKey<TEventMap>>[], TGlobal extends JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined>(input: JourneyBuilderBuildInput<TContext, TStepId, TEventMap, TStepMeta, THandlers, TSteps, TGlobal>) => JourneyBuilderDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers, JourneyStepBuilderHandledCustomEventMap<TStepId, TEventMap, TSteps>, JourneyBuilderGlobalHandledCustomEventKey<TEventMap, TGlobal>>;
|
|
125
|
-
};
|
|
126
|
-
export type { JourneyStepBuilderConfig as _JourneyStepBuilderConfig, JourneyBuilderBuildInput as _JourneyBuilderBuildInput, JourneyBuilderEventEntry as _JourneyBuilderEventEntry };
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import type { JourneyDefaultEventType, JourneyDefinition, JourneyFullEventType, JourneyJsonObject } from "../types";
|
|
2
|
-
import type { JourneyStepLifecycleCallback, JourneyTransitionArgsForEvent, JourneyTransitionUpdateContextArgsForEvent } from "../types";
|
|
3
|
-
export type JourneyBuilderStepEventKey<TEventMap extends Record<string, unknown>> = Exclude<JourneyFullEventType<TEventMap>, "completeJourney" | "terminateJourney">;
|
|
4
|
-
export type JourneyBuilderTerminalEventKey<TEventMap extends Record<string, unknown>> = Extract<JourneyFullEventType<TEventMap>, "completeJourney" | "terminateJourney">;
|
|
5
|
-
export type JourneyBuilderCustomEventKey<TEventMap extends Record<string, unknown>> = Exclude<keyof TEventMap & string, JourneyDefaultEventType>;
|
|
6
|
-
export type JourneyBuilderGuard<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = (args: JourneyTransitionArgsForEvent<TContext, TStepId, TEventMap, THandlers, TEventType>) => boolean | Promise<boolean>;
|
|
7
|
-
export type JourneyBuilderUpdateContext<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = (args: JourneyTransitionUpdateContextArgsForEvent<TContext, TStepId, TEventMap, TEventType>) => TContext;
|
|
8
|
-
export type JourneyBuilderLifecycle<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>> = JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers>;
|
|
9
|
-
export type JourneyBuilderCandidate<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = {
|
|
10
|
-
readonly _to: TStepId;
|
|
11
|
-
readonly _when: JourneyBuilderGuard<TContext, TStepId, TEventMap, THandlers, TEventType> | undefined;
|
|
12
|
-
readonly _updateContext: JourneyBuilderUpdateContext<TContext, TStepId, TEventMap, TEventType> | undefined;
|
|
13
|
-
readonly _onEnter: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
14
|
-
readonly _onLeave: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
15
|
-
readonly _label: string | undefined;
|
|
16
|
-
readonly _timeoutMs: number | undefined;
|
|
17
|
-
};
|
|
18
|
-
export type JourneyToBuilderUsage = {
|
|
19
|
-
readonly when: boolean;
|
|
20
|
-
readonly updateContext: boolean;
|
|
21
|
-
readonly onEnter: boolean;
|
|
22
|
-
readonly onLeave: boolean;
|
|
23
|
-
readonly label: boolean;
|
|
24
|
-
readonly timeoutMs: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type JourneyToBuilderUnused = {
|
|
27
|
-
readonly when: false;
|
|
28
|
-
readonly updateContext: false;
|
|
29
|
-
readonly onEnter: false;
|
|
30
|
-
readonly onLeave: false;
|
|
31
|
-
readonly label: false;
|
|
32
|
-
readonly timeoutMs: false;
|
|
33
|
-
};
|
|
34
|
-
type JourneyDuplicateModifierCall<TName extends string> = (...args: [
|
|
35
|
-
`Duplicate transition modifier ${TName}() is invalid. If several are present, the last one wins at runtime.`
|
|
36
|
-
]) => never;
|
|
37
|
-
export type JourneyToBuilder<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>, TUsed extends JourneyToBuilderUsage = JourneyToBuilderUnused> = {
|
|
38
|
-
readonly _candidate: JourneyBuilderCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
39
|
-
when: TUsed["when"] extends true ? JourneyDuplicateModifierCall<"when"> : (guard: JourneyBuilderGuard<TContext, TStepId, TEventMap, THandlers, TEventType>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "when"> & {
|
|
40
|
-
readonly when: true;
|
|
41
|
-
}>;
|
|
42
|
-
updateContext: TUsed["updateContext"] extends true ? JourneyDuplicateModifierCall<"updateContext"> : (fn: JourneyBuilderUpdateContext<TContext, TStepId, TEventMap, TEventType>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "updateContext"> & {
|
|
43
|
-
readonly updateContext: true;
|
|
44
|
-
}>;
|
|
45
|
-
onEnter: TUsed["onEnter"] extends true ? JourneyDuplicateModifierCall<"onEnter"> : (fn: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "onEnter"> & {
|
|
46
|
-
readonly onEnter: true;
|
|
47
|
-
}>;
|
|
48
|
-
onLeave: TUsed["onLeave"] extends true ? JourneyDuplicateModifierCall<"onLeave"> : (fn: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "onLeave"> & {
|
|
49
|
-
readonly onLeave: true;
|
|
50
|
-
}>;
|
|
51
|
-
label: TUsed["label"] extends true ? JourneyDuplicateModifierCall<"label"> : (label: string) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "label"> & {
|
|
52
|
-
readonly label: true;
|
|
53
|
-
}>;
|
|
54
|
-
timeoutMs: TUsed["timeoutMs"] extends true ? JourneyDuplicateModifierCall<"timeoutMs"> : (ms: number) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType, Omit<TUsed, "timeoutMs"> & {
|
|
55
|
-
readonly timeoutMs: true;
|
|
56
|
-
}>;
|
|
57
|
-
};
|
|
58
|
-
type JourneyBuiltTransitionCandidate<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap> = JourneyFullEventType<TEventMap>> = {
|
|
59
|
-
readonly _candidate: JourneyBuilderCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
60
|
-
};
|
|
61
|
-
export type JourneyBuilderOnEntry<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyBuilderStepEventKey<TEventMap>> = readonly JourneyBuiltTransitionCandidate<TContext, TStepId, TEventMap, THandlers>[] | ((helpers: {
|
|
62
|
-
to: (stepId: TStepId) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
63
|
-
}) => readonly JourneyBuiltTransitionCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>[]);
|
|
64
|
-
export type JourneyBuilderTerminalCandidate<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyBuilderTerminalEventKey<TEventMap>> = {
|
|
65
|
-
when?: JourneyBuilderGuard<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
66
|
-
updateContext?: JourneyBuilderUpdateContext<TContext, TStepId, TEventMap, TEventType>;
|
|
67
|
-
onEnter?: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>;
|
|
68
|
-
onLeave?: JourneyBuilderLifecycle<TContext, TStepId, TEventMap, THandlers>;
|
|
69
|
-
label?: string;
|
|
70
|
-
timeoutMs?: number;
|
|
71
|
-
};
|
|
72
|
-
export type JourneyBuilderTerminalEntry<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyBuilderTerminalEventKey<TEventMap>> = true | readonly [] | readonly JourneyBuilderTerminalCandidate<TContext, TStepId, TEventMap, THandlers, TEventType>[];
|
|
73
|
-
type JourneyBuilderEventEntry<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TEventType extends JourneyFullEventType<TEventMap>> = TEventType extends JourneyBuilderTerminalEventKey<TEventMap> ? JourneyBuilderTerminalEntry<TContext, TStepId, TEventMap, THandlers, TEventType> : JourneyBuilderOnEntry<TContext, TStepId, TEventMap, THandlers, Extract<TEventType, JourneyBuilderStepEventKey<TEventMap>>>;
|
|
74
|
-
type JourneyStepBuilderOnConfig<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>> = Partial<{
|
|
75
|
-
[TEventType in JourneyFullEventType<TEventMap>]: JourneyBuilderEventEntry<TContext, TStepId, TEventMap, THandlers, TEventType>;
|
|
76
|
-
}>;
|
|
77
|
-
type JourneyStepBuilderHandledCustomEventKey<TEventMap extends Record<string, unknown>, TOn> = Extract<keyof NonNullable<TOn>, JourneyBuilderCustomEventKey<TEventMap>>;
|
|
78
|
-
type JourneyStepBuilderConfig<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>, TOn extends JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined> = {
|
|
79
|
-
meta?: TStepMeta;
|
|
80
|
-
onEnter?: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers>;
|
|
81
|
-
onLeave?: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers>;
|
|
82
|
-
on?: TOn;
|
|
83
|
-
};
|
|
84
|
-
export type JourneyStepBuilder<TContext extends JourneyJsonObject, TStepId extends string, TStepKey extends TStepId, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>, THandledCustomEventType extends JourneyBuilderCustomEventKey<TEventMap> = never> = {
|
|
85
|
-
readonly id: TStepKey;
|
|
86
|
-
readonly _meta: TStepMeta | undefined;
|
|
87
|
-
readonly _onEnter: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
88
|
-
readonly _onLeave: JourneyStepLifecycleCallback<TContext, TStepId, TEventMap, THandlers> | undefined;
|
|
89
|
-
readonly _on: Record<string, JourneyBuilderEventEntry<TContext, TStepId, TEventMap, THandlers, JourneyFullEventType<TEventMap>>> | undefined;
|
|
90
|
-
readonly _handledCustomEventType?: THandledCustomEventType;
|
|
91
|
-
};
|
|
92
|
-
type JourneyStepBuilderHandledCustomEventMap<TStepId extends string, TEventMap extends Record<string, unknown>, TSteps extends readonly {
|
|
93
|
-
readonly id: TStepId;
|
|
94
|
-
readonly _handledCustomEventType?: JourneyBuilderCustomEventKey<TEventMap>;
|
|
95
|
-
}[]> = {
|
|
96
|
-
[TCurrentStepId in TStepId]: Extract<Extract<TSteps[number], {
|
|
97
|
-
readonly id: TCurrentStepId;
|
|
98
|
-
}> extends {
|
|
99
|
-
readonly _handledCustomEventType?: infer THandledCustomEventType;
|
|
100
|
-
} ? THandledCustomEventType : never, JourneyBuilderCustomEventKey<TEventMap>>;
|
|
101
|
-
};
|
|
102
|
-
type JourneyBuilderGlobalHandledCustomEventKey<TEventMap extends Record<string, unknown>, TGlobal> = Extract<keyof NonNullable<TGlobal>, JourneyBuilderCustomEventKey<TEventMap>>;
|
|
103
|
-
declare const journeyBuilderDefinitionBrand: unique symbol;
|
|
104
|
-
export type JourneyBuilderDefinitionMetadata<TStepId extends string, TEventMap extends Record<string, unknown>, TStepHandledCustomEventMap extends Record<TStepId, JourneyBuilderCustomEventKey<TEventMap>> = Record<TStepId, never>, TGlobalHandledCustomEventType extends JourneyBuilderCustomEventKey<TEventMap> = never> = {
|
|
105
|
-
readonly [journeyBuilderDefinitionBrand]?: {
|
|
106
|
-
readonly stepHandledCustomEvents: TStepHandledCustomEventMap;
|
|
107
|
-
readonly globalHandledCustomEvents: TGlobalHandledCustomEventType;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
export type JourneyBuilderDefinition<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta = unknown, THandlers extends Record<string, unknown> = Record<never, never>, TStepHandledCustomEventMap extends Record<TStepId, JourneyBuilderCustomEventKey<TEventMap>> = Record<TStepId, never>, TGlobalHandledCustomEventType extends JourneyBuilderCustomEventKey<TEventMap> = never> = JourneyDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers> & JourneyBuilderDefinitionMetadata<TStepId, TEventMap, TStepHandledCustomEventMap, TGlobalHandledCustomEventType>;
|
|
111
|
-
type JourneyBuilderGlobalConfig<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>> = Partial<{
|
|
112
|
-
[TEventType in JourneyFullEventType<TEventMap>]: TEventType extends JourneyBuilderTerminalEventKey<TEventMap> ? JourneyBuilderTerminalEntry<TContext, TStepId, TEventMap, THandlers, TEventType> : readonly JourneyBuiltTransitionCandidate<TContext, TStepId, TEventMap, THandlers>[];
|
|
113
|
-
}>;
|
|
114
|
-
type JourneyBuilderBuildInput<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>, TSteps extends readonly JourneyStepBuilder<TContext, TStepId, TStepId, TEventMap, TStepMeta, THandlers, JourneyBuilderCustomEventKey<TEventMap>>[], TGlobal extends JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined> = {
|
|
115
|
-
initial: TStepId;
|
|
116
|
-
context: TContext;
|
|
117
|
-
handlers?: THandlers;
|
|
118
|
-
steps: TSteps;
|
|
119
|
-
global?: TGlobal;
|
|
120
|
-
};
|
|
121
|
-
export type JourneyBuilder<TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown> = Record<never, never>, TStepMeta = unknown, THandlers extends Record<string, unknown> = Record<never, never>> = {
|
|
122
|
-
createStep: <TStepKey extends TStepId, TOn extends JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyStepBuilderOnConfig<TContext, TStepId, TEventMap, THandlers> | undefined>(id: TStepKey, config?: JourneyStepBuilderConfig<TContext, TStepId, TEventMap, TStepMeta, THandlers, TOn>) => JourneyStepBuilder<TContext, TStepId, TStepKey, TEventMap, TStepMeta, THandlers, JourneyStepBuilderHandledCustomEventKey<TEventMap, TOn>>;
|
|
123
|
-
to: (stepId: TStepId) => JourneyToBuilder<TContext, TStepId, TEventMap, THandlers>;
|
|
124
|
-
build: <TSteps extends readonly JourneyStepBuilder<TContext, TStepId, TStepId, TEventMap, TStepMeta, THandlers, JourneyBuilderCustomEventKey<TEventMap>>[], TGlobal extends JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined = JourneyBuilderGlobalConfig<TContext, TStepId, TEventMap, THandlers> | undefined>(input: JourneyBuilderBuildInput<TContext, TStepId, TEventMap, TStepMeta, THandlers, TSteps, TGlobal>) => JourneyBuilderDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers, JourneyStepBuilderHandledCustomEventMap<TStepId, TEventMap, TSteps>, JourneyBuilderGlobalHandledCustomEventKey<TEventMap, TGlobal>>;
|
|
125
|
-
};
|
|
126
|
-
export type { JourneyStepBuilderConfig as _JourneyStepBuilderConfig, JourneyBuilderBuildInput as _JourneyBuilderBuildInput, JourneyBuilderEventEntry as _JourneyBuilderEventEntry };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { JourneyAsyncPhase, JourneyAsyncState, JourneyJsonObject } from "../types";
|
|
2
|
-
import type { JourneyMachineRuntime } from "./runtime";
|
|
3
|
-
export type JourneyMachineAsyncStateController<TStepId extends string> = {
|
|
4
|
-
syncState: (asyncState: JourneyAsyncState<TStepId>) => void;
|
|
5
|
-
updateStepAsync: (stepId: TStepId, updater: (current: JourneyAsyncState<TStepId>["byStep"][TStepId]) => JourneyAsyncState<TStepId>["byStep"][TStepId], runVersion?: number) => void;
|
|
6
|
-
setStepLoading: (stepId: TStepId, phase: JourneyAsyncPhase, eventType: string, transitionId?: string, runVersion?: number) => void;
|
|
7
|
-
setStepIdle: (stepId: TStepId, runVersion?: number) => void;
|
|
8
|
-
setStepError: (stepId: TStepId, eventType: string, error: unknown, transitionId?: string, runVersion?: number) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const createJourneyMachineAsyncStateController: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>>({ runtime }: {
|
|
11
|
-
runtime: JourneyMachineRuntime<TContext, TStepId, TEventMap>;
|
|
12
|
-
}) => JourneyMachineAsyncStateController<TStepId>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { JourneyAsyncPhase, JourneyAsyncState, JourneyJsonObject } from "../types";
|
|
2
|
-
import type { JourneyMachineRuntime } from "./runtime";
|
|
3
|
-
export type JourneyMachineAsyncStateController<TStepId extends string> = {
|
|
4
|
-
syncState: (asyncState: JourneyAsyncState<TStepId>) => void;
|
|
5
|
-
updateStepAsync: (stepId: TStepId, updater: (current: JourneyAsyncState<TStepId>["byStep"][TStepId]) => JourneyAsyncState<TStepId>["byStep"][TStepId], runVersion?: number) => void;
|
|
6
|
-
setStepLoading: (stepId: TStepId, phase: JourneyAsyncPhase, eventType: string, transitionId?: string, runVersion?: number) => void;
|
|
7
|
-
setStepIdle: (stepId: TStepId, runVersion?: number) => void;
|
|
8
|
-
setStepError: (stepId: TStepId, eventType: string, error: unknown, transitionId?: string, runVersion?: number) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const createJourneyMachineAsyncStateController: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>>({ runtime }: {
|
|
11
|
-
runtime: JourneyMachineRuntime<TContext, TStepId, TEventMap>;
|
|
12
|
-
}) => JourneyMachineAsyncStateController<TStepId>;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { JourneyComputed, JourneyDefinition, JourneyJsonObject, JourneyResolvedDefinition, JourneySnapshot } from "../types";
|
|
2
|
-
export declare const createJourneyMachineComputedGetter: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>>(journey: JourneyDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers>, resolvedJourney: JourneyResolvedDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers>, getSnapshot: () => JourneySnapshot<TContext, TStepId>) => (() => JourneyComputed<TStepId>);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { JourneyComputed, JourneyDefinition, JourneyJsonObject, JourneyResolvedDefinition, JourneySnapshot } from "../types";
|
|
2
|
-
export declare const createJourneyMachineComputedGetter: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, TStepMeta, THandlers extends Record<string, unknown>>(journey: JourneyDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers>, resolvedJourney: JourneyResolvedDefinition<TContext, TStepId, TEventMap, TStepMeta, THandlers>, getSnapshot: () => JourneySnapshot<TContext, TStepId>) => (() => JourneyComputed<TStepId>);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { JourneyJsonObject, JourneySnapshot } from "../types";
|
|
2
|
-
import type { JourneyMachineAsyncStateController } from "./async-state";
|
|
3
|
-
import type { JourneyMachineRuntime } from "./runtime";
|
|
4
|
-
export type JourneyMachineControls<TContext extends JourneyJsonObject, TStepId extends string> = {
|
|
5
|
-
startJourney: () => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
6
|
-
resetJourney: () => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
7
|
-
updateContext: (updater: (context: TContext) => TContext) => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
8
|
-
clearStepError: (stepId?: TStepId) => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
9
|
-
dispose: () => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const createJourneyMachineControls: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>>({ runtime, asyncState, initial, initialContext, steps }: {
|
|
12
|
-
runtime: JourneyMachineRuntime<TContext, TStepId, TEventMap>;
|
|
13
|
-
asyncState: JourneyMachineAsyncStateController<TStepId>;
|
|
14
|
-
initial: TStepId;
|
|
15
|
-
initialContext: TContext;
|
|
16
|
-
steps: Record<TStepId, unknown>;
|
|
17
|
-
}) => JourneyMachineControls<TContext, TStepId>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { JourneyJsonObject, JourneySnapshot } from "../types";
|
|
2
|
-
import type { JourneyMachineAsyncStateController } from "./async-state";
|
|
3
|
-
import type { JourneyMachineRuntime } from "./runtime";
|
|
4
|
-
export type JourneyMachineControls<TContext extends JourneyJsonObject, TStepId extends string> = {
|
|
5
|
-
startJourney: () => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
6
|
-
resetJourney: () => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
7
|
-
updateContext: (updater: (context: TContext) => TContext) => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
8
|
-
clearStepError: (stepId?: TStepId) => Promise<JourneySnapshot<TContext, TStepId>>;
|
|
9
|
-
dispose: () => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const createJourneyMachineControls: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>>({ runtime, asyncState, initial, initialContext, steps }: {
|
|
12
|
-
runtime: JourneyMachineRuntime<TContext, TStepId, TEventMap>;
|
|
13
|
-
asyncState: JourneyMachineAsyncStateController<TStepId>;
|
|
14
|
-
initial: TStepId;
|
|
15
|
-
initialContext: TContext;
|
|
16
|
-
steps: Record<TStepId, unknown>;
|
|
17
|
-
}) => JourneyMachineControls<TContext, TStepId>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { JourneyAsyncState, JourneyEvent, JourneyGoToEvent, JourneyJsonObject, JourneyPayloadFor, JourneyResolvedTransition, JourneySendEvent, JourneySendResult, JourneySnapshot, JourneyStatus, JourneyStepAsyncState, JourneyTerminal, JourneyTransition, JourneyTransitionArgs } from "../types";
|
|
2
|
-
export declare const assertStepExists: <TStepId extends string>(steps: Record<TStepId, unknown>, stepId: TStepId, message: string) => void;
|
|
3
|
-
export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
|
|
4
|
-
export declare function assertSerializableContext<TContext extends JourneyJsonObject>(context: TContext, label?: string): TContext;
|
|
5
|
-
export declare const cloneContext: <TContext extends JourneyJsonObject>(context: TContext) => TContext;
|
|
6
|
-
export declare const cloneMetaValue: <T>(value: T) => T;
|
|
7
|
-
export declare const normalizeStepCount: (steps?: number) => number;
|
|
8
|
-
export declare const now: () => number;
|
|
9
|
-
export declare const buildVisitedFromTimeline: <TStepId extends string>(timeline: readonly TStepId[], stepIds?: readonly TStepId[]) => Record<TStepId, boolean>;
|
|
10
|
-
export declare const appendVisited: <TStepId extends string>(visited: Record<TStepId, boolean>, current: TStepId) => Record<TStepId, boolean>;
|
|
11
|
-
export declare const isPromiseLike: <T>(value: T | PromiseLike<T>) => value is PromiseLike<T>;
|
|
12
|
-
export declare const validateFiniteTimeout: (timeoutMs: unknown, label: string) => void;
|
|
13
|
-
export declare class JourneyTimeoutError extends Error {
|
|
14
|
-
name: string;
|
|
15
|
-
constructor(message: string);
|
|
16
|
-
}
|
|
17
|
-
export declare class JourneyDisposedError extends Error {
|
|
18
|
-
name: string;
|
|
19
|
-
readonly operation: string;
|
|
20
|
-
constructor(operation: string);
|
|
21
|
-
}
|
|
22
|
-
export declare const isDevelopmentEnvironment: () => boolean;
|
|
23
|
-
export declare const warnInDevelopment: (message: string, detail?: unknown) => void;
|
|
24
|
-
export declare const errorInDevelopment: (message: string, detail?: unknown) => void;
|
|
25
|
-
export declare const withTimeout: <T>(promise: PromiseLike<T>, timeoutMs: number | undefined, buildError: () => Error) => Promise<T>;
|
|
26
|
-
export declare const withAbortSignal: <T>(promise: PromiseLike<T>, signal: AbortSignal) => Promise<T>;
|
|
27
|
-
export declare const buildIdleStepAsyncState: () => JourneyStepAsyncState;
|
|
28
|
-
export declare const buildInitialAsyncState: <TStepId extends string>(steps: Record<TStepId, unknown>) => JourneyAsyncState<TStepId>;
|
|
29
|
-
export declare const isGoToStepByIdEvent: <TStepId extends string, TEventMap extends Record<string, unknown>>(event: JourneySendEvent<TStepId, TEventMap>) => event is JourneyGoToEvent<TStepId, JourneyPayloadFor<TEventMap, "goToStepById">>;
|
|
30
|
-
export declare const isTerminalTarget: <TStepId extends string>(target: TStepId | JourneyTerminal) => target is JourneyTerminal;
|
|
31
|
-
export declare const resolveTransitionTarget: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>>(transition: JourneyTransition<TContext, TStepId, TEventMap, THandlers>) => TStepId | JourneyTerminal;
|
|
32
|
-
export declare const validateJourneyTransitions: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>>(transitions: readonly JourneyResolvedTransition<TContext, TStepId, TEventMap, THandlers>[], steps: Record<TStepId, unknown>) => void;
|
|
33
|
-
export declare const buildSendResult: <TContext extends JourneyJsonObject, TStepId extends string>(snapshot: JourneySnapshot<TContext, TStepId>, transitioned: boolean, options?: {
|
|
34
|
-
transitionId?: string;
|
|
35
|
-
label?: string;
|
|
36
|
-
error?: unknown;
|
|
37
|
-
}) => JourneySendResult<TContext, TStepId>;
|
|
38
|
-
export declare const buildSnapshot: <TContext extends JourneyJsonObject, TStepId extends string>(timeline: readonly TStepId[], index: number, context: TContext, status: JourneyStatus, asyncState: JourneyAsyncState<TStepId>, visited?: Record<TStepId, boolean>) => JourneySnapshot<TContext, TStepId>;
|
|
39
|
-
export declare const stabilizeSnapshot: <TContext extends JourneyJsonObject, TStepId extends string>(snapshot: JourneySnapshot<TContext, TStepId>) => JourneySnapshot<TContext, TStepId>;
|
|
40
|
-
export declare const selectTransition: <TContext extends JourneyJsonObject, TStepId extends string, TEventMap extends Record<string, unknown>, THandlers extends Record<string, unknown>, TTransition extends {
|
|
41
|
-
from: TStepId | "*";
|
|
42
|
-
event: string;
|
|
43
|
-
when?: (args: JourneyTransitionArgs<TContext, TStepId, TEventMap, THandlers>) => boolean | Promise<boolean>;
|
|
44
|
-
timeoutMs?: number;
|
|
45
|
-
id?: string;
|
|
46
|
-
label?: string;
|
|
47
|
-
}>(transitions: readonly TTransition[], snapshot: JourneySnapshot<TContext, TStepId>, event: JourneyEvent<TStepId, TEventMap>, signal: AbortSignal, handlers: THandlers, hooks?: {
|
|
48
|
-
onAsyncGuardStart?: (transition: TTransition) => void;
|
|
49
|
-
onAsyncGuardSuccess?: (transition: TTransition) => void;
|
|
50
|
-
onAsyncGuardError?: (transition: TTransition, error: unknown) => void;
|
|
51
|
-
}, defaultTimeoutMs?: number) => Promise<TTransition | null>;
|
|
52
|
-
export declare const transitionSnapshot: <TContext extends JourneyJsonObject, TStepId extends string>(snapshot: JourneySnapshot<TContext, TStepId>, nextCurrent: TStepId, nextContext: TContext) => JourneySnapshot<TContext, TStepId>;
|