source: frontend/node_modules/postcss/lib/document.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: 1.8 KB
Line 
1import Container, { ContainerProps } from './container.js'
2import { ProcessOptions } from './postcss.js'
3import Result from './result.js'
4import Root from './root.js'
5
6declare namespace Document {
7 export interface DocumentProps extends ContainerProps {
8 nodes?: readonly Root[]
9
10 /**
11 * Information to generate byte-to-byte equal node string as it was
12 * in the origin input.
13 *
14 * Every parser saves its own properties.
15 */
16 raws?: Record<string, any>
17 }
18
19 export { Document_ as default }
20}
21
22/**
23 * Represents a file and contains all its parsed nodes.
24 *
25 * **Experimental:** some aspects of this node could change within minor
26 * or patch version releases.
27 *
28 * ```js
29 * const document = htmlParser(
30 * '<html><style>a{color:black}</style><style>b{z-index:2}</style>'
31 * )
32 * document.type //=> 'document'
33 * document.nodes.length //=> 2
34 * ```
35 */
36declare class Document_ extends Container<Root> {
37 nodes: Root[]
38 parent: undefined
39 type: 'document'
40
41 constructor(defaults?: Document.DocumentProps)
42
43 assign(overrides: Document.DocumentProps | object): this
44 clone(overrides?: Partial<Document.DocumentProps>): this
45 cloneAfter(overrides?: Partial<Document.DocumentProps>): this
46 cloneBefore(overrides?: Partial<Document.DocumentProps>): this
47
48 /**
49 * Returns a `Result` instance representing the document’s CSS roots.
50 *
51 * ```js
52 * const root1 = postcss.parse(css1, { from: 'a.css' })
53 * const root2 = postcss.parse(css2, { from: 'b.css' })
54 * const document = postcss.document()
55 * document.append(root1)
56 * document.append(root2)
57 * const result = document.toResult({ to: 'all.css', map: true })
58 * ```
59 *
60 * @param opts Options.
61 * @return Result with current document’s CSS.
62 */
63 toResult(options?: ProcessOptions): Result
64}
65
66declare class Document extends Document_ {}
67
68export = Document
Note: See TracBrowser for help on using the repository browser.