likec4 1.52.0 → 1.53.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/__app__/src/likec4.js +34 -48
- package/__app__/src/routes/index.js +7 -0
- package/__app__/src/routes/single.js +30 -18
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +2065 -2809
- package/config/schema.json +56 -0
- package/dist/THIRD-PARTY-LICENSES.md +10 -2
- package/dist/_chunks/filesystem.mjs +70 -68
- package/dist/_chunks/index.d.mts +10 -1
- package/dist/_chunks/index2.d.mts +76 -4
- package/dist/_chunks/libs/@hono/mcp.mjs +1 -1
- package/dist/_chunks/libs/@logtape/logtape.d.mts +1021 -0
- package/dist/_chunks/libs/@logtape/logtape.mjs +4 -6
- package/dist/_chunks/libs/@modelcontextprotocol/sdk.d.mts +1 -1
- package/dist/_chunks/libs/@nanostores/react.d.mts +5 -5
- package/dist/_chunks/libs/destr.mjs +1 -0
- package/dist/_chunks/libs/fast-equals.mjs +1 -1
- package/dist/_chunks/libs/langium.mjs +1 -1
- package/dist/_chunks/libs/remeda.mjs +2 -2
- package/dist/_chunks/libs/tinyrainbow.mjs +1 -1
- package/dist/_chunks/libs/unstorage.mjs +1 -0
- package/dist/_chunks/node.mjs +1 -0
- package/dist/_chunks/sequence.mjs +1 -1
- package/dist/_chunks/src.mjs +14 -12
- package/dist/_chunks/src2.mjs +46 -46
- package/dist/cli/index.mjs +164 -84
- package/dist/index.d.mts +16 -819
- package/dist/index.mjs +1 -1
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.mjs +1 -1
- package/package.json +34 -33
- package/react/index.d.mts +24 -20
- package/react/index.mjs +969 -1728
- package/vite-plugin-modules.d.ts +5 -0
- package/dist/_chunks/LikeC4.mjs +0 -1
- package/dist/_chunks/libs/boxen.d.mts +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_chunks/libs/remeda.mjs";import"./_chunks/libs/@logtape/logtape.mjs";import"./_chunks/libs/merge-error-cause.mjs";import"./_chunks/libs/is-error-instance.mjs";import"./_chunks/libs/is-plain-obj.mjs";import"./_chunks/libs/safe-stringify.mjs";import"./_chunks/filesystem.mjs";import"./_chunks/libs/defu.mjs";import"./_chunks/libs/pathe.mjs";import"./_chunks/libs/tinyrainbow.mjs";import"./_chunks/libs/json5.mjs";import"./_chunks/libs/@hono/mcp.mjs";import"./_chunks/src.mjs";import"./_chunks/libs/langium.mjs";import"./_chunks/libs/@chevrotain/regexp-to-ast.mjs";import"./_chunks/libs/chevrotain.mjs";import"./_chunks/libs/@chevrotain/cst-dts-gen.mjs";import"./_chunks/libs/@chevrotain/utils.mjs";import"./_chunks/libs/chevrotain-allstar.mjs";import"./_chunks/sequence.mjs";import"./_chunks/libs/@lume/kiwi.mjs";import"./_chunks/libs/ts-graphviz.mjs";import"./_chunks/libs/word-wrap.mjs";import"./_chunks/libs/khroma.mjs";import"./_chunks/libs/p-limit.mjs";import"./_chunks/libs/eventemitter3.mjs";import"./_chunks/libs/p-queue.mjs";import"./_chunks/libs/isexe.mjs";import"./_chunks/libs/which.mjs";import"./_chunks/libs
|
|
1
|
+
import"./_chunks/libs/remeda.mjs";import"./_chunks/libs/@logtape/logtape.mjs";import"./_chunks/libs/merge-error-cause.mjs";import"./_chunks/libs/is-error-instance.mjs";import"./_chunks/libs/is-plain-obj.mjs";import"./_chunks/libs/safe-stringify.mjs";import"./_chunks/filesystem.mjs";import{t as e}from"./_chunks/libs/defu.mjs";import"./_chunks/libs/pathe.mjs";import"./_chunks/libs/tinyrainbow.mjs";import"./_chunks/libs/json5.mjs";import"./_chunks/libs/@hono/mcp.mjs";import"./_chunks/src.mjs";import"./_chunks/libs/langium.mjs";import"./_chunks/libs/@chevrotain/regexp-to-ast.mjs";import"./_chunks/libs/chevrotain.mjs";import"./_chunks/libs/@chevrotain/cst-dts-gen.mjs";import"./_chunks/libs/@chevrotain/utils.mjs";import"./_chunks/libs/chevrotain-allstar.mjs";import"./_chunks/sequence.mjs";import"./_chunks/libs/@lume/kiwi.mjs";import"./_chunks/libs/ts-graphviz.mjs";import"./_chunks/libs/word-wrap.mjs";import"./_chunks/libs/khroma.mjs";import"./_chunks/libs/p-limit.mjs";import"./_chunks/libs/eventemitter3.mjs";import"./_chunks/libs/p-queue.mjs";import"./_chunks/libs/isexe.mjs";import"./_chunks/libs/which.mjs";import"./_chunks/libs/parse-ms.mjs";import"./_chunks/libs/pretty-ms.mjs";import"./_chunks/libs/picomatch.mjs";import"./_chunks/libs/ufo.mjs";import"./_chunks/libs/@modelcontextprotocol/sdk.mjs";import"./_chunks/libs/@hono/node-server.mjs";import"./_chunks/libs/fast-equals.mjs";import"./_chunks/libs/strip-indent.mjs";import"./_chunks/libs/destr.mjs";import"./_chunks/libs/unstorage.mjs";import{n as t,t as n}from"./_chunks/node.mjs";import{exact as r}from"@likec4/core";let i;(function(i){async function a(t,i){let{logger:a,watch:o,...s}=i??{};return n(t,e(r({...s,configureLogger:a}),{configureLogger:`console`}))}i.fromSource=a;async function o(n=``,i){let{logger:a,watch:o,...s}=i??{};return t(n,e(r({...s,configureLogger:a}),{configureLogger:`console`}))}i.fromWorkspace=o})(i||={});export{i as LikeC4};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_chunks/libs/birpc.mjs";import"../_chunks/libs/remeda.mjs";import"../_chunks/libs/@logtape/logtape.mjs";import"../_chunks/libs/merge-error-cause.mjs";import"../_chunks/libs/is-error-instance.mjs";import"../_chunks/libs/is-plain-obj.mjs";import"../_chunks/libs/safe-stringify.mjs";import"../_chunks/filesystem.mjs";import"../_chunks/libs/defu.mjs";import"../_chunks/libs/pathe.mjs";import"../_chunks/libs/tinyrainbow.mjs";import"../_chunks/libs/json5.mjs";import"../_chunks/libs/@hono/mcp.mjs";import"../_chunks/src.mjs";import"../_chunks/libs/langium.mjs";import"../_chunks/libs/@chevrotain/regexp-to-ast.mjs";import"../_chunks/libs/chevrotain.mjs";import"../_chunks/libs/@chevrotain/cst-dts-gen.mjs";import"../_chunks/libs/@chevrotain/utils.mjs";import"../_chunks/libs/chevrotain-allstar.mjs";import"../_chunks/sequence.mjs";import"../_chunks/libs/@lume/kiwi.mjs";import"../_chunks/libs/ts-graphviz.mjs";import"../_chunks/libs/word-wrap.mjs";import"../_chunks/libs/khroma.mjs";import"../_chunks/libs/p-limit.mjs";import"../_chunks/libs/eventemitter3.mjs";import"../_chunks/libs/p-queue.mjs";import"../_chunks/libs/isexe.mjs";import"../_chunks/libs/which.mjs";import"../_chunks/libs
|
|
1
|
+
import"../_chunks/libs/birpc.mjs";import"../_chunks/libs/remeda.mjs";import"../_chunks/libs/@logtape/logtape.mjs";import"../_chunks/libs/merge-error-cause.mjs";import"../_chunks/libs/is-error-instance.mjs";import"../_chunks/libs/is-plain-obj.mjs";import"../_chunks/libs/safe-stringify.mjs";import"../_chunks/filesystem.mjs";import"../_chunks/libs/defu.mjs";import"../_chunks/libs/pathe.mjs";import"../_chunks/libs/tinyrainbow.mjs";import"../_chunks/libs/json5.mjs";import"../_chunks/libs/@hono/mcp.mjs";import"../_chunks/src.mjs";import"../_chunks/libs/langium.mjs";import"../_chunks/libs/@chevrotain/regexp-to-ast.mjs";import"../_chunks/libs/chevrotain.mjs";import"../_chunks/libs/@chevrotain/cst-dts-gen.mjs";import"../_chunks/libs/@chevrotain/utils.mjs";import"../_chunks/libs/chevrotain-allstar.mjs";import"../_chunks/sequence.mjs";import"../_chunks/libs/@lume/kiwi.mjs";import"../_chunks/libs/ts-graphviz.mjs";import"../_chunks/libs/word-wrap.mjs";import"../_chunks/libs/khroma.mjs";import"../_chunks/libs/p-limit.mjs";import"../_chunks/libs/eventemitter3.mjs";import"../_chunks/libs/p-queue.mjs";import"../_chunks/libs/isexe.mjs";import"../_chunks/libs/which.mjs";import"../_chunks/libs/parse-ms.mjs";import"../_chunks/libs/pretty-ms.mjs";import"../_chunks/libs/picomatch.mjs";import"../_chunks/libs/ufo.mjs";import"../_chunks/libs/@modelcontextprotocol/sdk.mjs";import"../_chunks/libs/@hono/node-server.mjs";import"../_chunks/libs/fast-equals.mjs";import"../_chunks/libs/strip-indent.mjs";import"../_chunks/libs/destr.mjs";import"../_chunks/libs/unstorage.mjs";import{t as e}from"../_chunks/src2.mjs";import"../_chunks/libs/pako.mjs";export{e as LikeC4VitePlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"../_chunks/libs/@nanostores/react.mjs";import{t as a}from"../_chunks/libs/birpc.mjs";import{I as o,
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"../_chunks/libs/@nanostores/react.mjs";import{t as a}from"../_chunks/libs/birpc.mjs";import{I as o,_ as s}from"../_chunks/libs/remeda.mjs";import{LikeC4Model as c}from"@likec4/core/model";import{useEffect as l,useState as u}from"react";function d(e){return a({},{post:t=>e.send(`likec4:rpc`,t),on:t=>e.on(`likec4:rpc`,t),onGeneralError(e,t){console.error(`RPC error in ${t}`,{error:e})},onFunctionError:(e,t)=>{console.error(`RPC error in ${t}`,{error:e})}})}const f=e=>{let n=t(e,e=>c.create(e));function r(t){let n=e.get();if(o(n,t))return;let r={...t,views:s(t.views,e=>{let t=n.views[e.id];return o(t,e)?t:e})};e.set(r)}let a=t(e,e=>Object.values(e.views));function d(){return i(n)}function f(){return i(a)}function p(t){let[n,r]=u(e.value?.views[t]??null);return l(()=>e.subscribe(e=>{r(e.views[t]??null)}),[t]),n}return{updateModel:r,$likec4model:n,useLikeC4Model:d,useLikeC4Views:f,useLikeC4View:p}};export{e as atom,r as batched,t as computed,f as createHooksForModel,d as createRpc,n as map,i as useStore};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "likec4",
|
|
3
3
|
"description": "Toolchain for your architecture diagrams",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.53.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
7
7
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"dependencies": {
|
|
111
|
-
"@hpcc-js/wasm-graphviz": "1.21.
|
|
112
|
-
"@vitejs/plugin-react": "^5.
|
|
111
|
+
"@hpcc-js/wasm-graphviz": "1.21.2",
|
|
112
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
113
113
|
"bundle-require": "^5.1.0",
|
|
114
|
-
"esbuild": "0.27.
|
|
114
|
+
"esbuild": "0.27.4",
|
|
115
115
|
"fdir": "6.4.0",
|
|
116
116
|
"playwright": "1.58.2",
|
|
117
117
|
"chokidar": "^5.0.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"vite": "^7.3.1",
|
|
122
122
|
"yargs": "17.7.2",
|
|
123
123
|
"nano-spawn": "^2.0.0",
|
|
124
|
-
"@likec4/core": "1.
|
|
124
|
+
"@likec4/core": "1.53.0",
|
|
125
125
|
"@likec4/icons": "1.46.4"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
@@ -132,22 +132,22 @@
|
|
|
132
132
|
"langium": "3.5.0",
|
|
133
133
|
"@dagrejs/dagre": "1.1.8",
|
|
134
134
|
"@fontsource-variable/ibm-plex-sans": "^5.2.8",
|
|
135
|
-
"@mantine/core": "8.3.
|
|
136
|
-
"@mantine/hooks": "8.3.
|
|
137
|
-
"@pandacss/dev": "^1.
|
|
135
|
+
"@mantine/core": "8.3.17",
|
|
136
|
+
"@mantine/hooks": "8.3.17",
|
|
137
|
+
"@pandacss/dev": "^1.9.0",
|
|
138
138
|
"@react-hookz/web": "^25.2.0",
|
|
139
|
-
"@tabler/icons-react": "3.
|
|
139
|
+
"@tabler/icons-react": "3.40.0",
|
|
140
140
|
"@tanstack/react-router": "^1.114.13",
|
|
141
141
|
"@tanstack/router-cli": "^1.114.13",
|
|
142
142
|
"@tanstack/router-vite-plugin": "^1.114.13",
|
|
143
|
-
"@types/node": "~22.19.
|
|
143
|
+
"@types/node": "~22.19.15",
|
|
144
144
|
"@types/picomatch": "^4.0.2",
|
|
145
145
|
"@types/react": "19.2.14",
|
|
146
146
|
"@types/react-dom": "19.2.3",
|
|
147
147
|
"@types/semver": "^7.7.1",
|
|
148
148
|
"@types/yargs": "^17.0.33",
|
|
149
|
-
"@xstate/react": "6.
|
|
150
|
-
"@xstate/store": "3.
|
|
149
|
+
"@xstate/react": "6.1.0",
|
|
150
|
+
"@xstate/store": "3.17.0",
|
|
151
151
|
"@xyflow/react": "12.10.1",
|
|
152
152
|
"@xyflow/system": "0.0.75",
|
|
153
153
|
"autoprefixer": "^10.4.27",
|
|
@@ -167,32 +167,32 @@
|
|
|
167
167
|
"ky": "^1.14.3",
|
|
168
168
|
"merge-error-cause": "^5.0.2",
|
|
169
169
|
"mkdirp": "^3.0.1",
|
|
170
|
-
"motion": "^12.
|
|
170
|
+
"motion": "^12.36.0",
|
|
171
171
|
"npm-run-all2": "^8.0.4",
|
|
172
172
|
"p-limit": "7.3.0",
|
|
173
|
-
"nanostores": "1.1.
|
|
173
|
+
"nanostores": "1.1.1",
|
|
174
174
|
"@nanostores/react": "1.0.0",
|
|
175
175
|
"package-manager-detector": "1.6.0",
|
|
176
176
|
"package-up": "^5.0.0",
|
|
177
|
-
"postcss": "8.5.
|
|
177
|
+
"postcss": "8.5.8",
|
|
178
178
|
"pretty-ms": "^9.3.0",
|
|
179
179
|
"react": "19.2.4",
|
|
180
180
|
"react-dom": "19.2.4",
|
|
181
181
|
"react-error-boundary": "^6.1.1",
|
|
182
|
-
"react-resizable-panels": "^4.
|
|
182
|
+
"react-resizable-panels": "^4.7.3",
|
|
183
183
|
"react-shadow": "^20.6.0",
|
|
184
184
|
"remeda": "^2.33.6",
|
|
185
185
|
"semver": "^7.7.4",
|
|
186
186
|
"strip-indent": "^4.1.1",
|
|
187
|
-
"tinyrainbow": "^
|
|
187
|
+
"tinyrainbow": "^3.0.3",
|
|
188
188
|
"tsx": "4.21.0",
|
|
189
|
-
"turbo": "2.8.
|
|
189
|
+
"turbo": "2.8.17",
|
|
190
190
|
"typescript": "5.9.3",
|
|
191
191
|
"ufo": "1.6.3",
|
|
192
|
-
"obuild": "
|
|
192
|
+
"obuild": "0.4.31",
|
|
193
193
|
"vite-plugin-dts": "^4.5.4",
|
|
194
194
|
"vite-plugin-inspect": "^11.3.3",
|
|
195
|
-
"vitest": "4.0
|
|
195
|
+
"vitest": "4.1.0",
|
|
196
196
|
"vscode-jsonrpc": "8.2.1",
|
|
197
197
|
"vscode-languageserver": "9.0.1",
|
|
198
198
|
"vscode-languageserver-types": "3.17.5",
|
|
@@ -201,20 +201,21 @@
|
|
|
201
201
|
"wireit": "0.14.12",
|
|
202
202
|
"zod": "^3.25.76",
|
|
203
203
|
"zx": "8.8.5",
|
|
204
|
-
"xstate": "5.
|
|
205
|
-
"@likec4/config": "1.
|
|
206
|
-
"@likec4/
|
|
207
|
-
"@likec4/
|
|
208
|
-
"@likec4/
|
|
204
|
+
"xstate": "5.28.0",
|
|
205
|
+
"@likec4/config": "1.53.0",
|
|
206
|
+
"@likec4/log": "1.53.0",
|
|
207
|
+
"@likec4/language-server": "1.53.0",
|
|
208
|
+
"@likec4/leanix-bridge": "1.53.0",
|
|
209
|
+
"@likec4/language-services": "1.53.0",
|
|
209
210
|
"@likec4/devops": "1.42.0",
|
|
210
|
-
"@likec4/diagram": "1.
|
|
211
|
-
"@likec4/layouts": "1.
|
|
212
|
-
"@likec4/vite-plugin": "1.
|
|
213
|
-
"@likec4/
|
|
214
|
-
"@likec4/
|
|
215
|
-
"@likec4/
|
|
216
|
-
"@likec4/tsconfig": "1.
|
|
217
|
-
"@likec4/styles": "1.
|
|
211
|
+
"@likec4/diagram": "1.53.0",
|
|
212
|
+
"@likec4/layouts": "1.53.0",
|
|
213
|
+
"@likec4/vite-plugin": "1.53.0",
|
|
214
|
+
"@likec4/generators": "1.53.0",
|
|
215
|
+
"@likec4/style-preset": "1.53.0",
|
|
216
|
+
"@likec4/react": "1.53.0",
|
|
217
|
+
"@likec4/tsconfig": "1.53.0",
|
|
218
|
+
"@likec4/styles": "1.53.0"
|
|
218
219
|
},
|
|
219
220
|
"scripts": {
|
|
220
221
|
"typecheck": "tsc --build --verbose",
|
package/react/index.d.mts
CHANGED
|
@@ -137,7 +137,7 @@ declare type ActionFunctionMap<TContext extends MachineContext, TEvent extends E
|
|
|
137
137
|
|
|
138
138
|
declare type Actions<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TParams extends ParameterizedObject['params'] | undefined, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TEmitted extends EventObject> = SingleOrArray<Action<TContext, TExpressionEvent, TEvent, TParams, TActor, TAction, TGuard, TDelay, TEmitted>>;
|
|
139
139
|
|
|
140
|
-
declare interface ActiveMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject,
|
|
140
|
+
declare interface ActiveMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema> extends MachineSnapshotBase<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> {
|
|
141
141
|
status: 'active';
|
|
142
142
|
output: undefined;
|
|
143
143
|
error: undefined;
|
|
@@ -1416,7 +1416,7 @@ declare interface DoneActorEvent<TOutput = unknown, TId extends string = string>
|
|
|
1416
1416
|
actorId: TId;
|
|
1417
1417
|
}
|
|
1418
1418
|
|
|
1419
|
-
declare interface DoneMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject,
|
|
1419
|
+
declare interface DoneMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema> extends MachineSnapshotBase<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> {
|
|
1420
1420
|
status: 'done';
|
|
1421
1421
|
output: TOutput;
|
|
1422
1422
|
error: undefined;
|
|
@@ -1762,7 +1762,7 @@ declare interface ErrorActorEvent<TErrorData = unknown, TId extends string = str
|
|
|
1762
1762
|
actorId: TId;
|
|
1763
1763
|
}
|
|
1764
1764
|
|
|
1765
|
-
declare interface ErrorMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject,
|
|
1765
|
+
declare interface ErrorMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema> extends MachineSnapshotBase<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> {
|
|
1766
1766
|
status: 'error';
|
|
1767
1767
|
output: undefined;
|
|
1768
1768
|
error: unknown;
|
|
@@ -2833,7 +2833,7 @@ declare interface MachineImplementationsSimplified<TContext extends MachineConte
|
|
|
2833
2833
|
delays: DelayFunctionMap<TContext, TEvent, TAction>;
|
|
2834
2834
|
}
|
|
2835
2835
|
|
|
2836
|
-
declare type MachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject,
|
|
2836
|
+
declare type MachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema> = ActiveMachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> | DoneMachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> | ErrorMachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> | StoppedMachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>;
|
|
2837
2837
|
|
|
2838
2838
|
declare interface MachineSnapshotBase<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta, TStateSchema extends StateSchema = StateSchema> {
|
|
2839
2839
|
/** The state machine that produced this state snapshot. */
|
|
@@ -3491,6 +3491,13 @@ declare interface ResolvedStateMachineTypes<TContext extends MachineContext, TEv
|
|
|
3491
3491
|
|
|
3492
3492
|
declare type ReturnTypeOrValue<T> = T extends AnyFunction ? ReturnType<T> : T;
|
|
3493
3493
|
|
|
3494
|
+
declare interface RouteTransitionConfig<TContext extends MachineContext, TExpressionEvent extends EventObject, TEvent extends EventObject, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TEmitted extends EventObject> {
|
|
3495
|
+
guard?: Guard<TContext, TExpressionEvent, undefined, TGuard>;
|
|
3496
|
+
actions?: Actions<TContext, TExpressionEvent, TEvent, undefined, TActor, TAction, TGuard, TDelay, TEmitted>;
|
|
3497
|
+
meta?: Record<string, any>;
|
|
3498
|
+
description?: string;
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3494
3501
|
declare interface ScheduledEvent {
|
|
3495
3502
|
id: string;
|
|
3496
3503
|
event: EventObject;
|
|
@@ -3694,7 +3701,7 @@ declare type StateId<TSchema extends StateSchema, TKey extends string = '(machin
|
|
|
3694
3701
|
[K in keyof TSchema['states'] & string]: StateId<TSchema['states'][K], K, TParentKey extends string ? `${TParentKey}.${TKey}` : TSchema['id'] extends string ? TSchema['id'] : TKey>;
|
|
3695
3702
|
}> : never);
|
|
3696
3703
|
|
|
3697
|
-
declare class StateMachine<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TStateValue extends StateValue, TTag extends string, TInput, TOutput, TEmitted extends EventObject, TMeta extends MetaObject,
|
|
3704
|
+
declare class StateMachine<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TActor extends ProvidedActor, TAction extends ParameterizedObject, TGuard extends ParameterizedObject, TDelay extends string, TStateValue extends StateValue, TTag extends string, TInput, TOutput, TEmitted extends EventObject, TMeta extends MetaObject, TStateSchema extends StateSchema> implements ActorLogic<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, TEvent, TInput, AnyActorSystem, TEmitted> {
|
|
3698
3705
|
/** The raw config used to create the machine. */
|
|
3699
3706
|
config: MachineConfig<TContext, TEvent, any, any, any, any, any, any, TOutput, any, // TEmitted
|
|
3700
3707
|
any> & {
|
|
@@ -3721,7 +3728,7 @@ declare class StateMachine<TContext extends MachineContext, TEvent extends Event
|
|
|
3721
3728
|
* recursively merge with the existing options.
|
|
3722
3729
|
* @returns A new `StateMachine` instance with the provided implementations.
|
|
3723
3730
|
*/
|
|
3724
|
-
provide(implementations: InternalMachineImplementations<ResolvedStateMachineTypes<TContext, DoNotInfer<TEvent>, TActor, TAction, TGuard, TDelay, TTag, TEmitted>>): StateMachine<TContext, TEvent, TChildren, TActor, TAction, TGuard, TDelay, TStateValue, TTag, TInput, TOutput, TEmitted, TMeta,
|
|
3731
|
+
provide(implementations: InternalMachineImplementations<ResolvedStateMachineTypes<TContext, DoNotInfer<TEvent>, TActor, TAction, TGuard, TDelay, TTag, TEmitted>>): StateMachine<TContext, TEvent, TChildren, TActor, TAction, TGuard, TDelay, TStateValue, TTag, TInput, TOutput, TEmitted, TMeta, TStateSchema>;
|
|
3725
3732
|
resolveState(config: {
|
|
3726
3733
|
value: StateValue;
|
|
3727
3734
|
context?: TContext;
|
|
@@ -3731,7 +3738,7 @@ declare class StateMachine<TContext extends MachineContext, TEvent extends Event
|
|
|
3731
3738
|
error?: unknown;
|
|
3732
3739
|
} & (Equals<TContext, MachineContext> extends false ? {
|
|
3733
3740
|
context: unknown;
|
|
3734
|
-
} : {})): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3741
|
+
} : {})): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>;
|
|
3735
3742
|
/**
|
|
3736
3743
|
* Determines the next snapshot given the current `snapshot` and received
|
|
3737
3744
|
* `event`. Calculates a full macrostep from all microsteps.
|
|
@@ -3739,7 +3746,7 @@ declare class StateMachine<TContext extends MachineContext, TEvent extends Event
|
|
|
3739
3746
|
* @param snapshot The current snapshot
|
|
3740
3747
|
* @param event The received event
|
|
3741
3748
|
*/
|
|
3742
|
-
transition(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3749
|
+
transition(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, event: TEvent, actorScope: ActorScope<typeof snapshot, TEvent, AnyActorSystem, TEmitted>): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>;
|
|
3743
3750
|
/**
|
|
3744
3751
|
* Determines the next state given the current `state` and `event`. Calculates
|
|
3745
3752
|
* a microstep.
|
|
@@ -3747,24 +3754,19 @@ declare class StateMachine<TContext extends MachineContext, TEvent extends Event
|
|
|
3747
3754
|
* @param state The current state
|
|
3748
3755
|
* @param event The received event
|
|
3749
3756
|
*/
|
|
3750
|
-
microstep(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3751
|
-
getTransitionData(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3752
|
-
/**
|
|
3753
|
-
* The initial state _before_ evaluating any microsteps. This "pre-initial"
|
|
3754
|
-
* state is provided to initial actions executed in the initial state.
|
|
3755
|
-
*/
|
|
3756
|
-
private getPreInitialState;
|
|
3757
|
+
microstep(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, event: TEvent, actorScope: AnyActorScope): Array<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>>;
|
|
3758
|
+
getTransitionData(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, event: TEvent): Array<TransitionDefinition<TContext, TEvent>>;
|
|
3757
3759
|
/**
|
|
3758
3760
|
* Returns the initial `State` instance, with reference to `self` as an
|
|
3759
3761
|
* `ActorRef`.
|
|
3760
3762
|
*/
|
|
3761
|
-
getInitialSnapshot(actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3762
|
-
start(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3763
|
+
getInitialSnapshot(actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, TEvent, AnyActorSystem, TEmitted>, input?: TInput): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>;
|
|
3764
|
+
start(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>): void;
|
|
3763
3765
|
getStateNodeById(stateId: string): StateNode<TContext, TEvent>;
|
|
3764
3766
|
get definition(): StateMachineDefinition<TContext, TEvent>;
|
|
3765
3767
|
toJSON(): StateMachineDefinition<TContext, TEvent>;
|
|
3766
|
-
getPersistedSnapshot(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3767
|
-
restoreSnapshot(snapshot: Snapshot<unknown>, _actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta,
|
|
3768
|
+
getPersistedSnapshot(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, options?: unknown): Snapshot<unknown>;
|
|
3769
|
+
restoreSnapshot(snapshot: Snapshot<unknown>, _actorScope: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>, TEvent, AnyActorSystem, TEmitted>): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema>;
|
|
3768
3770
|
}
|
|
3769
3771
|
|
|
3770
3772
|
declare interface StateMachineDefinition<TContext extends MachineContext, TEvent extends EventObject> extends StateNodeDefinition<TContext, TEvent> {
|
|
@@ -3972,6 +3974,7 @@ declare interface StateNodeConfig<TContext extends MachineContext, TEvent extend
|
|
|
3972
3974
|
description?: string;
|
|
3973
3975
|
/** A default target for a history state */
|
|
3974
3976
|
target?: string | undefined;
|
|
3977
|
+
route?: RouteTransitionConfig<TContext, TEvent, TEvent, TActor, TAction, TGuard, TDelay, TEmitted>;
|
|
3975
3978
|
}
|
|
3976
3979
|
|
|
3977
3980
|
declare interface StateNodeDefinition<TContext extends MachineContext, TEvent extends EventObject> {
|
|
@@ -4008,6 +4011,7 @@ declare type StateNodesConfig<TContext extends MachineContext, TEvent extends Ev
|
|
|
4008
4011
|
|
|
4009
4012
|
declare type StateSchema = {
|
|
4010
4013
|
id?: string;
|
|
4014
|
+
route?: unknown;
|
|
4011
4015
|
states?: Record<string, StateSchema>;
|
|
4012
4016
|
type?: unknown;
|
|
4013
4017
|
invoke?: unknown;
|
|
@@ -4050,7 +4054,7 @@ declare interface StateValueMap {
|
|
|
4050
4054
|
|
|
4051
4055
|
declare type StaticLikeC4DiagramProps<A extends Any> = Pick<LikeC4DiagramProperties<A>, 'view' | 'className' | 'fitView' | 'fitViewPadding' | 'background' | 'enableElementDetails' | 'enableRelationshipDetails' | 'enableRelationshipBrowser' | 'enableElementTags' | 'reduceGraphics' | 'initialWidth' | 'initialHeight' | 'renderIcon' | 'renderNodes' | 'dynamicViewVariant' | 'where'>;
|
|
4052
4056
|
|
|
4053
|
-
declare interface StoppedMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject,
|
|
4057
|
+
declare interface StoppedMachineSnapshot<TContext extends MachineContext, TEvent extends EventObject, TChildren extends Record<string, AnyActorRef | undefined>, TStateValue extends StateValue, TTag extends string, TOutput, TMeta extends MetaObject, TStateSchema extends StateSchema> extends MachineSnapshotBase<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TStateSchema> {
|
|
4054
4058
|
status: 'stopped';
|
|
4055
4059
|
output: undefined;
|
|
4056
4060
|
error: undefined;
|