postcss 8.3.9 → 8.4.31
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.
- package/README.md +7 -23
- package/lib/at-rule.d.ts +58 -49
- package/lib/comment.d.ts +43 -32
- package/lib/container.d.ts +233 -223
- package/lib/container.js +251 -244
- package/lib/css-syntax-error.d.ts +117 -61
- package/lib/css-syntax-error.js +10 -3
- package/lib/declaration.d.ts +85 -61
- package/lib/document.d.ts +27 -16
- package/lib/fromJSON.d.ts +6 -2
- package/lib/input.d.ts +118 -54
- package/lib/input.js +87 -55
- package/lib/lazy-result.d.ts +82 -67
- package/lib/lazy-result.js +234 -232
- package/lib/list.d.ts +53 -47
- package/lib/list.js +16 -14
- package/lib/map-generator.js +231 -172
- package/lib/no-work-result.d.ts +46 -0
- package/lib/no-work-result.js +135 -0
- package/lib/node.d.ts +345 -253
- package/lib/node.js +200 -139
- package/lib/parse.d.ts +6 -2
- package/lib/parser.js +354 -309
- package/lib/postcss.d.mts +72 -0
- package/lib/postcss.d.ts +288 -319
- package/lib/postcss.js +18 -12
- package/lib/postcss.mjs +1 -0
- package/lib/previous-map.d.ts +23 -14
- package/lib/previous-map.js +37 -40
- package/lib/processor.d.ts +55 -41
- package/lib/processor.js +20 -27
- package/lib/result.d.ts +87 -76
- package/lib/root.d.ts +49 -36
- package/lib/root.js +12 -10
- package/lib/rule.d.ts +54 -45
- package/lib/stringifier.d.ts +46 -0
- package/lib/stringifier.js +140 -138
- package/lib/stringify.d.ts +6 -2
- package/lib/terminal-highlight.js +11 -11
- package/lib/tokenize.js +2 -2
- package/lib/warn-once.js +1 -0
- package/lib/warning.d.ts +79 -36
- package/lib/warning.js +6 -4
- package/package.json +20 -10
package/lib/container.d.ts
CHANGED
@@ -1,23 +1,28 @@
|
|
1
|
-
import Node, { ChildNode, NodeProps, ChildProps } from './node.js'
|
2
|
-
import Declaration from './declaration.js'
|
3
|
-
import Comment from './comment.js'
|
4
1
|
import AtRule from './at-rule.js'
|
2
|
+
import Comment from './comment.js'
|
3
|
+
import Declaration from './declaration.js'
|
4
|
+
import Node, { ChildNode, ChildProps, NodeProps } from './node.js'
|
5
5
|
import Rule from './rule.js'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
declare namespace Container {
|
8
|
+
export interface ValueOptions {
|
9
|
+
/**
|
10
|
+
* String that’s used to narrow down values and speed up the regexp search.
|
11
|
+
*/
|
12
|
+
fast?: string
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
14
|
+
/**
|
15
|
+
* An array of property names.
|
16
|
+
*/
|
17
|
+
props?: string[]
|
18
|
+
}
|
19
|
+
|
20
|
+
export interface ContainerProps extends NodeProps {
|
21
|
+
nodes?: (ChildNode | ChildProps)[]
|
22
|
+
}
|
18
23
|
|
19
|
-
|
20
|
-
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
25
|
+
export { Container_ as default }
|
21
26
|
}
|
22
27
|
|
23
28
|
/**
|
@@ -27,9 +32,7 @@ export interface ContainerProps extends NodeProps {
|
|
27
32
|
* Note that all containers can store any content. If you write a rule inside
|
28
33
|
* a rule, PostCSS will parse it.
|
29
34
|
*/
|
30
|
-
|
31
|
-
Child extends Node = ChildNode
|
32
|
-
> extends Node {
|
35
|
+
declare abstract class Container_<Child extends Node = ChildNode> extends Node {
|
33
36
|
/**
|
34
37
|
* An array containing the container’s children.
|
35
38
|
*
|
@@ -43,22 +46,33 @@ export default abstract class Container<
|
|
43
46
|
nodes: Child[]
|
44
47
|
|
45
48
|
/**
|
46
|
-
*
|
49
|
+
* Inserts new nodes to the end of the container.
|
47
50
|
*
|
48
51
|
* ```js
|
49
|
-
*
|
50
|
-
*
|
51
|
-
|
52
|
-
get first(): Child | undefined
|
53
|
-
|
54
|
-
/**
|
55
|
-
* The container’s last child.
|
52
|
+
* const decl1 = new Declaration({ prop: 'color', value: 'black' })
|
53
|
+
* const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
|
54
|
+
* rule.append(decl1, decl2)
|
56
55
|
*
|
57
|
-
*
|
58
|
-
*
|
56
|
+
* root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule
|
57
|
+
* root.append({ selector: 'a' }) // rule
|
58
|
+
* rule.append({ prop: 'color', value: 'black' }) // declaration
|
59
|
+
* rule.append({ text: 'Comment' }) // comment
|
60
|
+
*
|
61
|
+
* root.append('a {}')
|
62
|
+
* root.first.append('color: black; z-index: 1')
|
59
63
|
* ```
|
64
|
+
*
|
65
|
+
* @param nodes New nodes.
|
66
|
+
* @return This node for methods chain.
|
60
67
|
*/
|
61
|
-
|
68
|
+
append(
|
69
|
+
...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
|
70
|
+
): this
|
71
|
+
|
72
|
+
assign(overrides: Container.ContainerProps | object): this
|
73
|
+
clone(overrides?: Partial<Container.ContainerProps>): Container<Child>
|
74
|
+
cloneAfter(overrides?: Partial<Container.ContainerProps>): Container<Child>
|
75
|
+
cloneBefore(overrides?: Partial<Container.ContainerProps>): Container<Child>
|
62
76
|
|
63
77
|
/**
|
64
78
|
* Iterates through the container’s immediate children,
|
@@ -98,131 +112,57 @@ export default abstract class Container<
|
|
98
112
|
): false | undefined
|
99
113
|
|
100
114
|
/**
|
101
|
-
*
|
102
|
-
* for
|
103
|
-
*
|
104
|
-
* Like container.each(), this method is safe to use
|
105
|
-
* if you are mutating arrays during iteration.
|
106
|
-
*
|
107
|
-
* If you only need to iterate through the container’s immediate children,
|
108
|
-
* use `Container#each`.
|
115
|
+
* Returns `true` if callback returns `true`
|
116
|
+
* for all of the container’s children.
|
109
117
|
*
|
110
118
|
* ```js
|
111
|
-
*
|
112
|
-
* // Traverses all descendant nodes.
|
113
|
-
* })
|
119
|
+
* const noPrefixes = rule.every(i => i.prop[0] !== '-')
|
114
120
|
* ```
|
115
121
|
*
|
116
|
-
* @param
|
117
|
-
* @return
|
122
|
+
* @param condition Iterator returns true or false.
|
123
|
+
* @return Is every child pass condition.
|
118
124
|
*/
|
119
|
-
|
120
|
-
|
121
|
-
):
|
122
|
-
|
125
|
+
every(
|
126
|
+
condition: (node: Child, index: number, nodes: Child[]) => boolean
|
127
|
+
): boolean
|
123
128
|
/**
|
124
|
-
*
|
125
|
-
* for each declaration node.
|
126
|
-
*
|
127
|
-
* If you pass a filter, iteration will only happen over declarations
|
128
|
-
* with matching properties.
|
129
|
+
* Returns a `child`’s index within the `Container#nodes` array.
|
129
130
|
*
|
130
131
|
* ```js
|
131
|
-
*
|
132
|
-
* checkPropertySupport(decl.prop)
|
133
|
-
* })
|
134
|
-
*
|
135
|
-
* root.walkDecls('border-radius', decl => {
|
136
|
-
* decl.remove()
|
137
|
-
* })
|
138
|
-
*
|
139
|
-
* root.walkDecls(/^background/, decl => {
|
140
|
-
* decl.value = takeFirstColorFromGradient(decl.value)
|
141
|
-
* })
|
132
|
+
* rule.index( rule.nodes[2] ) //=> 2
|
142
133
|
* ```
|
143
134
|
*
|
144
|
-
*
|
145
|
-
*
|
146
|
-
*
|
147
|
-
* @param prop String or regular expression to filter declarations
|
148
|
-
* by property name.
|
149
|
-
* @param callback Iterator receives each node and index.
|
150
|
-
* @return Returns `false` if iteration was broke.
|
135
|
+
* @param child Child of the current container.
|
136
|
+
* @return Child index.
|
151
137
|
*/
|
152
|
-
|
153
|
-
propFilter: string | RegExp,
|
154
|
-
callback: (decl: Declaration, index: number) => false | void
|
155
|
-
): false | undefined
|
156
|
-
walkDecls(
|
157
|
-
callback: (decl: Declaration, index: number) => false | void
|
158
|
-
): false | undefined
|
138
|
+
index(child: Child | number): number
|
159
139
|
|
160
140
|
/**
|
161
|
-
*
|
162
|
-
* for each rule node.
|
163
|
-
*
|
164
|
-
* If you pass a filter, iteration will only happen over rules
|
165
|
-
* with matching selectors.
|
166
|
-
*
|
167
|
-
* Like `Container#each`, this method is safe
|
168
|
-
* to use if you are mutating arrays during iteration.
|
169
|
-
*
|
170
|
-
* ```js
|
171
|
-
* const selectors = []
|
172
|
-
* root.walkRules(rule => {
|
173
|
-
* selectors.push(rule.selector)
|
174
|
-
* })
|
175
|
-
* console.log(`Your CSS uses ${ selectors.length } selectors`)
|
176
|
-
* ```
|
141
|
+
* Insert new node after old node within the container.
|
177
142
|
*
|
178
|
-
* @param
|
179
|
-
* @param
|
180
|
-
* @return
|
143
|
+
* @param oldNode Child or child’s index.
|
144
|
+
* @param newNode New node.
|
145
|
+
* @return This node for methods chain.
|
181
146
|
*/
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
):
|
186
|
-
walkRules(
|
187
|
-
callback: (atRule: Rule, index: number) => false | void
|
188
|
-
): false | undefined
|
189
|
-
|
147
|
+
insertAfter(
|
148
|
+
oldNode: Child | number,
|
149
|
+
newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
|
150
|
+
): this
|
190
151
|
/**
|
191
|
-
*
|
192
|
-
* for each at-rule node.
|
193
|
-
*
|
194
|
-
* If you pass a filter, iteration will only happen over at-rules
|
195
|
-
* that have matching names.
|
196
|
-
*
|
197
|
-
* Like `Container#each`, this method is safe
|
198
|
-
* to use if you are mutating arrays during iteration.
|
152
|
+
* Insert new node before old node within the container.
|
199
153
|
*
|
200
154
|
* ```js
|
201
|
-
*
|
202
|
-
* if (isOld(rule.name)) rule.remove()
|
203
|
-
* })
|
204
|
-
*
|
205
|
-
* let first = false
|
206
|
-
* root.walkAtRules('charset', rule => {
|
207
|
-
* if (!first) {
|
208
|
-
* first = true
|
209
|
-
* } else {
|
210
|
-
* rule.remove()
|
211
|
-
* }
|
212
|
-
* })
|
155
|
+
* rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
|
213
156
|
* ```
|
214
157
|
*
|
215
|
-
* @param
|
216
|
-
* @param
|
217
|
-
* @return
|
158
|
+
* @param oldNode Child or child’s index.
|
159
|
+
* @param newNode New node.
|
160
|
+
* @return This node for methods chain.
|
218
161
|
*/
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
):
|
223
|
-
walkAtRules(
|
224
|
-
callback: (atRule: AtRule, index: number) => false | void
|
225
|
-
): false | undefined
|
162
|
+
insertBefore(
|
163
|
+
oldNode: Child | number,
|
164
|
+
newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
|
165
|
+
): this
|
226
166
|
|
227
167
|
/**
|
228
168
|
* Traverses the container’s descendant nodes, calling callback
|
@@ -241,37 +181,6 @@ export default abstract class Container<
|
|
241
181
|
* @return Returns `false` if iteration was broke.
|
242
182
|
*/
|
243
183
|
|
244
|
-
walkComments(
|
245
|
-
callback: (comment: Comment, indexed: number) => false | void
|
246
|
-
): false | undefined
|
247
|
-
walkComments(
|
248
|
-
callback: (comment: Comment, indexed: number) => false | void
|
249
|
-
): false | undefined
|
250
|
-
|
251
|
-
/**
|
252
|
-
* Inserts new nodes to the end of the container.
|
253
|
-
*
|
254
|
-
* ```js
|
255
|
-
* const decl1 = new Declaration({ prop: 'color', value: 'black' })
|
256
|
-
* const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
|
257
|
-
* rule.append(decl1, decl2)
|
258
|
-
*
|
259
|
-
* root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule
|
260
|
-
* root.append({ selector: 'a' }) // rule
|
261
|
-
* rule.append({ prop: 'color', value: 'black' }) // declaration
|
262
|
-
* rule.append({ text: 'Comment' }) // comment
|
263
|
-
*
|
264
|
-
* root.append('a {}')
|
265
|
-
* root.first.append('color: black; z-index: 1')
|
266
|
-
* ```
|
267
|
-
*
|
268
|
-
* @param nodes New nodes.
|
269
|
-
* @return This node for methods chain.
|
270
|
-
*/
|
271
|
-
append(
|
272
|
-
...nodes: (Node | Node[] | ChildProps | ChildProps[] | string | string[])[]
|
273
|
-
): this
|
274
|
-
|
275
184
|
/**
|
276
185
|
* Inserts new nodes to the start of the container.
|
277
186
|
*
|
@@ -293,9 +202,8 @@ export default abstract class Container<
|
|
293
202
|
* @return This node for methods chain.
|
294
203
|
*/
|
295
204
|
prepend(
|
296
|
-
...nodes: (
|
205
|
+
...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
|
297
206
|
): this
|
298
|
-
|
299
207
|
/**
|
300
208
|
* Add child to the end of the node.
|
301
209
|
*
|
@@ -309,32 +217,17 @@ export default abstract class Container<
|
|
309
217
|
push(child: Child): this
|
310
218
|
|
311
219
|
/**
|
312
|
-
*
|
220
|
+
* Removes all children from the container
|
221
|
+
* and cleans their parent properties.
|
313
222
|
*
|
314
223
|
* ```js
|
315
|
-
* rule.
|
224
|
+
* rule.removeAll()
|
225
|
+
* rule.nodes.length //=> 0
|
316
226
|
* ```
|
317
227
|
*
|
318
|
-
* @param oldNode Child or child’s index.
|
319
|
-
* @param newNode New node.
|
320
228
|
* @return This node for methods chain.
|
321
229
|
*/
|
322
|
-
|
323
|
-
oldNode: Child | number,
|
324
|
-
newNode: Child | ChildProps | string | Child[] | ChildProps[] | string[]
|
325
|
-
): this
|
326
|
-
|
327
|
-
/**
|
328
|
-
* Insert new node after old node within the container.
|
329
|
-
*
|
330
|
-
* @param oldNode Child or child’s index.
|
331
|
-
* @param newNode New node.
|
332
|
-
* @return This node for methods chain.
|
333
|
-
*/
|
334
|
-
insertAfter(
|
335
|
-
oldNode: Child | number,
|
336
|
-
newNode: Child | ChildProps | string | Child[] | ChildProps[] | string[]
|
337
|
-
): this
|
230
|
+
removeAll(): this
|
338
231
|
|
339
232
|
/**
|
340
233
|
* Removes node from the container and cleans the parent properties
|
@@ -352,18 +245,10 @@ export default abstract class Container<
|
|
352
245
|
*/
|
353
246
|
removeChild(child: Child | number): this
|
354
247
|
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
* ```js
|
360
|
-
* rule.removeAll()
|
361
|
-
* rule.nodes.length //=> 0
|
362
|
-
* ```
|
363
|
-
*
|
364
|
-
* @return This node for methods chain.
|
365
|
-
*/
|
366
|
-
removeAll(): this
|
248
|
+
replaceValues(
|
249
|
+
pattern: RegExp | string,
|
250
|
+
replaced: { (substring: string, ...args: any[]): string } | string
|
251
|
+
): this
|
367
252
|
|
368
253
|
/**
|
369
254
|
* Passes all declaration values within the container that match pattern
|
@@ -389,54 +274,179 @@ export default abstract class Container<
|
|
389
274
|
* @return This node for methods chain.
|
390
275
|
*/
|
391
276
|
replaceValues(
|
392
|
-
pattern:
|
393
|
-
options: ValueOptions,
|
394
|
-
replaced:
|
395
|
-
): this
|
396
|
-
replaceValues(
|
397
|
-
pattern: string | RegExp,
|
398
|
-
replaced: string | { (substring: string, ...args: any[]): string }
|
277
|
+
pattern: RegExp | string,
|
278
|
+
options: Container.ValueOptions,
|
279
|
+
replaced: { (substring: string, ...args: any[]): string } | string
|
399
280
|
): this
|
400
281
|
|
401
282
|
/**
|
402
|
-
* Returns `true` if callback returns `true`
|
403
|
-
*
|
283
|
+
* Returns `true` if callback returns `true` for (at least) one
|
284
|
+
* of the container’s children.
|
404
285
|
*
|
405
286
|
* ```js
|
406
|
-
* const
|
287
|
+
* const hasPrefix = rule.some(i => i.prop[0] === '-')
|
407
288
|
* ```
|
408
289
|
*
|
409
290
|
* @param condition Iterator returns true or false.
|
410
|
-
* @return Is
|
291
|
+
* @return Is some child pass condition.
|
411
292
|
*/
|
412
|
-
|
293
|
+
some(
|
413
294
|
condition: (node: Child, index: number, nodes: Child[]) => boolean
|
414
295
|
): boolean
|
415
296
|
|
416
297
|
/**
|
417
|
-
*
|
418
|
-
*
|
298
|
+
* Traverses the container’s descendant nodes, calling callback
|
299
|
+
* for each node.
|
300
|
+
*
|
301
|
+
* Like container.each(), this method is safe to use
|
302
|
+
* if you are mutating arrays during iteration.
|
303
|
+
*
|
304
|
+
* If you only need to iterate through the container’s immediate children,
|
305
|
+
* use `Container#each`.
|
419
306
|
*
|
420
307
|
* ```js
|
421
|
-
*
|
308
|
+
* root.walk(node => {
|
309
|
+
* // Traverses all descendant nodes.
|
310
|
+
* })
|
422
311
|
* ```
|
423
312
|
*
|
424
|
-
* @param
|
425
|
-
* @return
|
313
|
+
* @param callback Iterator receives each node and index.
|
314
|
+
* @return Returns `false` if iteration was broke.
|
426
315
|
*/
|
427
|
-
|
428
|
-
|
429
|
-
):
|
316
|
+
walk(
|
317
|
+
callback: (node: ChildNode, index: number) => false | void
|
318
|
+
): false | undefined
|
430
319
|
|
431
320
|
/**
|
432
|
-
*
|
321
|
+
* Traverses the container’s descendant nodes, calling callback
|
322
|
+
* for each at-rule node.
|
323
|
+
*
|
324
|
+
* If you pass a filter, iteration will only happen over at-rules
|
325
|
+
* that have matching names.
|
326
|
+
*
|
327
|
+
* Like `Container#each`, this method is safe
|
328
|
+
* to use if you are mutating arrays during iteration.
|
433
329
|
*
|
434
330
|
* ```js
|
435
|
-
*
|
331
|
+
* root.walkAtRules(rule => {
|
332
|
+
* if (isOld(rule.name)) rule.remove()
|
333
|
+
* })
|
334
|
+
*
|
335
|
+
* let first = false
|
336
|
+
* root.walkAtRules('charset', rule => {
|
337
|
+
* if (!first) {
|
338
|
+
* first = true
|
339
|
+
* } else {
|
340
|
+
* rule.remove()
|
341
|
+
* }
|
342
|
+
* })
|
436
343
|
* ```
|
437
344
|
*
|
438
|
-
* @param
|
439
|
-
* @
|
345
|
+
* @param name String or regular expression to filter at-rules by name.
|
346
|
+
* @param callback Iterator receives each node and index.
|
347
|
+
* @return Returns `false` if iteration was broke.
|
440
348
|
*/
|
441
|
-
|
349
|
+
walkAtRules(
|
350
|
+
nameFilter: RegExp | string,
|
351
|
+
callback: (atRule: AtRule, index: number) => false | void
|
352
|
+
): false | undefined
|
353
|
+
|
354
|
+
walkAtRules(
|
355
|
+
callback: (atRule: AtRule, index: number) => false | void
|
356
|
+
): false | undefined
|
357
|
+
walkComments(
|
358
|
+
callback: (comment: Comment, indexed: number) => false | void
|
359
|
+
): false | undefined
|
360
|
+
|
361
|
+
walkComments(
|
362
|
+
callback: (comment: Comment, indexed: number) => false | void
|
363
|
+
): false | undefined
|
364
|
+
|
365
|
+
/**
|
366
|
+
* Traverses the container’s descendant nodes, calling callback
|
367
|
+
* for each declaration node.
|
368
|
+
*
|
369
|
+
* If you pass a filter, iteration will only happen over declarations
|
370
|
+
* with matching properties.
|
371
|
+
*
|
372
|
+
* ```js
|
373
|
+
* root.walkDecls(decl => {
|
374
|
+
* checkPropertySupport(decl.prop)
|
375
|
+
* })
|
376
|
+
*
|
377
|
+
* root.walkDecls('border-radius', decl => {
|
378
|
+
* decl.remove()
|
379
|
+
* })
|
380
|
+
*
|
381
|
+
* root.walkDecls(/^background/, decl => {
|
382
|
+
* decl.value = takeFirstColorFromGradient(decl.value)
|
383
|
+
* })
|
384
|
+
* ```
|
385
|
+
*
|
386
|
+
* Like `Container#each`, this method is safe
|
387
|
+
* to use if you are mutating arrays during iteration.
|
388
|
+
*
|
389
|
+
* @param prop String or regular expression to filter declarations
|
390
|
+
* by property name.
|
391
|
+
* @param callback Iterator receives each node and index.
|
392
|
+
* @return Returns `false` if iteration was broke.
|
393
|
+
*/
|
394
|
+
walkDecls(
|
395
|
+
propFilter: RegExp | string,
|
396
|
+
callback: (decl: Declaration, index: number) => false | void
|
397
|
+
): false | undefined
|
398
|
+
|
399
|
+
walkDecls(
|
400
|
+
callback: (decl: Declaration, index: number) => false | void
|
401
|
+
): false | undefined
|
402
|
+
|
403
|
+
/**
|
404
|
+
* Traverses the container’s descendant nodes, calling callback
|
405
|
+
* for each rule node.
|
406
|
+
*
|
407
|
+
* If you pass a filter, iteration will only happen over rules
|
408
|
+
* with matching selectors.
|
409
|
+
*
|
410
|
+
* Like `Container#each`, this method is safe
|
411
|
+
* to use if you are mutating arrays during iteration.
|
412
|
+
*
|
413
|
+
* ```js
|
414
|
+
* const selectors = []
|
415
|
+
* root.walkRules(rule => {
|
416
|
+
* selectors.push(rule.selector)
|
417
|
+
* })
|
418
|
+
* console.log(`Your CSS uses ${ selectors.length } selectors`)
|
419
|
+
* ```
|
420
|
+
*
|
421
|
+
* @param selector String or regular expression to filter rules by selector.
|
422
|
+
* @param callback Iterator receives each node and index.
|
423
|
+
* @return Returns `false` if iteration was broke.
|
424
|
+
*/
|
425
|
+
walkRules(
|
426
|
+
selectorFilter: RegExp | string,
|
427
|
+
callback: (rule: Rule, index: number) => false | void
|
428
|
+
): false | undefined
|
429
|
+
walkRules(
|
430
|
+
callback: (rule: Rule, index: number) => false | void
|
431
|
+
): false | undefined
|
432
|
+
/**
|
433
|
+
* The container’s first child.
|
434
|
+
*
|
435
|
+
* ```js
|
436
|
+
* rule.first === rules.nodes[0]
|
437
|
+
* ```
|
438
|
+
*/
|
439
|
+
get first(): Child | undefined
|
440
|
+
/**
|
441
|
+
* The container’s last child.
|
442
|
+
*
|
443
|
+
* ```js
|
444
|
+
* rule.last === rule.nodes[rule.nodes.length - 1]
|
445
|
+
* ```
|
446
|
+
*/
|
447
|
+
get last(): Child | undefined
|
442
448
|
}
|
449
|
+
|
450
|
+
declare class Container<Child extends Node = ChildNode> extends Container_<Child> {}
|
451
|
+
|
452
|
+
export = Container
|