import type { Action2, ActionConfig, ActionResult, MaybeAsyncActionResult } from '../actions/index.js'; import type { Equals, NOmit, Primitive, PrimitiveObject } from '../libs/bemedev/globals/types'; import type { DelayFunction2, DelayFunction3 } from '../delays/index.js'; import type { Pausable } from '../emitters/index.js'; import type { ActorsConfigMap, EventArg, EventObject, EventsMap, ToEventObject, ToEvents } from '../events/index.js'; import type { GuardConfig, PredicateS2, PredicateS3 } from '../guards/index.js'; import type { AnyMachine, ContextFrom, PrivateContextFrom } from '../machine/index.js'; import type { ActivityConfig, NodeConfig, StateValue } from '../states/index.js'; import type { AlwaysConfig, DelayedTransitions, TransitionConfig } from '../transitions/index.js'; import type { Decompose } from '@bemedev/decompose'; import type { Interval2, IntervalParams } from '@bemedev/interval2'; import type { FnMapR, OptionalDefinition } from '../types/index.js'; import { type InterpreterFrom } from './interpreter'; import type { SubscriberClass, SubscriberOptions } from './subscriber'; export type WorkingStatus = 'idle' | 'starting' | 'started' | 'paused' | 'working' | 'sending' | 'stopped' | 'busy'; export type Mode = 'normal' | 'strict'; export type OptionalDefinitions = OptionalDefinition & OptionalDefinition; export type InterpreterOptions = PrivateContextFrom, C extends ContextFrom = ContextFrom> = { mode?: Mode; exact?: boolean; } & OptionalDefinitions; export type InterpretArgs = Equals, Partial>> extends true ? [machine: M, config?: InterpreterOptions] : [machine: M, config: InterpreterOptions]; export type Interpreter_F = (...args: InterpretArgs) => InterpreterFrom; export type ToAction_F = (action?: ActionConfig) => Action2; export type PerformActionLater_F = (action: Action2) => MaybeAsyncActionResult; export type PerformAction_F = (action: Action2) => Promise; export type ToPredicate_F = (predicate?: GuardConfig) => PredicateS2; export type PerformPredicate_F = (predicate: PredicateS3) => boolean; export type ToDelay_F = (delay?: string) => DelayFunction2 | undefined; export type PerformDelay_F = (delay: DelayFunction3) => number; export type ExecuteActivities_F = (from: string, activity: ActivityConfig) => string[]; export type PerformAfter_F = (from: string, after: DelayedTransitions) => (() => Promise) | undefined; export type TransitionAfterResult = { result: ActionResult; target: string; } | undefined; export type PerformAlway_F = (always: AlwaysConfig) => Promise; export type Collected0 = { after?: (() => Promise) | undefined; always?: () => Promise; }; export type Contexts = { pContext?: Pc; context?: Tc; }; export type PerformTransition_F = (transition: TransitionConfig) => Promise; export type PerformTransitions_F = (...transitions: TransitionConfig[]) => Promise; export type SleepContexts_F = (ms?: number) => Promise>; export type _Send_F = (event: E) => Promise; export type AddSubscriber_F> = ToEventObject>> = (subscriber: FnMapR, options?: SubscriberOptions) => SubscriberClass; export type Subscribe_F> = ToEventObject>> = (subscriber: FnMapR, options?: SubscriberOptions) => SubscriberClass; export type Selector_F = T extends Primitive ? undefined : , K extends Extract, R = D[K]>(selector: K) => R; export interface AnyInterpreter { mode: Mode; eventsMap: EventsMap; initialNode: any; node: any; makeStrict: () => void; status: WorkingStatus; initialConfig: NodeConfig; initialValue: StateValue; config: NodeConfig; renew: any; value: StateValue; context: any; start: () => Promise; pause: () => void; resume: () => void; stop: () => void; _providePrivateContext: (pContext: Pc) => AnyMachine; _ppC: (pContext: Pc) => AnyMachine; _provideContext: (context: Tc) => AnyMachine; subscribe: AddSubscriber_F; send: (event: EventArg) => Promise; toActionFn: (action: ActionConfig) => any; toPredicateFn: (guard: GuardConfig) => any; toPromiseSrcFn: (src: string) => any; toDelayFn: (delay: string) => any; toChildFunction: (machine: string) => any; toObservable: (emitter: string) => any; id?: string; from?: string; dispose: () => void; } export type CreateInterval2_F = (config: NOmit) => Interval2; export type Subcription = { unsubscribe: () => void; }; export type Observer = { next: (value: T) => void; error: (err: any) => void; complete: () => void; }; export type TimeOutAction = { id: string; timer: NodeJS.Timeout; }; export type DiffNext = { sv: StateValue; diffEntries: ActionConfig[]; diffExits: ActionConfig[]; }; export type CollectedPausable = { from: string; pausable: Pausable; id: string; }; export type CollectedService = { from: string; service: AnyInterpreter; id: string; }; //# sourceMappingURL=interpreter.types.d.ts.map