import { EventUnsubscribe } from './event'; export interface CancellationToken { /** * A flag signalling is cancellation has been requested. */ readonly isCancellationRequested: boolean; /** * An event which fires when cancellation is requested. This event * only ever fires `once` as cancellation can only happen once. Listeners * that are registered after cancellation will be called (next event loop run), * but also only once. * * @event onCancellationRequested */ readonly onCancellationRequested: (listener: (e: any) => any, thisArgs?: any, unsubs?: EventUnsubscribe[]) => EventUnsubscribe; } export declare namespace CancellationToken { function isCancellationToken(thing: unknown): thing is CancellationToken; const None: CancellationToken; const Cancelled: CancellationToken; } export declare class CancellationTokenSource { private readonly _parentUnsubscribe?; constructor(parent?: CancellationToken); private _token?; get token(): CancellationToken; cancel(): void; dispose(cancel?: boolean): void; }