CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
root.d.ts87 linesDownload Raw Back to lib
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?: string12 13    /**14     * Non-CSS code after `Root`, when `Root` is inside `Document`.15     *16     * **Experimental:** some aspects of this node could change within minor17     * or patch version releases.18     */19    codeAfter?: string20 21    /**22     * Non-CSS code before `Root`, when `Root` is inside `Document`.23     *24     * **Experimental:** some aspects of this node could change within minor25     * or patch version releases.26     */27    codeBefore?: string28 29    /**30     * Is the last child has an (optional) semicolon.31     */32    semicolon?: boolean33  }34 35  export interface RootProps extends ContainerProps {36    /**37     * Information used to generate byte-to-byte equal node string38     * as it was in the origin input.39     * */40    raws?: RootRaws41  }42 43  export { Root_ as default }44}45 46/**47 * Represents a CSS file and contains all its parsed nodes.48 *49 * ```js50 * const root = postcss.parse('a{color:black} b{z-index:2}')51 * root.type         //=> 'root'52 * root.nodes.length //=> 253 * ```54 */55declare class Root_ extends Container {56  nodes: NonNullable<Container['nodes']>57  parent: Document | undefined58  raws: Root.RootRaws59  type: 'root'60 61  constructor(defaults?: Root.RootProps)62 63  assign(overrides: object | Root.RootProps): this64  clone(overrides?: Partial<Root.RootProps>): this65  cloneAfter(overrides?: Partial<Root.RootProps>): this66  cloneBefore(overrides?: Partial<Root.RootProps>): this67 68  /**69   * Returns a `Result` instance representing the root’s CSS.70   *71   * ```js72   * 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): Result82}83 84declare class Root extends Root_ {}85 86export = Root87