import type { ScheduleSpec, ScheduleSummary, ScheduleUpdateOptions } from '../types.ts'; /** * Narrow engine view a {@link ScheduleHandle} delegates to. The full * {@link Engine} implements it; the handle only depends on these schedule * lifecycle operations. */ export interface ScheduleHandleEngine { pauseSchedule(scheduleId: string): Promise; resumeSchedule(scheduleId: string): Promise; cancelSchedule(scheduleId: string): Promise; updateSchedule(scheduleId: string, newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise; getSchedule(scheduleId: string): Promise; } /** * Handle to a recurring schedule created by {@link Engine.schedule}. Use * `handle.pause()`, `handle.resume()`, `handle.cancel()`, or * `handle.update(spec, options?)` to manage the schedule lifecycle. * `handle.describe()` returns the current {@link ScheduleSummary}. * * @example * ```ts * import { workflow, Engine, ScheduleHandle } from '@lostgradient/weft'; * * const engine = new Engine(); * engine.register(workflow({ name: 'daily-report' }).execute(async function* () { return 'ok'; })); * * const handle = await engine.schedule('daily-report', null, '0 9 * * *'); * const typedHandle: ScheduleHandle = handle; * await handle.pause(); * const summary = await handle.describe(); * void typedHandle; * console.log(summary.status); // 'paused' * await handle.cancel(); * ``` */ export declare class ScheduleHandle { #private; readonly id: string; constructor(id: string, engine: ScheduleHandleEngine); pause(): Promise; resume(): Promise; cancel(): Promise; update(newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise; describe(): Promise; }