import {capitalize} from '@revideo/core'; import type {Layout} from '../components'; export function defaultStyle( styleName: string, parse: (value: string) => T = value => value as T, ): PropertyDecorator { return (target: any, key) => { target[`getDefault${capitalize(key)}`] = function (this: Layout) { this.requestLayoutUpdate(); const old = (this.element.style)[styleName]; (this.element.style)[styleName] = ''; const ret = parse.call(this, this.styles.getPropertyValue(styleName)); (this.element.style)[styleName] = old; return ret; }; }; }