import { version } from '../package.json'; /** * A global namespace for `abort` event. */ export declare const abortEvent = "abort"; declare interface AbstractView { styleMedia: StyleMedia; document: Document; } /** * Add one or more CSS classes to `Element.classList`. * * @param element target * @param classNAME to add */ export declare const addClass: (element: Element, ...classNAME: string[]) => void; /** * A global namespace for 'addEventListener' string. */ declare const addEventListener_2 = "addEventListener"; export { addEventListener_2 as addEventListener } /** * Utility to add focus trap inside a designated target element; * @param target */ export declare const addFocusTrap: (target: Element) => void; /** * A global namespace for 'animationDelay' string. */ export declare const animationDelay = "animationDelay"; /** * A global namespace for 'animationDuration' string. */ export declare const animationDuration = "animationDuration"; /** * A global namespace for 'animationend' string. */ export declare const animationEndEvent = "animationend"; declare interface AnimationEvent_2 extends NativeEvent { animationName: string; elapsedTime: number; pseudoElement: string; } export { AnimationEvent_2 as AnimationEvent } export declare type AnimationEventHandler = EventHandler< T, AnimationEvent_2 >; /** * A global namespace for 'animationName' string. */ export declare const animationName = "animationName"; /** * A global namespace for aria-checked. */ export declare const ariaChecked = "aria-checked"; /** * A global namespace for aria-describedby. */ export declare const ariaDescribedBy = "aria-describedby"; /** * A global namespace for aria-description. */ export declare const ariaDescription = "aria-description"; /** * A global namespace for aria-expanded. */ export declare const ariaExpanded = "aria-expanded"; /** * A global namespace for aria-haspopup. */ export declare const ariaHasPopup = "aria-haspopup"; /** * A global namespace for aria-hidden. */ export declare const ariaHidden = "aria-hidden"; /** * A global namespace for aria-label. */ export declare const ariaLabel = "aria-label"; /** * A global namespace for aria-labelledby. */ export declare const ariaLabelledBy = "aria-labelledby"; /** * A global namespace for aria-modal. */ export declare const ariaModal = "aria-modal"; /** * A global namespace for aria-pressed. */ export declare const ariaPressed = "aria-pressed"; /** * A global namespace for aria-selected. */ export declare const ariaSelected = "aria-selected"; /** * A global namespace for aria-valuemax. */ export declare const ariaValueMax = "aria-valuemax"; /** * A global namespace for aria-valuemin. */ export declare const ariaValueMin = "aria-valuemin"; /** * A global namespace for aria-valuenow. */ export declare const ariaValueNow = "aria-valuenow"; /** * A global namespace for aria-valuetext. */ export declare const ariaValueText = "aria-valuetext"; /** * Shortie for `Array.from()` static method. * The utility should also work with any typed arrays * like Float64Array or Int32Array. * * @param arr array-like iterable object * @returns a new array from iterable object */ export declare const ArrayFrom: (arr: ArrayLike | Iterable) => T[]; declare interface BaseEvent { nativeEvent: E; currentTarget: C | null; target: T & EventTarget; bubbles: boolean; cancelable: boolean; defaultPrevented: boolean; eventPhase: number; isTrusted: boolean; preventDefault(): void; isDefaultPrevented(): boolean; stopPropagation(): void; isPropagationStopped(): boolean; persist(): void; timeStamp: number; type: string; } /** * A global namespace for `beforeunload` event. */ export declare const beforeunloadEvent = "beforeunload"; /** * A global namespace for predefined * CSS3 'cubic-bezier()' easing functions. */ export declare const bezierEasings: { linear: string; easingSinusoidalIn: string; easingSinusoidalOut: string; easingSinusoidalInOut: string; easingQuadraticIn: string; easingQuadraticOut: string; easingQuadraticInOut: string; easingCubicIn: string; easingCubicOut: string; easingCubicInOut: string; easingQuarticIn: string; easingQuarticOut: string; easingQuarticInOut: string; easingQuinticIn: string; easingQuinticOut: string; easingQuinticInOut: string; easingExponentialIn: string; easingExponentialOut: string; easingExponentialInOut: string; easingCircularIn: string; easingCircularOut: string; easingCircularInOut: string; easingBackIn: string; easingBackOut: string; easingBackInOut: string; }; /** * A global namespace for `blur` event. */ export declare const blurEvent = "blur"; export declare interface BoundingClientRect { width: number; height: number; top: number; left: number; right: number; bottom: number; x: number; y: number; } /** * Transform a string to camel case. * @param input source string */ export declare const camelCase: (input: string) => string; /** * Capitalize first character in a string. * @param input source string */ export declare const capitalize: (input: string) => string; export declare interface ChangeEvent extends FormEvent { target: EventTarget & T; } /** * A global namespace for `change` event. */ export declare const changeEvent = "change"; export declare type ChangeEventHandler = EventHandler< T, ChangeEvent >; declare interface ClipboardEvent_2 extends NativeEvent { clipboardData: DataTransfer; } export { ClipboardEvent_2 as ClipboardEvent } export declare type ClipboardEventHandler = EventHandler< T, ClipboardEvent_2 >; /** * Shortcut for `HTMLElement.closest` method which also works * with children of `ShadowRoot`. The order of the parameters * is intentional since they're both required. * * @see https://stackoverflow.com/q/54520554/803358 * * @param element target Element to check * @param selector the selector string * @return the query result */ export declare const closest: (element: T, selector: string) => T | null; declare interface CompositionEvent_2 extends NativeEvent { data: string; } export { CompositionEvent_2 as CompositionEvent } export declare type CompositionEventHandler = EventHandler< T, CompositionEvent_2 >; /** * A global namespace for `contextmenu` event. */ export declare const contextmenuEvent = "contextmenu"; /** * Returns a namespaced `CustomEvent` specific to each component. * * @param eventType Event.type * @param config Event.options | Event.properties * @returns a new namespaced event */ export declare const createCustomEvent: , T extends OriginalEvent>(eventType: string, config?: O) => T; /** * Shortie for `document.createElement` method * which allows you to create a new `HTMLElement` for a given `tagName` * or based on an object with specific non-readonly attributes with string values: * `id`, `className`, `textContent`, `style`, etc. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement * * @param param `tagName` or object * @return a new `HTMLElement` */ export declare const createElement: (param?: string | Partial) => T | undefined; /** * Shortie for `document.createElementNS` method * which allows you to create a new `Element` for a given `tagName` * or based on an object with specific non-readonly attributes with string values: * `id`, `className`, `textContent`, `style`, etc. * Note: some elements resulted from this function call may not be compatible with * some attributes. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS * * @param ns `namespaceURI` to associate with the new `Element` * @param param `tagName` or object * @return a new `Element` */ export declare const createElementNS: (ns: string, param?: string | Partial) => T | undefined; export declare interface CSS4Declaration extends Exclude<() => string | symbol, CSSStyleDeclaration> { [key: string]: string; } export declare interface CustomElement extends HTMLElement { shadowRoot: ShadowRoot; connectedCallback?: () => void; disconnectedCallback?: () => void; adoptedCallback?: () => void; attributeChangedCallback?: () => void; // [key: PropertyKey]: any; } /** * An interface for web components background data. * * @see https://github.com/thednp/bootstrap.native/blob/master/src/components/base-component.js */ export declare const Data: { data: Map>; /** * Sets web components data. * * @param element target element * @param component the component's name or a unique key * @param instance the component instance */ set: (element: Element, component: string, instance: T) => void; /** * Returns all instances for specified component. * * @param component the component's name or a unique key * @returns all the component instances */ getAllFor: (component: string) => Map | null; /** * Returns the instance associated with the target. * * @param element target element * @param component the component's name or a unique key * @returns the instance */ get: (element: Element, component: string) => T | null; /** * Removes web components data. * * @param element target element * @param component the component's name or a unique key */ remove: (element: Element, component: string) => void; }; /** * Shortcut for the `Element.dispatchEvent(Event)` method. * * @param element is the target * @param event is the `Event` object */ declare const dispatchEvent_2: (element: EventTarget, event: Event) => boolean; export { dispatchEvent_2 as dispatchEvent } /** * JavaScript `Array` distinct. * * @see https://codeburst.io/javascript-array-distinct-5edc93501dc4 * * @example * ``` * [0,1,1,2].filter(distinct) * // => [0,1,2] * ``` * @param value array item value * @param index array item index * @param arr a clone of the target array * @returns the query result */ export declare const distinct: (value: T, index: number, arr: T[]) => boolean; /** * A global namespace for `document.body`. */ export declare const documentBody: HTMLElement; /** * A global namespace for `document.documentElement` or the ``. */ export declare const documentElement: HTMLElement; /** * A global namespace for `document.head`. */ export declare const documentHead: HTMLHeadElement; /** * A global namespace for `DOMContentLoaded` event. */ export declare const DOMContentLoadedEvent = "DOMContentLoaded"; /** * A global namespace for `DOMMouseScroll` event. */ export declare const DOMMouseScrollEvent = "DOMMouseScroll"; /** * A global namespace for `dragend` event. */ export declare const dragendEvent = "dragend"; /** * A global namespace for `dragenter` event. */ export declare const dragenterEvent = "dragenter"; /** * A global namespace for `drag` event. */ export declare const dragEvent = "drag"; declare interface DragEvent_2 extends MouseEvent_2 { dataTransfer: DataTransfer; } export { DragEvent_2 as DragEvent } export declare type DragEventHandler = EventHandler< T, DragEvent_2 >; /** * A global namespace for `dragleave` event. */ export declare const dragleaveEvent = "dragleave"; /** * A global namespace for `dragover` event. */ export declare const dragoverEvent = "dragover"; /** * A global namespace for `dragstart` event. */ export declare const dragstartEvent = "dragstart"; /** * Utility to make sure callbacks are consistently * called when animation ends. * * @param element target * @param handler `animationend` callback */ export declare const emulateAnimationEnd: (element: Element, handler: EventListener) => void; /** * Utility to make sure callbacks are consistently * called when transition ends. * * @param element element target * @param handler `transitionend` callback */ export declare const emulateTransitionEnd: (element: Element, handler: EventListener) => void; /** * A global namespace for `error` event. */ export declare const errorEvent = "error"; declare type EventHandler< T extends EventTarget = HTMLElement, E = Event | NativeEvent, > = (event: E) => void; /** * Shortcut for `Float32Array.from()` static method. * * @param arr array-like iterable object * @returns a new Float32Array */ export declare const Float32ArrayFrom: (arr: ArrayLike | Iterable) => Float32Array; /** * Shortcut for `Float64Array.from()` static method. * * @param arr array-like iterable object * @returns a new Float64Array */ export declare const Float64ArrayFrom: (arr: ArrayLike | Iterable) => Float64Array; declare type Fn = (...args: unknown[]) => unknown; /** * Shortie for `HTMLOrSVGElement.focus()` method. * * @param element is the target * @param options allows to pass additional options such as `preventScroll: boolean` */ declare const focus_2: (element: HTMLOrSVGElement, options?: FocusOptions) => void; export { focus_2 as focus } export declare type FocusableElement = HTMLAnchorElement | HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLDataListElement | HTMLDetailsElement | HTMLSelectElement; export declare const focusableSelector = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]"; /** * A global namespace for `focus` event. */ export declare const focusEvent = "focus"; declare interface FocusEvent_2< T extends EventTarget = HTMLElement, R extends Element = HTMLElement, > extends NativeEvent { relatedTarget: (EventTarget & R) | null; target: EventTarget & T; } export { FocusEvent_2 as FocusEvent } export declare type FocusEventHandler = EventHandler< T, FocusEvent_2 >; /** * A global namespace for focus event names. */ export declare const focusEvents: { in: string; out: string; }; /** * A global namespace for `focusin` event. */ export declare const focusinEvent = "focusin"; /** * A global namespace for `focusout` event. */ export declare const focusoutEvent = "focusout"; declare type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; export declare type FormEvent = NativeEvent; export declare type FormEventHandler = EventHandler< T, FormEvent >; /** * A global namespace for `gesturechange` event. */ export declare const gesturechangeEvent = "gesturechange"; /** * A global namespace for `gestureend` event. */ export declare const gestureendEvent = "gestureend"; /** * A global namespace for `gesturestart` event. */ export declare const gesturestartEvent = "gesturestart"; /** * Shortcut for `Element.getAttribute()` method. * * @param element target element * @param att attribute name * @returns attribute value */ export declare const getAttribute: (element: Element, att: string) => string | null; /** * Shortcut for `Element.getAttributeNS()` method. * * @param ns attribute namespace * @param element target element * @param att attribute name * @returns attribute value */ export declare const getAttributeNS: (ns: string, element: Element, att: string) => string | null; /** * Returns the bounding client rect of a target `Element`. * * @see https://github.com/floating-ui/floating-ui * * @param element event.target * @param includeScale when *true*, the target scale is also computed * @returns the bounding client rect object */ export declare const getBoundingClientRect: (element: Element, includeScale?: boolean) => BoundingClientRect; /** * Returns an `Array` of `Node` elements that are registered as * `CustomElement`. * * @see https://stackoverflow.com/questions/27334365/how-to-get-list-of-registered-custom-elements * * @param parent parent to look into * @returns the query result */ export declare const getCustomElements: (parent?: ParentNode) => CustomElement[]; /** * Returns the `document` or the `#document` element. * * @see https://github.com/floating-ui/floating-ui * * @param node the reference node * @returns the parent document of the given node */ export declare const getDocument: (node?: Node | Document | Window) => Document; /** * Returns the `document.body` or the `` element. * * @param node the reference node * @returns the parent `` of the specified node */ export declare const getDocumentBody: (node?: Node | Document | Window) => HTMLElement; /** * Returns the `document.documentElement` or the `` element. * * @param node the reference node * @returns the parent `` of the node's parent document */ export declare const getDocumentElement: (node?: Node | Document | Window) => HTMLElement; /** * Returns the `document.head` or the `` element. * * @param node the reference node * @returns the `` of the node's parent document */ export declare const getDocumentHead: (node?: Node | Document | Window) => HTMLHeadElement; /** * Utility to get the computed `animationDelay` * from Element in miliseconds. * * @param element target * @return the `animationDelay` value in miliseconds */ export declare const getElementAnimationDelay: (element: Element) => number; /** * Utility to get the computed `animationDuration` * from `Element` in miliseconds. * * @param element target * @return the `animationDuration` value in miliseconds */ export declare const getElementAnimationDuration: (element: Element) => number; /** * Returns an `HTMLElement` that matches the id in the document. * Within multiple