diff --git a/types/autoprefixer/autoprefixer-tests.ts b/types/autoprefixer/autoprefixer-tests.ts index f3585fe30d..c8581b8da8 100644 --- a/types/autoprefixer/autoprefixer-tests.ts +++ b/types/autoprefixer/autoprefixer-tests.ts @@ -16,5 +16,22 @@ const ap2: Transformer = autoprefixer({ flexbox: true, grid: false, stats: {}, - ignoreUnknownVersions: false + ignoreUnknownVersions: false, +}); + +// Using environment map in "overrideBrowserslist" +const ap3: Transformer = autoprefixer({ + overrideBrowserslist: { + production: [ + '> 1%', + 'ie 10', + ], + modern: [ + 'last 1 chrome version', + 'last 1 firefox version', + ], + ssr: [ + 'node 12', + ], + }, }); diff --git a/types/autoprefixer/index.d.ts b/types/autoprefixer/index.d.ts index f689168751..95b0d99e9e 100644 --- a/types/autoprefixer/index.d.ts +++ b/types/autoprefixer/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for autoprefixer 9.6 // Project: https://github.com/postcss/autoprefixer -// Definitions by: Armando Meziat , murt +// Definitions by: Armando Meziat +// murt +// Slava Fomin II // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 @@ -8,6 +10,8 @@ import { Plugin } from 'postcss'; import { Stats } from 'browserslist'; declare namespace autoprefixer { + type BrowserslistTarget = (string | string[] | { [key: string]: string[]; }); + interface Options { env?: string; cascade?: boolean; @@ -18,7 +22,7 @@ declare namespace autoprefixer { grid?: false | 'autoplace' | 'no-autoplace'; stats?: Stats; browsers?: string[] | string; - overrideBrowserslist?: string[] | string; + overrideBrowserslist?: BrowserslistTarget; ignoreUnknownVersions?: boolean; }