loulijun2021
2024-04-08 429e9bb5915dd90978374cbd8574a9dc5fa464d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import { Plugin } from 'postcss'
import { Stats } from 'browserslist'
 
declare function autoprefixer<T extends string[]>(
  ...args: [...T, autoprefixer.Options]
): Plugin & autoprefixer.ExportedAPI
 
declare function autoprefixer(
  browsers: string[],
  options?: autoprefixer.Options
): Plugin & autoprefixer.ExportedAPI
 
declare function autoprefixer(
  options?: autoprefixer.Options
): Plugin & autoprefixer.ExportedAPI
 
declare namespace autoprefixer {
  type GridValue = 'autoplace' | 'no-autoplace'
 
  interface Options {
    /** environment for `Browserslist` */
    env?: string
 
    /** should Autoprefixer use Visual Cascade, if CSS is uncompressed */
    cascade?: boolean
 
    /** should Autoprefixer add prefixes. */
    add?: boolean
 
    /** should Autoprefixer [remove outdated] prefixes */
    remove?: boolean
 
    /** should Autoprefixer add prefixes for @supports parameters. */
    supports?: boolean
 
    /** should Autoprefixer add prefixes for flexbox properties */
    flexbox?: boolean | 'no-2009'
 
    /** should Autoprefixer add IE 10-11 prefixes for Grid Layout properties */
    grid?: boolean | GridValue
 
    /** custom usage statistics for > 10% in my stats browsers query */
    stats?: Stats
 
    /**
     * list of queries for target browsers.
     * Try to not use it.
     * The best practice is to use `.browserslistrc` config or `browserslist` key in `package.json`
     * to share target browsers with Babel, ESLint and Stylelint
     */
    overrideBrowserslist?: string | string[]
 
    /** do not raise error on unknown browser version in `Browserslist` config. */
    ignoreUnknownVersions?: boolean
  }
 
  interface ExportedAPI {
    /** Autoprefixer data */
    data: {
      browsers: { [browser: string]: object | undefined }
      prefixes: { [prefixName: string]: object | undefined }
    }
 
    /** Autoprefixer default browsers */
    defaults: string[]
 
    /** Inspect with default Autoprefixer */
    info(options?: { from?: string }): string
 
    options: Options
 
    browsers: string | string[]
  }
 
  /** Autoprefixer data */
  let data: ExportedAPI['data']
 
  /** Autoprefixer default browsers */
  let defaults: ExportedAPI['defaults']
 
  /** Inspect with default Autoprefixer */
  let info: ExportedAPI['info']
 
  let postcss: true
}
 
declare global {
  namespace NodeJS {
    interface ProcessEnv {
      AUTOPREFIXER_GRID?: autoprefixer.GridValue
    }
  }
}
 
export = autoprefixer