source: trip-planner-front/node_modules/postcss/lib/document.d.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

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