mirror of
https://gitee.com/myxzgzs/boyue_jnpf.git
synced 2025-08-08 15:22:43 +08:00
18 lines
661 B
TypeScript
18 lines
661 B
TypeScript
![]() |
import { EventEmitter } from "events";
|
||
|
export declare class CancellationToken extends EventEmitter {
|
||
|
private parentCancelHandler;
|
||
|
private _cancelled;
|
||
|
get cancelled(): boolean;
|
||
|
private _parent;
|
||
|
set parent(value: CancellationToken);
|
||
|
constructor(parent?: CancellationToken);
|
||
|
cancel(): void;
|
||
|
private onCancel;
|
||
|
createPromise<R>(callback: (resolve: (thenableOrResult: R | PromiseLike<R>) => void, reject: (error: Error) => void, onCancel: (callback: () => void) => void) => void): Promise<R>;
|
||
|
private removeParentCancelHandler;
|
||
|
dispose(): void;
|
||
|
}
|
||
|
export declare class CancellationError extends Error {
|
||
|
constructor();
|
||
|
}
|