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