UNPKG

@domx/dataelement

Version:

A DataElement base class for handling data state changes

36 lines 1.31 kB
import { EventMapListenAt } from "@domx/eventmap"; export { customDataElement, dataProperty }; export { event } from "@domx/eventmap/decorators"; export { EventMapListenAt }; interface CustomDataElementOptions { /** Sets which property is to be used as the stateId; default: stateId */ stateIdProperty?: string; /** * Sets the default event listener element for events; * can be "self", "parent", or "window"; * default: "self" */ eventsListenAt?: EventMapListenAt | string; } /** * A class decorator that defines the custom element with * `window.customElements.define` and tags the element name * for use in RootState. * * Options allow for setting `stateIdProperty` and `eventsListenAt`. * @param elementName {string} * @param options {CustomDataElementOptions} */ declare const customDataElement: (elementName: string, options?: CustomDataElementOptions) => (ctor: CustomElementConstructor) => void; interface DataPropertyOptions { changeEvent: string; } /** * A property decorator that tags a class property * as a state property. * * Options allow for setting the change event name. * @param options */ declare const dataProperty: (options?: DataPropertyOptions) => any; //# sourceMappingURL=decorators.d.ts.map