@darlean/base
Version:
Base types and definitions for creating Darlean actors and suites
28 lines (27 loc) • 747 B
TypeScript
/**
* Actor type for the Timers Service
*/
export declare const TIMERS_SERVICE = "io.darlean.TimersService";
export interface ITimerTrigger {
moment?: number;
interval?: number;
jitter?: number;
repeatCount?: number;
error: 'continue' | 'break';
success: 'continue' | 'break';
}
export interface ITimerOptions {
id: string;
triggers: ITimerTrigger[];
callbackActorType: string;
callbackActorId: string[];
callbackActionName: string;
callbackActionArgs?: unknown[];
}
export interface ITimerCancelOptions {
id: string;
}
export interface ITimersService {
schedule(options: ITimerOptions): Promise<void>;
cancel(options: ITimerCancelOptions): Promise<void>;
}