Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit 51f43d0

Browse files
author
scott
committed
Add TypeScript declarations
1 parent f553d89 commit 51f43d0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export as namespace stable;
2+
export = stable;
3+
4+
type Comparator<T> = ((a : T, b : T)=>boolean) | ((a: T, b : T)=>number);
5+
6+
declare function stable<T>(array : T[], comparator? : Comparator<T>) : T[];
7+
declare namespace stable {
8+
export function inplace<T>(array: T[], comparator? : Comparator<T>) : T[];
9+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"url": "https://github.com/Two-Screen/stable.git"
99
},
1010
"main": "./stable.js",
11+
"types": "./index.d.ts",
1112
"devDependencies": {
1213
"tape": "2",
1314
"uglify-js": "2"

0 commit comments

Comments
 (0)