Skip to content

Commit 1ee29eb

Browse files
authored
Merge pull request #27 from stretchkennedy/upstream-ts-declarations
Add typescript typings
2 parents 8a95fdf + 54ca731 commit 1ee29eb

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## main
4+
5+
* Adds typescript typings
6+
37
## 1.1.2 - 2022-01-20
48

59
* Updates mocha to v9.

index.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
declare type WordsOptions = {
2+
min?: number;
3+
max?: number;
4+
exactly?: number;
5+
maxLength?: number;
6+
wordsPerString?: number;
7+
seperator?: string;
8+
formatter?: (word: string, index: number) => string;
9+
};
10+
11+
declare type JoinedWordsOptions = WordsOptions & { join: string; };
12+
13+
declare function words(count: number): string[];
14+
declare function words(options: WordsOptions): string[];
15+
declare function words(options: JoinedWordsOptions): string;
16+
17+
export const wordsList: string[];
18+
export default words;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.1.2",
44
"description": "Generate one or more common English words",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"test": "mocha tests/test.js"
89
},

0 commit comments

Comments
 (0)