import { AxiosResponse } from 'axios'; import { NotFrontDataSource } from '../types/componentsCore.type'; import { NextUIResponseData } from '../types/builder.type'; type GetNextUIFn = (userFlow: string, pageHash: string, entries: Record, responseKey: string, showLoading?: boolean) => Promise | undefined>; type FetchDataSourceFn = (dataSource: NotFrontDataSource, userFlow: string, showLoading?: boolean) => Promise<{ status?: number; data?: unknown; } | undefined>; /** * Runs the GET_DATA_SOURCE pipeline: next-ui fetch config, external request, * session update, then next-ui re-render. * * The first next-ui reply decides the path: * - `fetch`: the request runs (at most once), its result is stored under * ``content.responseKey`` (falling back to the triggering component key), * and next-ui is asked again; a page/overlay answer is applied. * - `page` / `overlay`: there is nothing to fetch (for example a refresh * button), so the reply is applied as is, with no second next-ui call. * - anything else is ignored. * * Loading ownership: when a reply is handed to `setPage`, `setPage` owns the * `isLoading` flag (a superseded reply leaves it to the newer request). On * every other exit, including a throw (which is rethrown), the flow clears it. */ export declare function runGetDataSourceFlow(userFlow: string, pageHash: string, triggerKey: string, entries: Record, getNextUI: GetNextUIFn, fetchDataSource: FetchDataSourceFn): Promise; /** * Custom hook that encapsulates actions related to navigation and data fetching for dynamic UI flows. */ export declare const useAction: () => { getNextUI: (userFlow: string, pageHash: string, entries: any, responseKey: string, showLoading?: boolean) => Promise>; fetchDataSource: (dataSource: NotFrontDataSource, userFlow: string, showLoading?: boolean) => Promise | { status: number; data: {}; } | undefined>; fetchAndGetNextUI: (userFlow: string, pageHash: string, entries: any, responseKey: string, dataSource: NotFrontDataSource) => Promise | undefined>; runGetDataSource: (userFlow: string, pageHash: string, triggerKey: string, entries: Record) => Promise; }; export {};