/** * Cookie - Operation progress and cancellation tracking * * This module provides 100% API compatibility with MicroPDF's cookie operations. * Cookies track progress, errors, and allow cancellation of long-running operations. */ /** * A cookie for tracking operation progress and cancellation */ export declare class Cookie { private _abort; private _progress; private _progressMax; private _errors; private _incomplete; private _refCount; constructor(_handle?: unknown); /** * Create a new cookie */ static create(): Cookie; keep(): this; drop(): void; /** * Clone this cookie */ clone(): Cookie; /** * Check if operation should abort */ shouldAbort(): boolean; /** * Request abortion of the operation */ abort(): void; /** * Reset abort flag */ resetAbort(): void; /** * Check if aborted */ get isAborted(): boolean; /** * Get current progress */ getProgress(): number; /** * Set current progress */ setProgress(progress: number): void; /** * Increment progress */ incProgress(delta?: number): void; /** * Get progress maximum */ getProgressMax(): number; /** * Set progress maximum */ setProgressMax(max: number): void; /** * Get progress as percentage (0-100) */ getProgressPercent(): number; /** * Get progress as float (0.0-1.0) */ getProgressFloat(): number; /** * Get remaining progress */ getProgressRemaining(): number; /** * Get progress as percentage (alias for getProgressPercent) */ progressPercent(): number; /** * Get progress as float (alias for getProgressFloat) */ progressFloat(): number; /** * Get remaining progress (alias for getProgressRemaining) */ progressRemaining(): number; /** * Check if progress is complete */ isComplete(): boolean; /** * Get error count */ getErrors(): number; /** * Set error count */ setErrors(count: number): void; /** * Increment error count */ incErrors(delta?: number): void; /** * Check if there are errors */ hasErrors(): boolean; /** * Check if operation is incomplete */ isIncomplete(): boolean; /** * Set incomplete flag */ setIncomplete(incomplete: boolean): void; /** * Reset cookie to initial state */ reset(): void; /** * Check if cookie is valid */ isValid(): boolean; /** * Get status summary */ getStatus(): { aborted: boolean; progress: number; progressMax: number; progressPercent: number; progressFloat: number; errors: number; incomplete: boolean; complete: boolean; }; /** * Get status string */ toString(): string; } /** * Cookie-aware operation wrapper */ export declare class CookieOperation { private _cookie; private _operation; private _onProgress?; private _onError?; private _running; constructor(operation: (cookie: Cookie) => Promise, options?: { onProgress?: (progress: number, max: number) => void; onError?: (error: Error) => void; }); /** * Get the cookie */ get cookie(): Cookie; /** * Check if operation is running */ get isRunning(): boolean; /** * Run the operation */ run(): Promise; /** * Abort the operation */ abort(): void; /** * Get progress as percentage */ getProgress(): number; } //# sourceMappingURL=cookie.d.ts.map