import { KosConfigProperty } from '../models';

/**
 * Event name for timer-related events.
 */
export declare const TIMER_EVENT = "/kos-timer-event";
/**
 * Event name for timer-tick events.
 */
export declare const TOPIC_TIMER_TICK_EVENT = "/kos-timer-event/tick";
/**
 * Default action name for timer end event.
 */
export declare const TIMER_END = "defaultTimerEnd";
/**
 * Represents a timer event.
 */
export interface TimerEvent {
    name: string;
    action: string;
    remainingTime: number;
}
/**
 * Represents a function that can be executed as a timer action.
 */
type TimerActionFn = (name: string, timeRemaining: number) => void;
/**
 * Represents a timer action configuration.
 */
export interface TimerAction {
    name: string;
    action?: TimerActionFn;
    remainingTime?: number;
    singleUse?: boolean;
}
/**
 * Manages the behavior of a timer.
 */
export declare class KosTimer {
    private name;
    private timeout;
    private timer?;
    private state;
    private decrementValue;
    private remainingTime;
    private timeoutActions;
    get id(): string;
    /**
     * Creates a new timer.
     * @param name - The name of the timer.
     * @param timeout - The duration (in seconds) of the timer.
     * @param defaultActions - Optional default timer actions.
     */
    constructor(name: string, timeout: number | KosConfigProperty<number>, defaultActions?: TimerAction[]);
    /**
     * Starts the timer.
     */
    start(): void;
    /**
     * Pauses the timer.
     */
    pause(): void;
    /**
     * Restarts the timer.  The timer will continue to run from its initial state.
     */
    restart(): void;
    /**
     * Resets the timer to its initial state.  The timer will be stopped and reset to its initial state.
     * The timer will need to be started again to continue running.
     */
    reset(): void;
    updateTimeout(timeout: number): void;
    /**
     * Adds a timeout action to the timer.
     * @param timerAction - The timer action configuration to add.
     */
    addTimeoutAction(timerAction: TimerAction): void;
    /**
     * Removes a timeout action from the timer by action name.
     * @param actionName - The name of the action to remove.
     */
    removeTimeoutAction(actionName: string): void;
    /**
     * Updates the timer's remaining time and executes timeout actions.
     */
    private updateTimer;
    /**
     * Executes timeout actions at the specified time.
     * @param time - The remaining time at which to execute actions.
     */
    private executeActions;
    private notifyTick;
    /**
     * Notifies a timeout action through the EventBus.
     * @param action - The timeout action to notify.
     */
    private notifyTimeoutAction;
}
/**
 * The TimerManager provides utility functions to manage timers.
 */
export declare const TimerManager: {
    /**
     * Creates a new timer with a timeout relative to the current date.
     * @param name - The name of the timer
     * @param date - The date to set the timer to
     * @param defaultActions  - Optional default timer actions.
     * @returns the time instance
     */
    createRelativeTimer(name: string, date: Date, defaultActions?: TimerAction[]): KosTimer | undefined;
    /**
     * Creates a new timer or retrieves an existing one by name.
     * @param name - The name of the timer.
     * @param timeout - The duration (in seconds) of the timer (default: 60 seconds).
     * @param defaultActions - Optional default timer actions.
     * @returns The timer instance.
     */
    createTimer(name: string, timeout?: number, defaultActions?: TimerAction[]): KosTimer | undefined;
    /**
     * Gets an existing timer by name.
     * @param name - The name of the timer.
     * @returns The timer instance or `undefined` if not found.
     */
    getTimer(name: string): KosTimer | undefined;
    /**
     * Clears (pauses) an existing timer by name.
     * @param name - The name of the timer.
     */
    clearTimer(name: string): void;
    /**
     * Restarts an existing timer to its initial state by name.  The timer will continue to run from its initial state.
     * @param name - The name of the timer.
     */
    restartTimer(name: string): void;
    /**
     * Resets an existing timer to its initial state by name.
     * @param name - The name of the timer.
     */
    resetTimer(name: string): void;
    /**
     * Adds a timeout action to an existing timer by name.
     * @param name - The name of the timer.
     * @param action - The timer action configuration to add.
     */
    addTimeoutAction(name: string, action: TimerAction): void;
    /**
     * Removes a timeout action from an existing timer by name and action name.
     * @param name - The name of the timer.
     * @param actionName - The name of the action to remove.
     */
    removeTimeoutAction(name: string, actionName: string): void;
    /**
     * Starts an existing timer by name.
     * @param name - The name of the timer.
     */
    startTimer(name: string): void;
};
export {};
//# sourceMappingURL=timer-manager.d.ts.map