1 | import { ActorContext, ActorRef, Behavior, EventObject } from './types';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export declare function fromReducer<TState, TEvent extends EventObject>(transition: (state: TState, event: TEvent, actorContext: ActorContext<TEvent, TState>) => TState, initialState: TState): Behavior<TEvent, TState>;
|
10 | declare type PromiseEvents<T> = {
|
11 | type: 'fulfill';
|
12 | data: T;
|
13 | } | {
|
14 | type: 'reject';
|
15 | error: unknown;
|
16 | };
|
17 | declare type PromiseState<T> = {
|
18 | status: 'pending';
|
19 | data: undefined;
|
20 | error: undefined;
|
21 | } | {
|
22 | status: 'fulfilled';
|
23 | data: T;
|
24 | error: undefined;
|
25 | } | {
|
26 | status: 'rejected';
|
27 | data: undefined;
|
28 | error: any;
|
29 | };
|
30 | export declare function fromPromise<T>(promiseFn: () => Promise<T>): Behavior<PromiseEvents<T>, PromiseState<T>>;
|
31 | interface SpawnBehaviorOptions {
|
32 | id?: string;
|
33 | parent?: ActorRef<any>;
|
34 | }
|
35 | export declare function spawnBehavior<TEvent extends EventObject, TEmitted>(behavior: Behavior<TEvent, TEmitted>, options?: SpawnBehaviorOptions): ActorRef<TEvent, TEmitted>;
|
36 | export {};
|
37 |
|
\ | No newline at end of file |