Skip to content

Commit

Permalink
Merge pull request #27 from stretchkennedy/upstream-ts-declarations
Browse files Browse the repository at this point in the history
Add typescript typings
  • Loading branch information
boutell committed Jun 15, 2022
2 parents 8a95fdf + 54ca731 commit 1ee29eb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog

## main

* Adds typescript typings

## 1.1.2 - 2022-01-20

* Updates mocha to v9.
Expand Down
18 changes: 18 additions & 0 deletions index.d.ts
@@ -0,0 +1,18 @@
declare type WordsOptions = {
min?: number;
max?: number;
exactly?: number;
maxLength?: number;
wordsPerString?: number;
seperator?: string;
formatter?: (word: string, index: number) => string;
};

declare type JoinedWordsOptions = WordsOptions & { join: string; };

declare function words(count: number): string[];
declare function words(options: WordsOptions): string[];
declare function words(options: JoinedWordsOptions): string;

export const wordsList: string[];
export default words;
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.2",
"description": "Generate one or more common English words",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "mocha tests/test.js"
},
Expand Down

0 comments on commit 1ee29eb

Please sign in to comment.