export declare const BettererTasksContext: import("react").Context; /** * @internal This could change at any point! Please don't use! * * The state of the a running tasks. */ export interface BettererTaskState { /** * If this task has finished running or not. It will be `true` if an error has been throw. */ done: boolean; /** * If this task is currently running or not. */ running: boolean; /** * The error thrown by this task. It will be `null` if the task completes successfully. */ error: Error | null; } /** * @internal This could change at any point! Please don't use! * * The state of the running tasks. `endTime` will only be present when there are no more * `running` tasks. */ export interface BettererTasksState { /** * How many tasks are currently running. */ running: number; /** * How many tasks are done running. */ done: number; /** * How many tasks threw an error. */ errors: number; /** * What time the tasks started running. */ startTime: number; /** * What time the tasks finished running. * * @remarks will be `null` until `running` is `0`. */ endTime: number | null; } /** @knipignore used by an exported function */ export interface BettererTasksAPI { error(name: string, error: Error): void; start(name: string): void; stop(name: string): void; } export declare function useTasksState(): [BettererTasksState, BettererTasksAPI]; /** @knipignore used by an exported function */ export interface BettererTaskAPI { error(error: Error): void; start(): void; stop(): void; } export declare function useTaskState(name: string): [BettererTaskState | null, BettererTaskAPI]; //# sourceMappingURL=useTasksState.d.ts.map