UNPKG

804 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 function is(value: unknown): value is CancellationToken;
10}
11export declare class CancellationError extends Error {
12 constructor();
13}
14export declare class CancellationTokenSource {
15 private _token;
16 get token(): CancellationToken;
17 cancel(): void;
18 dispose(): void;
19}
20export declare function cancelled(): Error;
21export declare function isCancelled(err: Error | undefined): boolean;
22export declare function checkCancelled(token?: CancellationToken): void;
23//# sourceMappingURL=cancellation.d.ts.map
\No newline at end of file