index.d.ts 730 Bytes
Newer Older
Rosanny Sihombing's avatar
Rosanny Sihombing committed
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
35
36
37
38
39
40
41
42
43
44
45
46
47
declare class Denque<T = any> {
  length: number;

  constructor();

  constructor(array: T[]);

  constructor(array: T[], options: IDenqueOptions);

  push(item: T): number;

  unshift(item: T): number;

  pop(): T | undefined;

  shift(): T | undefined;

  peekBack(): T | undefined;

  peekFront(): T | undefined;

  peekAt(index: number): T | undefined;

  get(index: number): T | undefined;

  remove(index: number, count: number): T[];

  removeOne(index: number): T | undefined;

  splice(index: number, count: number, ...item: T[]): T[] | undefined;

  isEmpty(): boolean;

  clear(): void;

  size(): number;

  toString(): string;

  toArray(): T[];
}

interface IDenqueOptions {
  capacity?: number
}

export = Denque;