@lite-fsm/core 2.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.
@@ -0,0 +1,26 @@
1
+ export declare function compose(): <T>(x: T) => T;
2
+ export declare function compose<A, R>(f1: (a: A) => R): (a: A) => R;
3
+ export declare function compose<A, B, R>(f1: (b: B) => R, f2: (a: A) => B): (a: A) => R;
4
+ export declare function compose<A, B, C, R>(f1: (c: C) => R, f2: (b: B) => C, f3: (a: A) => B): (a: A) => R;
5
+ export declare function compose<A, B, C, D, R>(f1: (d: D) => R, f2: (c: C) => D, f3: (b: B) => C, f4: (a: A) => B): (a: A) => R;
6
+ export declare function compose<A, B, C, D, E, R>(f1: (e: E) => R, f2: (d: D) => E, f3: (c: C) => D, f4: (b: B) => C, f5: (a: A) => B): (a: A) => R;
7
+ export declare function compose<T, R = T>(...fns: Array<(next: (action: T) => R) => (action: T) => R>): (next: (action: T) => R) => (action: T) => R;
8
+ export declare const WILDCARD = "*";
9
+ export declare const LITE_FSM_SYSTEM_ACTION_PREFIX = "@@lite-fsm/";
10
+ export declare const HYDRATE_ACTION_TYPE = "@@lite-fsm/HYDRATE";
11
+ export declare const VOID_REDUCER_MIDDLEWARE_MARKER = "__liteFsmAllowVoidReducer";
12
+ export declare const VOID_REDUCER_ERROR = "Reducer returned undefined. Return the next state, or use immerMiddleware to mutate draft state without return.";
13
+ export declare const supportsVoidReducer: (middleware: unknown) => boolean;
14
+ export type LiteFsmErrorCode = "LITE_FSM_ACTOR_DISPOSED" | "LITE_FSM_INVALID_ACTOR_CONFIG" | "LITE_FSM_INVALID_ACTOR_SLICE" | "LITE_FSM_INVALID_GENERATED_ID" | "LITE_FSM_INVALID_HYDRATION_ENVELOPE" | "LITE_FSM_INVALID_OPTIONS" | "LITE_FSM_STANDALONE_ACTOR_TEMPLATE";
15
+ export declare class LiteFsmError extends Error {
16
+ readonly code: LiteFsmErrorCode;
17
+ constructor(code: LiteFsmErrorCode, message: string);
18
+ }
19
+ export declare const validateGeneratedId: (id: unknown, kind: "actor" | "group") => string;
20
+ export declare const isSystemAction: (action: {
21
+ type?: unknown;
22
+ }) => action is {
23
+ type: `${typeof LITE_FSM_SYSTEM_ACTION_PREFIX}${string}`;
24
+ };
25
+ export declare const IS_DEV: boolean;
26
+ export declare const deepFreeze: <T>(obj: T) => T;
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@lite-fsm/core",
3
+ "version": "2.0.0",
4
+ "type": "module",
5
+ "description": "Framework-agnostic runtime for lite-fsm",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "main": "./dist/index.cjs",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "sideEffects": false,
14
+ "exports": {
15
+ "./package.json": "./package.json",
16
+ ".": {
17
+ "import": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.cts",
23
+ "default": "./dist/index.cjs"
24
+ }
25
+ }
26
+ },
27
+ "typesVersions": {
28
+ "*": {
29
+ "*": [
30
+ "dist/index.d.ts"
31
+ ]
32
+ }
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "keywords": [
38
+ "lite-fsm",
39
+ "fsm",
40
+ "finite-state-machine",
41
+ "state-machine",
42
+ "statechart",
43
+ "actor-model",
44
+ "event-driven",
45
+ "reducer",
46
+ "lightweight",
47
+ "typescript"
48
+ ],
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/AlexanderGureev/lite-fsm.git",
52
+ "directory": "packages/core"
53
+ },
54
+ "engines": {
55
+ "node": ">=16"
56
+ },
57
+ "scripts": {
58
+ "build": "tsup --config tsup.config.ts && tsc -p tsconfig.build.json && node ../../scripts/dts-to-dcts.mjs dist",
59
+ "check-types": "tsc --noEmit -p tsconfig.json"
60
+ }
61
+ }