Skip to content

Commit a9733a2

Browse files
w8rmourner
authored andcommitted
Added TypeScript declaration file (#14)
1 parent 3a212a4 commit a9733a2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

index.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export declare type Item = any;
2+
export declare type Comparator<Item> = (a: Item, b: Item) => -1 | 0 | 1;
3+
4+
export default class TinyQueue<Item> {
5+
public data : Item[];
6+
public length : number;
7+
constructor (items? : Item[], compare? : Comparator<Item>);
8+
peek () : Item;
9+
pop () : Item;
10+
push (Item) : void;
11+
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"module": "index.js",
77
"jsdelivr": "tinyqueue.min.js",
88
"unpkg": "tinyqueue.min.js",
9+
"types": "index.d.ts",
910
"scripts": {
1011
"lint": "eslint index.js test.js bench.js rollup.config.js",
1112
"pretest": "npm run lint",
@@ -18,7 +19,8 @@
1819
"files": [
1920
"index.js",
2021
"tinyqueue.js",
21-
"tinyqueue.min.js"
22+
"tinyqueue.min.js",
23+
"index.d.ts"
2224
],
2325
"repository": {
2426
"type": "git",

0 commit comments

Comments
 (0)