export declare const QUICK_EVENT: { capture: boolean; passive: boolean; }; export declare const isBrowser: () => boolean; export declare const getByCSSModule: (key: string) => HTMLCollectionOf | never[]; export declare function debounce(callback: (...args: T) => void, delay: number): (this: unknown, ...args: T) => void; /** * attr * @description Utility to quickly get, set and remove attributes * @param el The Element to read/write attributes from * @param name The attribute name to get, set or remove, or a object to set multiple attributes * @param value A valid attribute value or null to remove attribute */ export declare const attr: (el: Element, name: string, value?: string | null) => string | null; /** * on * @param el The Element to use as EventTarget * @param types A space separated string of event types * @param listener An event listener function or listener object */ export declare const on: (el: Node | Window | ShadowRoot, ...rest: Parameters) => (() => void); /** * off * @param el The Element to use as EventTarget * @param types A space separated string of event types * @param listener An event listener function or listener object */ export declare const off: (el: Node | Window | ShadowRoot, ...rest: Parameters) => void; declare global { interface Window { _mtdsHotReloadCleanup?: Map void>>; } } /** * onHotReload * @description Runs a callback when window is loaded in browser, and ensures cleanup when hot-reloading * @param key The key to identify setup and corresponding cleanup * @param callback The callback to run when the page is ready */ export declare const onHotReload: (key: string, setup: () => Array<() => void>) => void; /** * Speed up MutationObserver by debouncing and only running when page is visible * @return new MutaionObserver */ export declare const onMutation: (el: Node, callback: (observer: MutationObserver) => void, options: MutationObserverInit) => () => void; export declare const toCustomElementProps: >(rest: T, klass?: string) => T & { suppressHydrationWarning: boolean; "aria-selected": boolean | undefined; class: string | undefined; hidden: boolean; open: boolean; }; /** * tag * @description creates element and assigns properties * @param tagName The tagname of element to create * @param attrs Optional attributes to add to the element * @param text Optional text content to add to the element * @return HTMLElement with props */ export declare const tag: (tagName: TagName, attrs?: Record | null, text?: string | null) => HTMLElementTagNameMap[TagName]; export declare const MTDSElement: { new (): HTMLElement; prototype: HTMLElement; }; /** * defineElement * @description Defines a customElement if running in browser and if not already registered */ export declare const defineElement: (name: string, instance: CustomElementConstructor) => true | void | CustomElementConstructor; /** * attachStyle * @param el The Element to scope styles for * @param css The css to inject */ export declare const SUPPORTS_CONSTRUCTED_CSS: false | CSSStyleSheet[]; export declare const attachStyle: (el: Element, css: string) => void;