From 4c0e92cbb3e770f6dc58e1ce7521b2b2764b8009 Mon Sep 17 00:00:00 2001 From: Michael Bull Date: Thu, 28 Apr 2022 20:49:03 +0100 Subject: [PATCH] Add TypeScript definitions --- index.d.ts | 24 ++++++++++++++++++++++++ package.json | 7 ++++++- 2 files changed, 30 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..9af2ec4 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,24 @@ +import type { + Plugin, + ProcessOptions, + Processor +} from 'postcss'; + +export interface Options { + readonly sort?: boolean; +} + +export interface Packer { + (options?: Options): Plugin; + + pack( + css: string, + opts?: Options & ProcessOptions + ): ReturnType; + + readonly postcss: true; +} + +declare const mqpacker: Packer; + +export default mqpacker; diff --git a/package.json b/package.json index 398f82f..ef17437 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,13 @@ }, "license": "MIT", "author": "Kyo Nagashima (https://hail2u.net/)", - "files": [], + "files": [ + "bin", + "index.js", + "index.d.ts" + ], "main": "index.js", + "types": "index.d.ts", "bin": { "mqpacker": "./bin/mqpacker.js" },