import type { ProvideDepsIterator } from '@tinkoff/dippy'; import type { ConsumerContext, Dispatch, GetState } from './state'; export type ActionContext = ConsumerContext; export type ActionConditionsParameters = { requiredCoreRoles?: string[]; requiredRoles?: string[]; onlyBrowser?: boolean; onlyServer?: boolean; pageBrowser?: boolean; pageServer?: boolean; always?: boolean; never?: boolean; [key: string]: any; }; export interface ActionParameters { name: string; fn: (context: ActionContext, payload: Payload, deps: ProvideDepsIterator) => Result; deps?: Deps; conditions?: ActionConditionsParameters; conditionsFailResult?: 'reject' | 'empty'; deferred?: boolean; } export declare const ACTION_PARAMETERS = "__action_parameters__"; export type Action = ActionParameters['fn'] & { [ACTION_PARAMETERS]: ActionParameters; }; /** * @deprecated */ export interface PlatformAction { (context: Context, payload?: Payload): Promise; priority?: 3 | 5 | 7 | 10; name?: string; cancelable?: boolean; requiredRoles?: boolean; cancelOnUrlChange?: boolean; } export type TramvaiActionType = 'page' | 'standalone'; export interface TramvaiActionContext { abortController: AbortController; abortSignal: AbortSignal; executeAction(action: TramvaiAction, ...params: Params): Result extends Promise ? Result : Promise; executeAction(action: Action, payload?: Payload): Result extends Promise ? Result : Promise; deps: ProvideDepsIterator; actionType: TramvaiActionType; dispatch: Dispatch; getState: GetState; } export interface TramvaiActionDefinition { name?: string; fn: (this: TramvaiActionContext, ...params: Params) => Result; deps?: Deps; conditions?: ActionConditionsParameters; conditionsFailResult?: 'reject' | 'empty'; deferred?: boolean; } export interface TramvaiAction extends TramvaiActionDefinition { tramvaiActionVersion: number; name: string; } export type UnknownAction = (...args: any[]) => Result; export type AnyAction = Action | PlatformAction | UnknownAction; export type PageAction = Action | TramvaiAction<[], void, any>; //# sourceMappingURL=actions.d.ts.map