import { RequestCore, TaskManagerCoreConfig, SharedConfigs, RequestConfigs, RequestEventHandlersType } from './request-core.js'; export { RequestConfigBase, RequestDataRecordType, RequestStatus, TaskManagerInterceptorsType } from './request-core.js'; import './cache-core.js'; import 'idb-keyval'; import './encode-core.js'; /** * TaskManagerCore manages the tasks and triggers events based on the task's lifecycle. * The onCache, onRequest, onSuccess, onError, and onFinally events are triggered based on the task's lifecycle. * * @template Task - A function type that returns a Promise. * @template TaskError - The type of error that can be thrown by the task. */ declare class TaskManagerCore Promise, TaskError = any, Meta = Record> extends RequestCore { constructor(config: TaskManagerCoreConfig); /** * Initiates a request with the given parameters. * * @param {...Parameters} parameters - The parameters to pass to the task. * @returns {Promise} - The result of the task. */ request(...parameters: Parameters): Promise<{ data?: Awaited> | null | undefined; error?: TaskError | undefined; isError?: boolean; createdAt: number; updatedAt: number; hash: string; parameters: Parameters; meta: Meta; isPrevented?: boolean; } & SharedConfigs>; /** * Configures the request with the given configuration. * * @param {RequestConfigs} config - The configuration for the request. * @returns {Object} - An object containing a request function. */ config(config: RequestConfigs): { request: (...parameters: Parameters) => Promise; }; /** * Invalidates the current request. * it will ignore any blocker logics and re-fetch the data. * * @param {Omit, "onCache">} [config={}] - The configuration for the request. * @returns {Promise} - The result of the invalidated task. */ invalidate(config?: Omit, "onCache">): Promise; /** * Pre-processes the request with the given parameters. * It only affects the cache and does not change the current request parameters. * * @param {...Parameters} parameters - The parameters to pass to the task. * @returns {Promise} - The result of the pre-processed task. */ preProcess(...parameters: Parameters): Promise<{ data?: Awaited> | null | undefined; error?: TaskError | undefined; isError?: boolean; createdAt: number; updatedAt: number; hash: string; parameters: Parameters; meta: Meta; isPrevented?: boolean; } & SharedConfigs>; } declare function taskManager Promise, TaskError = any, Meta = Record>(config: TaskManagerCoreConfig): TaskManagerCore; export { RequestConfigs, RequestEventHandlersType, SharedConfigs, TaskManagerCore, TaskManagerCoreConfig, taskManager };