import type { DurableEventData } from "../../data";
export interface ScheduledFn {
    (event: DurableEventData): Promise<void> | void;
}
export interface DispatchEventFn {
    (event: DurableEventData): Promise<void>;
}
export interface DispatcherFn {
    (event: DurableEventData, dispatch: DispatchEventFn): Promise<void> | void;
}
export type ScheduledFunctionsRecord<F = ScheduledFn> = Record<string, F>;
type ScheduledFunctionsConfig<F = ScheduledFn> = ScheduledOptions<F>[] | ScheduledFunctionsRecord<F>;
export interface ScheduledFunctionOptionsInit extends Record<string, unknown> {
    once?: false;
}
export interface ScheduledOptions<F = ScheduledFn> {
    cron?: string;
    on?: string;
    handler: F;
}
export interface ScheduledConfig {
    functions?: ScheduledFunctionsConfig;
    dispatchers?: ScheduledFunctionsConfig<DispatcherFn>;
}
export declare function cron(cron: string, handler: ScheduledFn): () => void;
export declare function addEventListener(on: string, handler: ScheduledFn, options?: ScheduledFunctionOptionsInit): () => void;
export declare function removeEventListener(on: string, handler: ScheduledFn, options?: ScheduledFunctionOptionsInit): void;
export declare function on(on: string, handler: ScheduledFn, options?: ScheduledFunctionOptionsInit): () => void;
export declare function dispatcher(on: string, handler: DispatcherFn): () => void;
export declare const SCHEDULED_FUNCTIONS: ScheduledOptions[];
export declare const DISPATCHER_FUNCTIONS: Map<string, ScheduledOptions<DispatcherFn>>;
export declare function createScheduledFunction(optionsOrFn: ScheduledOptions | ScheduledFn): () => void;
export declare function createDispatcherFunction(optionsOrFn: ScheduledOptions<DispatcherFn> | DispatcherFn): () => void;
export declare function getScheduledFunctionCorrelation(options: ScheduledOptions<unknown>): string;
export declare function getScheduledCorrelation(options: ScheduledFunctionOptions): string;
export interface ScheduledFunctionOptions {
    cron?: string;
    event?: DurableEventData;
}
export declare function getScheduledFunctions(options: ScheduledFunctionOptions): ScheduledOptions[];
export declare function getDispatcherFunction(options: ScheduledFunctionOptions): ScheduledOptions<DispatcherFn> | undefined;
export {};
