import { CSSUnitValue } from './cssom/CSSNumericValue'; import type { PropertySyntax } from './interfaces'; // import { layoutRegistry, styleValueRegistry } from '../contants'; import { runtime } from '../global-runtime'; /** * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty#parameters */ import { styleValueRegistry } from '../globalContants/styleValueRegistryContant' export interface PropertyDefinition { name: string; /** * representing the expected syntax of the defined property. Defaults to "*". */ syntax: PropertySyntax; /** * A boolean value defining whether the defined property should be inherited (true), or not (false). Defaults to false. */ inherits?: boolean; interpolable?: boolean; initialValue?: string; } /** * holds useful CSS-related methods. * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS * * * CSS Typed OM @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions * * register property @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty * * CSS Layout API */ export const CSS = { /** * * @see https://drafts.csswg.org/css-values-4/#number-value */ number: (n: number) => { return new CSSUnitValue(n); }, /** * * @see https://drafts.csswg.org/css-values-4/#percentage-value */ percent: (n: number) => { return new CSSUnitValue(n, '%'); }, /** * */ px: (n: number) => { return new CSSUnitValue(n, 'px'); }, /** * */ em: (n: number) => { return new CSSUnitValue(n, 'em'); }, rem: (n: number) => { return new CSSUnitValue(n, 'rem'); }, /** * */ deg: (n: number) => { return new CSSUnitValue(n, 'deg'); }, /** * */ grad: (n: number) => { return new CSSUnitValue(n, 'grad'); }, /** * */ rad: (n: number) => { return new CSSUnitValue(n, 'rad'); }, /** * */ turn: (n: number) => { return new CSSUnitValue(n, 'turn'); }, /** *