mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add type definitions for rollup-plugin-postcss (#37464)
Signed-off-by: Jeroen Claassens <support@favware.tech>
This commit is contained in:
committed by
Nathan Shively-Sanders
parent
0597482b35
commit
4f3f0a7224
38
types/rollup-plugin-postcss/index.d.ts
vendored
Normal file
38
types/rollup-plugin-postcss/index.d.ts
vendored
Normal 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;
|
||||
6
types/rollup-plugin-postcss/package.json
Normal file
6
types/rollup-plugin-postcss/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"rollup": "^0.63.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import postcss from 'rollup-plugin-postcss';
|
||||
|
||||
postcss(); // $ExpectType Plugin
|
||||
|
||||
postcss({ modules: true, minimize: true }); // $ExpectType Plugin
|
||||
23
types/rollup-plugin-postcss/tsconfig.json
Normal file
23
types/rollup-plugin-postcss/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/rollup-plugin-postcss/tslint.json
Normal file
1
types/rollup-plugin-postcss/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user