Skip to content

Commit 3e6453e

Browse files
lucifer1004mourner
authored andcommitted
refactor: improve type definition (#18)
1 parent 9440dc1 commit 3e6453e

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

index.d.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
export declare type Item = any;
2-
export declare type Comparator<Item> = (a: Item, b: Item) => number;
1+
export declare type Comparator<T> = (a: T, b: T) => number;
32

4-
export default class TinyQueue<Item> {
5-
public data : Item[];
3+
export default class TinyQueue<T> {
4+
public data : T[];
65
public length : number;
7-
constructor (items? : Item[], compare? : Comparator<Item>);
8-
peek () : Item | undefined;
9-
pop () : Item | undefined;
10-
push (item: Item) : void;
6+
constructor (items? : T[], compare? : Comparator<T>);
7+
peek () : T | undefined;
8+
pop () : T | undefined;
9+
push (item: T) : void;
1110
}

0 commit comments

Comments
 (0)