@kayahr/ed-journal
Version:
Typescript library to read/watch the player journal of Frontier's game Elite Dangerous
27 lines (26 loc) • 790 B
TypeScript
/**
* Allows async process to be notified by another process.
*/
export declare class Notifier {
private error;
private promise;
private resolve;
private reject;
/**
* Notifies waiting processes. This resolves the promise returned by {@link wait} method.
*/
notify(): void;
/**
* Aborts the notifier. This rejects the promise returned by the {@link wait} method.
*
* @param error - The error with which to abort the notifier.
*/
abort(error: Error): void;
private reset;
/**
* Waits until some other process calls the {@link notify} or {@link abort} method.
*
* @return Promise resolved with {@link notify} was called or rejected when {@link abort} has been called.
*/
wait(): Promise<void>;
}