/*! * V4Fire Core * https://github.com/V4Fire/Core * * Released under the MIT license * https://github.com/V4Fire/Core/blob/master/LICENSE */ import type Async from 'core/async'; import type { AsyncOptions, AsyncProxyOptions, ProxyCb } from 'core/async/interface'; /** * Something that looks like a worker */ export interface WorkerLike { terminate?: Function; destroy?: Function; destructor?: Function; close?: Function; abort?: Function; cancel?: Function; disconnect?: Function; unwatch?: Function; } /** * Extended type of worker */ export type WorkerLikeP = Function | WorkerLike; /** * Promise that supports canceling */ export interface CancelablePromise extends Promise { abort?: Function; cancel?: Function; } /** * Extended type of promise */ export type PromiseLikeP = (() => PromiseLike) | PromiseLike; export interface AsyncRequestOptions extends AsyncOptions { /** * Name of a destructor method */ destructor?: string; } export interface AsyncWorkerOptions extends AsyncProxyOptions { /** * Name of a destructor method */ destructor?: string; } export interface AsyncPromiseOptions extends AsyncOptions { /** * Namespace of the proxy */ name?: string; /** * Name of a destructor method */ destructor?: string; /** * Handler/s of muted promise resolving. * These handlers are invoked when occurring resolving the promise if it is muted. */ onMutedResolve?: CanArray>; }