-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Node.js 8, add TypeScript definition (#4)
- Loading branch information
1 parent
7816a9f
commit 793178c
Showing
5 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- '12' | ||
- '10' | ||
- '8' | ||
- '6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import supervillainsJson = require('./supervillains.json'); | ||
|
||
declare const supervillains: { | ||
/** | ||
Supervillain names in alphabetical order. | ||
@example | ||
``` | ||
const supervillains = require('supervillains'); | ||
supervillains.all; | ||
//=> ['Abattoir', 'Able Crown', …] | ||
``` | ||
*/ | ||
readonly all: Readonly<typeof supervillainsJson>; | ||
|
||
/** | ||
Random supervillain name. | ||
@example | ||
``` | ||
const supervillains = require('supervillains'); | ||
supervillains.random(); | ||
//=> 'Mud Pack' | ||
``` | ||
*/ | ||
random(): string; | ||
}; | ||
|
||
export = supervillains; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {expectType} from 'tsd'; | ||
import supervillains = require('.'); | ||
|
||
expectType<readonly string[]>(supervillains.all); | ||
expectType<string>(supervillains.random()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters