import { NeuronKey } from "./Neuron"; export declare class Payload implements IPayload { #private; readonly key: NeuronKey; readonly prevState: Readonly; state: T; readonly cancelDispatch: () => void; readonly isDispatchCancelled: () => boolean; constructor(options: PayloadParams); } /** * Interface for a Payload object, which contains the data necessary for updating state * and running middleware during state transitions. * * @template T - The type of the state being managed. */ export interface IPayload { /** * The unique key associated with the Neuron state. */ readonly key: Readonly; /** * The current state of the Neuron. */ state: T; /** * The previous state of the Neuron. */ readonly prevState: Readonly; /** * Cancels the dispatch operation for the current payload. */ readonly cancelDispatch: () => void; /** * Checks if the dispatch operation for the current payload has been canceled. * * @returns `true` if the dispatch is canceled; otherwise `false`. */ readonly isDispatchCancelled: () => boolean; } /** * Parameters for creating a new Payload instance. * * @template T - The type of the state being managed. */ export interface PayloadParams { /** * The unique key associated with the Neuron state. */ key: NeuronKey; /** * The previous state of the Neuron. */ prevState: T; /** * The current state of the Neuron. */ state: T; }