1 | import Container, { ContainerProps } from './container.js'
|
2 | import Document from './document.js'
|
3 | import { ProcessOptions } from './postcss.js'
|
4 | import Result from './result.js'
|
5 |
|
6 | declare namespace Root {
|
7 | export interface RootRaws extends Record<string, any> {
|
8 | |
9 |
|
10 |
|
11 | after?: string
|
12 |
|
13 | |
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | codeAfter?: string
|
20 |
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | codeBefore?: string
|
28 |
|
29 | |
30 |
|
31 |
|
32 | semicolon?: boolean
|
33 | }
|
34 |
|
35 | export interface RootProps extends ContainerProps {
|
36 | |
37 |
|
38 |
|
39 |
|
40 | raws?: RootRaws
|
41 | }
|
42 |
|
43 |
|
44 | export { Root_ as default }
|
45 | }
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | declare class Root_ extends Container {
|
57 | nodes: NonNullable<Container['nodes']>
|
58 | parent: Document | undefined
|
59 | raws: Root.RootRaws
|
60 | type: 'root'
|
61 |
|
62 | constructor(defaults?: Root.RootProps)
|
63 |
|
64 | assign(overrides: object | Root.RootProps): this
|
65 | clone(overrides?: Partial<Root.RootProps>): Root
|
66 | cloneAfter(overrides?: Partial<Root.RootProps>): Root
|
67 | cloneBefore(overrides?: Partial<Root.RootProps>): Root
|
68 |
|
69 | /**
|
70 | * Returns a `Result` instance representing the root’s CSS.
|
71 | *
|
72 | * ```js
|
73 | * const root1 = postcss.parse(css1, { from: 'a.css' })
|
74 | * const root2 = postcss.parse(css2, { from: 'b.css' })
|
75 | * root1.append(root2)
|
76 | * const result = root1.toResult({ to: 'all.css', map: true })
|
77 | * ```
|
78 | *
|
79 | * @param opts Options.
|
80 | * @return Result with current root’s CSS.
|
81 | */
|
82 | toResult(options?: ProcessOptions): Result
|
83 | }
|
84 |
|
85 | declare class Root extends Root_ {}
|
86 |
|
87 | export = Root
|