MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/cafsindia/snap.cafsinfotech.in/node_modules/xstate/es/behaviors.d.ts
import { ActorContext, ActorRef, Behavior, EventObject } from './types';
/**
 * Returns an actor behavior from a reducer and its initial state.
 *
 * @param transition The pure reducer that returns the next state given the current state and event.
 * @param initialState The initial state of the reducer.
 * @returns An actor behavior
 */
export declare function fromReducer<TState, TEvent extends EventObject>(transition: (state: TState, event: TEvent, actorContext: ActorContext<TEvent, TState>) => TState, initialState: TState): Behavior<TEvent, TState>;
declare type PromiseEvents<T> = {
    type: 'fulfill';
    data: T;
} | {
    type: 'reject';
    error: unknown;
};
declare type PromiseState<T> = {
    status: 'pending';
    data: undefined;
    error: undefined;
} | {
    status: 'fulfilled';
    data: T;
    error: undefined;
} | {
    status: 'rejected';
    data: undefined;
    error: any;
};
export declare function fromPromise<T>(promiseFn: () => Promise<T>): Behavior<PromiseEvents<T>, PromiseState<T>>;
interface SpawnBehaviorOptions {
    id?: string;
    parent?: ActorRef<any>;
}
export declare function spawnBehavior<TEvent extends EventObject, TEmitted>(behavior: Behavior<TEvent, TEmitted>, options?: SpawnBehaviorOptions): ActorRef<TEvent, TEmitted>;
export {};
//# sourceMappingURL=behaviors.d.ts.map