/** * Valid CSS property values. */ export type PropertyValue = number | boolean | string | null | undefined; /** * Input styles object. */ export interface Styles { $unique?: boolean; $global?: boolean; $displayName?: string; [selector: string]: PropertyValue | PropertyValue[] | Styles; } export interface CompiledStyle { selector: string; style: string; isUnique: boolean; } export interface CompiledRule { selector: string; style: string; rules: CompiledRule[]; styles: CompiledStyle[]; } /** * Pre-registered container for cached styles and rules. */ export interface Compiled { id: string; rules: CompiledRule[]; styles: CompiledStyle[]; displayName: string | undefined; } /** * Propagate change events. */ export interface Changes { add(style: Container, index: number): void; remove(style: Container, index: number): void; change(style: Container, index: number): void; } /** * Cache-able interface. */ export interface Container { /** Unique identifier for the cache, used for merging styles. */ cid(): string; clone(): T; getStyles(): string; } /** * Implement a cache/event emitter. */ export declare class Cache> { changes?: Changes | undefined; changeId: number; protected sheet: string[]; protected children: T[]; protected counters: Map; constructor(changes?: Changes | undefined); add(style: T): void; remove(style: T): void; merge(cache: Cache): this; unmerge(cache: Cache): this; } /** * Selector is a dumb class made to represent nested CSS selectors. */ export declare class Selector implements Container { selector: string; constructor(selector: string); cid(): string; getStyles(): string; clone(): Selector; } /** * The style container registers a style string with selectors. */ export declare class Style extends Cache implements Container