From 7bb5be8a19c4e75b67a2d32dc536fc107d78d814 Mon Sep 17 00:00:00 2001 From: Tim Kennedy Date: Wed, 15 Jun 2022 13:08:15 +1000 Subject: [PATCH] Add typescript bindings --- index.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..da59d59 --- /dev/null +++ b/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;