/** * Import the needed reducers */ import { updateCollectorValues } from './node.reducer.js'; /** * Import the types */ import type { PayloadAction } from '@reduxjs/toolkit'; import type { DavinciErrorResponse, DaVinciFailureResponse, DaVinciNextResponse, DaVinciSuccessResponse } from './davinci.types.js'; import type { ContinueNode, SuccessNode, ErrorNode, StartNode, FailureNode } from './node.types.js'; /** * @const initialNodeState - Initial state for the node slice */ export declare const initialNodeState: { cache: null; client: { status: "start"; }; error: null; server: { status: "start"; }; status: "start"; }; /** * @const nodeSlice - Slice for handling the node state * @see https://redux-toolkit.js.org/api/createSlice */ export declare const nodeSlice: import("@reduxjs/toolkit").Slice>} action - The action to be dispatched * @returns {ErrorNode} - The error node */ error(state: import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft, action: PayloadAction<{ data: DavinciErrorResponse; requestId: string; httpStatus: number; }>): import("immer").WritableDraft; /** * @method failure - Method for creating a failure node * @param {Object} state - The current state of the slice * @param {PayloadAction} action - The action to be dispatched * @returns {FailureNode} - The failure node */ failure(state: import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft, action: PayloadAction<{ data: DaVinciFailureResponse | unknown; requestId: string; httpStatus: number; }>): import("immer").WritableDraft; /** * @method next - Method for creating a next node * @param {Object} state - The current state of the slice * @param {PayloadAction} action - The action to be dispatched * @returns {ContinueNode} - The next node */ next(state: import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft, action: PayloadAction<{ data: DaVinciNextResponse; requestId: string; httpStatus: number; }>): import("immer").WritableDraft; /** * @method success - Method for creating a success node * @param {Object} state - The current state of the slice * @returns {SuccessNode} - The success node */ success(state: import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft, action: PayloadAction<{ data: DaVinciSuccessResponse; requestId: string; httpStatus: number; }>): import("immer").WritableDraft; /** * @method update - Method for updating collector values with the node * @param {Object} state - The current state of the slice * @param {PayloadAction} action - The action to be dispatched * @returns {ContinueNode} - The next node */ update(state: import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft, action: ReturnType): import("immer").WritableDraft; /** * @method poll - Method for creating the next node after continue polling * @param {Object} state - The current state of the slice * @param {PayloadAction} action - The action to be dispatched * @returns {ContinueNode} - The next node */ poll(state: import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft | import("immer").WritableDraft, action: PayloadAction<{ requestId: string; }>): import("immer").WritableDraft; }, "node", "node", { selectClient: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => { action: string; collectors: import("./node.types.js").Collectors[]; description?: string; name?: string; status: "continue"; } | { action: string; collectors: import("./node.types.js").Collectors[]; description?: string; name?: string; status: "error"; } | { status: "failure"; } | { status: "start"; } | { authorization?: { code?: string; state?: string; }; status: "success"; } | null; selectCollectors: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => { error: null; state: import("./node.types.js").Collectors[]; } | { error: { readonly code: "unknown"; readonly type: "state_error"; readonly message: "`collectors` are only available on nodes with `status` of continue or error"; }; state: never[]; }; selectCollector: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode, id: string) => { error: null; state: import("./node.types.js").Collectors | undefined; } | { error: { readonly code: "unknown"; readonly type: "state_error"; readonly message: "`collectors` are only available on nodes with `status` of continue or error"; }; state: null; }; selectError: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => import("./node.types.js").DaVinciError | null; selectErrorCollectors: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => { error: null; state: import("./node.types.js").CollectorErrors[]; } | { error: { readonly code: "unknown"; readonly type: "state_error"; readonly message: "`errorCollectors` are only available on nodes with `status` of error"; }; state: never[]; }; selectServer: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => { _links?: import("./davinci.types.js").Links; id?: string; interactionId?: string; interactionToken?: string; href?: string; eventName?: string; status: "continue"; } | { _links?: import("./davinci.types.js").Links; eventName?: string; id?: string; interactionId?: string; interactionToken?: string; status: "error"; } | { _links?: import("./davinci.types.js").Links; eventName?: string; href?: string; id?: string; interactionId?: string; interactionToken?: string; status: "failure"; } | { status: "start"; } | { _links?: import("./davinci.types.js").Links; eventName?: string; id?: string; interactionId?: string; interactionToken?: string; href?: string; session?: string; status: "success"; } | null; selectContinueServer: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => { error: { readonly code: "unknown"; readonly type: "state_error"; readonly message: "Not in a continue node state, must be in a continue node to use poll method"; }; state: null; } | { error: null; state: { _links?: import("./davinci.types.js").Links; id?: string; interactionId?: string; interactionToken?: string; href?: string; eventName?: string; status: "continue"; }; }; selectSelfLink: (state: ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode) => { error: { readonly code: "unknown"; readonly type: "state_error"; readonly message: "Not in a continue node state, must be in a continue node for self link"; }; state: null; } | { error: { readonly code: "unknown"; readonly type: "state_error"; readonly message: "No self link found in server info for challenge polling operation"; }; state: null; } | { error: null; state: string; }; }>; //# sourceMappingURL=node.slice.d.ts.map