Add type definitions for rollup-plugin-postcss (#37464)

Signed-off-by: Jeroen Claassens <support@favware.tech>
This commit is contained in:
Jeroen Claassens
2019-08-08 19:20:18 +02:00
committed by Nathan Shively-Sanders
parent 0597482b35
commit 4f3f0a7224
5 changed files with 73 additions and 0 deletions

38
types/rollup-plugin-postcss/index.d.ts vendored Normal file
View File

@@ -0,0 +1,38 @@
// Type definitions for rollup-plugin-postcss 2.0
// Project: https://github.com/egoist/rollup-plugin-postcss
// Definitions by: Jeroen Claassens <https://github.com/favna>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
/// <reference types="node" />
import { Plugin } from 'rollup';
import { CssNanoOptions } from 'cssnano';
export interface PostCssPluginOptions {
extensions?: string[];
plugins?: any[];
inject?: boolean | {
insertAt?: 'top' | string;
};
extract?: boolean | string;
modules?: boolean | unknown;
autoModules?: boolean;
minimize?: boolean | CssNanoOptions;
sourceMap?: boolean | 'inline';
exec?: boolean;
config?: boolean | {
path: string;
ctx: any;
};
name?: any[] | any[][];
loaders?: any[];
namedExports?(...args: any[]): void | boolean;
parser?(...args: any[]): void | string;
syntax?(...args: any[]): void | string;
stringifier?(...args: any[]): void | string;
onImport?: (id: any) => void;
}
declare function postcss(options?: PostCssPluginOptions): Plugin;
export default postcss;

View File

@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"rollup": "^0.63.4"
}
}

View File

@@ -0,0 +1,5 @@
import postcss from 'rollup-plugin-postcss';
postcss(); // $ExpectType Plugin
postcss({ modules: true, minimize: true }); // $ExpectType Plugin

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",
"rollup-plugin-postcss-tests.ts"
]
}

View File

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