import type { ActionConfig } from './actions/index.js'; import type { SingleOrArrayT, TransitionConfigMapA } from './transitions/index.js'; import type { Require } from './libs/bemedev/globals/types'; export type CommonActor = { readonly description?: string; }; /** * The finally part of a completion configuration. * * @see {@linkcode TransitionConfigMapA} for the type of transition configurations. * @see {@linkcode ActionConfig} for the type of action configurations. */ export type FinallyConfig = TransitionConfigMapA extends infer F extends TransitionConfigMapA ? (F | ActionConfig) | readonly [...Require[], F | ActionConfig] : never; export type _EmitterConfig = CommonActor & { readonly next: SingleOrArrayT; readonly error?: SingleOrArrayT; readonly complete?: FinallyConfig; }; export type EmitterConfig = _EmitterConfig extends infer E ? E & { [K in Exclude]: never; } : never; export type ExtractSrcFromActor = T['src']; export type _ChildConfig = CommonActor & ({ readonly on: Record>; readonly contexts?: Record; } | { readonly on?: Record>; readonly contexts: Record; }); export type ChildConfig = _ChildConfig extends infer C ? C & { [K in Exclude]: never; } : never; export type ActorConfig = EmitterConfig | ChildConfig; //# sourceMappingURL=actor.types.d.ts.map