-
-
Notifications
You must be signed in to change notification settings - Fork 59
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 (#30)
- Loading branch information
1 parent
7daf6f3
commit ac8e847
Showing
5 changed files
with
54 additions
and
8 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,34 @@ | ||
import words = require('./words.json'); | ||
|
||
declare const superb: { | ||
/** | ||
All the words in alphabetical order. | ||
@example | ||
``` | ||
import superb = require('superb'); | ||
superb.all; | ||
//=> ['ace', 'amazing', …] | ||
``` | ||
*/ | ||
readonly all: Readonly<typeof words>; | ||
|
||
/** | ||
Random word. | ||
@example | ||
``` | ||
import superb = require('superb'); | ||
superb.random(); | ||
//=> 'legendary' | ||
superb.random(); | ||
//=> 'awesome' | ||
``` | ||
*/ | ||
random(): string; | ||
}; | ||
|
||
export = superb; |
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 superb = require('.'); | ||
|
||
expectType<readonly string[]>(superb.all); | ||
expectType<string>(superb.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