import { type PayloadAction } from "@reduxjs/toolkit"; import { type SagaIterator } from "redux-saga"; import { type DashboardCommandType } from "../commands/base.js"; import { type DashboardCommands } from "../commands/index.js"; import { type DashboardEventType } from "../events/base.js"; import { type DashboardEvents } from "../events/index.js"; import { type IDashboardQuery } from "../queries/base.js"; import { type IDashboardQueryService } from "../store/_infra/queryService.js"; import { type DashboardState } from "../store/types.js"; import { type DashboardContext, type DashboardModelCustomizationFns } from "../types/commonTypes.js"; /** * @internal */ export interface IMonitoredAction { calls: number; promise: Promise>; resolve: (action: PayloadAction) => void; reject: (e: any) => void; } /** * @internal */ export interface IHeadlessDashboardConfig { queryServices?: IDashboardQueryService[]; backgroundWorkers?: ((context: DashboardContext) => SagaIterator)[]; customizationFns?: DashboardModelCustomizationFns; } /** * @internal */ export declare class HeadlessDashboard { private readonly reduxedStore; protected monitoredActions: Record; protected capturedActions: Array>; protected capturedEvents: Array; constructor(ctx: DashboardContext, config?: IHeadlessDashboardConfig); protected getOrCreateMonitoredAction: (actionType: string) => IMonitoredAction; private onActionCaptured; private eventHandler; dispatch(action: DashboardCommands | PayloadAction): void; /** * Convenience function that combines both {@link HeadlessDashboard.dispatch} and {@link HeadlessDashboard.waitFor}. * * @param action - action (typically a command) to dispatch * @param actionType - type of action (typically an event type) to wait for * @param timeout - timeout after which the wait fails, default is 1000 */ dispatchAndWaitFor(action: DashboardCommands | PayloadAction, actionType: DashboardEventType | DashboardCommandType | string, timeout?: number): Promise; private commandFailedRejectsWaitFor; private commandRejectedEndsWaitFor; /** * Starts a dashboard query. * * @param action - query action */ query(action: IDashboardQuery): Promise; /** * Wait for action to occur. The wait is bounded by a timeout that is 1s by default. * * @param actionType - action type to wait for * @param timeout - timeout after which the wait fails, default is 1000 */ waitFor(actionType: DashboardEventType | DashboardCommandType | string, timeout?: number): Promise; /** * select data from the state */ select any>(selectorFactory: TSelectorFactory): ReturnType; /** * Returns dashboard state. */ protected state(): DashboardState; } //# sourceMappingURL=HeadlessDashboard.d.ts.map