import { Tempo } from '@magmacomputing/tempo'; import { type TempoPlugin } from '@magmacomputing/tempo/plugin-api'; declare module '@magmacomputing/tempo' { namespace Tempo { const tickers: Ticker.Snapshot[]; function ticker(interval?: Ticker.Interval): Ticker.Instance; function ticker(options: Ticker.Options): Ticker.Instance; function ticker(callback: Ticker.Callback): Ticker.Instance; function ticker(interval: Ticker.Interval, callback: Ticker.Callback): Ticker.Instance; function ticker(options: Ticker.Options, callback: Ticker.Callback): Ticker.Instance; function ticker(options: Ticker.Options, extraOptions: Ticker.Options): Ticker.Instance; } } /** * # Ticker * Merged documentation and exported API object. */ 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; 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; 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; }; } /** * # TickerPlugin */ export declare const TickerPlugin: TempoPlugin;