import { Meta } from './Nodes'; /** * * __Ephemeral__ for actions which are shortlived. e.g. hovering * * __Regular__ for all you other actions. * */ export declare type ActionType = 'Ephemeral' | 'Regular'; /** * * __Complete__ for saving the entire state * * __Diff__ for using diff algorithm * */ export declare type ActionSaveStateMode = 'Complete' | 'Diff'; /** * @typeParam T Type of application state * @typeParam Args Represents the types for the arguments * * @param T Application state */ export declare type ActionFunction = (state: T, ...args: Args) => void; export declare type ActionReturnType = { state: T; label: string; stateSaveMode: ActionSaveStateMode; actionType: ActionType; eventType: S; meta: Meta; }; export declare type ApplyObject = { apply: (state: T, label?: string) => ActionReturnType; }; export declare type ActionObject = { /** * Edits the label associated with this action */ setLabel: (label: string) => ActionObject; /** * Changes the action type to either "Regular" or "Ephemeral" * Ephemeral actions are skipped with the ephemeral undo/redo, * and appear clustered in trrackvis */ setActionType: (actionType: ActionType) => ActionObject; /** * Manually changes the state save for this node to either "Diff" or "Complete" * Typically better to let trrack decide how to store your node */ saveStateMode: (mode: ActionSaveStateMode) => ActionObject; /** * Manually changes the state save for this action to either "Diff" or "Complete" * Typically better to let trrack decide how to store your node */ setEventType: (eventType: S) => ActionObject; /** * Adds custom metadata to the metadata associated with this action * See Nodes.ts for more documentation on the NodeMetadata type. */ setMetaData: (metadata: Meta) => ActionObject; } & ((...args: Args) => ApplyObject);