Merge pull request #30171 from huan086/postcss-calc

[postcss-calc] Add Typescript definitions.
This commit is contained in:
Daniel Rosenwasser
2018-11-01 16:05:31 -07:00
committed by GitHub
5 changed files with 64 additions and 0 deletions
+22
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;
+6
View File
@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"postcss": "7.x.x"
}
}
+12
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
});
+23
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"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }