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 longhand inline CSS into shorthand
[![Version][npm-version-shield]][npm] diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..80d9162 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,29 @@ +export type 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" ] }