dsl-builder
Version:
OpenSearch Query Builder - Extract from OpenSearch Dashboards
28 lines (27 loc) • 926 B
TypeScript
/**
* Class used to signify that something was aborted. Useful for applications to conditionally handle
* this type of error differently than other errors.
*/
export declare class AbortError extends Error {
constructor(message?: string);
}
/**
* Returns a `Promise` corresponding with when the given `AbortSignal` is aborted. Useful for
* situations when you might need to `Promise.race` multiple `AbortSignal`s, or an `AbortSignal`
* with any other expected errors (or completions).
*
* @param signal The `AbortSignal` to generate the `Promise` from
*/
export declare function toPromise(signal: AbortSignal): {
promise: Promise<never>;
cleanup: () => void;
};
/**
* Returns an `AbortSignal` that will be aborted when the first of the given signals aborts.
*
* @param signals
*/
export declare function getCombinedSignal(signals: AbortSignal[]): {
signal: AbortSignal;
cleanup: () => void;
};