@wilcosp/rex
Version:
Rex is an automated command manager for discord js
40 lines (39 loc) • 1.08 kB
TypeScript
/*!
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/**
* When having multiple tasks that need to execute synchronously, you can use this class to have each task wait for the earlier tasks
*
*/
export declare class RexAsyncDefferedQueue {
private delay;
private waiting;
private interval;
private _ended;
get ended(): boolean;
constructor(delay?: number);
private check;
/**
* allow the next task to begin
*/
next(): void;
/**
* the amount of promises queued up
*/
get size(): number;
/**
* wait till earlier queued up tasks are done
* @returns promise that will resolve when earlier tasks are done
*/
wait(): Promise<void>;
/**
* resolves all left over waiting promises and ends auto checking
*/
end(): Promise<void>;
/**
* re enable auto checking for when tasks are waiting
*/
restart(): void;
}