@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
41 lines (40 loc) • 1.18 kB
TypeScript
/**
* @class Queue
* This class provides a TypeScript implementation of a Queue (FIFO Structure).
*/
export declare class Queue<T> {
private intHead?;
private intTail?;
private iintLength;
constructor(...values: T[]);
/**
*
* Creates a Application object using a JSON string
* @param {String} json - JSON string.
* @returns {Application} - Application object.
* @memberof Queue
*/
iterator(): IterableIterator<T>;
[Symbol.iterator](): IterableIterator<T>;
get head(): T | undefined;
get tail(): T | undefined;
get length(): number;
insert(val: T, previousItem: T, checkDuplicates?: boolean): boolean;
append(val: T, checkDuplicates?: boolean): boolean;
prepend(val: T, checkDuplicates?: boolean): boolean;
remove(val: T): T | undefined;
removeHead(): T | undefined;
removeTail(): T | undefined;
first(num: number): T[];
toArray(): T[];
get front(): T | undefined;
enqueue(val: T): void;
dequeue(): T | undefined;
private isDuplicate;
}
export declare class QueueItem<T> {
value: T;
next?: QueueItem<T>;
prev?: QueueItem<T>;
constructor(val: T);
}