import type { Unawaitable } from '../functions/unawaitable'; export type Callback = (val?: any) => void; export declare class Queue { error_handler?: Callback; constructor(error_handler?: Callback); /** Is a process ongoing? */ working: boolean; /** Queued callbacks */ queue: Callback[]; /** Call next() after call stack resolved */ next_async(): void; /** Call the next callback */ next(): false | void; /** Add a callback */ add(cb: Callback): number | void; /** Get a promise */ get promise(): Promise; /** executes callback after queue empty, does not lock queue */ then(callback: (self: Unawaitable) => any): Promise; } export default Queue;