/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { BylineCore } from '../core.js'; import type { BylineLogger } from '../lib/logger.js'; /** The sweep depends only on this server-side operational surface. */ type ScheduledPublicationCore = Pick & { config: { slugifier?: BylineCore['config']['slugifier']; i18n: { content: { defaultLocale: string; }; }; scheduledPublication?: { enabled?: boolean; }; }; }; export interface ScheduledPublicationSweepOptions { /** Abort before claiming another batch. */ signal?: AbortSignal; /** Stop claiming new work after this process-time budget. */ budgetMs?: number; /** Maximum schedules claimed per batch. */ batchSize?: number; /** Renew an enclosing scheduler lease between batches. */ heartbeat?: () => Promise; logger?: BylineLogger; } export interface ScheduledPublicationSweepResult { published: number; failed: number; workRemaining: boolean; } /** * Drain due publication schedules without depending on the in-process ticker. * Database claims provide the execution fence, so independent external * orchestrators may invoke this operation concurrently. */ export declare function runScheduledPublicationSweep(core: ScheduledPublicationCore, options?: ScheduledPublicationSweepOptions): Promise; export {};