/** 样式单位 */ export declare enum StyleUnitEnum { percentage = "%", px = "px", em = "em", rem = "rem", vw = "vw", vh = "vh", vmax = "vmax", vmin = "vmin" } /** 样式属性通用值 */ export declare enum StyleBaseValueEnum { inherit = "inherit", initial = "initial", unset = "unset" } export declare enum TypeEnum { ID = "ID", Number = "NUMBER", Percentage = "PERCENTAGE", String = "STRING", Dimension = "DIMENSION", Hash = "HASH", Url = "URL", Sequence = "SEQUENCE", Expression = "EXPRESSION", Function = "FUNCTION", Declaration = "DECLARATION" } export interface PrimitiveVal { type: T; value: V; } export interface UnitVal extends PrimitiveVal { unit: string; } export interface IdentVal extends PrimitiveVal { type: TypeEnum.ID; value: string; vendorPrefix?: string; } export declare type NumberValue = PrimitiveVal; export interface PercentageVal extends PrimitiveVal { unit: StyleUnitEnum.percentage; } export declare type StringValue = PrimitiveVal; export interface DimensionValue extends PrimitiveVal { unit: string; } export declare type HashValue = PrimitiveVal; export interface UrlValue extends PrimitiveVal { name: IdentVal; } export declare type SequenceValue = PrimitiveVal; export interface Expression { type: TypeEnum.Expression; operator: string; lhs: NumberValue | PercentageVal | DimensionValue; rhs: NumberValue | PercentageVal | DimensionValue; } export interface FunctionValue extends PrimitiveVal { name: string | IdentVal; parameters: DeclarationValue; } export declare type DeclarationValue = IdentVal | NumberValue | PercentageVal | StringValue | DimensionValue | UrlValue | FunctionValue | SequenceValue; export interface Declaration { type: TypeEnum.Declaration; property: PrimitiveVal; value: DeclarationValue; }