import { Descriptor } from 'hybrids'; /** * An observer executing each passed observer in sequence * ``` * define({ * color: { * value: 'red', * observe: forEach( * cssVar('--my-element-color'), * cssVar('--my-element-color-complement', (val, host) => complementaryColor(value)), * ), * }, * }) * ``` * @category Descriptor:Observe * @typeParam E - host element type * @typeParam V - property value type * @param observers a list of 'observe' Descriptor functions to execute * @returns An 'observe' Descriptor function */ export declare const forEach: (...observers: Descriptor["observe"][]) => NonNullable["observe"]>; /** * An observer which reflects the current property value to a custom CSS property on the host element. * ``` * define({ * color: { value: 'red', observe: cssVar('--my-element-color') }, * }) * ``` * @category Descriptor:Observe * @typeParam E - host element type * @typeParam V - property value type * @param customProperty CSS custom property name * @param transform am optional function converting the JS to CSS value * @returns An 'observe' Descriptor function */ export declare const cssVar: (customProperty: string, transform?: (val: V, host: E) => any) => NonNullable["observe"]>; /** * Runs the observe function only when the current value is non-nullish. * ``` * define({ * property: { * ...getset(undefined), * observe: nnull(cssVar(--custom-property)), * }, * }) * ``` * @category Descriptor:Observe * @typeParam E - host element type * @typeParam V - property value type * @param observe 'observe' function to execute when the value is not null or undefined * @param nullCallback optional 'observe' function when the value is nullish * @returns an 'observe' Descriptor */ export declare function nnull(observe: Descriptor['observe'], nullCallback?: Descriptor['observe']): NonNullable['observe']>; /** * Runs the observe function only when the current value is truthy. * ``` * define({ * property: { * ...getset(''), // will not run on initial set * observe: truthy(cssVar(--custom-property)), * }, * }) * ``` * @category Descriptor:Observe * @typeParam E - host element type * @typeParam V - property value type * @param observe 'observe' function to execute when the value is truthy * @param nullCallback optional 'observe' function when the value is falsy * @returns an 'observe' Descriptor */ export declare function truthy(observe: Descriptor['observe'], nullCallback?: Descriptor['observe']): NonNullable['observe']>;