UNPKG

743 BTypeScriptView Raw
1import { Event } from './event';
2export interface CancellationToken {
3 readonly isCancellationRequested: boolean;
4 readonly onCancellationRequested: Event<void>;
5}
6export declare namespace CancellationToken {
7 const None: CancellationToken;
8 const Cancelled: CancellationToken;
9}
10export declare class CancellationError extends Error {
11 constructor();
12}
13export declare class CancellationTokenSource {
14 private _token;
15 get token(): CancellationToken;
16 cancel(): void;
17 dispose(): void;
18}
19export declare function cancelled(): Error;
20export declare function isCancelled(err: Error | undefined): boolean;
21export declare function checkCancelled(token?: CancellationToken): void;
22//# sourceMappingURL=cancellation.d.ts.map
\No newline at end of file