-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
fixed-deque.d.ts
34 lines (29 loc) · 975 Bytes
/
fixed-deque.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Mnemonist FixedDeque Typings
* =============================
*/
import {IArrayLikeConstructor, TypedArray} from './utils/types';
export default class FixedDeque<T> implements Iterable<T> {
// Members
capacity: number;
size: number;
// Constructor
constructor(ArrayClass: IArrayLikeConstructor, capacity: number);
// Methods
clear(): void;
push(item: T): number;
unshift(item: T): number;
pop(): T | undefined;
shift(): T | undefined;
peekFirst(): T | undefined;
peekLast(): T | undefined;
get(index: number): T | undefined;
forEach(callback: (item: T, index: number, buffer: this) => void, scope?: any): void;
toArray(): Array<T> | TypedArray;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
inspect(): any;
// Statics
static from<I>(iterable: Iterable<I> | {[key: string]: I}, ArrayClass: IArrayLikeConstructor, capacity?: number): FixedDeque<I>;
}