/**
 * Represents a marker type used to indicate that a function or process
 * has been warmed up and is ready for use.
 *
 * This type is typically used as a flag or annotation in scenarios
 * where initialization or preparation steps are required before
 * execution.
 */
export type WarmupMarker = {
    __warmup: true;
};
type Warmupable<T extends (arg?: any) => any> = (arg?: any | WarmupMarker) => ReturnType<T>;
interface UseFunctionWarmupOptions {
    intervalMs?: number;
    immediate?: boolean;
}
/**
 * A React hook that periodically invokes a given function to keep it "warmed up."
 * This can be useful for functions that require initialization or caching to
 * improve performance during actual usage.
 *
 * @template T - The type of the function to be warmed up.
 * @param fn - The function to be warmed up. It should accept an optional argument
 *             and handle a special warmup call with `{ __warmup: true }`.
 * @param options - Configuration options for the warmup behavior.
 * @param options.intervalMs - The interval in milliseconds at which the function
 *                             should be warmed up. Defaults to 5 minutes (300,000 ms).
 *                             If set to `null` or `0`, periodic warmup is disabled.
 * @param options.immediate - Whether to perform an immediate warmup when the hook
 *                            is first invoked. Defaults to `true`.
 *
 * @returns void
 *
 * @remarks
 * - If the `immediate` option is enabled, the function will be warmed up immediately
 *   using `requestIdleCallback` if available, or a `setTimeout` fallback.
 * - Errors thrown during the warmup process are caught and ignored.
 * - The periodic warmup is cleaned up automatically when the component unmounts.
 *
 * @example
 * ```tsx
 * import { useFunctionWarmup } from './use-function-warmup';
 *
 * const myFunction = (arg?: any) => {
 *   if (arg?.__warmup) {
 *     console.log('Warming up...');
 *   } else {
 *     console.log('Executing function...');
 *   }
 * };
 *
 * function MyComponent() {
 *   useFunctionWarmup(myFunction, { intervalMs: 60000, immediate: true });
 *
 *   return <div>My Component</div>;
 * }
 * ```
 */
export declare function useFunctionWarmup<T extends (arg?: any) => any>(fn: Warmupable<T>, options?: UseFunctionWarmupOptions): void;
export {};
//# sourceMappingURL=use-function-warmup.d.ts.map