export interface EventWaitResult<T = Event> {
    event: T | null;
    timedOut: boolean;
    cancelled: boolean;
}
export interface TransitionWaitResult {
    completed: boolean;
    cancelled: boolean;
}
export interface AnimationWaitResult {
    completed: boolean;
    type: 'transition' | 'animation' | 'timeout';
}
export declare function waitForEvent<T extends Event = Event>(target: EventTarget, eventName: string, timeout?: number): Promise<EventWaitResult<T>>;
export declare function waitForTime(ms: number): Promise<void>;
export declare function waitForTransitionEnd(element: HTMLElement, property: string, duration: number): Promise<TransitionWaitResult>;
export declare function waitForAnimationComplete(element: HTMLElement, computedAnimationTime: number, userTimeout: number): Promise<AnimationWaitResult>;
export type WaitCondition = {
    type: 'time';
    ms: number;
} | {
    type: 'event';
    target: EventTarget;
    eventName: string;
};
export interface RaceResult {
    winner: WaitCondition;
    result: number | Event;
}
export declare function waitForFirst(conditions: WaitCondition[]): Promise<RaceResult>;
export declare function createGuardedFinisher<T>(cleanup: () => void, resolve: (value: T) => void): (result: T) => void;
export declare function createOnceGuard<T extends (...args: any[]) => void>(callback: T): (...args: Parameters<T>) => void;
export declare function createCleanupManager(): {
    add: (fn: () => void) => void;
    cleanup: () => void;
};
//# sourceMappingURL=event-waiting.d.ts.map