declare class Builder { static Create(): Builder; private timer_; private auto_start_; WithTimer(callback: (timer: CallbackTimer) => void): this; WithWaitTime(value: number): this; WithOneShot(value: boolean): this; WithTimeOutCallback(callback: () => void): this; WithYieldAfterCall(value: boolean): this; WithTerminateOld(value: boolean): this; WithAutoStart(): this; Build(): CallbackTimer; } type CallableBuilder = typeof Builder & { (): Builder; }; export declare class CallbackTimer { static Builder: CallableBuilder; WaitTime: number; /**dont restart the timer til the callback is finished. * *Applied only if one_shot is false */ YieldAfterCall: boolean; /**stops the previous callback if it's still running. * *Applied only if one_shot is false */ TerminateOld: boolean; private start_time_; /** * if one_shot if true, the timer will work only once and will stop * if false timer works until the manual Stop() * default is true */ OneShot: boolean; private stopped_; IsStopped(): boolean; private thread_?; private callback_thread_?; private callback_; SetCallback(callback: () => void): this; Start(time_sec?: number): void; private TerminateCallbackThread; private Cycle; /** * way to stop the timer in timer callback * @param terminate_callback whether to stop running callback defaults to false * if called from the timer callback should be always false, its better to handle termination within the callback with return statement * * ```ts * function TimerFunction() * ... * if(something){ * timer.StopInThread(); * return; * } * } * ``` */ StopInThread(terminate_callback?: boolean): void; /** * should not be called from the callback in the timer, can cause error! * @param terminate_callback */ Stop(terminate_callback?: boolean): void; GetTimeLeft(): number; Destroy(): void; } export {};