import { Atoms, Shade, ModeShadeGroups } from "../atoms/index"; import { Molecules } from "../molecules/index"; import { Organisms } from "../organisms/index"; import { Property } from "../common/index"; import { IDesignSystem, VarListener, IVarGroup } from "../interfaces"; /** * * The CSS code generator. * @category Generators */ export declare class CSSGenerator { readonly ds: IDesignSystem; readonly atoms: Atoms; readonly molecules: Molecules; readonly organisms: Organisms; private readonly cssVars; private readonly cssVarListeners; private readonly varGroups; private readonly cssColors; private defaultTheme?; constructor(ds: IDesignSystem); generate(): void; getDyslexiaAsObject(): Object; getMotionSensitivityAsObject(): Object; getDyslexiaAsString(): string; getMotionSensitivityAsString(): string; private convertObjectToString; getVars(): { [name: string]: string; }; getVarGroupKeys(): string[]; private setStaticVars; private setAtomVars; private generateTypographyVars; private setMoleculeVars; private setOrganismVars; private coreSystemSettings; private addBevelProps; getVarGroup(name: string): CSSVarGroup; private colorListener; private shadowColorListener; private addPercentToDecimal; private percentToDecimalListener; private generateFocusBlurVariable; private generateInputBackgroundVariables; private setStateSettingsVars; generateHotlinkVariables(vk: CSSVariableKind): void; private generateHotlinkVariables2; private generateHotlinkModeVariables; private generateOnHotlinkVariables; setShadeVar(name: string, kind: CSSVariableKind, shade?: Shade): void; private defaultThemeListener; setCSSVarListener(name: string, cb?: VarListener): void; setVar(name: string, unit: string, kind: CSSVariableKind, value?: any): void; lkey(name: string): string; private cssName; /** * Call this if there is a 1-1 relationship between an input property 'prop' * and a generated output CSS variable (varName). * There must be no computation involved in order to generate the CSS * variable value from the value of the property. * Note: this means that the CSS variables are dynamically updated when the 'prop' * property is updated. * @param name The CSS variable name (without the leading --); * @param unit The unit that is appended to the value of the variable. * @param prop The input property from which the CSS variable value is derived */ addPropVar(name: string, unit: string, prop: Property, cb?: (propVar: CSSVariableKind) => void): void; /** * Call this when there is a more complicated relationship between input properties * and output CSS variables. * * @param name A unique name. * @param props Any number of properties which are monitored for changes before calling 'cb'. * @param cb The callback called each time all 'props' are initialized and any values change. */ addPropsVar(name: string, unit: string, props: Property[], cb: (propVar: CSSVariableKind) => void, opts?: { or?: boolean; }): void; } export declare class CSSVariableKind { readonly name: string; readonly unit: string; readonly props: Property[]; readonly cssGenerator: CSSGenerator; readonly componentKeys: string[]; constructor(name: string, unit: string, props: Property[], cssGenerator: CSSGenerator); setVar(name: string, value?: any): void; setVars(vars: { [name: string]: string; }): void; setShadeVar(name: string, shade?: Shade): void; setModeVars(type: string, lm: boolean, bmsg: ModeShadeGroups): void; private setGroupVars; setShadeVarRef(name: string, shade: Shade, core?: boolean): void; private addProp; } export declare class CSSDynamicVariableKind extends CSSVariableKind { private cb?; constructor(name: string, unit: string, props: Property[], cssGenerator: CSSGenerator, opts?: { or?: boolean; cb?: (propVar: CSSVariableKind) => void; }); private singlePropCallback; private multiplePropCallback; private setValue; } export declare class CSSVariable { name: string; unit: string; value?: any; kind: CSSVariableKind; constructor(name: string, unit: string, kind: CSSVariableKind, value?: any); } export type CSSVarGroupListener = (vg: CSSVarGroup) => void; export declare class CSSVarGroup implements IVarGroup { readonly name: string; readonly vars: { [name: string]: string; }; private listeners; constructor(name: string); setListener(key: string, listener?: CSSVarGroupListener): void; setVar(name: string, value?: string): void; notifyListeners(): void; }