import { EventObject, IndexByType, IsNever, Prop, ParameterizedObject, ProvidedActor, OutputFrom, AnyActorLogic, IndexByProp } from "./types.js"; /** * @deprecated */ export interface TypegenDisabled { '@@xstate/typegen': false; } /** * @deprecated */ export interface TypegenEnabled { '@@xstate/typegen': true; } /** * @deprecated */ export interface TypegenMeta extends TypegenEnabled { /** * Allows you to specify all the results of state.matches */ matchesStates: string | {}; /** * Allows you to specify all tags used by the machine */ tags: string; /** * Allows you to specify all the missing implementations * of the machine */ missingImplementations: { actions: string; actors: string; delays: string; guards: string; }; /** * A map for the internal events of the machine. * * ```js * key: 'xstate.done.actor.myActor' * value: { * type: 'xstate.done.actor.myActor'; * data: unknown; * __tip: 'Declare the type in event types!'; * } * ``` */ internalEvents: {}; /** * Maps the src of the invoked actor to the event type that includes its known id * * key: 'invokeSrc' * value: 'xstate.done.actor.invokeName' */ invokeSrcNameMap: Record; /** * Keeps track of which events lead to which * actions. * * Key: 'EVENT_NAME' * Value: 'actionName' | 'otherActionName' */ eventsCausingActions: Record; /** * Keeps track of which events lead to which * delays. * * Key: 'EVENT_NAME' * Value: 'delayName' | 'otherDelayName' */ eventsCausingDelays: Record; /** * Keeps track of which events lead to which * guards. * * Key: 'EVENT_NAME' * Value: 'guardName' | 'otherGuardName' */ eventsCausingGuards: Record; /** * Keeps track of which events lead to which * actors. * * Key: 'EVENT_NAME' * Value: 'actorName' | 'otherActorName' */ eventsCausingActors: Record; } /** * @deprecated */ export interface ResolvedTypegenMeta extends TypegenMeta { resolved: TypegenMeta & { indexedActors: Record; indexedActions: Record; indexedEvents: Record; indexedGuards: Record; indexedDelays: Record; }; } /** * @deprecated */ export type TypegenConstraint = TypegenEnabled | TypegenDisabled; /** * @deprecated Always resolves to `true` */ export type AreAllImplementationsAssumedToBeProvided<_TResolvedTypesMeta, _TMissingImplementations = never> = true; /** * @deprecated Always resolves to `never` */ export type MissingImplementationsError<_TResolvedTypesMeta, _TMissingImplementations = never> = never; /** * @deprecated */ interface AllImplementationsProvided { missingImplementations: { actions: never; actors: never; delays: never; guards: never; }; } type GenerateActorEvents = string extends TActor['src'] ? never : TActor extends any ? { type: TActor['id'] extends string ? `xstate.done.actor.${TActor['id']}` : TActor['src'] extends keyof TInvokeSrcNameMap ? `xstate.done.actor.${TInvokeSrcNameMap[TActor['src']] & string}` : `xstate.done.actor.${string}`; output: OutputFrom; } : never; type MergeWithInternalEvents = TIndexedEvents & Pick>; type AllowAllEvents = { eventsCausingActions: Record; eventsCausingActors: Record; eventsCausingDelays: Record; eventsCausingGuards: Record; }; type IndexParameterizedImplementation = string extends TParameterizedImplementation['type'] ? IsNever extends true ? never : Record : IndexByType; type WrapIntoParameterizedObject = T extends any ? { type: T; } : never; /** * @deprecated */ export interface ResolveTypegenMeta { '@@xstate/typegen': TTypesMeta['@@xstate/typegen']; resolved: { enabled: TTypesMeta & { indexedActions: IndexParameterizedImplementation>; indexedActors: string extends TActor['src'] ? Record, { logic: AnyActorLogic; }> : IndexByProp; indexedEvents: MergeWithInternalEvents>>, Prop>; indexedGuards: IndexParameterizedImplementation>; indexedDelays: IndexParameterizedImplementation, Prop>; tags: string extends TTag ? Prop : TTag; emitted: TEmitted; }; disabled: TypegenDisabled & AllImplementationsProvided & AllowAllEvents & { indexedActions: IndexByType; indexedActors: IndexByProp; indexedEvents: Record; indexedGuards: IndexByType; indexedDelays: IndexByType>; invokeSrcNameMap: Record; tags: TTag; emitted: TEmitted; }; }[IsNever extends true ? 'disabled' : TTypesMeta['@@xstate/typegen'] extends true ? 'enabled' : 'disabled']; } export {};