export declare class PromiseTimeoutError extends Error {
    readonly timeoutMs: number;
    constructor(message: string, timeoutMs: number);
}
export interface WithTimeoutOptions<T> {
    onTimeout?: () => void | Promise<void>;
    onSettledAfterTimeout?: (value: T) => void | Promise<void>;
    onRejectedAfterTimeout?: (error: unknown) => void | Promise<void>;
}
export declare function withTimeout<T>(promise: PromiseLike<T> | T, timeoutMs: number, message: string, options?: WithTimeoutOptions<T>): Promise<T>;
