[postcss-calc] Add Typescript definitions.

This commit is contained in:
Jeow Li Huan 2018-11-01 00:24:31 +08:00
parent f01ba112a9
commit 3d7a352af7
5 changed files with 64 additions and 0 deletions

22
types/postcss-calc/index.d.ts vendored Normal file
View File

@ -0,0 +1,22 @@
// Type definitions for postcss-calc 7.0
// Project: https://github.com/postcss/postcss-calc
// Definitions by: Jeow Li Huan <https://github.com/huan086>
// 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<Options>;
}
declare const calc: calc.Calc;
export = calc;

View File

@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"postcss": "7.x.x"
}
}

View File

@ -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
});

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }