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 | parent: Document | undefined
|
58 | raws: Root.RootRaws
|
59 | type: 'root'
|
60 |
|
61 | constructor(defaults?: Root.RootProps)
|
62 |
|
63 | assign(overrides: object | Root.RootProps): this
|
64 | clone(overrides?: Partial<Root.RootProps>): Root
|
65 | cloneAfter(overrides?: Partial<Root.RootProps>): Root
|
66 | cloneBefore(overrides?: Partial<Root.RootProps>): Root
|
67 |
|
68 | /**
|
69 | * Returns a `Result` instance representing the root’s CSS.
|
70 | *
|
71 | * ```js
|
72 | * const root1 = postcss.parse(css1, { from: 'a.css' })
|
73 | * const root2 = postcss.parse(css2, { from: 'b.css' })
|
74 | * root1.append(root2)
|
75 | * const result = root1.toResult({ to: 'all.css', map: true })
|
76 | * ```
|
77 | *
|
78 | * @param opts Options.
|
79 | * @return Result with current root’s CSS.
|
80 | */
|
81 | toResult(options?: ProcessOptions): Result
|
82 | }
|
83 |
|
84 | declare class Root extends Root_ {}
|
85 |
|
86 | export = Root
|