{ "version": 3, "sources": ["../src/index.ts", "../src/utils.ts", "../src/core.ts", "../src/modules/css/classes.ts", "../src/modules/css/styles.ts", "../src/modules/css/index.ts", "../src/modules/events/binding.ts", "../src/modules/events/mouse.ts", "../src/modules/events/lifecycle.ts", "../src/modules/events/keyboard.ts", "../src/modules/events/form.ts", "../src/modules/events/touch.ts", "../src/modules/events/index.ts", "../src/modules/dom/attributes.ts", "../src/modules/dom/content.ts", "../src/modules/http/get.ts", "../src/modules/dom/manipulation.ts", "../src/modules/dom/traversal.ts", "../src/modules/dom/states.ts", "../src/modules/dom/index.ts", "../src/modules/effects/slide.ts", "../src/modules/effects/vertical.ts", "../src/modules/effects/fade.ts", "../src/modules/effects/index.ts", "../src/modules/http/post.ts", "../src/modules/http/upload.ts", "../src/modules/http/index.ts", "../src/modules/data/arrays.ts", "../src/modules/data/objects.ts", "../src/modules/data/index.ts"], "sourcesContent": ["/**\r\n * @file src/index.ts\r\n * @version 2.3.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio \r\n * @category Entry Point\r\n * @description\r\n * * Main library entry point. Aggregates Core, Types, Utils, and all functional modules into a single export.\r\n * @requires ./core\r\n * * Core class logic and inheritance.\r\n * @requires ./types\r\n * * TypeScript type definitions and interfaces.\r\n * @requires ./utils\r\n * * Helper functions (throttle, debounce).\r\n * @requires ./modules/css\r\n * * Style manipulation methods.\r\n * @requires ./modules/events\r\n * * Event handling logic.\r\n * @requires ./modules/dom\r\n * * DOM traversal and manipulation.\r\n * @requires ./modules/effects\r\n * * Visual effects and animations.\r\n * @requires ./modules/http\r\n * * HTTP client for AJAX requests.\r\n * @requires ./modules/data\r\n * * Data structure utilities.\r\n */\r\n\r\nimport { jBase as JBaseClass } from './core';\r\nimport { JBaseInput, JBaseCSSProperty, JBaseEventMap, JBaseElement } from './types';\r\nimport { cssMethods } from './modules/css';\r\nimport { eventMethods } from './modules/events';\r\nimport { domMethods } from './modules/dom';\r\nimport { effectMethods } from './modules/effects';\r\nimport { http } from './modules/http';\r\nimport { data } from './modules/data';\r\nimport { debounce, each, throttle } from './utils';\r\n\r\nObject.assign(JBaseClass.prototype, cssMethods);\r\nObject.assign(JBaseClass.prototype, eventMethods);\r\nObject.assign(JBaseClass.prototype, domMethods);\r\nObject.assign(JBaseClass.prototype, effectMethods);\r\n\r\n/**\r\n * * TypeScript Declaration Merging.\r\n */\r\ndeclare module './core' {\r\n interface jBase {\r\n /**\r\n * * Adds one or more CSS classes to the selected elements.\r\n * @example addClass('active', 'highlight'); => Adds the 'active' and 'highlight' classes to all selected elements.\r\n * @param classNames One or more class names to be added.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n addClass(...classNames: string[]): jBase;\r\n\r\n /**\r\n * * Removes one or more CSS classes from the selected elements.\r\n * @example removeClass('active', 'highlight'); => Removes the 'active' and 'highlight' classes from all selected elements.\r\n * @param classNames One or more class names to be removed.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n removeClass(...classNames: string[]): jBase;\r\n\r\n /**\r\n * * Toggles a CSS class (adds if missing, removes if present).\r\n * @example toggleClass('active'); => Toggles the 'active' class on all selected elements.\r\n * @param className The class name to toggle.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n toggleClass(className: string): jBase;\r\n\r\n /**\r\n * * Checks if at least one of the selected elements has the specified class.\r\n * @example hasClass('active'); => Checks if at least one selected element has the 'active' class.\r\n * @param className The class name to check for.\r\n * @returns True if the class exists on at least one element, otherwise false.\r\n */\r\n hasClass(className: string): boolean;\r\n\r\n /**\r\n * * Sets a CSS property for all selected elements.\r\n * @example css('color', 'red'); => Sets the 'color' style to 'red' for all selected elements.\r\n * @param property The CSS property name (camelCase).\r\n * @param value The value to set.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n css(property: JBaseCSSProperty, value: string | number): jBase;\r\n\r\n /**\r\n * * Gets the computed CSS value of the first element.\r\n * @example css('color'); => Returns the computed 'color' value of the first selected element.\r\n * @param property The CSS property name (camelCase).\r\n * @returns The computed value as a string.\r\n */\r\n css(property: JBaseCSSProperty): string;\r\n\r\n /**\r\n * * Sets multiple CSS properties for all selected elements using an object.\r\n * @example css({ color: 'red', backgroundColor: 'blue' }); => Sets the 'color' to 'red' and 'background-color' to 'blue' for all selected elements.\r\n * @param properties An object containing CSS property-value pairs.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n css(properties: Record): jBase;\r\n\r\n /**\r\n * Iterates over the jBase collection in a highly performant manner.\r\n * Returning `false` within the callback breaks the loop early.\r\n * @example each((el, index) => { console.log(el); if (index === 5) return false; }); => Logs the first 6 matched elements to the console.\r\n * @param callback The function to execute for each element.\r\n * The context (`this`)\r\n * The first argument (`el`) are set to the current DOM element.\r\n * The second argument (`index`) provides the current loop index.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n each(callback: (this: JBaseElement, el: JBaseElement, index: number) => boolean | void): jBase;\r\n\r\n /**\r\n * * Registers a typed event listener.\r\n * @example on('click', event => { console.log(event); }); => Attaches a click event listener that logs the event object.\r\n * @param event The event name (e.g., 'click').\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n on(event: K, handler: (event: JBaseEventMap[K]) => void): jBase;\r\n\r\n /**\r\n * * Attaches an event handler function for one or more events to the selected elements.\r\n * @example on('click', handler) => Binds a click event handler to all matched elements.\r\n * @param events One or more space-separated event types (e.g., 'click', 'mouseenter mouseleave').\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, handler: (event: any) => void): jBase;\r\n \r\n /**\r\n * * Attaches an event handler to the selected elements, passing custom data to the event object.\r\n * @example on('click', { key: 'value' }, handler) => Binds a click event handler and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, data: any, handler: (event: any) => void): jBase;\r\n \r\n /**\r\n * * Attaches a delegated event handler. The handler is only executed if the event target matches the given selector.\r\n * * Highly performant for observing dynamically added child elements.\r\n * @example on('click', '.btn', handler) => Binds a click event handler to all current and future elements matching '.btn' within the matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string to filter the descendants of the selected elements.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, selector: string, handler: (event: any) => void): jBase;\r\n \r\n /**\r\n * * Attaches a delegated event handler and passes custom data to the event object.\r\n * @example on('click', '.btn', { key: 'value' }, handler) => Binds a click event handler to all current and future elements matching '.btn' and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string to filter the descendants of the selected elements.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, selector: string, data: any, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Removes a typed event listener.\r\n * @example off('click', handler) => Removes a click event handler from all matched elements.\r\n * @param event The event name.\r\n * @param handler The exact reference of the handler to remove.\r\n * @returns The current jBase instance.\r\n */\r\n off(event: K, handler: (event: JBaseEventMap[K]) => void): jBase;\r\n\r\n /**\r\n * * Removes all or a specific event listener.\r\n * @example off('click') => Removes all click event handlers from all matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param handler (Optional) The specific handler to remove.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n off(events: string, handler?: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Removes a delegated event listener.\r\n * @example off('click', '.btn', handler) => Removes a delegated click event handler from all matched elements for the specified selector.\r\n * @param events One or more space-separated event types.\r\n * @param selector The CSS selector string originally used for delegation.\r\n * @param handler (Optional) The specific handler to remove.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n off(events: string, selector: string, handler?: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a typed event listener that executes only once.\r\n * @example once('click', event => { console.log(event); }); => Attaches a click event listener that executes only once and logs the event object.\r\n * @param event The event name.\r\n * @param handler The exact reference of the handler.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(event: K, handler: (event: JBaseEventMap[K]) => void): jBase;\r\n\r\n /**\r\n * * Registers an event listener that executes only once.\r\n * @example once('click', handler) => Binds a click event handler that executes only once for all matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a one-time listener with custom data.\r\n * @example once('click', { key: 'value' }, handler) => Binds a click event handler that executes only once and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, data: any, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a one-time listener with event delegation.\r\n * @example once('click', '.btn', handler) => Binds a click event handler that executes only once for all current and future elements matching '.btn' within the matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string for event delegation.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, selector: string, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a one-time listener with event delegation and custom data.\r\n * @example once('click', '.btn', { key: 'value' }, handler) => Binds a click event handler that executes only once for all current and future elements matching '.btn' and passes custom data to the event object.\r\n * @example once('click', { key: 'value' }, handler) => Binds a click event handler that executes only once and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string for event delegation.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, selector: string, data: any, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Triggers an event on each element in the collection.\r\n * @example trigger('customEvent') => Triggers 'customEvent' on all matched elements.\r\n * @example trigger('customEvent', { key: 'value' }) => Triggers 'customEvent' on all matched elements and passes custom data to the event object.\r\n * @example trigger('click') => Programmatically triggers a click event on all matched elements.\r\n * @example trigger('click', { key: 'value' }) => Programmatically triggers a click event on all matched elements and passes custom data to the event object.\r\n * @param eventName The name of the event to trigger.\r\n * @param data Optional data to pass to the event (accessible via event.detail).\r\n * @returns The current jBase instance.\r\n */\r\n trigger(eventName: string, data?: any): jBase;\r\n\r\n /**\r\n * * Triggers the 'click' event or binds a handler.\r\n * @example click() => Triggers the 'click' event on all matched elements.\r\n * @example click(handler) => Binds a click event handler to all matched elements.\r\n * @param handler (Optional) The function to execute on click.\r\n * @returns The current jBase instance.\r\n */\r\n click(handler?: (event: Event) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mousemove' event.\r\n * @example mousemove(handler) => Binds a mousemove event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mousemove(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseleave' event.\r\n * @example mouseleave(handler) => Binds a mouseleave event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseleave(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseenter' event.\r\n * @example mouseenter(handler) => Binds a mouseenter event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseenter(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mousedown' event.\r\n * @example mousedown(handler) => Binds a mousedown event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mousedown(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseup' event.\r\n * @example mouseup(handler) => Binds a mouseup event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseup(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Triggers the 'dblclick' event or binds a handler.\r\n * @example dblclick() => Triggers the 'dblclick' event on all matched elements.\r\n * @example dblclick(handler) => Binds a dblclick event handler to all matched elements.\r\n * @param handler (Optional) The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n dblclick(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseout' event.\r\n * @example mouseout(handler) => Binds a mouseout event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseout(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseover' event.\r\n * @example mouseover(handler) => Binds a mouseover event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseover(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds handlers to both 'mouseenter' and 'mouseleave' events.\r\n * @example hover(handlerIn, handlerOut) => Binds handlerIn to mouseenter and handlerOut to mouseleave for all matched elements.\r\n * @param handlerIn Executed on mouseenter.\r\n * @param handlerOut Executed on mouseleave.\r\n * @returns The current jBase instance.\r\n */\r\n hover(handlerIn: (event: MouseEvent) => void, handlerOut: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'keydown' event\r\n * @example keydown(handler) => Binds a keydown event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n keydown(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'keyup' event.\r\n * @example keyup(handler) => Binds a keyup event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n keyup(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'keypress' event (Deprecated).\r\n * @deprecated Use keydown instead.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n keypress(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler that fires only when a specific key is pressed.\r\n * @example pressedKey(handler) => Binds a handler that executes only when a specific key is pressed.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n pressedKey(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'submit' event.\r\n * @example submit(handler) => Binds a submit event handler to all matched forms.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n submit(handler: (event: SubmitEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'change' event.\r\n * @example change(handler) => Binds a change event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n change(handler: (event: Event) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'input' event (real-time).\r\n * @example input(handler) => Binds an input event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n input(handler: (event: Event) => void): jBase;\r\n\r\n /**\r\n * * Sets focus on the element.\r\n * @example focus() => Sets focus on the element.\r\n * @returns The current jBase instance.\r\n */\r\n focus(): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'focus' event.\r\n * @example focus(handler) => Binds a focus event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n focus(handler: (event: FocusEvent) => void): jBase;\r\n\r\n /**\r\n * * Removes focus from the element.\r\n * @example blur() => Removes focus from the element.\r\n * @returns The current jBase instance.\r\n */\r\n blur(): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'blur' event.\r\n * @example blur(handler) => Binds a blur event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n blur(handler: (event: FocusEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchstart' event.\r\n * @example touchstart(handler) => Binds a touchstart event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchstart(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchend' event.\r\n * @example touchend(handler) => Binds a touchend event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchend(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchmove' event.\r\n * @example touchmove(handler) => Binds a touchmove event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchmove(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchcancel' event.\r\n * @example touchcancel(handler) => Binds a touchcancel event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchcancel(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeLeft' gesture.\r\n * @example swipeLeft(handler) => Binds a swipeLeft gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeLeft(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeRight' gesture.\r\n * @example swipeRight(handler) => Binds a swipeRight gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeRight(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeDown' gesture.\r\n * @example swipeDown(handler) => Binds a swipeDown gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeDown(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeUp' gesture.\r\n * @example swipeUp(handler) => Binds a swipeUp gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeUp(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Gets the HTML content of the first element.\r\n * @example html() => Returns the HTML content of the first matched element as a string.\r\n * @returns The HTML content as a string.\r\n */\r\n html(): string;\r\n \r\n /**\r\n * * Gets the HTML content of the first element, or sets the HTML content of all matched elements.\r\n * @example html() => Returns the innerHTML of the first element.\r\n * @example html('
New
') => Sets safe HTML for all matched elements.\r\n * @example html('', { executeScripts: true }) => Injects and executes scripts.\r\n * @param content The HTML string to set. If undefined, acts as a getter.\r\n * @param options Security and execution options.\r\n * @returns HTML string (getter) or the current jBase instance (setter).\r\n */\r\n html(content: string, options?: { executeScripts?: boolean }): jBase;\r\n\r\n /**\r\n * * Gets the text content of the first element.\r\n * @example text() => Returns the text content of the first matched element as a string.\r\n * @returns The text content as a string.\r\n */\r\n text(): string;\r\n /**\r\n * * Sets the text content of all selected elements (safe against XSS).\r\n * @example text('New text content') => Sets the text content of all matched elements to 'New text content'.\r\n * @param content The new text content.\r\n * @returns The current jBase instance.\r\n */\r\n text(content: string): jBase;\r\n\r\n /**\r\n * * Loads HTML from a server and injects it into the matched elements.\r\n * @example $('#content').load('/pages/about.html')\r\n * @example $('#content').load('/pages/widget.html', { executeScripts: true })\r\n * @param url The URL to fetch the HTML from.\r\n * @param options Fetch options extended with jBase specific settings (e.g., executeScripts).\r\n * @returns A Promise resolving to the current jBase instance.\r\n */\r\n load(url: string, options?: RequestInit & { executeScripts?: boolean }): Promise;\r\n\r\n /**\r\n * * Gets an attribute value from the first element.\r\n * @example attr('href') => Returns the value of the 'href' attribute from the first matched element or null if it doesn't exist.\r\n * @param name The name of the attribute.\r\n * @returns The attribute value or null.\r\n */\r\n attr(name: string): string | null;\r\n\r\n /**\r\n * * Sets an attribute for all selected elements.\r\n * @example attr('data-id', '123') => Sets the 'data-id' attribute to '123' for all matched elements.\r\n * @param name The name of the attribute.\r\n * @param value The value to set.\r\n * @returns The current jBase instance.\r\n */\r\n attr(name: string, value: string): jBase;\r\n\r\n /**\r\n * * Gets the value of the first form element.\r\n * @example val() => Returns the current value of the first matched form element as a string.\r\n * @returns The value as a string.\r\n */\r\n val(): string;\r\n\r\n /**\r\n * * Sets the value for all selected form elements.\r\n * @example val('New value') => Sets the value of all matched form elements to 'New value'.\r\n * @param value The value to set.\r\n * @returns The current jBase instance.\r\n */\r\n val(value: string | number): jBase;\r\n\r\n /**\r\n * * Gets a property from the first element.\r\n * * Useful for DOM properties that don't directly map to HTML attributes.\r\n * @example prop('checked') => Returns the checked property of the first matched element (true or false).\r\n * @param name The name of the property (e.g., 'checked', 'disabled').\r\n * @returns The property value.\r\n */\r\n prop(name: string): any;\r\n\r\n /**\r\n * * Sets a property for all selected elements.\r\n * @example prop('checked', true) => Sets the checked property to true for all matched elements.\r\n * @param name The name of the property.\r\n * @param value The value to set.\r\n * @returns The current jBase instance.\r\n */\r\n prop(name: string, value: any): jBase;\r\n\r\n /**\r\n * * Removes an attribute from all selected elements.\r\n * @example removeAttr('data-id') => Removes the 'data-id' attribute from all matched elements.\r\n * @param name The name of the attribute to remove.\r\n * @returns The current jBase instance.\r\n */\r\n removeAttr(name: string): jBase;\r\n\r\n /**\r\n * * Replaces elements with a deep clone of themselves (removes listeners).\r\n * @example replaceWithClone() => Replaces each matched element with a deep clone of itself, effectively removing all event listeners and data.\r\n * @returns The current jBase instance.\r\n */\r\n replaceWithClone(): jBase;\r\n\r\n /**\r\n * * Removes all selected elements from the DOM.\r\n * @example remove() => Removes all matched elements from the DOM.\r\n * @returns The current jBase instance.\r\n */\r\n remove(): jBase;\r\n\r\n /**\r\n * * Removes all child nodes from the selected elements.\r\n * @example empty() => Removes all child nodes from each matched element, leaving the elements themselves intact.\r\n * @returns The current jBase instance.\r\n */\r\n empty(): jBase;\r\n\r\n /**\r\n * * Finds the closest ancestor matching the selector.\r\n * @example closest('.container') => For each matched element, returns the closest ancestor that matches the '.container' selector.\r\n * @param selector The CSS selector to match.\r\n * @returns A new jBase instance containing the ancestor.\r\n */\r\n closest(selector: string): jBase;\r\n\r\n /**\r\n * * Executes the handler when the DOM is fully loaded.\r\n * @example ready(() => { console.log('DOM is ready'); }); => Executes the provided function when the DOM is fully loaded.\r\n * @param handler The function to execute.\r\n * @returns The current jBase instance.\r\n */\r\n ready(handler: () => void): jBase;\r\n\r\n /**\r\n * * Inserts content at the end of the selected elements (inside).\r\n * @example append('New content') => Appends a new element with 'New content' inside each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n append(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Inserts content at the beginning of the selected elements (inside).\r\n * @example prepend('New content') => Prepends a new element with 'New content' inside each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n prepend(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Inserts content before the selected elements (outside).\r\n * @example before('New content') => Inserts a new element with 'New content' before each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n before(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Inserts content after the selected elements (outside).\r\n * @example after('New content') => Inserts a new element with 'New content' after each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n after(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Replaces the selected elements with new content.\r\n * @example replaceWith('New content') => Replaces each matched element with a new element containing 'New content'.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n replaceWith(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Appends the selected elements to a target.\r\n * @example appendTo('#container') => Appends all matched elements to the element with id 'container'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n appendTo(target: string | Element): jBase;\r\n\r\n /**\r\n * * Prepends the selected elements to a target.\r\n * @example prependTo('#container') => Prepends all matched elements to the element with id 'container'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n prependTo(target: string | Element): jBase;\r\n\r\n /**\r\n * * Inserts the selected elements before a target.\r\n * @example insertBefore('#target') => Inserts all matched elements before the element with id 'target'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n insertBefore(target: string | Element): jBase;\r\n\r\n /**\r\n * * Inserts the selected elements after a target.\r\n * @example insertAfter('#target') => Inserts all matched elements after the element with id 'target'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n insertAfter(target: string | Element): jBase;\r\n\r\n /**\r\n * * Wraps each selected element with the specified HTML structure.\r\n * @example wrap('
') => Wraps each matched element with a
element having the class 'wrapper'.\r\n * @param wrapperHtml The HTML string for the wrapper.\r\n * @returns The current jBase instance.\r\n */\r\n wrap(wrapperHtml: string): jBase;\r\n\r\n /**\r\n * * Removes the direct parent of the selected elements.\r\n * @example unwrap() => Removes the direct parent of each matched element, effectively unwrapping it from its parent.\r\n * @returns The current jBase instance.\r\n */\r\n unwrap(): jBase;\r\n\r\n /**\r\n * * Gets the direct parents.\r\n * @example parent() => Gets the direct parent of each matched element.\r\n * @returns A new jBase instance with parents.\r\n */\r\n parent(): jBase;\r\n\r\n /**\r\n * * Gets the direct children.\r\n * @example children() => Gets the direct children of each matched element.\r\n * @example children('.filter') => Gets the direct children of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance with children.\r\n */\r\n children(selector?: string): jBase;\r\n\r\n /**\r\n * * Finds descendants matching the selector (deep).\r\n * @example find('.item') => Finds all descendant elements matching the '.item' selector for each matched element.\r\n * @param selector CSS selector to find.\r\n * @returns A new jBase instance.\r\n */\r\n findAll(selector: string): jBase;\r\n\r\n /**\r\n * * Gets all descendants recursively.\r\n * @example descendants() => Gets all descendant elements of each matched element, regardless of depth.\r\n * @returns A new jBase instance.\r\n */\r\n descendants(): jBase;\r\n\r\n /**\r\n * * Gets descendants recursively until a selector is met.\r\n * @example descendantsUntil('.stop') => Gets all descendant elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example descendantsUntil('.stop', '.filter') => Gets all descendant elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param untilSelector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n descendantsUntil(untilSelector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Gets all ancestors up to the root.\r\n * @example parents() => Gets all ancestor elements of each matched element, up to the document root.\r\n * @example parents('.filter') => Gets all ancestor elements of each matched element, up to the document root, filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n parents(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all ancestors until a selector is met.\r\n * @example parentsUntil('.stop') => Gets all ancestor elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example parentsUntil('.stop', '.filter') => Gets all ancestor elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param selector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n parentsUntil(selector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Gets the immediately following sibling.\r\n * @example next() => Gets the immediately following sibling of each matched element.\r\n * @example next('.filter') => Gets the immediately following sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n next(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets the immediately preceding sibling.\r\n * @example prev() => Gets the immediately preceding sibling of each matched element.\r\n * @example prev('.filter') => Gets the immediately preceding sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prev(selector?: string): jBase;\r\n\r\n /**\r\n * * Alias for `next()`.\r\n * @example sibling() => Gets the immediately following sibling of each matched element.\r\n * @example sibling('.filter') => Gets the immediately following sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n sibling(selector?: string): jBase;\r\n\r\n /**\r\n * * Alias for `next()`.\r\n * @example nextSibling() => Gets the immediately following sibling of each matched element.\r\n * @example nextSibling('.filter') => Gets the immediately following sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n nextSibling(selector?: string): jBase;\r\n\r\n /**\r\n * * Alias for `prev()`.\r\n * @example prevSibling() => Gets the immediately preceding sibling of each matched element.\r\n * @example prevSibling('.filter') => Gets the immediately preceding sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prevSibling(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all following siblings.\r\n * @example nextAll() => Gets all following siblings of each matched element.\r\n * @example nextAll('.filter') => Gets all following siblings of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n nextAll(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all preceding siblings.\r\n * @example prevAll() => Gets all preceding siblings of each matched element.\r\n * @example prevAll('.filter') => Gets all preceding siblings of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prevAll(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all siblings (prev and next).\r\n * @example siblings() => Gets all siblings (both previous and next) of each matched element.\r\n * @example siblings('.filter') => Gets all siblings of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n siblings(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets following siblings until a selector is met.\r\n * @example nextUntil('.stop') => Gets all following siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example nextUntil('.stop', '.filter') => Gets all following siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param untilSelector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n nextUntil(untilSelector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Gets preceding siblings until a selector is met.\r\n * @example prevUntil('.stop') => Gets all preceding siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example prevUntil('.stop', '.filter') => Gets all preceding siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param untilSelector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prevUntil(untilSelector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Reduces the set to the element at the index.\r\n * @example eq(0) => Reduces the set to the first element.\r\n * @example eq(-1) => Reduces the set to the last element.\r\n * @param index Index (negative values count from the end).\r\n * @returns A new jBase instance.\r\n */\r\n eq(index: number): jBase;\r\n\r\n /**\r\n * * Reduces the set to the first element.\r\n * @example first() => Reduces the set to the first element.\r\n * @returns A new jBase instance.\r\n */\r\n first(): jBase;\r\n\r\n /**\r\n * * Reduces the set to the last element.\r\n * @example last() => Reduces the set to the last element.\r\n * @returns A new jBase instance.\r\n */\r\n last(): jBase;\r\n\r\n /**\r\n * * Filters elements by selector.\r\n * @example filterBy('.active') => Reduces the set to elements that match the '.active' selector.\r\n * @param selector CSS selector to filter by.\r\n * @returns A new jBase instance.\r\n */\r\n filterBy(selector: string): jBase;\r\n\r\n /**\r\n * * Filters the collection based on a custom callback function.\r\n * * Elements for which the callback returns `true` are kept in the new collection.\r\n * @example filterBy((index, element) => element.classList.contains('active')) => Reduces the set to elements for which the callback returns true (e.g., elements with the 'active' class).\r\n * @param predicate A function executed for each element in the current collection. \r\n * Receives the current `index` and the DOM `element` as arguments. \r\n * Return `true` to keep the element, or `false` to exclude it.\r\n * @returns A new jBase instance containing only the elements that passed the test.\r\n */\r\n filterBy(predicate: (index: number, element: Element) => boolean): jBase;\r\n\r\n /**\r\n * * Removes elements matching the selector.\r\n * @example not('.active') => Removes elements that match the '.active' selector from the set.\r\n * @param selector CSS selector to remove.\r\n * @returns A new jBase instance.\r\n */\r\n not(selector: string): jBase;\r\n\r\n /**\r\n * * Removes elements matching the callback function.\r\n * @example not((index, element) => element.classList.contains('active')) => Removes elements for which the callback returns true (e.g., elements with the 'active' class) from the set.\r\n * @param predicate Function that returns true to remove the element.\r\n * @returns A new jBase instance.\r\n */\r\n not(predicate: (index: number, element: Element) => boolean): jBase;\r\n\r\n /**\r\n * * Slides the element into view (horizontal).\r\n * @example slideIn() => Slides the element into view from the left with default duration.\r\n * @example slideIn({ direction: 'right', duration: 500 }) => Slides the element into view from the right over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideIn(options?: { direction?: 'left' | 'right', duration?: number }): jBase;\r\n\r\n /**\r\n * * Slides the element out of view (horizontal).\r\n * @example slideOut() => Slides the element out of view to the left with default duration.\r\n * @example slideOut({ direction: 'right', duration: 500 }) => Slides the element out of view to the right over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideOut(options?: { direction?: 'left' | 'right', duration?: number }): jBase;\r\n\r\n /**\r\n * * Toggles between slideIn and slideOut.\r\n * @example slideToggle() => Toggles between sliding the element into and out of view from the left with default duration.\r\n * @example slideToggle({ direction: 'right', duration: 500 }) => Toggles between sliding the element into and out of view from the right over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideToggle(options?: { direction?: 'left' | 'right', duration?: number }): jBase;\r\n\r\n /**\r\n * * Slides the element down (Accordion).\r\n * @example slideDown() => Slides the element down into view with default duration.\r\n * @example slideDown({ duration: 500, displayType: 'block' }) => Slides the element down into view over 500 milliseconds and sets display to 'block' when shown.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideDown(options?: { duration?: number, displayType?: string }): jBase;\r\n\r\n /**\r\n * * Slides the element up.\r\n * @example slideUp() => Slides the element up out of view with default duration.\r\n * @example slideUp({ duration: 500 }) => Slides the element up out of view over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideUp(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Toggles between slideDown and slideUp.\r\n * @example slideToggleBox() => Toggles between sliding the element down into view and up out of view with default duration.\r\n * @example slideToggleBox({ duration: 500, displayType: 'block' }) => Toggles between sliding the element down into view and up out of view over 500 milliseconds, and sets display to 'block' when shown.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideToggleBox(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Fades the element in (Opacity).\r\n * @example fadeIn() => Fades the element in with default duration.\r\n * @example fadeIn({ duration: 500, displayType: 'block' }) => Fades the element in over 500 milliseconds and sets display to 'block' when shown.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n fadeIn(options?: { duration?: number, displayType?: string }): jBase;\r\n\r\n /**\r\n * * Fades the element out (Opacity).\r\n * @example fadeOut() => Fades the element out with default duration.\r\n * @example fadeOut({ duration: 500 }) => Fades the element out over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n fadeOut(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Toggles between fadeIn and fadeOut.\r\n * @example fadeToggle() => Toggles between fading the element in and out with default duration.\r\n * @example fadeToggle({ duration: 500 }) => Toggles between fading the element in and out over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n fadeToggle(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Checks the 'checked' state (Getter).\r\n * @example checked() => Returns true if the first matched element is checked (for checkboxes/radio buttons).\r\n * @returns True if checked.\r\n */\r\n checked(): boolean;\r\n\r\n /**\r\n * * Sets the 'checked' state (Setter).\r\n * @example checked(true) => Sets the checked state to true for all matched checkboxes/radio buttons.\r\n * @param state The new state.\r\n * @returns The current jBase instance.\r\n */\r\n checked(state: boolean): jBase;\r\n\r\n /**\r\n * * ALIAS for .checked(true). Checks the matched elements.\r\n * @example check() => Checks all matched checkboxes/radio buttons.\r\n * @returns The current jBase instance.\r\n */\r\n check(): jBase;\r\n\r\n /**\r\n * * ALIAS for .checked(false). Unchecks the matched elements.\r\n * @example uncheck() => Unchecks all matched checkboxes/radio buttons.\r\n * @returns The current jBase instance.\r\n */\r\n uncheck(): jBase;\r\n\r\n /**\r\n * * Checks the 'selected' state (Getter).\r\n * @example selected() => Returns true if the first matched element is selected (for options in a select element).\r\n * @returns True if selected.\r\n */\r\n selected(): boolean;\r\n\r\n /**\r\n * * Sets the 'selected' state (Setter).\r\n * @example selected(true) => Sets the selected state to true for all matched options in a select element.\r\n * @param state The new state.\r\n * @returns The current jBase instance.\r\n */\r\n selected(state: boolean): jBase;\r\n\r\n /**\r\n * * ALIAS for .selected(true). Selects the matched