import { Tempo } from '@magmacomputing/tempo'; import { isCronString } from '@magmacomputing/tempo/plugin/sdk'; export { isCronString }; declare module '@magmacomputing/tempo' { namespace Tempo { /** An array of snapshots for all currently active tickers. */ const tickers: Ticker.Snapshot[]; /** * Creates a new Ticker instance to schedule recurring events. * * @param interval - The ticker interval, cron string, rrule, or options configuration * @param callback - Optional callback to execute on each tick * @returns A Ticker.Instance that can be awaited, iterated, or listened to */ function ticker(options: Ticker.Options): Ticker.Instance; function ticker(interval?: Ticker.Interval): Ticker.Instance; function ticker(callback: Ticker.Callback): Ticker.Instance; function ticker(interval: Ticker.Interval, callback: Ticker.Callback): Ticker.Instance; function ticker(interval: Ticker.Interval, options: Ticker.Options): Ticker.Instance; function ticker(options: Ticker.Options, callback: Ticker.Callback): Ticker.Instance; function ticker(options: Ticker.Options, extraOptions: Ticker.Options): Ticker.Instance; } } /** * ## Ticker * Ticker namespace object. * Provides access to currently active tickers. */ export declare const Ticker: { readonly active: Ticker.Snapshot[]; }; /** * Unified namespace for Ticker types and public API. */ export declare namespace Ticker { /** ticker interval allowed types (interpreted as seconds) */ type Interval = number | string | bigint; /** ticker configuration and stop conditions */ type Options = { label?: string; cron?: string; rrule?: string | { rrule: string; [key: string]: any; }; years?: number; months?: number; weeks?: number; days?: number; hours?: number; minutes?: number; seconds?: number; milliseconds?: number; microseconds?: number; nanoseconds?: number; yy?: number; mm?: number; ww?: number; dd?: number; hh?: number; mi?: number; ss?: number; ms?: number; us?: number; ns?: number; limit?: number; until?: Tempo.DateTime | Tempo.Options; seed?: Tempo.DateTime | Tempo.Options; catch?: boolean; [key: `#${string}`]: number | string; }; /** callback function for Tempo.ticker() */ type Callback = (t: Tempo, stop: () => void) => void; /** Internal descriptor for Ticker methods and properties */ interface Descriptor extends AsyncGenerator, AsyncDisposable, Disposable { pulse(): Tempo; on(event: 'pulse' | 'catch' | 'stop', cb: (t: Tempo, stop: () => void) => void): this; stop(): void; readonly info: { label: string | undefined; next: Tempo; ticks: number; limit: number | undefined; interval: Record; rrule: string | undefined; cron: string | undefined; stopped: boolean; }; } /** Unified Ticker interface supporting generators, events, and manual pulsing (callable as stop()) */ interface Instance extends Descriptor { (): void; } /** Summary of an active ticker */ type Snapshot = Descriptor['info'] & { ticker: Instance; }; } /** * Options for configuring the Ticker plugin. */ export type TickerPluginOptions = Ticker.Options & { interval?: Ticker.Interval; }; /** * ## TickerPlugin * The Community Ticker Plugin. * Exposes the `Tempo.ticker()` factory and `Tempo.tickers` registry. */ export declare const TickerPlugin: import("@magmacomputing/tempo/plugin/plugin.type").PluginFactory<{ name: string; install(this: typeof Tempo, TempoClass: typeof Tempo, options?: any): void; }, any>;