UNPKG

transgate

Version:

Agent-based task flow framework

28 lines (27 loc) 694 B
import { GateItem } from "./type"; /** * Interval Gate for Input providing items at regular intervals */ export declare class IntervalGate { private _intervalMS; private _fire; private _isFirst; private _timer; /** * @param {number} seconds - receiving to be resolved every specified seconds */ constructor(seconds: number); /** * Item is `{ time: <Date> }`. * @return {Promise} - A promise that resolves an item when the item is written */ receive(): Promise<IntervalGateItem>; /** * Stop */ clear(): void; _kickTimer(origin: Date): void; } export interface IntervalGateItem extends GateItem { time: Date; }