From ce2e7d20c9fa95677d7f2b4676e282c2623ec181 Mon Sep 17 00:00:00 2001 From: Keith Yeh Date: Fri, 27 Sep 2019 23:22:14 +0800 Subject: [PATCH] Add TypeScript type definitions #32 (#34) --- index.d.ts | 13 +++++++++++++ package.json | 1 + 2 files changed, 14 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..aa00e6b --- /dev/null +++ b/index.d.ts @@ -0,0 +1,13 @@ +type Options = { + custom?: string[] | { [key: string]: string; }; + lang?: string; + maintainCase?: boolean; + replacement?: string; + separator?: string; + separateNumbers?: boolean; + tone?: boolean; +} | string; + +declare function slug(text: string, opt?: Options): string; + +export = slug; diff --git a/package.json b/package.json index 0eafffa..807a89f 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "limax", "version": "1.7.0", "main": "./lib/limax", + "types": "index.d.ts", "description": "Node.js module to generate URL slugs. Another one? This one cares about i18n and transliterates non-Latin scripts to conform to the RFC3986 standard. Mostly API-compatible with similar modules.", "repository": { "type": "git",