@crowdin/app-project-module
Version:
Module that generates for you all common endpoints for serving standalone Crowdin App
30 lines (29 loc) • 876 B
TypeScript
import { Config, UnauthorizedConfig } from '../types';
export interface Cron {
/**
* Schedule a task to run on a cron expression
* @param expression - Cron expression (e.g., '0 * * * *' for hourly)
* @param task - Async task to execute
*/
schedule(expression: string, task: () => Promise<void>): void;
}
/**
* Default Node.js cron handler that uses node-cron
*/
export declare class NodeCron implements Cron {
private cron;
private pendingSchedules;
private initialized;
constructor();
schedule(expression: string, task: () => Promise<void>): void;
}
/**
* Initialize the cron instance
* @param config - Client configuration
*/
export declare function initialize(config: Config | UnauthorizedConfig): void;
/**
* Get the initialized cron instance
* @returns The cron instance
*/
export declare function getCron(): Cron;