/** @noSelfInFile */ import { Event } from "./event"; declare global { type PromiseExecutor = ConstructorParameters>[0]; type PromiseResolve = Parameters>[0]; type PromiseReject = Parameters>[1]; } export declare class OperationMonitor extends Promise { private readonly o; constructor(operation: Operation, ...args: ConstructorParameters>); cancel(): boolean; } declare const OperationContinue: unique symbol; type OperationContinue = typeof OperationContinue; export { OperationContinue }; export declare abstract class Operation { protected constructor(); private started; protected progress: number; protected maximum: number; isCanceled: boolean; get isStarted(): boolean; execute(): OperationMonitor; protected abstract estimate(): number | Promise; protected abstract work(): T | OperationContinue | Promise; get onSuccess(): Event<[operation: Operation, result: T]>; get onFailure(): Event<[operation: Operation, reason?: any]>; get onComplete(): Event<[ operation: Operation, ...result: [success: true, result: T] | [success: false, reason?: any] ]>; get onProgress(): Event<[operation: Operation]>; protected abstract doCancel(): boolean; cancel(): boolean; }