postcss 8.4.21 → 8.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/lib/at-rule.d.ts +52 -43
- package/lib/comment.d.ts +35 -26
- package/lib/container.d.ts +23 -14
- package/lib/css-syntax-error.d.ts +22 -13
- package/lib/declaration.d.ts +45 -36
- package/lib/document.d.ts +21 -15
- package/lib/fromJSON.d.ts +6 -2
- package/lib/input.d.ts +44 -35
- package/lib/lazy-result.d.ts +10 -1
- package/lib/list.d.ts +53 -47
- package/lib/no-work-result.d.ts +10 -1
- package/lib/node.d.ts +101 -90
- package/lib/parse.d.ts +6 -2
- package/lib/postcss.d.mts +72 -0
- package/lib/postcss.d.ts +236 -261
- package/lib/previous-map.d.ts +10 -1
- package/lib/processor.d.ts +10 -1
- package/lib/processor.js +1 -1
- package/lib/result.d.ts +39 -29
- package/lib/root.d.ts +44 -35
- package/lib/rule.d.ts +52 -43
- package/lib/stringifier.d.ts +10 -1
- package/lib/stringify.d.ts +6 -2
- package/lib/warning.d.ts +47 -38
- package/package.json +7 -4
package/lib/result.d.ts
CHANGED
@@ -11,31 +11,37 @@ import {
|
|
11
11
|
} from './postcss.js'
|
12
12
|
import Processor from './processor.js'
|
13
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
|
-
|
14
|
+
declare namespace Result {
|
15
|
+
export interface Message {
|
16
|
+
/**
|
17
|
+
* Message type.
|
18
|
+
*/
|
19
|
+
type: string
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Source PostCSS plugin name.
|
23
|
+
*/
|
24
|
+
plugin?: string
|
25
|
+
|
26
|
+
[others: string]: any
|
27
|
+
}
|
28
|
+
|
29
|
+
export interface ResultOptions extends ProcessOptions {
|
30
|
+
/**
|
31
|
+
* The CSS node that was the source of the warning.
|
32
|
+
*/
|
33
|
+
node?: Node
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Name of plugin that created this warning. `Result#warn` will fill it
|
37
|
+
* automatically with `Plugin#postcssPlugin` value.
|
38
|
+
*/
|
39
|
+
plugin?: string
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
44
|
+
export { Result_ as default }
|
39
45
|
}
|
40
46
|
|
41
47
|
/**
|
@@ -54,7 +60,7 @@ export interface ResultOptions extends ProcessOptions {
|
|
54
60
|
* const result2 = postcss.parse(css).toResult()
|
55
61
|
* ```
|
56
62
|
*/
|
57
|
-
|
63
|
+
declare class Result_ {
|
58
64
|
/**
|
59
65
|
* The Processor instance used for this transformation.
|
60
66
|
*
|
@@ -86,7 +92,7 @@ export default class Result {
|
|
86
92
|
* }
|
87
93
|
* ```
|
88
94
|
*/
|
89
|
-
messages: Message[]
|
95
|
+
messages: Result.Message[]
|
90
96
|
|
91
97
|
/**
|
92
98
|
* Root node after all transformations.
|
@@ -105,7 +111,7 @@ export default class Result {
|
|
105
111
|
* root.toResult(opts).opts === opts
|
106
112
|
* ```
|
107
113
|
*/
|
108
|
-
opts: ResultOptions
|
114
|
+
opts: Result.ResultOptions
|
109
115
|
|
110
116
|
/**
|
111
117
|
* A CSS string representing of `Result#root`.
|
@@ -142,7 +148,7 @@ export default class Result {
|
|
142
148
|
* @param root Root node after all transformations.
|
143
149
|
* @param opts Options from the `Processor#process` or `Root#toResult`.
|
144
150
|
*/
|
145
|
-
constructor(processor: Processor, root: Root | Document, opts: ResultOptions)
|
151
|
+
constructor(processor: Processor, root: Root | Document, opts: Result.ResultOptions)
|
146
152
|
|
147
153
|
/**
|
148
154
|
* An alias for the `Result#css` property.
|
@@ -194,3 +200,7 @@ export default class Result {
|
|
194
200
|
*/
|
195
201
|
warnings(): Warning[]
|
196
202
|
}
|
203
|
+
|
204
|
+
declare class Result extends Result_ {}
|
205
|
+
|
206
|
+
export = Result
|
package/lib/root.d.ts
CHANGED
@@ -3,40 +3,45 @@ import Document from './document.js'
|
|
3
3
|
import { ProcessOptions } from './postcss.js'
|
4
4
|
import Result from './result.js'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
declare namespace Root {
|
7
|
+
export interface RootRaws extends Record<string, any> {
|
8
|
+
/**
|
9
|
+
* The space symbols after the last child to the end of file.
|
10
|
+
*/
|
11
|
+
after?: string
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
/**
|
14
|
+
* Non-CSS code before `Root`, when `Root` is inside `Document`.
|
15
|
+
*
|
16
|
+
* **Experimental:** some aspects of this node could change within minor
|
17
|
+
* or patch version releases.
|
18
|
+
*/
|
19
|
+
codeBefore?: string
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
/**
|
22
|
+
* Non-CSS code after `Root`, when `Root` is inside `Document`.
|
23
|
+
*
|
24
|
+
* **Experimental:** some aspects of this node could change within minor
|
25
|
+
* or patch version releases.
|
26
|
+
*/
|
27
|
+
codeAfter?: string
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
29
|
+
/**
|
30
|
+
* Is the last child has an (optional) semicolon.
|
31
|
+
*/
|
32
|
+
semicolon?: boolean
|
33
|
+
}
|
33
34
|
|
34
|
-
export interface RootProps extends ContainerProps {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
export interface RootProps extends ContainerProps {
|
36
|
+
/**
|
37
|
+
* Information used to generate byte-to-byte equal node string
|
38
|
+
* as it was in the origin input.
|
39
|
+
* */
|
40
|
+
raws?: RootRaws
|
41
|
+
}
|
42
|
+
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
44
|
+
export { Root_ as default }
|
40
45
|
}
|
41
46
|
|
42
47
|
/**
|
@@ -48,10 +53,10 @@ export interface RootProps extends ContainerProps {
|
|
48
53
|
* root.nodes.length //=> 2
|
49
54
|
* ```
|
50
55
|
*/
|
51
|
-
|
56
|
+
declare class Root_ extends Container {
|
52
57
|
type: 'root'
|
53
58
|
parent: Document | undefined
|
54
|
-
raws: RootRaws
|
59
|
+
raws: Root.RootRaws
|
55
60
|
|
56
61
|
/**
|
57
62
|
* Returns a `Result` instance representing the root’s CSS.
|
@@ -66,8 +71,12 @@ export default class Root extends Container {
|
|
66
71
|
* @param opts Options.
|
67
72
|
* @return Result with current root’s CSS.
|
68
73
|
*/
|
69
|
-
|
74
|
+
toResult(options?: ProcessOptions): Result
|
70
75
|
|
71
|
-
constructor(defaults?: RootProps)
|
72
|
-
assign(overrides: object | RootProps): this
|
76
|
+
constructor(defaults?: Root.RootProps)
|
77
|
+
assign(overrides: object | Root.RootProps): this
|
73
78
|
}
|
79
|
+
|
80
|
+
declare class Root extends Root_ {}
|
81
|
+
|
82
|
+
export = Root
|
package/lib/rule.d.ts
CHANGED
@@ -1,48 +1,53 @@
|
|
1
1
|
import Container, { ContainerProps } from './container.js'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
declare namespace Rule {
|
4
|
+
export interface RuleRaws extends Record<string, unknown> {
|
5
|
+
/**
|
6
|
+
* The space symbols before the node. It also stores `*`
|
7
|
+
* and `_` symbols before the declaration (IE hack).
|
8
|
+
*/
|
9
|
+
before?: string
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
/**
|
12
|
+
* The space symbols after the last child of the node to the end of the node.
|
13
|
+
*/
|
14
|
+
after?: string
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
/**
|
17
|
+
* The symbols between the selector and `{` for rules.
|
18
|
+
*/
|
19
|
+
between?: string
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
/**
|
22
|
+
* Contains `true` if the last child has an (optional) semicolon.
|
23
|
+
*/
|
24
|
+
semicolon?: boolean
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
/**
|
27
|
+
* Contains `true` if there is semicolon after rule.
|
28
|
+
*/
|
29
|
+
ownSemicolon?: string
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
/**
|
32
|
+
* The rule’s selector with comments.
|
33
|
+
*/
|
34
|
+
selector?: {
|
35
|
+
value: string
|
36
|
+
raw: string
|
37
|
+
}
|
36
38
|
}
|
37
|
-
}
|
38
39
|
|
39
|
-
export interface RuleProps extends ContainerProps {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
export interface RuleProps extends ContainerProps {
|
41
|
+
/** Selector or selectors of the rule. */
|
42
|
+
selector?: string
|
43
|
+
/** Selectors of the rule represented as an array of strings. */
|
44
|
+
selectors?: string[]
|
45
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
46
|
+
raws?: RuleRaws
|
47
|
+
}
|
48
|
+
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
50
|
+
export { Rule_ as default }
|
46
51
|
}
|
47
52
|
|
48
53
|
/**
|
@@ -63,10 +68,10 @@ export interface RuleProps extends ContainerProps {
|
|
63
68
|
* rule.toString() //=> 'a{}'
|
64
69
|
* ```
|
65
70
|
*/
|
66
|
-
|
71
|
+
declare class Rule_ extends Container {
|
67
72
|
type: 'rule'
|
68
73
|
parent: Container | undefined
|
69
|
-
raws: RuleRaws
|
74
|
+
raws: Rule.RuleRaws
|
70
75
|
|
71
76
|
/**
|
72
77
|
* The rule’s full selector represented as a string.
|
@@ -96,9 +101,13 @@ export default class Rule extends Container {
|
|
96
101
|
*/
|
97
102
|
selectors: string[]
|
98
103
|
|
99
|
-
constructor(defaults?: RuleProps)
|
100
|
-
assign(overrides: object | RuleProps): this
|
101
|
-
clone(overrides?: Partial<RuleProps>): this
|
102
|
-
cloneBefore(overrides?: Partial<RuleProps>): this
|
103
|
-
cloneAfter(overrides?: Partial<RuleProps>): this
|
104
|
+
constructor(defaults?: Rule.RuleProps)
|
105
|
+
assign(overrides: object | Rule.RuleProps): this
|
106
|
+
clone(overrides?: Partial<Rule.RuleProps>): this
|
107
|
+
cloneBefore(overrides?: Partial<Rule.RuleProps>): this
|
108
|
+
cloneAfter(overrides?: Partial<Rule.RuleProps>): this
|
104
109
|
}
|
110
|
+
|
111
|
+
declare class Rule extends Rule_ {}
|
112
|
+
|
113
|
+
export = Rule
|
package/lib/stringifier.d.ts
CHANGED
@@ -10,7 +10,12 @@ import {
|
|
10
10
|
Container
|
11
11
|
} from './postcss.js'
|
12
12
|
|
13
|
-
|
13
|
+
declare namespace Stringifier {
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
15
|
+
export { Stringifier_ as default }
|
16
|
+
}
|
17
|
+
|
18
|
+
declare class Stringifier_ {
|
14
19
|
builder: Builder
|
15
20
|
constructor(builder: Builder)
|
16
21
|
stringify(node: AnyNode, semicolon?: boolean): void
|
@@ -35,3 +40,7 @@ export default class Stringifier {
|
|
35
40
|
beforeAfter(node: AnyNode, detect: 'before' | 'after'): string
|
36
41
|
rawValue(node: AnyNode, prop: string): string
|
37
42
|
}
|
43
|
+
|
44
|
+
declare class Stringifier extends Stringifier_ {}
|
45
|
+
|
46
|
+
export = Stringifier
|
package/lib/stringify.d.ts
CHANGED
package/lib/warning.d.ts
CHANGED
@@ -1,42 +1,47 @@
|
|
1
1
|
import { RangePosition } from './css-syntax-error.js'
|
2
2
|
import Node from './node.js'
|
3
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
|
-
|
4
|
+
declare namespace Warning {
|
5
|
+
export interface WarningOptions {
|
6
|
+
/**
|
7
|
+
* CSS node that caused the warning.
|
8
|
+
*/
|
9
|
+
node?: Node
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Word in CSS source that caused the warning.
|
13
|
+
*/
|
14
|
+
word?: string
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Start index, inclusive, in CSS node string that caused the warning.
|
18
|
+
*/
|
19
|
+
index?: number
|
20
|
+
|
21
|
+
/**
|
22
|
+
* End index, exclusive, in CSS node string that caused the warning.
|
23
|
+
*/
|
24
|
+
endIndex?: number
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Start position, inclusive, in CSS node string that caused the warning.
|
28
|
+
*/
|
29
|
+
start?: RangePosition
|
30
|
+
|
31
|
+
/**
|
32
|
+
* End position, exclusive, in CSS node string that caused the warning.
|
33
|
+
*/
|
34
|
+
end?: RangePosition
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Name of the plugin that created this warning. `Result#warn` fills
|
38
|
+
* this property automatically.
|
39
|
+
*/
|
40
|
+
plugin?: string
|
41
|
+
}
|
42
|
+
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
44
|
+
export { Warning_ as default }
|
40
45
|
}
|
41
46
|
|
42
47
|
/**
|
@@ -48,7 +53,7 @@ export interface WarningOptions {
|
|
48
53
|
* }
|
49
54
|
* ```
|
50
55
|
*/
|
51
|
-
|
56
|
+
declare class Warning_ {
|
52
57
|
/**
|
53
58
|
* Type to filter warnings from `Result#messages`.
|
54
59
|
* Always equal to `"warning"`.
|
@@ -123,7 +128,7 @@ export default class Warning {
|
|
123
128
|
* @param text Warning message.
|
124
129
|
* @param opts Warning options.
|
125
130
|
*/
|
126
|
-
constructor(text: string, opts?: WarningOptions)
|
131
|
+
constructor(text: string, opts?: Warning.WarningOptions)
|
127
132
|
|
128
133
|
/**
|
129
134
|
* Returns a warning position and message.
|
@@ -136,3 +141,7 @@ export default class Warning {
|
|
136
141
|
*/
|
137
142
|
toString(): string
|
138
143
|
}
|
144
|
+
|
145
|
+
declare class Warning extends Warning_ {}
|
146
|
+
|
147
|
+
export = Warning
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "postcss",
|
3
|
-
"version": "8.4.
|
3
|
+
"version": "8.4.22",
|
4
4
|
"description": "Tool for transforming styles with JS plugins",
|
5
5
|
"engines": {
|
6
6
|
"node": "^10 || ^12 || >=14"
|
@@ -8,8 +8,7 @@
|
|
8
8
|
"exports": {
|
9
9
|
".": {
|
10
10
|
"require": "./lib/postcss.js",
|
11
|
-
"import": "./lib/postcss.mjs"
|
12
|
-
"types": "./lib/postcss.d.ts"
|
11
|
+
"import": "./lib/postcss.mjs"
|
13
12
|
},
|
14
13
|
"./lib/at-rule": "./lib/at-rule.js",
|
15
14
|
"./lib/comment": "./lib/comment.js",
|
@@ -61,6 +60,10 @@
|
|
61
60
|
{
|
62
61
|
"type": "tidelift",
|
63
62
|
"url": "https://tidelift.com/funding/github/npm/postcss"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"type": "github",
|
66
|
+
"url": "https://github.com/sponsors/ai"
|
64
67
|
}
|
65
68
|
],
|
66
69
|
"author": "Andrey Sitnik <andrey@sitnik.ru>",
|
@@ -71,7 +74,7 @@
|
|
71
74
|
"url": "https://github.com/postcss/postcss/issues"
|
72
75
|
},
|
73
76
|
"dependencies": {
|
74
|
-
"nanoid": "^3.3.
|
77
|
+
"nanoid": "^3.3.6",
|
75
78
|
"picocolors": "^1.0.0",
|
76
79
|
"source-map-js": "^1.0.2"
|
77
80
|
},
|