iopa
Version:
API-first, Internet of Things (IoT) stack for Typescript, official implementation of the Internet Open Protocols Alliance (IOPA) reference pattern
20 lines • 727 B
TypeScript
import type { ICancellationToken, ICancellationTokenSource } from '@iopa/types';
export declare class Token implements ICancellationToken {
private _source;
constructor(source: TokenSource);
get isCancelled(): boolean;
onCancelled(callback: (reason: string) => void): void;
throwIfCancelled(): void;
}
export declare class TokenSource implements ICancellationTokenSource {
private _data;
constructor();
cancel(reason: string): void;
get token(): ICancellationToken;
get isCancelled(): boolean;
get reason(): string;
register(cb: (reason: string) => void): void;
}
export declare const empty: Readonly<Token>;
export default TokenSource;
//# sourceMappingURL=cancellation.d.ts.map