-
-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathstack.d.ts
More file actions
30 lines (26 loc) · 715 Bytes
/
stack.d.ts
File metadata and controls
30 lines (26 loc) · 715 Bytes
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
/**
* Mnemonist Stack Typings
* ========================
*/
export default class Stack<T> implements Iterable<T> {
// Members
size: number;
// Constructor
constructor();
// Methods
clear(): void;
push(item: T): number;
pop(): T | undefined;
peek(): T | undefined;
forEach(callback: (item: T, index: number, stack: this) => void, scope?: any): void;
toArray(): Array<T>;
values(): IterableIterator<T>;
entries(): IterableIterator<[number, T]>;
[Symbol.iterator](): IterableIterator<T>;
toString(): string;
toJSON(): Array<T>;
inspect(): any;
// Statics
static from<I>(iterable: Iterable<I> | {[key: string]: I}): Stack<I>;
static of<I>(...items: Array<I>): Stack<I>;
}