Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit c1f368a

Browse files
author
Ruben Schmidmeister
committed
Fix typescript typings
1 parent ce7de34 commit c1f368a

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
run: yarn test
2222
- name: Check Code Style
2323
run: yarn lint
24+
- name: Lint .d.ts
25+
run: yarn dtslint
2426

2527
- name: Report Coverage
2628
uses: coverallsapp/github-action@master

index.d.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
declare module '@rschmidmeister/random.js' {
2-
// chosen by fair dice roll. guaranteed to be random.
3-
export function fairDiceRoll(): number;
1+
declare namespace random {
42
// Troll: Nine nine nine nine nine nine
5-
export function dilibertOracle(): number;
6-
export = fairDiceRoll;
3+
function dilibertOracle(): number;
4+
// chosen by fair dice roll. guaranteed to be random.
5+
function fairDiceRoll(): number;
76
}
7+
// Legacy default export
8+
declare function random(): number;
9+
export = random;

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@
2626
"mocha": "^7.0.0",
2727
"nyc": "^15.0.0",
2828
"standard": "^14.3.1"
29+
},
30+
"dependencies": {
31+
"dtslint": "^2.0.5"
2932
}
3033
}

tsconfig.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": [
5+
"es6"
6+
],
7+
"noImplicitAny": true,
8+
"noImplicitThis": true,
9+
"strictNullChecks": true,
10+
"strictFunctionTypes": true,
11+
"noEmit": true,
12+
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
13+
// If the library is global (cannot be imported via `import` or `require`), leave this out.
14+
"baseUrl": ".",
15+
"paths": {
16+
"@rschmidmeister/random.js": [
17+
"."
18+
]
19+
}
20+
},
21+
"files": [
22+
"index.d.ts"
23+
]
24+
}

0 commit comments

Comments
 (0)