@mantaq/core 0.2.0 → 0.4.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 +158 -113
- package/dist/index.d.mts +237 -71
- package/dist/index.mjs +1 -766
- package/package.json +5 -5
- package/dist/actor-internal-B4iAxUG_.d.mts +0 -152
- package/dist/internal.d.mts +0 -26
- package/dist/internal.mjs +0 -31
package/dist/index.d.mts
CHANGED
|
@@ -1,31 +1,218 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
//#region src/event.d.ts
|
|
2
|
+
declare function event<const T extends string>(type: T): <Payload extends object | void = void>() => EventRef<T, Payload>;
|
|
3
|
+
interface EventRef<T extends string = string, Payload extends object | void = void> {
|
|
4
|
+
readonly type: T;
|
|
5
|
+
is(anyEvent: unknown): anyEvent is CreatedOfEvent<T, Payload>;
|
|
6
|
+
create(): Payload extends void ? {
|
|
7
|
+
type: T;
|
|
8
|
+
} : void;
|
|
9
|
+
create(payload: Payload): Payload extends void ? {
|
|
10
|
+
type: T;
|
|
11
|
+
} : {
|
|
12
|
+
type: T;
|
|
13
|
+
payload: Payload;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
type AnyEventRef = EventRef<string, object | void>;
|
|
17
|
+
type CreatedOfEvent<T extends string, P> = P extends void ? {
|
|
18
|
+
type: T;
|
|
19
|
+
} : {
|
|
20
|
+
type: T;
|
|
21
|
+
payload: P;
|
|
22
|
+
};
|
|
23
|
+
declare function EventRef<const T extends string, Payload extends object | void = void>(type: T): EventRef<T, Payload>;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/clock.d.ts
|
|
26
|
+
interface Clock {
|
|
27
|
+
setTimeout(ms: number, options: ClockTimerOptions): number;
|
|
10
28
|
clearTimeout(id: number): void;
|
|
11
|
-
setInterval(ms: number,
|
|
12
|
-
signal?: AbortSignal;
|
|
13
|
-
}): number;
|
|
29
|
+
setInterval(ms: number, options: ClockIntervalOptions): number;
|
|
14
30
|
clearInterval(id: number): void;
|
|
31
|
+
now(): number;
|
|
32
|
+
/** Optional hook for draining queues after clock advances (VirtualClock). */
|
|
33
|
+
setDrain?(fn: () => void): void;
|
|
34
|
+
}
|
|
35
|
+
interface ClockTimerOptions {
|
|
36
|
+
cb: () => void;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
eventName?: string;
|
|
39
|
+
}
|
|
40
|
+
interface ClockIntervalOptions {
|
|
41
|
+
cb: () => void;
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/context.d.ts
|
|
46
|
+
interface Context<T> {
|
|
47
|
+
get(): T;
|
|
48
|
+
set(value: T): void;
|
|
49
|
+
}
|
|
50
|
+
/** Two-way handle over an owner's context: reads see live values, writes flag dirty state upstream. */
|
|
51
|
+
declare function Context<T>(options: {
|
|
52
|
+
get: () => T;
|
|
53
|
+
set: (value: T) => void;
|
|
54
|
+
}): Context<T>;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/state.d.ts
|
|
57
|
+
declare function state<const T extends string>(name: T): <Payload = unknown>() => StateRef<T, Payload, false>;
|
|
58
|
+
type AnyStateRef = StateRef<string, unknown, boolean>;
|
|
59
|
+
interface RegionOptions {
|
|
60
|
+
initial: string;
|
|
61
|
+
states: Record<string, AnyStateRef>;
|
|
62
|
+
}
|
|
63
|
+
type RegionsOptions = Record<string, RegionOptions>;
|
|
64
|
+
interface StateRef<T extends string = string, Payload = unknown, IsFinal extends boolean = false> {
|
|
65
|
+
readonly name: T;
|
|
66
|
+
readonly isFinal: IsFinal;
|
|
67
|
+
/** @internal */ _regions?: RegionsOptions;
|
|
68
|
+
regions(options: RegionsOptions): this;
|
|
69
|
+
final(): StateRef<T, Payload, true>;
|
|
70
|
+
create(payload: Payload): {
|
|
71
|
+
state: StateRef<T, Payload, IsFinal>;
|
|
72
|
+
payload: Payload;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
declare function isStateRef(value: unknown): value is StateRef;
|
|
76
|
+
declare function StateRef<T extends string, Payload = unknown, IsFinal extends boolean = false>(name: T, options: {
|
|
77
|
+
isFinal: IsFinal;
|
|
78
|
+
}): StateRef<T, Payload, IsFinal>;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/actor-types.d.ts
|
|
81
|
+
type CreatedOf<E extends EventRef<string, object | void>> = E extends EventRef<infer Type, infer P> ? CreatedOfEvent<Type, P> : never;
|
|
82
|
+
type NonFinalStateRef<States extends AnyStateRef[]> = Extract<States[number], {
|
|
83
|
+
isFinal: false;
|
|
84
|
+
}>;
|
|
85
|
+
interface EffectInput<ActorContext, Payload = unknown> {
|
|
86
|
+
signal: AbortSignal;
|
|
87
|
+
state: {
|
|
88
|
+
name: string;
|
|
89
|
+
payload: Payload;
|
|
90
|
+
};
|
|
91
|
+
event: InternalEvent;
|
|
92
|
+
context: Context<ActorContext>;
|
|
93
|
+
emit: (event: InternalEvent) => void;
|
|
94
|
+
clock: Clock;
|
|
95
|
+
}
|
|
96
|
+
type EffectFn<ActorContext, Payload = unknown> = (input: EffectInput<ActorContext, Payload>) => void | Promise<void> | {
|
|
97
|
+
then(onFulfilled: unknown, onRejected: unknown): unknown;
|
|
98
|
+
};
|
|
99
|
+
type ErrorReason = "transition" | "effect" | "budget" | "output" | "internal" | "async" | "unhandled";
|
|
100
|
+
interface ErrorInfo {
|
|
101
|
+
error: unknown;
|
|
102
|
+
state: AnyStateRef;
|
|
103
|
+
context: unknown;
|
|
104
|
+
event: InternalEvent;
|
|
105
|
+
reason: ErrorReason;
|
|
106
|
+
}
|
|
107
|
+
interface TransitionInfo {
|
|
108
|
+
event: InternalEvent;
|
|
109
|
+
from: string;
|
|
110
|
+
to: string;
|
|
111
|
+
transitioned: boolean;
|
|
112
|
+
/** Names of effects invoked on entry into `to`, in registration order. */
|
|
113
|
+
effects: string[];
|
|
114
|
+
}
|
|
115
|
+
type ErrorState = StateRef<"__error", unknown, true>;
|
|
116
|
+
type TransitionResult<AllowedState extends AnyStateRef = AnyStateRef, AllowedEmit extends string = string> = {
|
|
117
|
+
state?: AllowedState | {
|
|
118
|
+
state: AllowedState;
|
|
119
|
+
payload?: unknown;
|
|
120
|
+
};
|
|
121
|
+
payload?: unknown;
|
|
122
|
+
emit?: Array<{
|
|
123
|
+
type: AllowedEmit;
|
|
124
|
+
payload?: unknown;
|
|
125
|
+
}>;
|
|
126
|
+
};
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/actor-internal.d.ts
|
|
129
|
+
interface Snapshot<C = unknown> {
|
|
130
|
+
path: string[];
|
|
131
|
+
context: C;
|
|
132
|
+
payload?: unknown;
|
|
133
|
+
regions: Record<string, Snapshot<unknown>>;
|
|
134
|
+
done?: boolean;
|
|
135
|
+
error?: ErrorInfo;
|
|
136
|
+
}
|
|
137
|
+
type SubscriberEventName = "change" | "done" | "transition" | "error" | "output";
|
|
138
|
+
type SubscriberHandler<C, E extends SubscriberEventName> = E extends "change" ? (snapshot: Snapshot<C>, prev: Snapshot<C>) => void : E extends "done" ? () => void : E extends "transition" ? (info: TransitionInfo) => void : E extends "error" ? (info: ErrorInfo) => void : E extends "output" ? (event: InternalEvent) => void : never;
|
|
139
|
+
interface AnyActor<C = Record<string, unknown>> {
|
|
140
|
+
state: AnyStateRef;
|
|
141
|
+
clock: Clock;
|
|
142
|
+
regions: Record<string, AnyActor>;
|
|
143
|
+
send(event: InternalEvent): void;
|
|
144
|
+
snapshot(): Snapshot<C>;
|
|
145
|
+
on<E extends SubscriberEventName>(event: E, options: {
|
|
146
|
+
fn: SubscriberHandler<C, E>;
|
|
147
|
+
}): () => void;
|
|
148
|
+
recover(target: {
|
|
149
|
+
state: AnyStateRef;
|
|
150
|
+
context: C;
|
|
151
|
+
}): void;
|
|
152
|
+
settled(): Promise<void>;
|
|
153
|
+
context?: C;
|
|
154
|
+
options?: {
|
|
155
|
+
transitions?: Record<string, Record<string, unknown>>;
|
|
156
|
+
effects?: Record<string, unknown[]>;
|
|
157
|
+
states?: ReadonlyArray<{
|
|
158
|
+
name: string;
|
|
159
|
+
isFinal: boolean;
|
|
160
|
+
}>;
|
|
161
|
+
};
|
|
162
|
+
inject(event: InternalEvent): void;
|
|
163
|
+
dispose(): void;
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/parse-handler.d.ts
|
|
167
|
+
type RuntimeTransitionHandler<States extends readonly AnyStateRef[], ActorContext> = (event: InternalEvent, options: {
|
|
168
|
+
context: Context<ActorContext>;
|
|
169
|
+
actor: AnyActor<ActorContext>;
|
|
170
|
+
}) => TransitionResult<States[number], string>;
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/builder.d.ts
|
|
173
|
+
type EventTypeOf<E extends AnyEventRef> = E extends EventRef<infer Type, object | void> ? Type : never;
|
|
174
|
+
type PayloadOf<S extends AnyStateRef> = S extends StateRef<infer _Name, infer Payload, infer _IsFinal> ? Payload : never;
|
|
175
|
+
type TransitionHandler<States extends readonly AnyStateRef[], ActorContext> = RuntimeTransitionHandler<States, ActorContext>;
|
|
176
|
+
interface EffectEntry<ActorContext> {
|
|
177
|
+
name: string;
|
|
178
|
+
fn: EffectFn<ActorContext>;
|
|
15
179
|
}
|
|
180
|
+
interface BuiltMaps<States extends readonly AnyStateRef[], ActorContext> {
|
|
181
|
+
transitions: Record<string, Record<string, TransitionHandler<States, ActorContext>>>;
|
|
182
|
+
effects: Record<string, Array<EffectEntry<ActorContext>>>;
|
|
183
|
+
}
|
|
184
|
+
type HandlerFn<States extends readonly AnyStateRef[], _InputsInternal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext, E extends AnyEventRef> = (event: E extends EventRef<infer Type, infer P> ? CreatedOfEvent<Type, P> : never, opts: {
|
|
185
|
+
context: Context<ActorContext>;
|
|
186
|
+
actor: AnyActor<ActorContext>;
|
|
187
|
+
}) => TransitionResult<States[number], EventTypeOf<Outputs[number]>>;
|
|
188
|
+
interface ActorBuilder<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext> {
|
|
189
|
+
on<S extends States[number], E extends Inputs[number] | Internal[number]>(stateRef: S, options: {
|
|
190
|
+
eventRef: E;
|
|
191
|
+
handler: HandlerFn<States, Inputs | Internal, Outputs, ActorContext, E>;
|
|
192
|
+
}): ActorBuilder<States, Inputs, Internal, Outputs, ActorContext>;
|
|
193
|
+
onAny<E extends Inputs[number] | Internal[number]>(options: {
|
|
194
|
+
eventRef: E;
|
|
195
|
+
handler: HandlerFn<States, Inputs | Internal, Outputs, ActorContext, E>;
|
|
196
|
+
}): ActorBuilder<States, Inputs, Internal, Outputs, ActorContext>;
|
|
197
|
+
effect<S extends States[number]>(stateRef: S, definition: {
|
|
198
|
+
name: string;
|
|
199
|
+
fn: EffectFn<ActorContext, PayloadOf<S>>;
|
|
200
|
+
}): ActorBuilder<States, Inputs, Internal, Outputs, ActorContext>;
|
|
201
|
+
/** @internal */
|
|
202
|
+
build(): BuiltMaps<States, ActorContext>;
|
|
203
|
+
}
|
|
204
|
+
declare function ActorBuilder<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext>(): ActorBuilder<States, Inputs, Internal, Outputs, ActorContext>;
|
|
205
|
+
type SetupFn<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext> = (m: ActorBuilder<States, Inputs, Internal, Outputs, ActorContext>) => void;
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/real-clock.d.ts
|
|
208
|
+
declare function RealClock(): Clock;
|
|
16
209
|
//#endregion
|
|
17
210
|
//#region src/virtual-clock.d.ts
|
|
18
|
-
|
|
19
|
-
#private;
|
|
211
|
+
interface VirtualClock {
|
|
20
212
|
now(): number;
|
|
21
|
-
setTimeout(ms: number,
|
|
22
|
-
signal?: AbortSignal;
|
|
23
|
-
eventName?: string;
|
|
24
|
-
}): number;
|
|
213
|
+
setTimeout(ms: number, options: ClockTimerOptions): number;
|
|
25
214
|
clearTimeout(id: number): void;
|
|
26
|
-
setInterval(ms: number,
|
|
27
|
-
signal?: AbortSignal;
|
|
28
|
-
}): number;
|
|
215
|
+
setInterval(ms: number, options: ClockIntervalOptions): number;
|
|
29
216
|
clearInterval(id: number): void;
|
|
30
217
|
advance(ms: number): void;
|
|
31
218
|
hasPending(): boolean;
|
|
@@ -37,43 +224,19 @@ declare class VirtualClock implements Clock {
|
|
|
37
224
|
}>;
|
|
38
225
|
setDrain(fn: () => void): void;
|
|
39
226
|
}
|
|
40
|
-
|
|
41
|
-
//#region src/builder.d.ts
|
|
42
|
-
type EventTypeOf<E extends AnyEventRef> = E extends EventRef<infer Type, object | void> ? Type : never;
|
|
43
|
-
type PayloadOf<S extends AnyStateRef> = S extends StateRef<infer _Name, infer Payload, infer _IsFinal> ? Payload : never;
|
|
44
|
-
type TransitionHandler<States extends readonly AnyStateRef[], ActorContext> = (event: InternalEvent, opts: {
|
|
45
|
-
context: Context<ActorContext>;
|
|
46
|
-
actor: AnyActor;
|
|
47
|
-
}) => TransitionResult<States[number], string>;
|
|
48
|
-
interface BuiltMaps<States extends readonly AnyStateRef[], ActorContext> {
|
|
49
|
-
transitions: Record<string, Record<string, TransitionHandler<States, ActorContext>>>;
|
|
50
|
-
effects: Record<string, Array<EffectFn<ActorContext>>>;
|
|
51
|
-
}
|
|
52
|
-
declare class ActorBuilder<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext> {
|
|
53
|
-
#private;
|
|
54
|
-
on<S extends States[number], E extends Inputs[number] | Internal[number]>(stateRef: S, eventRef: E, fn: (event: E extends EventRef<infer Type, infer P> ? CreatedOfEvent<Type, P> : never, opts: {
|
|
55
|
-
context: Context<ActorContext>;
|
|
56
|
-
actor: AnyActor;
|
|
57
|
-
}) => TransitionResult<States[number], EventTypeOf<Outputs[number]>>): this;
|
|
58
|
-
onAny<E extends Inputs[number] | Internal[number]>(eventRef: E, fn: (event: E extends EventRef<infer Type, infer P> ? CreatedOfEvent<Type, P> : never, opts: {
|
|
59
|
-
context: Context<ActorContext>;
|
|
60
|
-
actor: AnyActor;
|
|
61
|
-
}) => TransitionResult<States[number], EventTypeOf<Outputs[number]>>): this;
|
|
62
|
-
effect<S extends States[number]>(stateRef: S, fn: EffectFn<ActorContext, PayloadOf<S>>): this;
|
|
63
|
-
/** @internal */ build(): BuiltMaps<States, ActorContext>;
|
|
64
|
-
}
|
|
65
|
-
type SetupFn<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext> = (m: ActorBuilder<States, Inputs, Internal, Outputs, ActorContext>) => void;
|
|
227
|
+
declare function VirtualClock(): VirtualClock;
|
|
66
228
|
//#endregion
|
|
67
229
|
//#region src/actor.d.ts
|
|
68
|
-
type CreatedOf$1<E extends AnyEventRef> = E extends EventRef<infer Type, infer P> ? CreatedOfEvent<Type, P> : never;
|
|
69
|
-
type
|
|
230
|
+
type CreatedOf$1<E extends AnyEventRef$1> = E extends EventRef<infer Type, infer P> ? CreatedOfEvent<Type, P> : never;
|
|
231
|
+
type AnyEventRef$1 = AnyEventRef;
|
|
232
|
+
type InitialState<S extends AnyStateRef> = S extends StateRef<infer _N extends string, infer P, infer _I extends boolean> ? [unknown] extends [P] ? S | {
|
|
70
233
|
state: S;
|
|
71
234
|
payload?: P;
|
|
72
235
|
} : {
|
|
73
236
|
state: S;
|
|
74
237
|
payload: P;
|
|
75
238
|
} : never;
|
|
76
|
-
interface ActorOptions<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext = Record<string, unknown>> {
|
|
239
|
+
interface ActorOptions<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef$1[], Internal extends readonly AnyEventRef$1[], Outputs extends readonly AnyEventRef$1[], ActorContext = Record<string, unknown>> {
|
|
77
240
|
inputs: Inputs;
|
|
78
241
|
outputs?: Outputs;
|
|
79
242
|
internal?: Internal;
|
|
@@ -85,38 +248,41 @@ interface ActorOptions<States extends readonly AnyStateRef[], Inputs extends rea
|
|
|
85
248
|
setup: SetupFn<States, Inputs, Internal, Outputs, ActorContext>;
|
|
86
249
|
regions?: Record<string, AnyActor>;
|
|
87
250
|
}
|
|
88
|
-
interface InternalActorOptions<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef[], Internal extends readonly AnyEventRef[], Outputs extends readonly AnyEventRef[], ActorContext = Record<string, unknown>> extends Omit<ActorOptions<States, Inputs, Internal, Outputs, ActorContext>, "setup"> {
|
|
251
|
+
interface InternalActorOptions<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef$1[], Internal extends readonly AnyEventRef$1[], Outputs extends readonly AnyEventRef$1[], ActorContext = Record<string, unknown>> extends Omit<ActorOptions<States, Inputs, Internal, Outputs, ActorContext>, "setup"> {
|
|
89
252
|
transitions: TransitionDispatch<States, ActorContext>;
|
|
90
|
-
effects: Record<string, Array<
|
|
253
|
+
effects: Record<string, Array<EffectEntry<ActorContext>>>;
|
|
91
254
|
}
|
|
92
|
-
type TransitionDispatch<States extends readonly AnyStateRef[], ActorContext> = Record<string, Record<string,
|
|
255
|
+
type TransitionDispatch<States extends readonly AnyStateRef[], ActorContext> = Record<string, Record<string, TransitionStepFn<States, ActorContext> | undefined>>;
|
|
256
|
+
type TransitionStepFn<States extends readonly AnyStateRef[], ActorContext> = (event: InternalEvent, options: {
|
|
93
257
|
context: Context<ActorContext>;
|
|
94
|
-
actor: AnyActor
|
|
95
|
-
}) => TransitionResult<States[number], string
|
|
96
|
-
|
|
97
|
-
#private;
|
|
258
|
+
actor: AnyActor<ActorContext>;
|
|
259
|
+
}) => TransitionResult<States[number], string>;
|
|
260
|
+
interface Actor<States extends readonly AnyStateRef[], Inputs extends readonly AnyEventRef$1[], Internal extends readonly AnyEventRef$1[] = readonly [], Outputs extends readonly AnyEventRef$1[] = readonly [], ActorContext = Record<string, unknown>> extends AnyActor<ActorContext> {
|
|
98
261
|
state: States[number] | ErrorState;
|
|
99
262
|
readonly clock: Clock;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
on(event: "transition", fn: (info: TransitionInfo) => void): () => void;
|
|
263
|
+
readonly context: ActorContext;
|
|
264
|
+
readonly regions: Record<string, AnyActor>;
|
|
265
|
+
readonly options: InternalActorOptions<States, Inputs, Internal, Outputs, ActorContext>;
|
|
266
|
+
on<E extends SubscriberEventName>(event: E, options: {
|
|
267
|
+
fn: SubscriberHandler<ActorContext, E>;
|
|
268
|
+
}): () => void;
|
|
107
269
|
settled(): Promise<void>;
|
|
270
|
+
pendingEffectCount(): number;
|
|
108
271
|
send(event: CreatedOf$1<Inputs[number]>): void;
|
|
109
|
-
/**
|
|
110
|
-
* Manually restore the actor to a live state after a fatal `__error`.
|
|
111
|
-
* DANGER: the caller supplies state and context, so the trajectory is no
|
|
112
|
-
* longer deterministic ("same inputs, same trace"). Effects are not re-run
|
|
113
|
-
* and timers are not re-armed — processing resumes on the next event.
|
|
114
|
-
*/
|
|
115
272
|
recover(target: {
|
|
116
273
|
state: States[number];
|
|
117
274
|
context: ActorContext;
|
|
118
275
|
}): void;
|
|
119
276
|
snapshot(): Snapshot<ActorContext>;
|
|
277
|
+
inject(event: InternalEvent): void;
|
|
278
|
+
dispose(): void;
|
|
120
279
|
}
|
|
280
|
+
declare function Actor<const States extends readonly AnyStateRef[], const Inputs extends readonly AnyEventRef$1[], const Internal extends readonly AnyEventRef$1[] = readonly [], const Outputs extends readonly AnyEventRef$1[] = readonly [], ActorContext = Record<string, unknown>>(options: ActorOptions<States, Inputs, Internal, Outputs, ActorContext>): Actor<States, Inputs, Internal, Outputs, ActorContext>;
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/index.d.ts
|
|
283
|
+
type InternalEvent = {
|
|
284
|
+
type: string;
|
|
285
|
+
payload?: unknown;
|
|
286
|
+
};
|
|
121
287
|
//#endregion
|
|
122
|
-
export { Actor, type ActorBuilder, type ActorOptions, type AnyActor, type AnyEventRef, type AnyStateRef, type BuiltMaps, type Clock, Context, type CreatedOf, type CreatedOfEvent, type EffectFn, type EffectInput, type ErrorInfo, type ErrorReason, type ErrorState, EventRef, type EventTypeOf, type InitialState,
|
|
288
|
+
export { Actor, type ActorBuilder, type ActorOptions, type AnyActor, type AnyEventRef, type AnyStateRef, type BuiltMaps, type Clock, Context, type CreatedOf, type CreatedOfEvent, type EffectFn, type EffectInput, type ErrorInfo, type ErrorReason, type ErrorState, EventRef, type EventTypeOf, type InitialState, InternalEvent, type NonFinalStateRef, type PayloadOf, RealClock, type SetupFn, type Snapshot, StateRef, type TransitionHandler, type TransitionInfo, type TransitionResult, VirtualClock, event, isStateRef, state };
|