/** * Publish Scheduler * * Background service that polls for documents scheduled for publishing * and publishes them when their scheduled time arrives. */ import type { DatabaseAdapter, CollectionConfig } from '@momentumcms/core'; /** * Options for the publish scheduler. */ export interface PublishSchedulerOptions { /** Polling interval in milliseconds (default: 10000 = 10s) */ intervalMs?: number; /** Logger function for status messages */ logger?: (message: string) => void; } /** * Publish scheduler instance handle. */ export interface PublishSchedulerHandle { /** Stop the scheduler */ stop(): void; /** Run one poll cycle manually (for testing) */ poll(): Promise; } /** * Start a background scheduler that polls for documents with * scheduledPublishAt <= now and publishes them. * * @param adapter - Database adapter * @param collections - All collection configs (only versioned ones are checked) * @param options - Scheduler options * @returns Handle to stop the scheduler */ export declare function startPublishScheduler(adapter: DatabaseAdapter, collections: CollectionConfig[], options?: PublishSchedulerOptions): PublishSchedulerHandle;