UNPKG

tc39-weakrefs-shim

Version:
24 lines (23 loc) 803 B
export declare type queueId = number; export interface TaskQueue<T extends queueId> { readonly set: TaskQueue.Set<T>; readonly clear: TaskQueue.Clear<T>; readonly process: TaskQueue.Internal.Process<T>; } export declare namespace TaskQueue { interface Set<T extends queueId> { (callback: (...args: any[]) => void, ...args: any[]): T; } interface Clear<T extends queueId> { (queueId: T): void; } namespace Internal { interface Process<T extends queueId> { (queueId: T): void; } interface Register<T extends queueId> { (queueId: T): boolean; } } } export default function makeTaskQueue<T extends queueId>(register: TaskQueue.Internal.Register<T>, letCallbackErrorsBubble?: boolean): TaskQueue<T>;