diff --git a/types/postcss-calc/index.d.ts b/types/postcss-calc/index.d.ts new file mode 100644 index 0000000000..c9ac8e30bb --- /dev/null +++ b/types/postcss-calc/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for postcss-calc 7.0 +// Project: https://github.com/postcss/postcss-calc +// Definitions by: Jeow Li Huan +// Definitions: https://github.com/huan086/postcss-plugins-typings +// TypeScript Version: 2.2 + +import { Plugin } from "postcss"; + +declare namespace calc { + interface Options { + precision?: number; + preserve?: boolean; + warnWhenCannotResolve?: boolean; + mediaQueries?: boolean; + selectors?: boolean; + } + + type Calc = Plugin; +} + +declare const calc: calc.Calc; +export = calc; diff --git a/types/postcss-calc/package.json b/types/postcss-calc/package.json new file mode 100644 index 0000000000..1e1a719545 --- /dev/null +++ b/types/postcss-calc/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "postcss": "7.x.x" + } +} diff --git a/types/postcss-calc/postcss-calc-tests.ts b/types/postcss-calc/postcss-calc-tests.ts new file mode 100644 index 0000000000..937741a1f3 --- /dev/null +++ b/types/postcss-calc/postcss-calc-tests.ts @@ -0,0 +1,12 @@ +import calc = require("postcss-calc"); +import { Transformer } from 'postcss'; + +const ap1: Transformer = calc(); + +const ap2: Transformer = calc({ + precision: 5, + preserve: false, + warnWhenCannotResolve: false, + mediaQueries: false, + selectors: false +}); diff --git a/types/postcss-calc/tsconfig.json b/types/postcss-calc/tsconfig.json new file mode 100644 index 0000000000..d21d8b4969 --- /dev/null +++ b/types/postcss-calc/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "postcss-calc-tests.ts" + ] +} diff --git a/types/postcss-calc/tslint.json b/types/postcss-calc/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/postcss-calc/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }