import type { Nitro } from "nitro/types"; import type { ScheduleRegistration } from "#runtime/schedules/register.js"; import type { NitroArtifactsConfig } from "#internal/nitro/routes/runtime-artifacts.js"; interface ScheduleTaskNitro { options: Pick; } /** * Inputs needed to wire one set of compiled authored schedules into Nitro's * task and cron surfaces. * * `dispatchModulePath` is the absolute path of `dispatchScheduleTask`'s * module — the synthetic task module imports it and forwards `event.name` * along with the baked-in artifacts config. */ interface RegisterScheduleTaskHandlersInput { readonly artifactsConfig: NitroArtifactsConfig; readonly dispatchModulePath: string; readonly registrations: readonly ScheduleRegistration[]; } /** * Registers compiled authored schedules as virtual Nitro task handlers. * * Each registration becomes: * - one entry in `nitro.options.tasks` whose `handler` points at a virtual * module that wraps `dispatchScheduleTask` in `defineTask({...})`, * - one entry in `nitro.options.scheduledTasks[cron]` so Nitro's cron * scheduler dispatches the task on schedule. * * The synthetic module is needed because Nitro requires task modules to * default-export an object with a `run` method. The dispatch implementation * (`dispatchScheduleTask`) is a plain async function — the virtual module * adapts it to Nitro's task contract while baking in the artifacts config so * the handler does not depend on a global runtime configuration store. */ export declare function registerScheduleTaskHandlers(nitro: ScheduleTaskNitro, input: RegisterScheduleTaskHandlersInput): void; export {};