import { IKosModel } from '../core/kosModel';
/**
 * Custom error for model timeout scenarios
 */
export declare class ModelError extends Error {
    model: IKosModel;
    constructor(message: string | undefined, model: IKosModel);
}
/**
 * Creates a promise that rejects after a specified delay with model context.
 * Provides a cancel function to prevent rejection if the operation completes.
 *
 * @param ms - Timeout duration in milliseconds
 * @param model - The model being operated on
 * @param status - Description of the operation status (e.g., "ACTIVE", "INACTIVE")
 * @returns Object containing the timeout promise and a cancel function
 *
 * @example
 * ```typescript
 * const { promise: timeoutPromise, cancel } = rejectAfterDelay(
 *   MODEL_PROMISE_TIMEOUT_MS,
 *   myModel,
 *   'ACTIVE'
 * );
 *
 * Promise.race([
 *   myOperation().then(() => cancel()),
 *   timeoutPromise
 * ]);
 * ```
 */
export declare const rejectAfterDelay: (ms: number, model: IKosModel, status: string) => {
    promise: Promise<void>;
    cancel: () => void;
};
/**
 * Races a promise against a timeout with automatic cleanup.
 * Useful for ensuring operations complete within a time limit.
 *
 * @param promise - The operation promise to race
 * @param timeoutMs - Timeout duration in milliseconds (defaults to MODEL_PROMISE_TIMEOUT_MS)
 * @param model - The model being operated on
 * @param status - Description of the operation
 * @returns Promise that resolves/rejects based on whichever completes first
 *
 * @example
 * ```typescript
 * await raceWithTimeout(
 *   model.transitionToActive(),
 *   MODEL_PROMISE_TIMEOUT_MS,
 *   model,
 *   'ACTIVE'
 * );
 * ```
 */
export declare const raceWithTimeout: <T>(promise: Promise<T>, timeoutMs: number | undefined, model: IKosModel, status: string) => Promise<T>;
//# sourceMappingURL=promise-utils.d.ts.map