import type { ActorLogic } from 'xstate'; import { TransitionsFromEventPayloadMap } from "./store.js"; import { EnqueueObject, EventPayloadMap, StoreContext, StoreSnapshot, EventObject, ExtractEvents, InferSchemaPayloadMap, ResolveStoreContext, ResolveStoreEmittedPayloadMap, StoreSchemas, StandardSchemaMap } from "./types.js"; import type { StandardSchemaV1 } from "./schema.js"; type StoreLogic = ActorLogic, TEvent, TInput, any, TEmitted>; type FromStoreEmittedEvents = ExtractEvents>; type InferredFromStoreTransitions any>, TEmittedPayloadMap extends EventPayloadMap, TContextSchema extends StandardSchemaV1 | undefined, TEmittedSchemaMap extends StandardSchemaMap | undefined> = Record>, event: any, enq: EnqueueObject, FromStoreEmittedEvents, InferredEventPayloadMap>) => ResolveStoreContext | void>; type InferredEventPayloadMap any>> = { [K in keyof TTransitions & string]: TTransitions[K] extends (context: any, event: infer TEvent, ...args: any[]) => any ? Omit : {}; }; type SchemaFromStoreTransitions = TransitionsFromEventPayloadMap, NoInfer>, FromStoreEmittedEvents>; type FromStoreValueConfig any>, TEmittedPayloadMap extends EventPayloadMap, TContextSchema extends StandardSchemaV1 | undefined, TEmittedSchemaMap extends StandardSchemaMap | undefined> = { context: ResolveStoreContext; schemas?: StoreSchemas; on: TTransitions & InferredFromStoreTransitions; }; type FromStoreInputConfig any>, TInput, TEmittedPayloadMap extends EventPayloadMap, TContextSchema extends StandardSchemaV1 | undefined, TEmittedSchemaMap extends StandardSchemaMap | undefined> = { context: (input: TInput) => ResolveStoreContext; schemas?: StoreSchemas; on: TTransitions & InferredFromStoreTransitions; }; type SchemaFromStoreValueConfig = { context: ResolveStoreContext; schemas: StoreSchemas & { events: TEventSchemaMap; }; on: SchemaFromStoreTransitions; }; type SchemaFromStoreInputConfig = { context: (input: TInput) => ResolveStoreContext; schemas: StoreSchemas & { events: TEventSchemaMap; }; on: SchemaFromStoreTransitions; }; /** * An actor logic creator which creates store [actor * logic](https://stately.ai/docs/actors#actor-logic) for use with XState. * * @param config An object containing the store configuration * @param config.context The initial context for the store, either a function * that returns context based on input, or the context itself * @param config.schemas Optional standard-schema definitions used as type * sources for context, events, and emitted events * @param config.on An object defining the transitions for different event types * @returns An actor logic creator function that creates store actor logic */ export declare function fromStore any>, TInput, TEmittedPayloadMap extends EventPayloadMap = EventPayloadMap, TContextSchema extends StandardSchemaV1 | undefined = undefined, TEmittedSchemaMap extends StandardSchemaMap | undefined = undefined>(config: FromStoreInputConfig): StoreLogic, ExtractEvents>, TInput, FromStoreEmittedEvents>; export declare function fromStore any>, TEmittedPayloadMap extends EventPayloadMap = EventPayloadMap, TContextSchema extends StandardSchemaV1 | undefined = undefined, TEmittedSchemaMap extends StandardSchemaMap | undefined = undefined>(config: FromStoreValueConfig): StoreLogic, ExtractEvents>, unknown, FromStoreEmittedEvents>; export declare function fromStore(config: SchemaFromStoreInputConfig): StoreLogic, ExtractEvents>, TInput, FromStoreEmittedEvents>; export declare function fromStore(config: SchemaFromStoreValueConfig): StoreLogic, ExtractEvents>, unknown, FromStoreEmittedEvents>; export {};