/** * A class that manages timeouts and abort signals, allowing for both a lifespan timeout and a resettable timeout. * * The class uses an `AbortController` to signal cancellation and provides methods to manage and clear timeouts. */ export declare class TimeoutAbort { private readonly abortController; private timeoutHandle; private lifespanTimeoutHandle; private _isAborted; /** * Constructs a `TimeoutAbort` instance with an optional lifespan timeout. * * @param {number | null} [lifespan = undefined] The lifespan in milliseconds after which the instance will be automatically aborted. */ constructor(lifespan?: number | null); /** * Gets the `AbortSignal` associated with this instance. * * @returns {AbortSignal} The `AbortSignal` that allows for cancellation of operations. */ get signal(): AbortSignal; /** * Checks if the instance has been aborted. * * @returns {boolean} `true` if the instance is aborted, otherwise `false`. */ get isAborted(): boolean; /** * Resets the timeout to a new value, aborting if necessary. * * @param {number} newTimeout The new timeout duration in milliseconds. * * @returns {boolean} `true` if the timeout was successfully reset, `false` if the instance is already aborted. */ resetTimeout(newTimeout: number): boolean; /** * Clears the currently set timeout, if any. */ clearTimeout(): void; /** * Aborts the instance immediately, clearing any active timeouts and signaling cancellation. */ abort(): void; }