@histoire/vendors 0.16.0 → 0.17.0
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,169 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RawSourceMap, SourceMapGenerator } from 'source-map-js'
|
|
2
2
|
|
|
3
|
+
import AtRule, { AtRuleProps } from './at-rule.js'
|
|
4
|
+
import Comment, { CommentProps } from './comment.js'
|
|
5
|
+
import Container, { ContainerProps } from './container.js'
|
|
6
|
+
import CssSyntaxError from './css-syntax-error.js'
|
|
7
|
+
import Declaration, { DeclarationProps } from './declaration.js'
|
|
8
|
+
import Document, { DocumentProps } from './document.js'
|
|
9
|
+
import Input, { FilePosition } from './input.js'
|
|
10
|
+
import LazyResult from './lazy-result.js'
|
|
11
|
+
import list from './list.js'
|
|
3
12
|
import Node, {
|
|
4
|
-
|
|
5
|
-
Source,
|
|
13
|
+
AnyNode,
|
|
6
14
|
ChildNode,
|
|
15
|
+
ChildProps,
|
|
7
16
|
NodeErrorOptions,
|
|
8
17
|
NodeProps,
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
Position,
|
|
19
|
+
Source
|
|
11
20
|
} from './node.js'
|
|
12
|
-
import
|
|
13
|
-
import Container, { ContainerProps } from './container.js'
|
|
14
|
-
import Document, { DocumentProps } from './document.js'
|
|
15
|
-
import Warning, { WarningOptions } from './warning.js'
|
|
16
|
-
import Comment, { CommentProps } from './comment.js'
|
|
17
|
-
import AtRule, { AtRuleProps } from './at-rule.js'
|
|
18
|
-
import Input, { FilePosition } from './input.js'
|
|
21
|
+
import Processor from './processor.js'
|
|
19
22
|
import Result, { Message } from './result.js'
|
|
20
23
|
import Root, { RootProps } from './root.js'
|
|
21
24
|
import Rule, { RuleProps } from './rule.js'
|
|
22
|
-
import
|
|
23
|
-
import list, { List } from './list.js'
|
|
24
|
-
import LazyResult from './lazy-result.js'
|
|
25
|
-
import Processor from './processor.js'
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
NodeErrorOptions,
|
|
29
|
-
DeclarationProps,
|
|
30
|
-
CssSyntaxError,
|
|
31
|
-
ContainerProps,
|
|
32
|
-
WarningOptions,
|
|
33
|
-
DocumentProps,
|
|
34
|
-
FilePosition,
|
|
35
|
-
CommentProps,
|
|
36
|
-
AtRuleProps,
|
|
37
|
-
Declaration,
|
|
38
|
-
ChildProps,
|
|
39
|
-
LazyResult,
|
|
40
|
-
ChildNode,
|
|
41
|
-
NodeProps,
|
|
42
|
-
Processor,
|
|
43
|
-
RuleProps,
|
|
44
|
-
RootProps,
|
|
45
|
-
Container,
|
|
46
|
-
Position,
|
|
47
|
-
Document,
|
|
48
|
-
AnyNode,
|
|
49
|
-
Warning,
|
|
50
|
-
Message,
|
|
51
|
-
Comment,
|
|
52
|
-
Source,
|
|
53
|
-
AtRule,
|
|
54
|
-
Result,
|
|
55
|
-
Input,
|
|
56
|
-
Node,
|
|
57
|
-
list,
|
|
58
|
-
Rule,
|
|
59
|
-
Root
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export type SourceMap = SourceMapGenerator & {
|
|
63
|
-
toJSON(): RawSourceMap
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export type Helpers = { result: Result; postcss: Postcss } & Postcss
|
|
25
|
+
import Warning, { WarningOptions } from './warning.js'
|
|
67
26
|
|
|
68
27
|
type DocumentProcessor = (
|
|
69
28
|
document: Document,
|
|
70
|
-
helper: Helpers
|
|
29
|
+
helper: postcss.Helpers
|
|
71
30
|
) => Promise<void> | void
|
|
72
|
-
type RootProcessor = (root: Root, helper: Helpers) => Promise<void> | void
|
|
31
|
+
type RootProcessor = (root: Root, helper: postcss.Helpers) => Promise<void> | void
|
|
73
32
|
type DeclarationProcessor = (
|
|
74
33
|
decl: Declaration,
|
|
75
|
-
helper: Helpers
|
|
34
|
+
helper: postcss.Helpers
|
|
76
35
|
) => Promise<void> | void
|
|
77
|
-
type RuleProcessor = (rule: Rule, helper: Helpers) => Promise<void> | void
|
|
78
|
-
type AtRuleProcessor = (atRule: AtRule, helper: Helpers) => Promise<void> | void
|
|
36
|
+
type RuleProcessor = (rule: Rule, helper: postcss.Helpers) => Promise<void> | void
|
|
37
|
+
type AtRuleProcessor = (atRule: AtRule, helper: postcss.Helpers) => Promise<void> | void
|
|
79
38
|
type CommentProcessor = (
|
|
80
39
|
comment: Comment,
|
|
81
|
-
helper: Helpers
|
|
40
|
+
helper: postcss.Helpers
|
|
82
41
|
) => Promise<void> | void
|
|
83
42
|
|
|
84
43
|
interface Processors {
|
|
85
|
-
/**
|
|
86
|
-
* Will be called on `Document` node.
|
|
87
|
-
*
|
|
88
|
-
* Will be called again on children changes.
|
|
89
|
-
*/
|
|
90
|
-
Document?: DocumentProcessor
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Will be called on `Document` node, when all children will be processed.
|
|
94
|
-
*
|
|
95
|
-
* Will be called again on children changes.
|
|
96
|
-
*/
|
|
97
|
-
DocumentExit?: DocumentProcessor
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Will be called on `Root` node once.
|
|
101
|
-
*/
|
|
102
|
-
Once?: RootProcessor
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Will be called on `Root` node once, when all children will be processed.
|
|
106
|
-
*/
|
|
107
|
-
OnceExit?: RootProcessor
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Will be called on `Root` node.
|
|
111
|
-
*
|
|
112
|
-
* Will be called again on children changes.
|
|
113
|
-
*/
|
|
114
|
-
Root?: RootProcessor
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Will be called on `Root` node, when all children will be processed.
|
|
118
|
-
*
|
|
119
|
-
* Will be called again on children changes.
|
|
120
|
-
*/
|
|
121
|
-
RootExit?: RootProcessor
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Will be called on all `Declaration` nodes after listeners
|
|
125
|
-
* for `Declaration` event.
|
|
126
|
-
*
|
|
127
|
-
* Will be called again on node or children changes.
|
|
128
|
-
*/
|
|
129
|
-
Declaration?: DeclarationProcessor | { [prop: string]: DeclarationProcessor }
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Will be called on all `Declaration` nodes.
|
|
133
|
-
*
|
|
134
|
-
* Will be called again on node or children changes.
|
|
135
|
-
*/
|
|
136
|
-
DeclarationExit?:
|
|
137
|
-
| DeclarationProcessor
|
|
138
|
-
| { [prop: string]: DeclarationProcessor }
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Will be called on all `Rule` nodes.
|
|
142
|
-
*
|
|
143
|
-
* Will be called again on node or children changes.
|
|
144
|
-
*/
|
|
145
|
-
Rule?: RuleProcessor
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Will be called on all `Rule` nodes, when all children will be processed.
|
|
149
|
-
*
|
|
150
|
-
* Will be called again on node or children changes.
|
|
151
|
-
*/
|
|
152
|
-
RuleExit?: RuleProcessor
|
|
153
|
-
|
|
154
44
|
/**
|
|
155
45
|
* Will be called on all`AtRule` nodes.
|
|
156
46
|
*
|
|
157
47
|
* Will be called again on node or children changes.
|
|
158
48
|
*/
|
|
159
|
-
AtRule?:
|
|
49
|
+
AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor
|
|
160
50
|
|
|
161
51
|
/**
|
|
162
52
|
* Will be called on all `AtRule` nodes, when all children will be processed.
|
|
163
53
|
*
|
|
164
54
|
* Will be called again on node or children changes.
|
|
165
55
|
*/
|
|
166
|
-
AtRuleExit?:
|
|
56
|
+
AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor
|
|
167
57
|
|
|
168
58
|
/**
|
|
169
59
|
* Will be called on all `Comment` nodes.
|
|
@@ -181,192 +71,279 @@ interface Processors {
|
|
|
181
71
|
CommentExit?: CommentProcessor
|
|
182
72
|
|
|
183
73
|
/**
|
|
184
|
-
* Will be called
|
|
74
|
+
* Will be called on all `Declaration` nodes after listeners
|
|
75
|
+
* for `Declaration` event.
|
|
185
76
|
*
|
|
186
|
-
*
|
|
187
|
-
*/
|
|
188
|
-
Exit?: RootProcessor
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export interface Plugin extends Processors {
|
|
192
|
-
postcssPlugin: string
|
|
193
|
-
prepare?: (result: Result) => Processors
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export interface PluginCreator<PluginOptions> {
|
|
197
|
-
(opts?: PluginOptions): Plugin | Processor
|
|
198
|
-
postcss: true
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
export interface Transformer extends TransformCallback {
|
|
202
|
-
postcssPlugin: string
|
|
203
|
-
postcssVersion: string
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export interface TransformCallback {
|
|
207
|
-
(root: Root, result: Result): Promise<void> | void
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export interface OldPlugin<T> extends Transformer {
|
|
211
|
-
(opts?: T): Transformer
|
|
212
|
-
postcss: Transformer
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export type AcceptedPlugin =
|
|
216
|
-
| Plugin
|
|
217
|
-
| PluginCreator<any>
|
|
218
|
-
| OldPlugin<any>
|
|
219
|
-
| TransformCallback
|
|
220
|
-
| {
|
|
221
|
-
postcss: TransformCallback | Processor
|
|
222
|
-
}
|
|
223
|
-
| Processor
|
|
224
|
-
|
|
225
|
-
export interface Parser<RootNode = Root | Document> {
|
|
226
|
-
(
|
|
227
|
-
css: string | { toString(): string },
|
|
228
|
-
opts?: Pick<ProcessOptions, 'map' | 'from'>
|
|
229
|
-
): RootNode
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface Builder {
|
|
233
|
-
(part: string, node?: AnyNode, type?: 'start' | 'end'): void
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface Stringifier {
|
|
237
|
-
(node: AnyNode, builder: Builder): void
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export interface JSONHydrator {
|
|
241
|
-
(data: object[]): Node[]
|
|
242
|
-
(data: object): Node
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
export interface Syntax {
|
|
246
|
-
/**
|
|
247
|
-
* Function to generate AST by string.
|
|
248
|
-
*/
|
|
249
|
-
parse?: Parser
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Class to generate string by AST.
|
|
77
|
+
* Will be called again on node or children changes.
|
|
253
78
|
*/
|
|
254
|
-
|
|
255
|
-
}
|
|
79
|
+
Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor
|
|
256
80
|
|
|
257
|
-
export interface SourceMapOptions {
|
|
258
81
|
/**
|
|
259
|
-
*
|
|
260
|
-
* as a Base64-encoded comment. By default, it is `true`.
|
|
261
|
-
* But if all previous maps are external, not inline, PostCSS will not embed
|
|
262
|
-
* the map even if you do not set this option.
|
|
82
|
+
* Will be called on all `Declaration` nodes.
|
|
263
83
|
*
|
|
264
|
-
*
|
|
265
|
-
* as the source map will be contained within the text of `result.css`.
|
|
84
|
+
* Will be called again on node or children changes.
|
|
266
85
|
*/
|
|
267
|
-
|
|
86
|
+
DeclarationExit?:
|
|
87
|
+
| { [prop: string]: DeclarationProcessor }
|
|
88
|
+
| DeclarationProcessor
|
|
268
89
|
|
|
269
90
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* PostCSS will try to read the previous source map
|
|
273
|
-
* automatically (based on comments within the source CSS), but you can use
|
|
274
|
-
* this option to identify it manually.
|
|
91
|
+
* Will be called on `Document` node.
|
|
275
92
|
*
|
|
276
|
-
*
|
|
277
|
-
*/
|
|
278
|
-
prev?: string | boolean | object | ((file: string) => string)
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Indicates that PostCSS should set the origin content (e.g., Sass source)
|
|
282
|
-
* of the source map. By default, it is true. But if all previous maps do not
|
|
283
|
-
* contain sources content, PostCSS will also leave it out even if you
|
|
284
|
-
* do not set this option.
|
|
93
|
+
* Will be called again on children changes.
|
|
285
94
|
*/
|
|
286
|
-
|
|
95
|
+
Document?: DocumentProcessor
|
|
287
96
|
|
|
288
97
|
/**
|
|
289
|
-
*
|
|
290
|
-
* By default, PostCSS will always add a comment with a path
|
|
291
|
-
* to the source map. PostCSS will not add annotations to CSS files
|
|
292
|
-
* that do not contain any comments.
|
|
293
|
-
*
|
|
294
|
-
* By default, PostCSS presumes that you want to save the source map as
|
|
295
|
-
* `opts.to + '.map'` and will use this path in the annotation comment.
|
|
296
|
-
* A different path can be set by providing a string value for annotation.
|
|
98
|
+
* Will be called on `Document` node, when all children will be processed.
|
|
297
99
|
*
|
|
298
|
-
*
|
|
299
|
-
*/
|
|
300
|
-
annotation?: string | boolean | ((file: string, root: Root) => string)
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Override `from` in map’s sources.
|
|
304
|
-
*/
|
|
305
|
-
from?: string
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Use absolute path in generated source map.
|
|
100
|
+
* Will be called again on children changes.
|
|
309
101
|
*/
|
|
310
|
-
|
|
311
|
-
}
|
|
102
|
+
DocumentExit?: DocumentProcessor
|
|
312
103
|
|
|
313
|
-
export interface ProcessOptions {
|
|
314
104
|
/**
|
|
315
|
-
*
|
|
316
|
-
* because it is used in source map generation and syntax error messages.
|
|
105
|
+
* Will be called on `Root` node once.
|
|
317
106
|
*/
|
|
318
|
-
|
|
107
|
+
Once?: RootProcessor
|
|
319
108
|
|
|
320
109
|
/**
|
|
321
|
-
*
|
|
322
|
-
* to generate correct source maps.
|
|
110
|
+
* Will be called on `Root` node once, when all children will be processed.
|
|
323
111
|
*/
|
|
324
|
-
|
|
112
|
+
OnceExit?: RootProcessor
|
|
325
113
|
|
|
326
114
|
/**
|
|
327
|
-
*
|
|
115
|
+
* Will be called on `Root` node.
|
|
116
|
+
*
|
|
117
|
+
* Will be called again on children changes.
|
|
328
118
|
*/
|
|
329
|
-
|
|
119
|
+
Root?: RootProcessor
|
|
330
120
|
|
|
331
121
|
/**
|
|
332
|
-
*
|
|
122
|
+
* Will be called on `Root` node, when all children will be processed.
|
|
123
|
+
*
|
|
124
|
+
* Will be called again on children changes.
|
|
333
125
|
*/
|
|
334
|
-
|
|
126
|
+
RootExit?: RootProcessor
|
|
335
127
|
|
|
336
128
|
/**
|
|
337
|
-
*
|
|
129
|
+
* Will be called on all `Rule` nodes.
|
|
130
|
+
*
|
|
131
|
+
* Will be called again on node or children changes.
|
|
338
132
|
*/
|
|
339
|
-
|
|
133
|
+
Rule?: RuleProcessor
|
|
340
134
|
|
|
341
135
|
/**
|
|
342
|
-
*
|
|
136
|
+
* Will be called on all `Rule` nodes, when all children will be processed.
|
|
137
|
+
*
|
|
138
|
+
* Will be called again on node or children changes.
|
|
343
139
|
*/
|
|
344
|
-
|
|
140
|
+
RuleExit?: RuleProcessor
|
|
345
141
|
}
|
|
346
142
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
143
|
+
declare namespace postcss {
|
|
144
|
+
export {
|
|
145
|
+
AnyNode,
|
|
146
|
+
AtRule,
|
|
147
|
+
AtRuleProps,
|
|
148
|
+
ChildNode,
|
|
149
|
+
ChildProps,
|
|
150
|
+
Comment,
|
|
151
|
+
CommentProps,
|
|
152
|
+
Container,
|
|
153
|
+
ContainerProps,
|
|
154
|
+
CssSyntaxError,
|
|
155
|
+
Declaration,
|
|
156
|
+
DeclarationProps,
|
|
157
|
+
Document,
|
|
158
|
+
DocumentProps,
|
|
159
|
+
FilePosition,
|
|
160
|
+
Input,
|
|
161
|
+
LazyResult,
|
|
162
|
+
list,
|
|
163
|
+
Message,
|
|
164
|
+
Node,
|
|
165
|
+
NodeErrorOptions,
|
|
166
|
+
NodeProps,
|
|
167
|
+
Position,
|
|
168
|
+
Processor,
|
|
169
|
+
Result,
|
|
170
|
+
Root,
|
|
171
|
+
RootProps,
|
|
172
|
+
Rule,
|
|
173
|
+
RuleProps,
|
|
174
|
+
Source,
|
|
175
|
+
Warning,
|
|
176
|
+
WarningOptions
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export type SourceMap = SourceMapGenerator & {
|
|
180
|
+
toJSON(): RawSourceMap
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export type Helpers = { postcss: Postcss; result: Result } & Postcss
|
|
184
|
+
|
|
185
|
+
export interface Plugin extends Processors {
|
|
186
|
+
postcssPlugin: string
|
|
187
|
+
prepare?: (result: Result) => Processors
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface PluginCreator<PluginOptions> {
|
|
191
|
+
(opts?: PluginOptions): Plugin | Processor
|
|
192
|
+
postcss: true
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface Transformer extends TransformCallback {
|
|
196
|
+
postcssPlugin: string
|
|
197
|
+
postcssVersion: string
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface TransformCallback {
|
|
201
|
+
(root: Root, result: Result): Promise<void> | void
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface OldPlugin<T> extends Transformer {
|
|
205
|
+
(opts?: T): Transformer
|
|
206
|
+
postcss: Transformer
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type AcceptedPlugin =
|
|
210
|
+
| {
|
|
211
|
+
postcss: Processor | TransformCallback
|
|
212
|
+
}
|
|
213
|
+
| OldPlugin<any>
|
|
214
|
+
| Plugin
|
|
215
|
+
| PluginCreator<any>
|
|
216
|
+
| Processor
|
|
217
|
+
| TransformCallback
|
|
218
|
+
|
|
219
|
+
export interface Parser<RootNode = Document | Root> {
|
|
220
|
+
(
|
|
221
|
+
css: { toString(): string } | string,
|
|
222
|
+
opts?: Pick<ProcessOptions, 'from' | 'map'>
|
|
223
|
+
): RootNode
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface Builder {
|
|
227
|
+
(part: string, node?: AnyNode, type?: 'end' | 'start'): void
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface Stringifier {
|
|
231
|
+
(node: AnyNode, builder: Builder): void
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface JSONHydrator {
|
|
235
|
+
(data: object): Node
|
|
236
|
+
(data: object[]): Node[]
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface Syntax<RootNode = Document | Root> {
|
|
240
|
+
/**
|
|
241
|
+
* Function to generate AST by string.
|
|
242
|
+
*/
|
|
243
|
+
parse?: Parser<RootNode>
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Class to generate string by AST.
|
|
247
|
+
*/
|
|
248
|
+
stringify?: Stringifier
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface SourceMapOptions {
|
|
252
|
+
/**
|
|
253
|
+
* Use absolute path in generated source map.
|
|
254
|
+
*/
|
|
255
|
+
absolute?: boolean
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Indicates that PostCSS should add annotation comments to the CSS.
|
|
259
|
+
* By default, PostCSS will always add a comment with a path
|
|
260
|
+
* to the source map. PostCSS will not add annotations to CSS files
|
|
261
|
+
* that do not contain any comments.
|
|
262
|
+
*
|
|
263
|
+
* By default, PostCSS presumes that you want to save the source map as
|
|
264
|
+
* `opts.to + '.map'` and will use this path in the annotation comment.
|
|
265
|
+
* A different path can be set by providing a string value for annotation.
|
|
266
|
+
*
|
|
267
|
+
* If you have set `inline: true`, annotation cannot be disabled.
|
|
268
|
+
*/
|
|
269
|
+
annotation?: ((file: string, root: Root) => string) | boolean | string
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Override `from` in map’s sources.
|
|
273
|
+
*/
|
|
274
|
+
from?: string
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Indicates that the source map should be embedded in the output CSS
|
|
278
|
+
* as a Base64-encoded comment. By default, it is `true`.
|
|
279
|
+
* But if all previous maps are external, not inline, PostCSS will not embed
|
|
280
|
+
* the map even if you do not set this option.
|
|
281
|
+
*
|
|
282
|
+
* If you have an inline source map, the result.map property will be empty,
|
|
283
|
+
* as the source map will be contained within the text of `result.css`.
|
|
284
|
+
*/
|
|
285
|
+
inline?: boolean
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Source map content from a previous processing step (e.g., Sass).
|
|
289
|
+
*
|
|
290
|
+
* PostCSS will try to read the previous source map
|
|
291
|
+
* automatically (based on comments within the source CSS), but you can use
|
|
292
|
+
* this option to identify it manually.
|
|
293
|
+
*
|
|
294
|
+
* If desired, you can omit the previous map with prev: `false`.
|
|
295
|
+
*/
|
|
296
|
+
prev?: ((file: string) => string) | boolean | object | string
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Indicates that PostCSS should set the origin content (e.g., Sass source)
|
|
300
|
+
* of the source map. By default, it is true. But if all previous maps do not
|
|
301
|
+
* contain sources content, PostCSS will also leave it out even if you
|
|
302
|
+
* do not set this option.
|
|
303
|
+
*/
|
|
304
|
+
sourcesContent?: boolean
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export interface ProcessOptions<RootNode = Document | Root> {
|
|
308
|
+
/**
|
|
309
|
+
* The path of the CSS source file. You should always set `from`,
|
|
310
|
+
* because it is used in source map generation and syntax error messages.
|
|
311
|
+
*/
|
|
312
|
+
from?: string
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Source map options
|
|
316
|
+
*/
|
|
317
|
+
map?: boolean | SourceMapOptions
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Function to generate AST by string.
|
|
321
|
+
*/
|
|
322
|
+
parser?: Parser<RootNode> | Syntax<RootNode>
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Class to generate string by AST.
|
|
326
|
+
*/
|
|
327
|
+
stringifier?: Stringifier | Syntax<RootNode>
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Object with parse and stringify.
|
|
331
|
+
*/
|
|
332
|
+
syntax?: Syntax<RootNode>
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* The path where you'll put the output CSS file. You should always set `to`
|
|
336
|
+
* to generate correct source maps.
|
|
337
|
+
*/
|
|
338
|
+
to?: string
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export type Postcss = typeof postcss
|
|
365
342
|
|
|
366
343
|
/**
|
|
367
344
|
* Default function to convert a node tree into a CSS string.
|
|
368
345
|
*/
|
|
369
|
-
stringify: Stringifier
|
|
346
|
+
export let stringify: Stringifier
|
|
370
347
|
|
|
371
348
|
/**
|
|
372
349
|
* Parses source css and returns a new `Root` or `Document` node,
|
|
@@ -379,7 +356,7 @@ export interface Postcss {
|
|
|
379
356
|
* root1.append(root2).toResult().css
|
|
380
357
|
* ```
|
|
381
358
|
*/
|
|
382
|
-
parse: Parser<Root>
|
|
359
|
+
export let parse: Parser<Root>
|
|
383
360
|
|
|
384
361
|
/**
|
|
385
362
|
* Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes.
|
|
@@ -390,12 +367,7 @@ export interface Postcss {
|
|
|
390
367
|
* const root2 = postcss.fromJSON(json)
|
|
391
368
|
* ```
|
|
392
369
|
*/
|
|
393
|
-
fromJSON: JSONHydrator
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Contains the `list` module.
|
|
397
|
-
*/
|
|
398
|
-
list: List
|
|
370
|
+
export let fromJSON: JSONHydrator
|
|
399
371
|
|
|
400
372
|
/**
|
|
401
373
|
* Creates a new `Comment` node.
|
|
@@ -403,7 +375,7 @@ export interface Postcss {
|
|
|
403
375
|
* @param defaults Properties for the new node.
|
|
404
376
|
* @return New comment node
|
|
405
377
|
*/
|
|
406
|
-
comment(defaults?: CommentProps): Comment
|
|
378
|
+
export function comment(defaults?: CommentProps): Comment
|
|
407
379
|
|
|
408
380
|
/**
|
|
409
381
|
* Creates a new `AtRule` node.
|
|
@@ -411,7 +383,7 @@ export interface Postcss {
|
|
|
411
383
|
* @param defaults Properties for the new node.
|
|
412
384
|
* @return New at-rule node.
|
|
413
385
|
*/
|
|
414
|
-
atRule(defaults?: AtRuleProps): AtRule
|
|
386
|
+
export function atRule(defaults?: AtRuleProps): AtRule
|
|
415
387
|
|
|
416
388
|
/**
|
|
417
389
|
* Creates a new `Declaration` node.
|
|
@@ -419,7 +391,7 @@ export interface Postcss {
|
|
|
419
391
|
* @param defaults Properties for the new node.
|
|
420
392
|
* @return New declaration node.
|
|
421
393
|
*/
|
|
422
|
-
decl(defaults?: DeclarationProps): Declaration
|
|
394
|
+
export function decl(defaults?: DeclarationProps): Declaration
|
|
423
395
|
|
|
424
396
|
/**
|
|
425
397
|
* Creates a new `Rule` node.
|
|
@@ -427,7 +399,7 @@ export interface Postcss {
|
|
|
427
399
|
* @param default Properties for the new node.
|
|
428
400
|
* @return New rule node.
|
|
429
401
|
*/
|
|
430
|
-
rule(defaults?: RuleProps): Rule
|
|
402
|
+
export function rule(defaults?: RuleProps): Rule
|
|
431
403
|
|
|
432
404
|
/**
|
|
433
405
|
* Creates a new `Root` node.
|
|
@@ -435,7 +407,7 @@ export interface Postcss {
|
|
|
435
407
|
* @param defaults Properties for the new node.
|
|
436
408
|
* @return New root node.
|
|
437
409
|
*/
|
|
438
|
-
root(defaults?: RootProps): Root
|
|
410
|
+
export function root(defaults?: RootProps): Root
|
|
439
411
|
|
|
440
412
|
/**
|
|
441
413
|
* Creates a new `Document` node.
|
|
@@ -443,31 +415,27 @@ export interface Postcss {
|
|
|
443
415
|
* @param defaults Properties for the new node.
|
|
444
416
|
* @return New document node.
|
|
445
417
|
*/
|
|
446
|
-
document(defaults?: DocumentProps): Document
|
|
447
|
-
|
|
448
|
-
CssSyntaxError: typeof CssSyntaxError
|
|
449
|
-
Declaration: typeof Declaration
|
|
450
|
-
Container: typeof Container
|
|
451
|
-
Comment: typeof Comment
|
|
452
|
-
Warning: typeof Warning
|
|
453
|
-
AtRule: typeof AtRule
|
|
454
|
-
Result: typeof Result
|
|
455
|
-
Input: typeof Input
|
|
456
|
-
Rule: typeof Rule
|
|
457
|
-
Root: typeof Root
|
|
458
|
-
Node: typeof Node
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
export const stringify: Stringifier
|
|
462
|
-
export const parse: Parser<Root>
|
|
463
|
-
export const fromJSON: JSONHydrator
|
|
418
|
+
export function document(defaults?: DocumentProps): Document
|
|
464
419
|
|
|
465
|
-
export
|
|
466
|
-
|
|
467
|
-
export const decl: Postcss['decl']
|
|
468
|
-
export const rule: Postcss['rule']
|
|
469
|
-
export const root: Postcss['root']
|
|
470
|
-
|
|
471
|
-
declare const postcss: Postcss
|
|
420
|
+
export { postcss as default }
|
|
421
|
+
}
|
|
472
422
|
|
|
473
|
-
|
|
423
|
+
/**
|
|
424
|
+
* Create a new `Processor` instance that will apply `plugins`
|
|
425
|
+
* as CSS processors.
|
|
426
|
+
*
|
|
427
|
+
* ```js
|
|
428
|
+
* let postcss = require('postcss')
|
|
429
|
+
*
|
|
430
|
+
* postcss(plugins).process(css, { from, to }).then(result => {
|
|
431
|
+
* console.log(result.css)
|
|
432
|
+
* })
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
435
|
+
* @param plugins PostCSS plugins.
|
|
436
|
+
* @return Processor to process multiple CSS.
|
|
437
|
+
*/
|
|
438
|
+
declare function postcss(plugins?: postcss.AcceptedPlugin[]): Processor
|
|
439
|
+
declare function postcss(...plugins: postcss.AcceptedPlugin[]): Processor
|
|
440
|
+
|
|
441
|
+
export = postcss
|