import type { GlobalState } from '../types'; declare let globalState: GlobalState; export default class BaseElement extends HTMLElement { label: string; storedProperties: Map; requiredProperties: (keyof this)[]; hasRequiredProps: boolean; propChangeHandlers: Map; delayedPropChangeHandlers: Map; queuedPropUpdates: Set; localState: { [key: string]: any; }; localStateChangeHandlers: Set; connectHandlers: Set; disconnectHandlers: Set; rafs: Map; timeouts: Map; reduceMotion: boolean; constructor(); /** * Connect */ connectedCallback(): void; disconnectedCallback(): void; /** * Register a callback to fire on connect */ onConnect(cb: Function): void; /** * Register a callback to fire on disconnect */ onDisconnect(cb: Function): void; /** * Register a callback to fire on resize */ onResize(context: Object, el: HTMLElement, cb: Function): void; /** * Register a callback to fire on intersection * * @param el - element to observe */ onIntersection(el: HTMLElement, cb: (entry: IntersectionObserverEntry) => void): void; /** * Register a callback to fire on loop * * @param callback - callback * @param minWait - min time between invocations */ onLoop(callback: (timeDelta: number) => void, minWait?: number): void; /** * @param handler - Will be called whenever a prop changes with a single object argument: {changedProp, oldValue, newValue} * @param props - An array of prop names to subscribe to * @param required - An array of props that must be set before any handlers are fired. All listed props are required by default or if set to null. No props are required if passed an empty array * @param setupFunction - A function to run after all required props are set. If this is defined, individual prop change handlers won't be fired during initial setup * @description * Register a callback to fire when a property changes. Undefined props in objects will be coerced to null */ onPropChange(handler: Function, props: Array, required?: Array | null, setupFunction?: Function | null): void; queueHandlers({ prop, oldValue, newValue, }: { prop: string | number | symbol; oldValue: unknown; newValue: unknown; }): void; runQueuedPropHandlers(): void; /** * @param val - Object to be merged with current shared state * @description - Update shared state */ updateLocalState(updates: { [key: string]: any; }): void; /** * @param handler - Will be passed an object when local state is updated: {changedProps, oldState, newState} * @description - Register a callback to fire on shared state change */ onLocalStateChange(handler: Function, defaultValue: { [key: string]: any; }): void; /** * @param val - Object to be merged with current shared state * @description - Update shared state */ updateGlobalState(val: Partial): void; /** * @param handler - Will be passed an object when global state is updated: {changedProps, oldState, newState} * @description - Register a callback to fire on shared state change */ onGlobalStateChange(handler: Function): void; /** * @description global keydown handler */ _globalHandleKeydown(evt: KeyboardEvent): void; /** * @description global mousedown handler */ _globalHandleMousedown(evt: MouseEvent): void; /** * @description global mousemove handler */ _globalHandleMousemove(evt: MouseEvent): void; /** * @description * Get global state value. This state object is shared between all elements across all widget instances on the page */ get globalState(): typeof globalState; /** * @description * Shared state cannot be set directly. Use this.updateGlobalState() instead. */ set globalState(val: never); /** * @param cb - callback function * @param id - An id for this raf. Can be used to cancel it with cancelRaf() * @description - requestAnimationFrame with cleanup */ raf(cb: Function, id: string, cancelPrev?: boolean): number; /** * @param id - id of the raf, set by previously called raf() * @description - Cancel a raf by id */ cancelRaf(id: string): void; /** * @param cb - callback function * @param delay - timeout delay * @param id - An id for this raf. Can be used to cancel it with cancelTo() * @description - setTimeout with cleanup */ to(cb: Function, delay: number, id: string): NodeJS.Timeout; /** * @param id - id of the timeout, set by previously called to() * @description - Cancel a timeout by id */ cancelTo(id: string): void; /** * @description * Log a warning if any required props aren't set in the same execution context that the element is created */ queueMissingPropsCheck(): void; } export {}; //# sourceMappingURL=BaseElement.d.ts.map