From dcbd8d4358d4c2bc0a3f5eb9674483192ee919fa Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Sat, 24 Feb 2024 14:44:41 +0200 Subject: [PATCH 1/3] feat: add types --- index.d.ts | 29 +++++++++++++++++++++++++++++ package.json | 4 +++- 2 files changed, 32 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..17f801d --- /dev/null +++ b/index.d.ts @@ -0,0 +1,29 @@ +export default interface PluginOptions { + /** + Array of tag names to process. All other tags will be skipped. + + @default [] + + @example + ```js + const posthtml = require('posthtml') + const mergeInlineLonghand = require('posthtml-postcss-merge-longhand') + + const html = ` +
+

+ ` + + posthtml([ + mergeInlineLonghand({tags: ['div']}) + ]) + .process(html) + .then(result => console.log(result.html)) + + // Result: + //
+ //

+ ``` + */ + tags?: string[]; +} diff --git a/package.json b/package.json index 87c7bbc..03859c8 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "homepage": "https://github.com/posthtml/posthtml-postcss-merge-longhand", "repository": "posthtml/posthtml-postcss-merge-longhand", "main": "lib", + "types": "index.d.ts", "engines": { "node": ">=14.0.0" }, @@ -41,6 +42,7 @@ "xo": "^0.54.2" }, "files": [ - "lib/*" + "lib/*", + "index.d.ts" ] } From 0ca801f16d13f75668e60ea0c013ea71fd8499bd Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Sat, 24 Feb 2024 14:45:21 +0200 Subject: [PATCH 2/3] chore: uppercase license and readme file names --- license => LICENSE | 0 readme.md => README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename license => LICENSE (100%) rename readme.md => README.md (98%) diff --git a/license b/LICENSE similarity index 100% rename from license rename to LICENSE diff --git a/readme.md b/README.md similarity index 98% rename from readme.md rename to README.md index 153e630..475fea6 100644 --- a/readme.md +++ b/README.md @@ -1,6 +1,6 @@
-

Merge inline longhand

+

Merge Longhand

Merge longhand inline CSS into shorthand

[![Version][npm-version-shield]][npm] From aef511723eb6f53c8b1b493e4f0f4ba26afb2a41 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Sat, 24 Feb 2024 14:51:51 +0200 Subject: [PATCH 3/3] fix: export type instead of interface --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 17f801d..80d9162 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -export default interface PluginOptions { +export type PluginOptions = { /** Array of tag names to process. All other tags will be skipped. @@ -26,4 +26,4 @@ export default interface PluginOptions { ``` */ tags?: string[]; -} +};