mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-27 22:49:20 +08:00
autoprefixer: updated to match postcss Plugin types for postcss 7.x (#29357)
* autoprefixer: updated to match postcss Plugin types for postcss 7.x types, resolve error with Transformer type * #29357: Renamed autoprefixer.AutoprefixerOptions to autoprefixer.Options
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import * as autopref from 'autoprefixer';
|
||||
import autoprefixer = require("autoprefixer");
|
||||
import { Transformer } from 'postcss';
|
||||
|
||||
const ap: autopref.Transformer = autopref({
|
||||
browsers: ['> 5%', 'last 2 versions'],
|
||||
env: '',
|
||||
cascade: true,
|
||||
add: true,
|
||||
remove: true,
|
||||
supports: true,
|
||||
flexbox: true,
|
||||
grid: true,
|
||||
stats: {},
|
||||
const ap1: Transformer = autoprefixer();
|
||||
|
||||
const ap2: Transformer = autoprefixer({
|
||||
browsers: [],
|
||||
env: "test",
|
||||
cascade: false,
|
||||
add: false,
|
||||
remove: false,
|
||||
supports: false,
|
||||
flexbox: false,
|
||||
grid: false,
|
||||
stats: {},
|
||||
ignoreUnknownVersions: false,
|
||||
});
|
||||
const ap2: autopref.Transformer = autopref({
|
||||
flexbox: 'no-2009',
|
||||
});
|
||||
const info: string = ap.info();
|
||||
|
||||
15
types/autoprefixer/index.d.ts
vendored
15
types/autoprefixer/index.d.ts
vendored
@@ -1,9 +1,9 @@
|
||||
// Type definitions for autoprefixer 6.7
|
||||
// Type definitions for autoprefixer 9.1
|
||||
// Project: https://github.com/postcss/autoprefixer
|
||||
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>
|
||||
// Definitions by: Armando Meziat <https://github.com/odnamrataizem>, murt <https://github.com/murt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Plugin, Transformer as PostcssTransformer } from 'postcss';
|
||||
import { Plugin } from "postcss";
|
||||
|
||||
declare namespace autoprefixer {
|
||||
interface Options {
|
||||
@@ -16,15 +16,10 @@ declare namespace autoprefixer {
|
||||
flexbox?: boolean | 'no-2009';
|
||||
grid?: boolean;
|
||||
stats?: any;
|
||||
ignoreUnknownVersions?: boolean;
|
||||
}
|
||||
|
||||
interface Transformer extends PostcssTransformer {
|
||||
info(): string;
|
||||
}
|
||||
|
||||
interface Autoprefixer extends Plugin<Options> {
|
||||
(opts?: Options): Transformer;
|
||||
}
|
||||
type Autoprefixer = Plugin<Options>;
|
||||
}
|
||||
|
||||
declare const autoprefixer: autoprefixer.Autoprefixer;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"postcss": "^5.2.15"
|
||||
"postcss": "7.x.x"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user