@histoire/vendors 0.16.0 → 0.16.5

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.
Files changed (86) hide show
  1. package/dist/client/b-floating-vue.js +2 -7
  2. package/dist/client/b-pinia.js +1970 -1953
  3. package/dist/client/b-vue-router.js +3574 -3550
  4. package/dist/client/b-vue-use.js +426 -360
  5. package/dist/client/b-vue.js +1 -1
  6. package/dist/client/node_modules/@babel/parser/package.json +6 -6
  7. package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +4 -2
  8. package/dist/client/node_modules/{sourcemap-codec → @jridgewell/sourcemap-codec}/dist/types/sourcemap-codec.d.ts +1 -0
  9. package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +74 -0
  10. package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +992 -1202
  11. package/dist/client/node_modules/@vue/compiler-core/package.json +6 -6
  12. package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +42 -66
  13. package/dist/client/node_modules/@vue/compiler-dom/package.json +4 -4
  14. package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +473 -317
  15. package/dist/client/node_modules/@vue/compiler-sfc/package.json +16 -15
  16. package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +4 -6
  17. package/dist/client/node_modules/@vue/compiler-ssr/package.json +4 -4
  18. package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +676 -351
  19. package/dist/client/node_modules/@vue/reactivity/package.json +3 -3
  20. package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +34 -44
  21. package/dist/client/node_modules/@vue/reactivity-transform/package.json +8 -8
  22. package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +1742 -2015
  23. package/dist/client/node_modules/@vue/runtime-core/package.json +4 -4
  24. package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1168 -1427
  25. package/dist/client/node_modules/@vue/runtime-dom/package.json +5 -5
  26. package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +71 -101
  27. package/dist/client/node_modules/@vue/server-renderer/package.json +5 -5
  28. package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +308 -363
  29. package/dist/client/node_modules/@vue/shared/package.json +2 -2
  30. package/dist/client/node_modules/@vueuse/core/index.d.ts +28 -13
  31. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +3 -3
  32. package/dist/client/node_modules/@vueuse/core/package.json +3 -3
  33. package/dist/client/node_modules/@vueuse/metadata/package.json +1 -1
  34. package/dist/client/node_modules/@vueuse/shared/index.d.ts +18 -5
  35. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +3 -3
  36. package/dist/client/node_modules/@vueuse/shared/package.json +1 -1
  37. package/dist/client/node_modules/csstype/index.d.ts +5009 -21819
  38. package/dist/client/node_modules/csstype/package.json +35 -25
  39. package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +0 -7
  40. package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +0 -7
  41. package/dist/client/node_modules/floating-vue/dist/index.d.ts +0 -7
  42. package/dist/client/node_modules/floating-vue/package.json +3 -2
  43. package/dist/client/node_modules/magic-string/{index.d.ts → dist/magic-string.cjs.d.ts} +50 -7
  44. package/dist/client/node_modules/magic-string/package.json +34 -22
  45. package/dist/client/node_modules/pinia/dist/pinia.d.ts +17 -5
  46. package/dist/client/node_modules/pinia/node_modules/vue-demi/package.json +3 -3
  47. package/dist/client/node_modules/pinia/package.json +7 -7
  48. package/dist/client/node_modules/postcss/lib/at-rule.d.ts +58 -49
  49. package/dist/client/node_modules/postcss/lib/comment.d.ts +43 -32
  50. package/dist/client/node_modules/postcss/lib/container.d.ts +224 -214
  51. package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +111 -102
  52. package/dist/client/node_modules/postcss/lib/declaration.d.ts +85 -61
  53. package/dist/client/node_modules/postcss/lib/document.d.ts +27 -16
  54. package/dist/client/node_modules/postcss/lib/fromJSON.d.ts +6 -2
  55. package/dist/client/node_modules/postcss/lib/input.d.ts +99 -90
  56. package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +69 -55
  57. package/dist/client/node_modules/postcss/lib/list.d.ts +53 -47
  58. package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +24 -15
  59. package/dist/client/node_modules/postcss/lib/node.d.ts +339 -281
  60. package/dist/client/node_modules/postcss/lib/parse.d.ts +6 -2
  61. package/dist/client/node_modules/postcss/lib/postcss.d.ts +288 -320
  62. package/dist/client/node_modules/postcss/lib/previous-map.d.ts +23 -14
  63. package/dist/client/node_modules/postcss/lib/processor.d.ts +52 -39
  64. package/dist/client/node_modules/postcss/lib/result.d.ts +77 -67
  65. package/dist/client/node_modules/postcss/lib/root.d.ts +49 -36
  66. package/dist/client/node_modules/postcss/lib/rule.d.ts +54 -45
  67. package/dist/client/node_modules/postcss/lib/stringifier.d.ts +31 -22
  68. package/dist/client/node_modules/postcss/lib/stringify.d.ts +6 -2
  69. package/dist/client/node_modules/postcss/lib/warning.d.ts +72 -63
  70. package/dist/client/node_modules/postcss/package.json +7 -4
  71. package/dist/client/node_modules/vue/compiler-sfc/package.json +2 -3
  72. package/dist/client/node_modules/vue/dist/vue.d.ts +11 -9
  73. package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +29 -0
  74. package/dist/client/node_modules/vue/jsx-runtime/package.json +5 -0
  75. package/dist/client/node_modules/vue/jsx.d.ts +26 -0
  76. package/dist/client/node_modules/vue/package.json +41 -15
  77. package/dist/client/node_modules/vue/ref-macros.d.ts +1 -1
  78. package/dist/client/node_modules/vue/server-renderer/package.json +2 -3
  79. package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +2 -1
  80. package/dist/client/node_modules/vue-router/package.json +38 -36
  81. package/dist/client/vue.runtime.esm-bundler.js +10048 -10684
  82. package/package.json +13 -13
  83. package/tsconfig.json +1 -2
  84. package/dist/client/node_modules/source-map/package.json +0 -73
  85. package/dist/client/node_modules/source-map/source-map.d.ts +0 -98
  86. package/dist/client/node_modules/sourcemap-codec/package.json +0 -53
@@ -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
- interface ValueOptions {
8
- /**
9
- * An array of property names.
10
- */
11
- props?: string[]
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
- * String that’s used to narrow down values and speed up the regexp search.
15
- */
16
- fast?: string
17
- }
14
+ /**
15
+ * An array of property names.
16
+ */
17
+ props?: string[]
18
+ }
18
19
 
19
- export interface ContainerProps extends NodeProps {
20
- nodes?: (ChildNode | ChildProps)[]
20
+ export interface ContainerProps extends NodeProps {
21
+ nodes?: (ChildNode | ChildProps)[]
22
+ }
23
+
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
- export default abstract class Container<
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
- * The container’s first child.
49
+ * Inserts new nodes to the end of the container.
47
50
  *
48
51
  * ```js
49
- * rule.first === rules.nodes[0]
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
- * ```js
58
- * rule.last === rule.nodes[rule.nodes.length - 1]
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
- get last(): Child | undefined
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,50 @@ export default abstract class Container<
98
112
  ): false | undefined
99
113
 
100
114
  /**
101
- * Traverses the container’s descendant nodes, calling callback
102
- * for each node.
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
- * root.walk(node => {
112
- * // Traverses all descendant nodes.
113
- * })
119
+ * const noPrefixes = rule.every(i => i.prop[0] !== '-')
114
120
  * ```
115
121
  *
116
- * @param callback Iterator receives each node and index.
117
- * @return Returns `false` if iteration was broke.
122
+ * @param condition Iterator returns true or false.
123
+ * @return Is every child pass condition.
118
124
  */
119
- walk(
120
- callback: (node: ChildNode, index: number) => false | void
121
- ): false | undefined
122
-
125
+ every(
126
+ condition: (node: Child, index: number, nodes: Child[]) => boolean
127
+ ): boolean
123
128
  /**
124
- * Traverses the container’s descendant nodes, calling callback
125
- * for each declaration node.
126
- *
127
- * If you pass a filter, iteration will only happen over declarations
128
- * with matching properties.
129
+ * The container’s first child.
129
130
  *
130
131
  * ```js
131
- * root.walkDecls(decl => {
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.first === rules.nodes[0]
142
133
  * ```
143
- *
144
- * Like `Container#each`, this method is safe
145
- * to use if you are mutating arrays during iteration.
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.
151
134
  */
152
- walkDecls(
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
135
+ get first(): Child | undefined
159
136
 
160
137
  /**
161
- * Traverses the container’s descendant nodes, calling callback
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.
138
+ * Returns a `child`’s index within the `Container#nodes` array.
169
139
  *
170
140
  * ```js
171
- * const selectors = []
172
- * root.walkRules(rule => {
173
- * selectors.push(rule.selector)
174
- * })
175
- * console.log(`Your CSS uses ${ selectors.length } selectors`)
141
+ * rule.index( rule.nodes[2] ) //=> 2
176
142
  * ```
177
143
  *
178
- * @param selector String or regular expression to filter rules by selector.
179
- * @param callback Iterator receives each node and index.
180
- * @return Returns `false` if iteration was broke.
144
+ * @param child Child of the current container.
145
+ * @return Child index.
181
146
  */
182
- walkRules(
183
- selectorFilter: string | RegExp,
184
- callback: (rule: Rule, index: number) => false | void
185
- ): false | undefined
186
- walkRules(
187
- callback: (rule: Rule, index: number) => false | void
188
- ): false | undefined
189
-
147
+ index(child: Child | number): number
190
148
  /**
191
- * Traverses the container’s descendant nodes, calling callback
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.
199
- *
200
- * ```js
201
- * root.walkAtRules(rule => {
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
- * })
213
- * ```
149
+ * Insert new node after old node within the container.
214
150
  *
215
- * @param name String or regular expression to filter at-rules by name.
216
- * @param callback Iterator receives each node and index.
217
- * @return Returns `false` if iteration was broke.
151
+ * @param oldNode Child or child’s index.
152
+ * @param newNode New node.
153
+ * @return This node for methods chain.
218
154
  */
219
- walkAtRules(
220
- nameFilter: string | RegExp,
221
- callback: (atRule: AtRule, index: number) => false | void
222
- ): false | undefined
223
- walkAtRules(
224
- callback: (atRule: AtRule, index: number) => false | void
225
- ): false | undefined
155
+ insertAfter(
156
+ oldNode: Child | number,
157
+ newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
158
+ ): this
226
159
 
227
160
  /**
228
161
  * Traverses the container’s descendant nodes, calling callback
@@ -241,36 +174,29 @@ export default abstract class Container<
241
174
  * @return Returns `false` if iteration was broke.
242
175
  */
243
176
 
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
177
  /**
252
- * Inserts new nodes to the end of the container.
178
+ * Insert new node before old node within the container.
253
179
  *
254
180
  * ```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')
181
+ * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
266
182
  * ```
267
183
  *
268
- * @param nodes New nodes.
184
+ * @param oldNode Child or child’s index.
185
+ * @param newNode New node.
269
186
  * @return This node for methods chain.
270
187
  */
271
- append(
272
- ...nodes: (Node | Node[] | ChildProps | ChildProps[] | string | string[])[]
188
+ insertBefore(
189
+ oldNode: Child | number,
190
+ newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
273
191
  ): this
192
+ /**
193
+ * The container’s last child.
194
+ *
195
+ * ```js
196
+ * rule.last === rule.nodes[rule.nodes.length - 1]
197
+ * ```
198
+ */
199
+ get last(): Child | undefined
274
200
 
275
201
  /**
276
202
  * Inserts new nodes to the start of the container.
@@ -293,7 +219,7 @@ export default abstract class Container<
293
219
  * @return This node for methods chain.
294
220
  */
295
221
  prepend(
296
- ...nodes: (Node | Node[] | ChildProps | ChildProps[] | string | string[])[]
222
+ ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
297
223
  ): this
298
224
 
299
225
  /**
@@ -309,32 +235,17 @@ export default abstract class Container<
309
235
  push(child: Child): this
310
236
 
311
237
  /**
312
- * Insert new node before old node within the container.
238
+ * Removes all children from the container
239
+ * and cleans their parent properties.
313
240
  *
314
241
  * ```js
315
- * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
242
+ * rule.removeAll()
243
+ * rule.nodes.length //=> 0
316
244
  * ```
317
245
  *
318
- * @param oldNode Child or child’s index.
319
- * @param newNode New node.
320
- * @return This node for methods chain.
321
- */
322
- insertBefore(
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
246
  * @return This node for methods chain.
333
247
  */
334
- insertAfter(
335
- oldNode: Child | number,
336
- newNode: Child | ChildProps | string | Child[] | ChildProps[] | string[]
337
- ): this
248
+ removeAll(): this
338
249
 
339
250
  /**
340
251
  * Removes node from the container and cleans the parent properties
@@ -352,18 +263,10 @@ export default abstract class Container<
352
263
  */
353
264
  removeChild(child: Child | number): this
354
265
 
355
- /**
356
- * Removes all children from the container
357
- * and cleans their parent properties.
358
- *
359
- * ```js
360
- * rule.removeAll()
361
- * rule.nodes.length //=> 0
362
- * ```
363
- *
364
- * @return This node for methods chain.
365
- */
366
- removeAll(): this
266
+ replaceValues(
267
+ pattern: RegExp | string,
268
+ replaced: { (substring: string, ...args: any[]): string } | string
269
+ ): this
367
270
 
368
271
  /**
369
272
  * Passes all declaration values within the container that match pattern
@@ -389,54 +292,161 @@ export default abstract class Container<
389
292
  * @return This node for methods chain.
390
293
  */
391
294
  replaceValues(
392
- pattern: string | RegExp,
393
- options: ValueOptions,
394
- replaced: string | { (substring: string, ...args: any[]): string }
395
- ): this
396
- replaceValues(
397
- pattern: string | RegExp,
398
- replaced: string | { (substring: string, ...args: any[]): string }
295
+ pattern: RegExp | string,
296
+ options: Container.ValueOptions,
297
+ replaced: { (substring: string, ...args: any[]): string } | string
399
298
  ): this
400
299
 
401
300
  /**
402
- * Returns `true` if callback returns `true`
403
- * for all of the container’s children.
301
+ * Returns `true` if callback returns `true` for (at least) one
302
+ * of the container’s children.
404
303
  *
405
304
  * ```js
406
- * const noPrefixes = rule.every(i => i.prop[0] !== '-')
305
+ * const hasPrefix = rule.some(i => i.prop[0] === '-')
407
306
  * ```
408
307
  *
409
308
  * @param condition Iterator returns true or false.
410
- * @return Is every child pass condition.
309
+ * @return Is some child pass condition.
411
310
  */
412
- every(
311
+ some(
413
312
  condition: (node: Child, index: number, nodes: Child[]) => boolean
414
313
  ): boolean
415
314
 
416
315
  /**
417
- * Returns `true` if callback returns `true` for (at least) one
418
- * of the container’s children.
316
+ * Traverses the container’s descendant nodes, calling callback
317
+ * for each node.
318
+ *
319
+ * Like container.each(), this method is safe to use
320
+ * if you are mutating arrays during iteration.
321
+ *
322
+ * If you only need to iterate through the container’s immediate children,
323
+ * use `Container#each`.
419
324
  *
420
325
  * ```js
421
- * const hasPrefix = rule.some(i => i.prop[0] === '-')
326
+ * root.walk(node => {
327
+ * // Traverses all descendant nodes.
328
+ * })
422
329
  * ```
423
330
  *
424
- * @param condition Iterator returns true or false.
425
- * @return Is some child pass condition.
331
+ * @param callback Iterator receives each node and index.
332
+ * @return Returns `false` if iteration was broke.
426
333
  */
427
- some(
428
- condition: (node: Child, index: number, nodes: Child[]) => boolean
429
- ): boolean
334
+ walk(
335
+ callback: (node: ChildNode, index: number) => false | void
336
+ ): false | undefined
337
+ /**
338
+ * Traverses the container’s descendant nodes, calling callback
339
+ * for each at-rule node.
340
+ *
341
+ * If you pass a filter, iteration will only happen over at-rules
342
+ * that have matching names.
343
+ *
344
+ * Like `Container#each`, this method is safe
345
+ * to use if you are mutating arrays during iteration.
346
+ *
347
+ * ```js
348
+ * root.walkAtRules(rule => {
349
+ * if (isOld(rule.name)) rule.remove()
350
+ * })
351
+ *
352
+ * let first = false
353
+ * root.walkAtRules('charset', rule => {
354
+ * if (!first) {
355
+ * first = true
356
+ * } else {
357
+ * rule.remove()
358
+ * }
359
+ * })
360
+ * ```
361
+ *
362
+ * @param name String or regular expression to filter at-rules by name.
363
+ * @param callback Iterator receives each node and index.
364
+ * @return Returns `false` if iteration was broke.
365
+ */
366
+ walkAtRules(
367
+ nameFilter: RegExp | string,
368
+ callback: (atRule: AtRule, index: number) => false | void
369
+ ): false | undefined
370
+
371
+ walkAtRules(
372
+ callback: (atRule: AtRule, index: number) => false | void
373
+ ): false | undefined
374
+
375
+ walkComments(
376
+ callback: (comment: Comment, indexed: number) => false | void
377
+ ): false | undefined
378
+
379
+ walkComments(
380
+ callback: (comment: Comment, indexed: number) => false | void
381
+ ): false | undefined
430
382
 
431
383
  /**
432
- * Returns a `child`’s index within the `Container#nodes` array.
384
+ * Traverses the container’s descendant nodes, calling callback
385
+ * for each declaration node.
386
+ *
387
+ * If you pass a filter, iteration will only happen over declarations
388
+ * with matching properties.
433
389
  *
434
390
  * ```js
435
- * rule.index( rule.nodes[2] ) //=> 2
391
+ * root.walkDecls(decl => {
392
+ * checkPropertySupport(decl.prop)
393
+ * })
394
+ *
395
+ * root.walkDecls('border-radius', decl => {
396
+ * decl.remove()
397
+ * })
398
+ *
399
+ * root.walkDecls(/^background/, decl => {
400
+ * decl.value = takeFirstColorFromGradient(decl.value)
401
+ * })
436
402
  * ```
437
403
  *
438
- * @param child Child of the current container.
439
- * @return Child index.
404
+ * Like `Container#each`, this method is safe
405
+ * to use if you are mutating arrays during iteration.
406
+ *
407
+ * @param prop String or regular expression to filter declarations
408
+ * by property name.
409
+ * @param callback Iterator receives each node and index.
410
+ * @return Returns `false` if iteration was broke.
440
411
  */
441
- index(child: Child | number): number
412
+ walkDecls(
413
+ propFilter: RegExp | string,
414
+ callback: (decl: Declaration, index: number) => false | void
415
+ ): false | undefined
416
+ walkDecls(
417
+ callback: (decl: Declaration, index: number) => false | void
418
+ ): false | undefined
419
+ /**
420
+ * Traverses the container’s descendant nodes, calling callback
421
+ * for each rule node.
422
+ *
423
+ * If you pass a filter, iteration will only happen over rules
424
+ * with matching selectors.
425
+ *
426
+ * Like `Container#each`, this method is safe
427
+ * to use if you are mutating arrays during iteration.
428
+ *
429
+ * ```js
430
+ * const selectors = []
431
+ * root.walkRules(rule => {
432
+ * selectors.push(rule.selector)
433
+ * })
434
+ * console.log(`Your CSS uses ${ selectors.length } selectors`)
435
+ * ```
436
+ *
437
+ * @param selector String or regular expression to filter rules by selector.
438
+ * @param callback Iterator receives each node and index.
439
+ * @return Returns `false` if iteration was broke.
440
+ */
441
+ walkRules(
442
+ selectorFilter: RegExp | string,
443
+ callback: (rule: Rule, index: number) => false | void
444
+ ): false | undefined
445
+ walkRules(
446
+ callback: (rule: Rule, index: number) => false | void
447
+ ): false | undefined
442
448
  }
449
+
450
+ declare class Container<Child extends Node = ChildNode> extends Container_<Child> {}
451
+
452
+ export = Container