/** An element as the selectors see it. */ export interface CssNode { name: string; attrs: Readonly>; parent?: CssNode; } interface Simple { tag?: string; classes: string[]; attrs: { name: string; value?: string; }[]; where: Complex[][]; not: Complex[][]; } /** Compounds from the leftmost to the rightmost, with the combinator that joins each to the one before. */ type Complex = { combinator: " " | ">" | ""; simple: Simple; }[]; interface Rule { selector: Complex; specificity: number; order: number; declarations: [string, string][]; } /** A stylesheet's rules for one theme: those under `prefers-color-scheme` are in when the theme is that one, and the other media are out. */ export interface Stylesheet { rules: Rule[]; } /** Read a stylesheet. `theme` decides which `@media (prefers-color-scheme:…)` blocks count. */ export declare function parseStylesheet(css: string, theme: "light" | "dark", into?: Stylesheet): Stylesheet; /** The declarations that apply to an element, lowest priority first (by weight, then by order). */ export declare function matched(sheet: Stylesheet, node: CssNode): [string, string][]; /** The declarations of a `style` attribute. */ export declare const inlineStyle: (text: string | undefined) => [string, string][]; /** Replace every `var(--name, fallback)` in a value. A name with no value and no fallback makes the whole value `undefined` (the property is not set). */ export declare function substitute(value: string, vars: Readonly>, depth?: number): string | undefined; /** A value with its lengths worked out: `px` dropped, `em` multiplied by the font size, and every `calc()` replaced by its number. */ export declare function evaluate(value: string, fontSize: number): string; /** A length or a number as a number of user units: `3`, `3px`, `.14em` (of the font size), and `calc()` of a product, sum or difference of those. */ export declare function lengthOf(value: string | undefined, fontSize: number): number | undefined; export {};