From e16f04fa4d265d8d1ca44683822fb1986729b1b8 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sat, 25 May 2024 18:54:01 +0300 Subject: [PATCH] Support typescript definitions out of the box Currently we have to install both hyphenate-style-name and @types/hyphenate-style-name to make it work in typescript project. Here I suggest to publish those typings out of the box. --- index.d.ts | 6 ++++++ package.json | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..bf5c961 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,6 @@ +/** + * Hyphenates a camelcased CSS property name + */ +declare function hyphenateStyleName(name: string): string; + +export = hyphenateStyleName; diff --git a/package.json b/package.json index 0a63337..3e45f71 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Hyphenates a camelcased CSS property name", "main": "index.cjs.js", "module": "index.js", + "types": "index.d.ts", "sideEffects": false, "scripts": { "build": "rollup --input index.js --file index.cjs.js --format cjs", @@ -16,7 +17,8 @@ }, "files": [ "index.js", - "index.cjs.js" + "index.cjs.js", + "index.d.ts" ], "repository": { "type": "git",