@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.
- package/dist/client/b-floating-vue.js +2 -7
- package/dist/client/b-pinia.js +1970 -1953
- package/dist/client/b-vue-router.js +3574 -3550
- package/dist/client/b-vue-use.js +426 -360
- package/dist/client/b-vue.js +1 -1
- package/dist/client/node_modules/@babel/parser/package.json +6 -6
- package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +4 -2
- package/dist/client/node_modules/{sourcemap-codec → @jridgewell/sourcemap-codec}/dist/types/sourcemap-codec.d.ts +1 -0
- package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +74 -0
- package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +992 -1202
- package/dist/client/node_modules/@vue/compiler-core/package.json +6 -6
- package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +42 -66
- package/dist/client/node_modules/@vue/compiler-dom/package.json +4 -4
- package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +473 -317
- package/dist/client/node_modules/@vue/compiler-sfc/package.json +16 -15
- package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +4 -6
- package/dist/client/node_modules/@vue/compiler-ssr/package.json +4 -4
- package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +676 -351
- package/dist/client/node_modules/@vue/reactivity/package.json +3 -3
- package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +34 -44
- package/dist/client/node_modules/@vue/reactivity-transform/package.json +8 -8
- package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +1742 -2015
- package/dist/client/node_modules/@vue/runtime-core/package.json +4 -4
- package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1168 -1427
- package/dist/client/node_modules/@vue/runtime-dom/package.json +5 -5
- package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +71 -101
- package/dist/client/node_modules/@vue/server-renderer/package.json +5 -5
- package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +308 -363
- package/dist/client/node_modules/@vue/shared/package.json +2 -2
- package/dist/client/node_modules/@vueuse/core/index.d.ts +28 -13
- package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +3 -3
- package/dist/client/node_modules/@vueuse/core/package.json +3 -3
- package/dist/client/node_modules/@vueuse/metadata/package.json +1 -1
- package/dist/client/node_modules/@vueuse/shared/index.d.ts +18 -5
- package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +3 -3
- package/dist/client/node_modules/@vueuse/shared/package.json +1 -1
- package/dist/client/node_modules/csstype/index.d.ts +5009 -21819
- package/dist/client/node_modules/csstype/package.json +35 -25
- package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +0 -7
- package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +0 -7
- package/dist/client/node_modules/floating-vue/dist/index.d.ts +0 -7
- package/dist/client/node_modules/floating-vue/package.json +3 -2
- package/dist/client/node_modules/magic-string/{index.d.ts → dist/magic-string.cjs.d.ts} +50 -7
- package/dist/client/node_modules/magic-string/package.json +34 -22
- package/dist/client/node_modules/pinia/dist/pinia.d.ts +17 -5
- package/dist/client/node_modules/pinia/node_modules/vue-demi/package.json +3 -3
- package/dist/client/node_modules/pinia/package.json +7 -7
- package/dist/client/node_modules/postcss/lib/at-rule.d.ts +58 -49
- package/dist/client/node_modules/postcss/lib/comment.d.ts +43 -32
- package/dist/client/node_modules/postcss/lib/container.d.ts +224 -214
- package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +111 -102
- package/dist/client/node_modules/postcss/lib/declaration.d.ts +85 -61
- package/dist/client/node_modules/postcss/lib/document.d.ts +27 -16
- package/dist/client/node_modules/postcss/lib/fromJSON.d.ts +6 -2
- package/dist/client/node_modules/postcss/lib/input.d.ts +99 -90
- package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +69 -55
- package/dist/client/node_modules/postcss/lib/list.d.ts +53 -47
- package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +24 -15
- package/dist/client/node_modules/postcss/lib/node.d.ts +339 -281
- package/dist/client/node_modules/postcss/lib/parse.d.ts +6 -2
- package/dist/client/node_modules/postcss/lib/postcss.d.ts +288 -320
- package/dist/client/node_modules/postcss/lib/previous-map.d.ts +23 -14
- package/dist/client/node_modules/postcss/lib/processor.d.ts +52 -39
- package/dist/client/node_modules/postcss/lib/result.d.ts +77 -67
- package/dist/client/node_modules/postcss/lib/root.d.ts +49 -36
- package/dist/client/node_modules/postcss/lib/rule.d.ts +54 -45
- package/dist/client/node_modules/postcss/lib/stringifier.d.ts +31 -22
- package/dist/client/node_modules/postcss/lib/stringify.d.ts +6 -2
- package/dist/client/node_modules/postcss/lib/warning.d.ts +72 -63
- package/dist/client/node_modules/postcss/package.json +7 -4
- package/dist/client/node_modules/vue/compiler-sfc/package.json +2 -3
- package/dist/client/node_modules/vue/dist/vue.d.ts +11 -9
- package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +29 -0
- package/dist/client/node_modules/vue/jsx-runtime/package.json +5 -0
- package/dist/client/node_modules/vue/jsx.d.ts +26 -0
- package/dist/client/node_modules/vue/package.json +41 -15
- package/dist/client/node_modules/vue/ref-macros.d.ts +1 -1
- package/dist/client/node_modules/vue/server-renderer/package.json +2 -3
- package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +2 -1
- package/dist/client/node_modules/vue-router/package.json +38 -36
- package/dist/client/vue.runtime.esm-bundler.js +10048 -10684
- package/package.json +13 -13
- package/tsconfig.json +1 -2
- package/dist/client/node_modules/source-map/package.json +0 -73
- package/dist/client/node_modules/source-map/source-map.d.ts +0 -98
- 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
|
-
|
|
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
|
+
}
|
|
18
19
|
|
|
19
|
-
export interface ContainerProps extends NodeProps {
|
|
20
|
-
|
|
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
|
-
|
|
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,50 @@ 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
|
+
* The container’s first child.
|
|
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.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
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
179
|
-
* @
|
|
180
|
-
* @return Returns `false` if iteration was broke.
|
|
144
|
+
* @param child Child of the current container.
|
|
145
|
+
* @return Child index.
|
|
181
146
|
*/
|
|
182
|
-
|
|
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
|
-
*
|
|
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
|
|
216
|
-
* @param
|
|
217
|
-
* @return
|
|
151
|
+
* @param oldNode Child or child’s index.
|
|
152
|
+
* @param newNode New node.
|
|
153
|
+
* @return This node for methods chain.
|
|
218
154
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
):
|
|
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
|
-
*
|
|
178
|
+
* Insert new node before old node within the container.
|
|
253
179
|
*
|
|
254
180
|
* ```js
|
|
255
|
-
*
|
|
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
|
|
184
|
+
* @param oldNode Child or child’s index.
|
|
185
|
+
* @param newNode New node.
|
|
269
186
|
* @return This node for methods chain.
|
|
270
187
|
*/
|
|
271
|
-
|
|
272
|
-
|
|
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: (
|
|
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
|
-
*
|
|
238
|
+
* Removes all children from the container
|
|
239
|
+
* and cleans their parent properties.
|
|
313
240
|
*
|
|
314
241
|
* ```js
|
|
315
|
-
* rule.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
393
|
-
options: ValueOptions,
|
|
394
|
-
replaced:
|
|
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
|
-
*
|
|
301
|
+
* Returns `true` if callback returns `true` for (at least) one
|
|
302
|
+
* of the container’s children.
|
|
404
303
|
*
|
|
405
304
|
* ```js
|
|
406
|
-
* const
|
|
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
|
|
309
|
+
* @return Is some child pass condition.
|
|
411
310
|
*/
|
|
412
|
-
|
|
311
|
+
some(
|
|
413
312
|
condition: (node: Child, index: number, nodes: Child[]) => boolean
|
|
414
313
|
): boolean
|
|
415
314
|
|
|
416
315
|
/**
|
|
417
|
-
*
|
|
418
|
-
*
|
|
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
|
-
*
|
|
326
|
+
* root.walk(node => {
|
|
327
|
+
* // Traverses all descendant nodes.
|
|
328
|
+
* })
|
|
422
329
|
* ```
|
|
423
330
|
*
|
|
424
|
-
* @param
|
|
425
|
-
* @return
|
|
331
|
+
* @param callback Iterator receives each node and index.
|
|
332
|
+
* @return Returns `false` if iteration was broke.
|
|
426
333
|
*/
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
):
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
439
|
-
*
|
|
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
|
-
|
|
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
|