source: frontend/node_modules/postcss/lib/root.d.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[9af201e]1import Container, { ContainerProps } from './container.js'
2import Document from './document.js'
3import { ProcessOptions } from './postcss.js'
4import Result from './result.js'
5
6declare namespace Root {
7 export interface RootRaws extends Record<string, any> {
8 /**
9 * The space symbols after the last child to the end of file.
10 */
11 after?: string
12
13 /**
14 * Non-CSS code after `Root`, when `Root` is inside `Document`.
15 *
16 * **Experimental:** some aspects of this node could change within minor
17 * or patch version releases.
18 */
19 codeAfter?: string
20
21 /**
22 * Non-CSS code before `Root`, when `Root` is inside `Document`.
23 *
24 * **Experimental:** some aspects of this node could change within minor
25 * or patch version releases.
26 */
27 codeBefore?: string
28
29 /**
30 * Is the last child has an (optional) semicolon.
31 */
32 semicolon?: boolean
33 }
34
35 export interface RootProps extends ContainerProps {
36 /**
37 * Information used to generate byte-to-byte equal node string
38 * as it was in the origin input.
39 * */
40 raws?: RootRaws
41 }
42
43 export { Root_ as default }
44}
45
46/**
47 * Represents a CSS file and contains all its parsed nodes.
48 *
49 * ```js
50 * const root = postcss.parse('a{color:black} b{z-index:2}')
51 * root.type //=> 'root'
52 * root.nodes.length //=> 2
53 * ```
54 */
55declare class Root_ extends Container {
56 nodes: NonNullable<Container['nodes']>
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>): this
65 cloneAfter(overrides?: Partial<Root.RootProps>): this
66 cloneBefore(overrides?: Partial<Root.RootProps>): this
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 options Options.
79 * @return Result with current root’s CSS.
80 */
81 toResult(options?: ProcessOptions): Result
82}
83
84declare class Root extends Root_ {}
85
86export = Root
Note: See TracBrowser for help on using the repository browser.