Upload files to "/"

This commit is contained in:
Sven Minio 2026-05-17 12:39:25 +02:00
commit 1fa6d558c7
149 changed files with 27987 additions and 0 deletions

32
dist/browser.d.ts vendored Normal file
View file

@ -0,0 +1,32 @@
/**
* @file src/browser.ts
* @version 2.2.1
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Browser
* @description
* * Browser Entry Point. Attaches the jBase library and utilities to the global window object
* * so they can be accessed via `$` or `jBase` (and other aliases) in inline scripts.
* @requires ./index
* * The core jBase class and its aliases are imported to be attached to the window object.
*/
import { $, jBase, jB, _jB, __jB, _jBase, __jBase, __ } from './index';
/**
* * TypeScript declaration merging to extend the global Window interface.
* * Ensures strict typing when accessing jBase aliases on the window object.
*/
declare global {
interface Window {
$: typeof $;
jBase: typeof jBase;
jB: typeof jB;
_jB: typeof _jB;
__jB: typeof __jB;
_jBase: typeof _jBase;
__jBase: typeof __jBase;
__: typeof __;
}
}
//# sourceMappingURL=browser.d.ts.map

1
dist/browser.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAEvE;;;GAGG;AACH,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,CAAC,EAAE,OAAO,CAAC,CAAC;QACZ,KAAK,EAAE,OAAO,KAAK,CAAC;QACpB,EAAE,EAAE,OAAO,EAAE,CAAC;QACd,GAAG,EAAE,OAAO,GAAG,CAAC;QAChB,IAAI,EAAE,OAAO,IAAI,CAAC;QAClB,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,OAAO,EAAE,OAAO,OAAO,CAAC;QACxB,EAAE,EAAE,OAAO,EAAE,CAAC;KACjB;CACJ"}

45
dist/core.d.ts vendored Normal file
View file

@ -0,0 +1,45 @@
/**
* @file src/core.ts
* @version 2.2.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Core
* @description
* * The main jBase class. Handles the selection engine, initialization, and plugin architecture.
* @requires ./types
* * Type definitions for the core class and its methods.
*/
import { JBaseElement, JBaseInput } from './types';
/**
* * The core class of the framework, inheriting from the native Array class. Acts as a wrapper around DOM elements and enables chainable methods (Fluent Interface).
*/
export declare class jBase extends Array<JBaseElement> {
/**
* * The original selector string or input type used to create this instance.
*/
selectorSource: string;
/**
* * The document context this instance is bound to (supports SSR via jsdom).
*/
doc: Document;
/**
* * Initializes a new jBase instance. Analyzes the provided selector and populates the internal array with found or created DOM elements.
* @param selector The input selector (CSS selector, HTML string, DOM element, or collection).
* @param context An optional specific Document or Window context (essential for SSR).
*/
constructor(selector?: JBaseInput, context?: Document | Window);
/**
* * Custom serializer for JSON.stringify. Prevents circular references and huge outputs by returning a simplified preview.
* @example toJson() => { meta: 'jBase Wrapper', query: '#myId', count: 1, preview: ['div'] }
* @returns A simplified object representation for debugging.
*/
toJSON(): {
meta: string;
query: string;
count: number;
preview: string[];
};
}
//# sourceMappingURL=core.d.ts.map

1
dist/core.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGnD;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,YAAY,CAAC;IAC1C;;OAEG;IACI,cAAc,EAAE,MAAM,CAAM;IAEnC;;OAEG;IACI,GAAG,EAAE,QAAQ,CAAC;IAErB;;;;OAIG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM;IA0D9D;;;;OAIG;IACH,MAAM;;;;;;CA4BT"}

3037
dist/index.cjs vendored Normal file

File diff suppressed because it is too large Load diff

7
dist/index.cjs.map vendored Normal file

File diff suppressed because one or more lines are too long

1914
dist/index.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

1
dist/index.d.ts.map vendored Normal file

File diff suppressed because one or more lines are too long

3002
dist/index.mjs vendored Normal file

File diff suppressed because it is too large Load diff

7
dist/index.mjs.map vendored Normal file

File diff suppressed because one or more lines are too long

3219
dist/jbase.browser.js vendored Normal file

File diff suppressed because it is too large Load diff

7
dist/jbase.browser.js.map vendored Normal file

File diff suppressed because one or more lines are too long

10
dist/jbase.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
dist/jbase.min.js.map vendored Normal file

File diff suppressed because one or more lines are too long

43
dist/modules/css/classes.d.ts vendored Normal file
View file

@ -0,0 +1,43 @@
/**
* @file src/modules/css/classes.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category CSS
* @description
* * Methods for manipulating CSS classes (add, remove, toggle, has).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Adds one or more CSS classes to each element in the collection.
* @example addClass('active', 'highlight') => Adds the 'active' and 'highlight' classes to all matched elements.
* @param classNames One or more class names to be added
* @returns The current jBase instance for method chaining
*/
export declare function addClass(this: jBase, ...classNames: string[]): jBase;
/**
* * Removes one or more CSS classes from each element in the collection.
* @example removeClass('active', 'highlight') => Removes the 'active' and 'highlight' classes from all matched elements.
* @param classNames One or more class names to be removed
* @returns The current jBase instance for method chaining
*/
export declare function removeClass(this: jBase, ...classNames: string[]): jBase;
/**
* * Toggles a CSS class (adds if missing, removes if present) for each element.
* @example toggleClass('active') => Toggles the 'active' class on all matched elements.
* @param className The class name to toggle.
* @returns The current jBase instance for method chaining.
*/
export declare function toggleClass(this: jBase, className: string): jBase;
/**
* * Checks if at least one element in the collection has the specified class.
* @example hasClass('active') => Returns true if at least one matched element has the 'active' class, otherwise false.
* @param className The class name to check for.
* @returns True if the class exists on at least one element, otherwise false.
*/
export declare function hasClass(this: jBase, className: string): boolean;
//# sourceMappingURL=classes.d.ts.map

1
dist/modules/css/classes.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../src/modules/css/classes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,CAKpE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,KAAK,CAKvE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAKjE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAIhE"}

26
dist/modules/css/index.d.ts vendored Normal file
View file

@ -0,0 +1,26 @@
/**
* @file src/modules/css/index.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category CSS
* @description
* * Central entry point for CSS operations. Aggregates class and style manipulation methods.
* @requires ./classes
* * Class manipulation methods (addClass, removeClass, etc.).
* @requires ./styles
* * Style manipulation methods (css).
*/
/**
* * Aggregation of all CSS methods. This object bundles functions for class manipulation and style manipulation. It is exported to extend the jBase prototype centrally via Object.assign.
*/
export declare const cssMethods: {
css(this: import("../..").JBaseClass, property: string | Record<string, string | number>, value?: string | number): string | import("../..").JBaseClass;
addClass(this: import("../..").JBaseClass, ...classNames: string[]): import("../..").JBaseClass;
removeClass(this: import("../..").JBaseClass, ...classNames: string[]): import("../..").JBaseClass;
toggleClass(this: import("../..").JBaseClass, className: string): import("../..").JBaseClass;
hasClass(this: import("../..").JBaseClass, className: string): boolean;
};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/css/index.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/css/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;CAGtB,CAAC"}

25
dist/modules/css/styles.d.ts vendored Normal file
View file

@ -0,0 +1,25 @@
/**
* @file src/modules/css/styles.ts
* @version 2.0.4
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category CSS
* @description
* * Methods for getting and setting inline CSS styles.
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets a CSS property value from the first element or sets one/multiple CSS properties for all elements.
* @example css('color', 'red') => Sets the 'color' style to 'red' for all matched elements.
* @example css({ color: 'red', backgroundColor: 'blue' }) => Sets multiple styles for all matched elements.
* @example css('color') => Returns the computed 'color' value of the first matched element.
* @param property A CSS property name as a string, or an object of property-value pairs to set multiple styles.
* @param value (Optional) The value to set if `property` is a string. If undefined and `property` is a string, acts as a getter.
* @returns The CSS value as a string when reading, or the jBase instance when writing.
*/
export declare function css(this: jBase, property: string | Record<string, string | number>, value?: string | number): string | jBase;
//# sourceMappingURL=styles.d.ts.map

1
dist/modules/css/styles.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/modules/css/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CA2C5H"}

238
dist/modules/data/arrays.d.ts vendored Normal file
View file

@ -0,0 +1,238 @@
/**
* @file src/modules/data/arrays.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Data
* @description
* * Utility functions for array manipulation and data processing.
* @requires ./types
* * Depends on types.
*/
import { MatchMode } from './types';
/**
* * Splits an array into smaller groups (chunks). Ideal for pagination or grid layouts.
* @example chunk([1, 2, 3, 4, 5], 2) => [[1, 2], [3, 4], [5]]
* @template T The type of the items in the array.
* @param array The source array.
* @param size The size of each chunk.
* @returns An array of arrays.
*/
export declare function chunk<T>(array: T[], size: number): T[][];
/**
* * Merges multiple arrays into a single flat array.
* @example mergeArray([1, 2], [3, 4], [5]) => [1, 2, 3, 4, 5]
* @template T The type of the items in the arrays.
* @param arrays A list of arrays.
* @returns A new, merged array.
*/
export declare function mergeArray<T>(...arrays: T[][]): T[];
/**
* * ALIAS for mergeArray (Consistency with object.merge)
*/
export declare const merge: typeof mergeArray;
/**
* * Safely adds an element at a specific position without mutating the original array (Immutable).
* @example add([1, 2, 4], 3, 2) => [1, 2, 3, 4]
* @template T The type of the items in the array.
* @param array The array.
* @param item The item to add.
* @param index The position (default: end). Negative values count from the back (-1 = before the last one).
* @returns A new array including the element.
*/
export declare function add<T>(array: T[], item: T, index?: number): T[];
/**
* * Clears the array and returns a new empty array (Immutable).
* @example clear([1, 2, 3]) => []
* @template T The type of the items in the array.
* @param array The array to clear.
* @returns A new empty array.
*/
export declare function clear<T>(array: T[]): T[];
/**
* * ALIAS for clear.
*/
export declare const empty: typeof clear;
/**
* * Creates a new array containing only the elements at the specified indices (Allowlist).
* * Mirrors object.pick.
* @example pick(['a', 'b', 'c', 'd'], [0, 2]) => ['a', 'c']
* @template T The type of the items in the array.
* @param array The source array.
* @param indices Array of indices to keep.
* @returns A new array with selected elements.
*/
export declare function pick<T>(array: T[], indices: number[]): T[];
/**
* * Creates a new array containing all elements EXCEPT those at the specified indices (Blocklist).
* * Mirrors object.omit.
* @example omit(['a', 'b', 'c', 'd'], [1, 3]) => ['a', 'c']
* @template T The type of the items in the array.
* @param array The source array.
* @param indices Array of indices to remove.
* @returns A new array without the specified elements.
*/
export declare function omit<T>(array: T[], indices: number[]): T[];
/**
* * Safely retrieves a value from a nested array/object structure (Safe Navigation).
* * Mirrors object.get.
* @example get(users, '0.profile.name') => Returns the name of the first user.
* @param array The array.
* @param path The path as a dot-notation string.
* @returns The found value or undefined.
*/
export declare function get(array: any[], path: string): any;
/**
* * Sets a value deeply within a nested array/object structure.
* * Mirrors object.set.
* @example set(users, '0.profile.name', 'Sven')
* @param array The array to modify.
* @param path The path as a string (e.g., '0.profile.name').
* @param value The value to set.
*/
export declare function set(array: any[], path: string, value: any): void;
/**
* * Removes elements based on index or match logic.
*/
export declare const remove: {
/**
* * Removes an element at a specific index.
* @example remove.at([1, 2, 3, 4], -2) => [1, 2, 4]
* @template T The type of the items in the array.
* @param array The array.
* @param index The index (negative values allowed).
* @returns A new array with the element removed.
*/
at<T>(array: T[], index: number): T[];
/**
* * Removes the first element.
* @example remove.first([1, 2, 3]) => [2, 3]
* @template T The type of the items in the array.
* @param array The array.
*/
first<T>(array: T[]): T[];
/**
* * Removes the last element.
* @example remove.last([1, 2, 3]) => [1, 2]
* @template T The type of the items in the array.
* @param array The array.
*/
last<T>(array: T[]): T[];
/**
* * Removes all elements matching a query condition.
* @example remove.byMatch(users, 'Admin', 'exact', 'role')
* @template T The type of the items in the array.
* @param array The array.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param key (Optional) The object key if it is an array of objects.
*/
byMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];
/**
* * Removes the element at a specific index.
* * Mirrors object.remove.byKey.
* @example remove.byKey(['a', 'b', 'c'], 1) => ['a', 'c']
* @template T The type of the items in the array.
* @param array The source array.
* @param index The index (key) to remove.
* @returns A new array without the specified index.
*/
byKey<T>(array: T[], index: number): T[];
/**
* * Removes all elements that match a specific value exactly (Strict Equality).
* * Mirrors object.remove.byValue.
* @example remove.byValue([1, 2, 1, 3], 1) => [2, 3]
* @template T The type of the items in the array.
* @param array The source array.
* @param value The value to remove.
* @returns A new array without the matching values.
*/
byValue<T>(array: T[], value: T): T[];
/**
* * ALIAS for clear. Removes all elements.
* @param array The source array.
* @returns A new, empty array.
*/
all<T>(array: T[]): T[];
};
/**
* * Searches for elements in the array.
*/
export declare const find: {
/**
* * Finds the index of the first match.
* @example find.at(['apple', 'banana', 'cherry'], 'an', 'contains') => 1
* @template T The type of the items in the array.
* @param array The array.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param key (Optional) The object key if it is an array of objects.
* @returns Index or -1.
*/
at<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number;
/**
* * Returns all elements matching the condition (Filter).
* @example find.all(['apple', 'banana', 'cherry'], 'a', 'contains') => ['apple', 'banana']
* @template T The type of the items in the array.
* @param array The array.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param key (Optional) The object key if it is an array of objects.
* @returns All matching elements or -1.
*/
all<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];
/**
* * Returns the first matching element (or undefined).
* @example find.first(['apple', 'banana', 'cherry'], 'a', 'contains') => 'apple'
* @template T The type of the items in the array.
* @param array The array.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param key (Optional) The object key if it is an array of objects.
* @returns Index or -1.
*/
first<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;
/**
* * Returns the last matching element (or undefined).
* @example find.last(['apple', 'banana', 'cherry'], 'a', 'contains') => 'banana'
* @template T The type of the items in the array.
* @param array The array.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param key (Optional) The object key if it is an array of objects.
* @returns Index or -1.
*/
last<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;
/**
* * Finds all indices (keys) matching the query.
* * Mirrors object.find.key(). For arrays, keys are the indices.
* @param array The array to search.
* @param query The search query.
* @param mode The comparison mode.
* @returns An array of matching indices as strings.
*/
key<T>(array: T[], query: string, mode?: MatchMode): string[];
/**
* * Finds all values matching the query.
* * Mirrors object.find.value(). Identical to find.all() for flat arrays.
* @param array The array to search.
* @param query The search query.
* @param mode The comparison mode.
* @returns An array of matching values.
*/
value<T>(array: T[], query: string, mode?: MatchMode): T[];
/**
* * Finds the key of the first match based on the query condition.
* @example find.byMatch(users, 'Admin', 'exact', 'role') => 0
* @template T The type of the items in the array.
* @param array The array.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param key (Optional) The object key if it is an array of objects.
* @returns Index or -1.
*/
byMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number | undefined;
};
//# sourceMappingURL=arrays.d.ts.map

1
dist/modules/data/arrays.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/modules/data/arrays.ts"],"names":[],"mappings":"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"}

227
dist/modules/data/index.d.ts vendored Normal file
View file

@ -0,0 +1,227 @@
/**
* @file src/modules/data/index.ts
* @version 2.1.0
* @since 2.0.0
* * @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Data
* @description
* * Central entry point for data manipulation.
* * Features a dynamic, overloaded API router that automatically delegates
* * to array or object utilities based on the input type.
* @requires ./arrays
* * Array manipulation methods.
* @requires ./objects
* * Object manipulation methods.
*/
import * as arr from './arrays';
import * as obj from './objects';
import { MatchMode } from './types';
/**
* * Splits an array or object into smaller chunks (batched processing).
* @param data The source array or object.
* @param size The maximum size/length of each chunk.
* @returns An array containing the chunked arrays or partial objects.
*/
declare function chunk<T>(array: T[], size: number): T[][];
declare function chunk<T extends Record<string, any>>(object: T, size: number): Partial<T>[];
/**
* * Merges multiple arrays (flat) or objects (deep merge) into a single structure.
* @param data The target array or object.
* @param args The source arrays or objects to merge.
* @returns The newly merged array or modified target object.
*/
declare function merge(...arrays: any[][]): any[];
declare function merge(target: any, ...sources: any[]): any;
/**
* * Safely adds an element/property at a specific index without mutating the original structure (Immutable).
* @param data The source array or object.
* @param arg1 The item to add (array) or the key to add (object).
* @param arg2 The index (array) or the value to add (object).
* @param arg3 The index (object only).
* @returns A new array or object including the added element.
*/
declare function add<T>(array: T[], item: T, index?: number): T[];
declare function add<T extends Record<string, any>>(object: T, key: string, value: any, index?: number): T & Record<string, any>;
/**
* * Clears the array or object and returns a new empty one (Immutable).
* @param data The array or object to clear.
* @returns A new empty array `[]` or object `{}`.
*/
declare function clear<T>(array: T[]): T[];
declare function clear<T extends Record<string, any>>(object: T): Partial<T>;
/**
* * Creates a new array or object containing ONLY the specified indices/keys (Allowlist).
* @param data The source array or object.
* @param keysOrIndices Array of keys (object) or indices (array) to keep.
* @returns A new filtered array or object.
*/
declare function pick<T>(array: T[], indices: number[]): T[];
declare function pick<T extends object, K extends keyof T>(object: T, keys: K[]): Pick<T, K>;
/**
* * Creates a new array or object containing all elements EXCEPT the specified indices/keys (Blocklist).
* @param data The source array or object.
* @param keysOrIndices Array of keys (object) or indices (array) to remove.
* @returns A new filtered array or object.
*/
declare function omit<T>(array: T[], indices: number[]): T[];
declare function omit<T extends object, K extends keyof T>(object: T, keys: K[]): Omit<T, K>;
/**
* * Safely retrieves a value from a nested array/object structure using dot-notation.
* @param data The source array or object.
* @param path The path string (e.g., 'settings.theme' or '0.profile.name').
* @returns The found value or undefined if any part is missing.
*/
declare function get(array: any[], path: string): any;
declare function get(object: any, path: string): any;
/**
* * Sets a value deeply within a nested structure. Creates missing objects/arrays automatically.
* @param data The array or object to modify.
* @param path The path string (e.g., 'settings.theme').
* @param value The value to set.
*/
declare function set(array: any[], path: string, value: any): void;
declare function set(object: any, path: string, value: any): void;
/**
* * Removes an entry/element at a specific index (Immutable).
* @param data The source array or object.
* @param index The index to remove (negative values count from the end).
* @returns A new array or object without the specified element.
*/
declare function removeAt<T>(array: T[], index: number): T[];
declare function removeAt<T extends Record<string, any>>(object: T, index: number): Partial<T>;
/**
* * Removes the first entry/element (Immutable).
* @param data The source array or object.
* @returns A new array or object without the first element.
*/
declare function removeFirst<T>(array: T[]): T[];
declare function removeFirst<T extends Record<string, any>>(object: T): Partial<T>;
/**
* * Removes the last entry/element (Immutable).
* @param data The source array or object.
* @returns A new array or object without the last element.
*/
declare function removeLast<T>(array: T[]): T[];
declare function removeLast<T extends Record<string, any>>(object: T): Partial<T>;
/**
* * Removes all entries/elements matching a query condition (Immutable). Acts as an inverse filter.
* @param data The source array or object.
* @param query The search term.
* @param mode Comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @returns A new array or object containing only the non-matching elements.
*/
declare function removeByMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];
declare function removeByMatch<T extends Record<string, any>>(object: T, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): Partial<T>;
/**
* * Removes a specific element by its index (arrays) or key (objects) (Immutable).
* @param data The source array or object.
* @param keyOrIndex The index or key string to remove.
* @returns A new array or object without the specified property/element.
*/
declare function removeByKey<T>(array: T[], index: number): T[];
declare function removeByKey<T extends Record<string, any>>(object: T, key: string): Partial<T>;
/**
* * Removes all elements/entries that match a specific value exactly (Immutable).
* @param data The source array or object.
* @param value The exact value to remove (strict equality).
* @returns A new array or object without the matching values.
*/
declare function removeByValue<T>(array: T[], value: T): T[];
declare function removeByValue<T extends Record<string, any>>(object: T, value: any): Partial<T>;
/**
* * Arrays: Finds the index of the first match. Objects: Returns the n-th [key, value] tuple.
* @param data The array or object to search.
* @param arg1 Query term (array) or numeric index (object).
* @returns The index (array) or tuple (object), or undefined.
*/
declare function findAt<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number;
declare function findAt(object: any, index: number): [string, any] | undefined;
/**
* * Returns ALL elements/entries matching the condition. Similar to filter().
* @param data The array or object to search.
* @param query The search term.
* @param mode Comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @returns A new array or partial object containing the matching elements.
*/
declare function findAll<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];
declare function findAll<T extends Record<string, any>>(object: T, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): Partial<T>;
/**
* * Returns the FIRST matching element (array) or [key, value] tuple (object).
* @param data The array or object to search.
* @param query The search term.
* @returns The found element/tuple or undefined.
*/
declare function findFirst<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;
declare function findFirst(object: any, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): [string, any] | undefined;
/**
* * Returns the LAST matching element (array) or [key, value] tuple (object). Searches in reverse.
* @param data The array or object to search.
* @param query The search term.
* @returns The found element/tuple or undefined.
*/
declare function findLast<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;
declare function findLast(object: any, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): [string, any] | undefined;
/**
* * Finds all matching indices (arrays) or keys (objects) based on the query.
* @param data The array or object to search.
* @param query The search term.
* @returns An array of matching stringified keys/indices.
*/
declare function findKey<T>(array: T[], query: string, mode?: MatchMode): string[];
declare function findKey(object: any, query: string, mode?: MatchMode): string[];
/**
* * Finds all matching values within the array or object.
* @param data The array or object to search.
* @param query The search term.
* @returns An array of matching values.
*/
declare function findValue<T>(array: T[], query: string, mode?: MatchMode): T[];
declare function findValue(object: any, query: string, mode?: MatchMode): any[];
/**
* * Finds the index (array) or key (object) of the first match based on the query condition.
* @param data The array or object to search.
* @param query The search term.
* @returns The matching index/key or undefined.
*/
declare function findByMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number | undefined;
declare function findByMatch(object: any, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): string | undefined;
/**
* * Central data utility object.
* * Dynamically routes to array or object methods based on input.
* * Backward compatibility for strict calls is maintained via `.arr` and `.obj`.
*/
export declare const data: {
arr: typeof arr;
obj: typeof obj;
chunk: typeof chunk;
merge: typeof merge;
add: typeof add;
clear: typeof clear;
empty: typeof clear;
pick: typeof pick;
omit: typeof omit;
get: typeof get;
set: typeof set;
remove: {
at: typeof removeAt;
first: typeof removeFirst;
last: typeof removeLast;
byKey: typeof removeByKey;
byValue: typeof removeByValue;
byMatch: typeof removeByMatch;
all: typeof clear;
};
find: {
at: typeof findAt;
all: typeof findAll;
first: typeof findFirst;
last: typeof findLast;
key: typeof findKey;
value: typeof findValue;
byMatch: typeof findByMatch;
};
};
export {};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/data/index.d.ts.map vendored Normal file

File diff suppressed because one or more lines are too long

223
dist/modules/data/objects.d.ts vendored Normal file
View file

@ -0,0 +1,223 @@
/**
* @file src/modules/data/objects.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Data
* @description
* * Utility functions for object manipulation (e.g., deep merging, extension).
* @requires ./types
* * Depends on types.
* @requires src/utils
* * Depends on utility functions (e.g., each).
*/
import { MatchMode } from './types';
/**
* * Recursively merges multiple objects (Deep Merge).
* @example mergeObjects({ a: 1, b: { x: 1 } }, { b: { y: 2 } }) => { a: 1, b: { x: 1, y: 2 } }
* @param target The target object (will be modified!).
* @param sources One or more source objects.
* @returns The modified target object.
*/
export declare function mergeObjects(target: any, ...sources: any[]): any;
/**
* * ALIAS for mergeObjects (Consistency with array.mergeArray)
*/
export declare const merge: typeof mergeObjects;
/**
* * Splits an object into an array of smaller objects (chunks). Ideal for batched processing.
* @example chunk({a: 1, b: 2, c: 3}, 2) => [{a: 1, b: 2}, {c: 3}]
* @param obj The source object.
* @param size The maximum number of keys per chunk.
* @returns An array of partial objects.
*/
export declare function chunk<T extends Record<string, any>>(obj: T, size: number): Partial<T>[];
/**
* * Safely adds a key-value pair at a specific index without mutating the original object (Immutable).
* * Note: While JS object key order is generally insertion-based, relying on it is not always recommended.
* @example add({a: 1, c: 3}, 'b', 2, 1) => {a: 1, b: 2, c: 3}
* @param obj The object.
* @param key The key to add.
* @param value The value to add.
* @param index The position (default: end). Negative values count from the back.
* @returns A new object including the element at the specified position.
*/
export declare function add<T extends Record<string, any>>(obj: T, key: string, value: any, index?: number): T & Record<string, any>;
/**
* * Clears the object and returns a new empty object (Immutable).
* @example clear({ a: 1, b: 2 }) => {}
* @template T The type of the object.
* @param obj The object to clear.
* @returns A new empty object.
*/
export declare function clear<T extends Record<string, any>>(obj: T): Partial<T>;
/**
* * ALIAS for clear.
*/
export declare const empty: typeof clear;
/**
* * Creates a new object containing only the specified keys (Allowlist).
* @example pick({ a: 1, b: 2, c: 3 }, ['a', 'c']) => { a: 1, c: 3 }
* @param obj The source object.
* @param keys Array of keys to keep.
* @returns A new object with selected keys.
*/
export declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
/**
* * Creates a new object containing all keys EXCEPT the specified ones (Blocklist).
* @example omit({ a: 1, b: 2, c: 3 }, ['b']) => { a: 1, c: 3 }
* @param obj The source object.
* @param keys Array of keys to remove.
* @returns A new object without the specified keys.
*/
export declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
/**
* * Safely retrieves a value from a nested object (Safe Navigation).
* @example get(config, 'settings.theme.color') => Returns the value of config.settings.theme.color or undefined if any part is missing.
* @param obj The object.
* @param path The path as a dot-notation string.
* @returns The found value or undefined.
*/
export declare function get(obj: any, path: string): any;
/**
* * Sets a value deeply within a nested object. Creates missing intermediate objects automatically.
* @example set(config, 'settings.theme.color', 'dark') => Sets config.settings.theme.color to 'dark', creating objects if needed.
* @param obj The object to modify.
* @param path The path as a string (e.g., 'settings.theme.color').
* @param value The value to set.
*/
export declare function set(obj: any, path: string, value: any): void;
/**
* * Removes elements from an object based on index or match logic (Immutable).
* * Mirrors the array.remove API.
*/
export declare const remove: {
/**
* * Removes an entry at a specific index.
* @example remove.at({a: 1, b: 2, c: 3}, -1) => {a: 1, b: 2}
* @param obj The source object.
* @param index The index (negative values allowed).
* @returns A new object with the element removed.
*/
at<T extends Record<string, any>>(obj: T, index: number): Partial<T>;
/**
* * Removes the first entry from the object.
* @param obj The source object.
* @returns A new object without the first entry.
*/
first<T extends Record<string, any>>(obj: T): Partial<T>;
/**
* * Removes the last entry from the object.
* @param obj The source object.
* @returns A new object without the last entry.
*/
last<T extends Record<string, any>>(obj: T): Partial<T>;
/**
* * Removes all entries matching a query condition.
* @example remove.byMatch(config, 'hidden', 'exact', 'key')
* @param obj The source object.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param searchBy Whether to search by 'key' or 'value' (default: 'key').
* @returns A new object without the matching elements.
*/
byMatch<T extends Record<string, any>>(obj: T, query: string | number, mode?: MatchMode, searchBy?: "key" | "value"): Partial<T>;
/**
* * Removes all entries that have a specific key.
* @example remove.byKey({ a: 1, b: 2, c: 3 }, 'b') => { a: 1, c: 3 }
* @param obj The source object.
* @param key The key to remove.
* @returns A new object without the specified key.
*/
byKey<T extends Record<string, any>>(obj: T, key: string): Partial<T>;
/**
* * Removes all entries that match a specific value exactly (Strict Equality).
* @example remove.byValue({ a: 1, b: 2, c: 1 }, 1) => { b: 2 }
* @param obj The source object.
* @param value The value to remove.
* @returns A new object without the matching values.
*/
byValue<T extends Record<string, any>>(obj: T, value: any): Partial<T>;
/**
* * ALIAS for clear. Removes all entries.
* @param obj The source object.
* @returns A new, empty object.
*/
all<T extends Record<string, any>>(obj: T): Partial<T>;
};
/**
* * Searches keys or values in the object.
*/
export declare const find: {
/**
* * Returns the n-th entry of an object as a [key, value] pair. Supports negative indices.
* @example find.at({ a: 1, b: 2 }, 1) => ['b', 2]
* @param obj The object to search.
* @param index The index (0-based, negative counts from the back).
* @returns A [key, value] tuple or undefined.
*/
at(obj: any, index: number): [string, any] | undefined;
/**
* * Returns a NEW OBJECT containing ALL elements matching the condition.
* * Mirrors array.find.all() but returns a partial object.
* @example find.all({a: 1, b: 2, c: 1}, 1, 'exact', 'value') => {a: 1, c: 1}
* @param obj The object to search.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param searchBy Whether to search by 'key' or 'value' (default: 'key').
* @returns A new object with only the matching elements.
*/
all<T extends Record<string, any>>(obj: T, query: string | number, mode?: MatchMode, searchBy?: "key" | "value"): Partial<T>;
/**
* * Finds the first entry where the key or value matches the query.
* @example find.first(config, 'admin', 'exact', 'key')
* @param obj The object to search.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param searchBy Whether to search by 'key' or 'value'.
* @returns The first matching [key, value] pair or undefined.
*/
first(obj: any, query: string | number, mode?: MatchMode, searchBy?: "key" | "value"): [string, any] | undefined;
/**
* * Finds the last entry where the key or value matches the query.
* @example find.last(config, '.php', 'endsWith', 'key')
* @param obj The object to search.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param searchBy Whether to search by 'key' or 'value'.
* @returns The last matching [key, value] pair or undefined.
*/
last(obj: any, query: string | number, mode?: MatchMode, searchBy?: "key" | "value"): [string, any] | undefined;
/**
* * Finds all keys matching the query.
* @example find.key(config, 'api_', 'startsWith')
* @param obj The object to search.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @returns An array of matching keys.
*/
key(obj: any, query: string, mode?: MatchMode): string[];
/**
* * Finds all values matching the query.
* @example find.value(config, 'enabled', 'exact')
* @param obj The object to search.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @returns An array of matching values.
*/
value(obj: any, query: string, mode?: MatchMode): any[];
/**
* * Finds the key of the first match based on the query condition.
* * Mirrors array.find.byMatch(). For objects, it returns the key instead of a numeric index.
* @example find.byMatch(config, 'admin', 'exact', 'value') => 'role'
* @param obj The object to search.
* @param query The search query.
* @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').
* @param searchBy Whether to search by 'key' or 'value' (default: 'key').
* @returns The matched key as a string, or undefined if no match is found.
*/
byMatch(obj: any, query: string | number, mode?: MatchMode, searchBy?: "key" | "value"): string | undefined;
};
//# sourceMappingURL=objects.d.ts.map

1
dist/modules/data/objects.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"objects.d.ts","sourceRoot":"","sources":["../../../src/modules/data/objects.ts"],"names":[],"mappings":"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"}

16
dist/modules/data/types.d.ts vendored Normal file
View file

@ -0,0 +1,16 @@
/**
* @file src/modules/data/types.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Data
* @description
* * Type definitions and validation helpers for data structures.
*/
/**
* * Defines the matching modes for search operations.
*/
export type MatchMode = 'exact' | 'contains' | 'startsWith' | 'endsWith';
//# sourceMappingURL=types.d.ts.map

1
dist/modules/data/types.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/data/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC"}

50
dist/modules/dom/attributes.d.ts vendored Normal file
View file

@ -0,0 +1,50 @@
/**
* @file src/modules/dom/attributes.ts
* @version 2.1.1
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for getting and setting HTML attributes and properties (attr, data, val).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets an attribute from the first element or sets it for all elements in the selection.
* @example attr('href', 'https://example.com') => Sets the 'href' attribute to 'https://example.com' for all matched elements.
* @example attr('href') => Returns the 'href' attribute value of the first matched element.
* @param name The name of the attribute (e.g., 'href', 'data-id').
* @param value (Optional) The value to set. If undefined, acts as a getter.
* @returns The attribute value (string/null) when reading, or the jBase instance when writing.
*/
export declare function attr(this: jBase, name: string, value?: string): string | null | jBase;
/**
* * Gets the 'value' from the first form element or sets it for all elements. Supports Input, Textarea, and Select elements.
* @example val('Hello') => Sets the value of all matched form elements to 'Hello'.
* @example val() => Returns the value of the first matched form element.
* @param value (Optional) The value to set. If undefined, acts as a getter.
* @returns The current value as a string when reading, or the jBase instance when writing.
*/
export declare function val(this: jBase, value?: string): string | jBase;
/**
* * Removes an attribute from all elements in the selection.
* @example removeAttr('disabled') => Removes the 'disabled' attribute from all matched elements.
* @param name The name of the attribute to remove (e.g., 'disabled', 'readonly').
* @returns The jBase instance for chaining.
*/
export declare function removeAttr(this: jBase, name: string): jBase;
/**
* * Gets a property from the first element or sets it for all elements in the selection.
* * Useful for DOM properties that don't directly map to HTML attributes (like 'checked' or 'selectedIndex').
* @example prop('checked', true) => Sets the 'checked' property to true for all matched elements (e.g., checkboxes).
* @example prop('checked') => Returns the 'checked' property value of the first matched element.
* @example prop('selectedIndex', 2) => Sets the 'selectedIndex' property to 2 for all matched <select> elements.
* @param name The name of the property (e.g., 'checked', 'disabled').
* @param value (Optional) The value to set. If undefined, acts as a getter.
* @returns The property value when reading, or the jBase instance when writing.
*/
export declare function prop(this: jBase, name: string, value?: any): any | jBase;
//# sourceMappingURL=attributes.d.ts.map

1
dist/modules/dom/attributes.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAUrF;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAe/D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAK3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,KAAK,CAYxE"}

46
dist/modules/dom/content.d.ts vendored Normal file
View file

@ -0,0 +1,46 @@
/**
* @file src/modules/dom/content.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for getting and setting element content (html, text, empty, replaceWith).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets the HTML content of the first element, or sets the HTML content of all matched elements.
* @example html() => Returns the innerHTML of the first element.
* @example html('<div>New</div>') => Sets safe HTML for all matched elements.
* @example html('<script>alert("Hi")</script>', { executeScripts: true }) => Injects and executes scripts.
* @param content The HTML string to set. If undefined, acts as a getter.
* @param options Security and execution options.
* @returns HTML string (getter) or the current jBase instance (setter).
*/
export declare function html(this: jBase, content?: string, options?: {
executeScripts?: boolean;
}): string | jBase;
/**
* * Gets the text content of the first element or sets it for all elements. Safe against XSS attacks.
* @example text('Hello World') => Sets the text content of all matched elements to 'Hello World'.
* @example text() => Returns the text content of the first matched element.
* @param content (Optional) The text content to set.
* @returns The text content (getter) or the current jBase instance (setter).
*/
export declare function text(this: jBase, content?: string): string | jBase;
/**
* * Loads HTML from a server and injects it into the matched elements.
* * This is now a clean wrapper around $.http.getText() and this.html().
* @example $('#content').load('/pages/about.html')
* @param url The URL to fetch the HTML from.
* @param options Fetch options extended with jBase specific settings (e.g., executeScripts).
* @returns A Promise resolving to the current jBase instance.
*/
export declare function load(this: jBase, url: string, options?: RequestInit & {
executeScripts?: boolean;
}): Promise<jBase>;
//# sourceMappingURL=content.d.ts.map

1
dist/modules/dom/content.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAmCnC;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,KAAK,CAmB1G;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAWlE;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAazH"}

83
dist/modules/dom/index.d.ts vendored Normal file
View file

@ -0,0 +1,83 @@
/**
* @file src/modules/dom/index.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Central entry point for DOM operations. Aggregates methods for attributes, content, manipulation, traversal, and states.
* @requires ./attributes
* * Attribute and value manipulation.
* @requires ./content
* * Content handling (html, text).
* @requires ./manipulation
* * DOM manipulation (append, remove, etc.).
* @requires ./traversal
* * Tree traversal (find, parent, children).
* @requires ./states
* * State checks (checked, disabled).
*/
/**
* * Aggregation of all DOM methods. Bundles specialized sub-modules into a single interface. Used to extend the jBase prototype centrally via Object.assign.
*/
export declare const domMethods: {
checked(this: import("../..").JBaseClass, state?: boolean): boolean | import("../..").JBaseClass;
selected(this: import("../..").JBaseClass, state?: boolean): boolean | import("../..").JBaseClass;
disabled(this: import("../..").JBaseClass, state?: boolean): boolean | import("../..").JBaseClass;
check(this: import("../..").JBaseClass): import("../..").JBaseClass;
uncheck(this: import("../..").JBaseClass): import("../..").JBaseClass;
select(this: import("../..").JBaseClass): import("../..").JBaseClass;
disable(this: import("../..").JBaseClass): import("../..").JBaseClass;
enable(this: import("../..").JBaseClass): import("../..").JBaseClass;
closest(this: import("../..").JBaseClass, selector: string): import("../..").JBaseClass;
parent(this: import("../..").JBaseClass): import("../..").JBaseClass;
children(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
findAll(this: import("../..").JBaseClass, selector: string): import("../..").JBaseClass;
descendants(this: import("../..").JBaseClass): import("../..").JBaseClass;
parents(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
parentsUntil(this: import("../..").JBaseClass, selector: string, filter?: string): import("../..").JBaseClass;
descendantsUntil(this: import("../..").JBaseClass, untilSelector: string, filter?: string): import("../..").JBaseClass;
next(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
prev(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
nextSibling(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
prevSibling(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
sibling(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
nextAll(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
prevAll(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
siblings(this: import("../..").JBaseClass, selector?: string): import("../..").JBaseClass;
nextUntil(this: import("../..").JBaseClass, untilSelector: string, filter?: string): import("../..").JBaseClass;
prevUntil(this: import("../..").JBaseClass, untilSelector: string, filter?: string): import("../..").JBaseClass;
eq(this: import("../..").JBaseClass, index: number): import("../..").JBaseClass;
first(this: import("../..").JBaseClass): import("../..").JBaseClass;
last(this: import("../..").JBaseClass): import("../..").JBaseClass;
filterBy(this: import("../..").JBaseClass, selectorOrFn: string | ((index: number, element: Element) => boolean)): import("../..").JBaseClass;
not(this: import("../..").JBaseClass, selectorOrFn: string | ((index: number, element: Element) => boolean)): import("../..").JBaseClass;
remove(this: import("../..").JBaseClass): import("../..").JBaseClass;
empty(this: import("../..").JBaseClass): import("../..").JBaseClass;
replaceWithClone(this: import("../..").JBaseClass): import("../..").JBaseClass;
append(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
prepend(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
before(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
after(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
replaceWith(this: import("../..").JBaseClass, content: string | Node | import("../..").JBaseClass): import("../..").JBaseClass;
appendTo(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
prependTo(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
insertBefore(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
insertAfter(this: import("../..").JBaseClass, target: string | Element): import("../..").JBaseClass;
wrap(this: import("../..").JBaseClass, wrapperHtml: string): import("../..").JBaseClass;
unwrap(this: import("../..").JBaseClass): import("../..").JBaseClass;
html(this: import("../..").JBaseClass, content?: string, options?: {
executeScripts?: boolean;
}): string | import("../..").JBaseClass;
text(this: import("../..").JBaseClass, content?: string): string | import("../..").JBaseClass;
load(this: import("../..").JBaseClass, url: string, options?: RequestInit & {
executeScripts?: boolean;
}): Promise<import("../..").JBaseClass>;
attr(this: import("../..").JBaseClass, name: string, value?: string): string | null | import("../..").JBaseClass;
val(this: import("../..").JBaseClass, value?: string): string | import("../..").JBaseClass;
removeAttr(this: import("../..").JBaseClass, name: string): import("../..").JBaseClass;
prop(this: import("../..").JBaseClass, name: string, value?: any): any | import("../..").JBaseClass;
};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/dom/index.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAMimC,CAAC;;;;sBAAo2D,CAAC;;;;;;CAA79F,CAAC"}

111
dist/modules/dom/manipulation.d.ts vendored Normal file
View file

@ -0,0 +1,111 @@
/**
* @file src/modules/dom/manipulation.ts
* @version 2.0.4
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for inserting, moving, and removing elements (append, prepend, remove).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires src/utils
* * Depends on utility functions (e.g., each).
*/
import { jBase } from '../../core';
/**
* * Removes the selected elements from the DOM.
* @example remove() => Removes all matched elements from the DOM.
* @returns The current jBase instance.
*/
export declare function remove(this: jBase): jBase;
/**
* * Removes all child nodes and text content from the selected elements.
* @example empty() => Empties the content of all matched elements, leaving them in the DOM.
* @returns The current jBase instance.
*/
export declare function empty(this: jBase): jBase;
/**
* * Replaces each element with a deep clone of itself. Useful for removing all event listeners ("Nuke" strategy).
* @example replaceWithClone() => Replaces each matched element with a clone, effectively removing all event listeners.
* @returns A new jBase instance containing the cloned elements.
*/
export declare function replaceWithClone(this: jBase): jBase;
/**
* * Inserts content at the end of each selected element (inside).
* @example append('<span>New</span>') => Appends a new <span> element to the end of each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function append(this: jBase, content: string | Node | jBase): jBase;
/**
* * Inserts content at the beginning of each selected element (inside).
* @example prepend('<span>New</span>') => Prepends a new <span> element to the beginning of each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function prepend(this: jBase, content: string | Node | jBase): jBase;
/**
* * Inserts content before the element (outside).
* @example before('<div>New</div>') => Inserts a new <div> element immediately before each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function before(this: jBase, content: string | Node | jBase): jBase;
/**
* * Inserts content after the element (outside).
* @example after('<div>New</div>') => Inserts a new <div> element immediately after each matched element.
* @param content HTML string, DOM Node, or jBase collection.
* @returns The current jBase instance.
*/
export declare function after(this: jBase, content: string | Node | jBase): jBase;
/**
* * Replaces the element with new content.
* @example replaceWith('<div>New</div>') => Replaces each matched element with a new <div> element.
* @param content The new content.
* @returns The current jBase instance.
*/
export declare function replaceWith(this: jBase, content: string | Node | jBase): jBase;
/**
* * Appends the selected elements to the end of a target element.
* @example appendTo('#container') => Appends all matched elements to the element with id 'container'.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function appendTo(this: jBase, target: string | Element): jBase;
/**
* * Prepends the selected elements to the beginning of a target element.
* @example prependTo('#container') => Prepends all matched elements to the element with id 'container', before its existing content.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function prependTo(this: jBase, target: string | Element): jBase;
/**
* * Inserts the selected elements immediately before the target element.
* @example insertBefore('#target') => Inserts all matched elements immediately before the element with id 'target'.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function insertBefore(this: jBase, target: string | Element): jBase;
/**
* * Inserts the selected elements immediately after the target element.
* @example insertAfter('#target') => Inserts all matched elements immediately after the element with id 'target'.
* @param target CSS selector or DOM element.
* @returns The current jBase instance.
*/
export declare function insertAfter(this: jBase, target: string | Element): jBase;
/**
* * Wraps each selected element with the specified HTML structure.
* @example wrap('<div class="box"></div>') => Wraps each matched element with a <div class="box"></div> element.
* @param wrapperHtml HTML string defining the wrapper (e.g., `<div class="box"></div>`).
* @returns The current jBase instance.
*/
export declare function wrap(this: jBase, wrapperHtml: string): jBase;
/**
* * Removes the direct parent of the selected elements from the DOM.
* * @example unwrap() => Removes the parent element of each matched element, effectively "unwrapping" it from its container.
* @returns The current jBase instance.
*/
export declare function unwrap(this: jBase): jBase;
//# sourceMappingURL=manipulation.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"manipulation.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/manipulation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA6DnC;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAKzC;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAKxC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAUnD;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAsBzE;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAsB1E;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAsBzE;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAsBxE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAa9E;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAarE;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAatE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAazE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAaxE;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,KAAK,CAc5D;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAiBzC"}

69
dist/modules/dom/states.d.ts vendored Normal file
View file

@ -0,0 +1,69 @@
/**
* @file src/modules/dom/states.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for checking element states (e.g., visibility, checked, disabled).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Gets or sets the 'checked' state of checkboxes and radio buttons.
* @example checked() => Gets the checked state of the first matched element.
* @example checked(true) => Checks the first matched element.
* @param state (Optional) `true` to check, `false` to uncheck. If undefined, acts as a getter.
* @returns Boolean (getter) or the current jBase instance (setter).
*/
export declare function checked(this: jBase, state?: boolean): boolean | jBase;
/**
* * Gets or sets the 'selected' state of `<option>` elements.
* @example selected() => Gets the selected state of the first matched option element.
* @example selected(true) => Selects the first matched option element.
* @param state (Optional) `true` to select, `false` to deselect. If undefined, acts as a getter.
* @returns Boolean (getter) or the current jBase instance (setter).
*/
export declare function selected(this: jBase, state?: boolean): boolean | jBase;
/**
* * Enables or disables form fields and buttons. Additionally toggles the CSS class `.disabled`.
* @example disabled() => Gets the disabled state of the first matched element.
* @example disabled(true) => Disables the first matched element.
* @param state (Optional) `true` to disable, `false` to enable. If undefined, acts as a getter.
* @returns Boolean (getter) or the current jBase instance (setter).
*/
export declare function disabled(this: jBase, state?: boolean): boolean | jBase;
/**
* * ALIAS for .checked(true). Checks the matched elements.
* @example check() => Checks all matched checkboxes/radio buttons.
* @returns The current jBase instance.
*/
export declare function check(this: jBase): jBase;
/**
* * ALIAS for .checked(false). Unchecks the matched elements.
* @example uncheck() => Unchecks all matched checkboxes/radio buttons.
* @returns The current jBase instance.
*/
export declare function uncheck(this: jBase): jBase;
/**
* * ALIAS for .selected(true). Selects the matched <option> elements.
* @example select() => Selects all matched option elements.
* @returns The current jBase instance.
*/
export declare function select(this: jBase): jBase;
/**
* * ALIAS for .disabled(true). Disables the matched elements and adds the 'disabled' class.
* @example disable() => Disables all matched elements.
* @returns The current jBase instance.
*/
export declare function disable(this: jBase): jBase;
/**
* * ALIAS for .disabled(false). Enables the matched elements and removes the 'disabled' class.
* @example enable() => Enables all matched elements.
* @returns The current jBase instance.
*/
export declare function enable(this: jBase): jBase;
//# sourceMappingURL=states.d.ts.map

1
dist/modules/dom/states.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"states.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/states.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAUrE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAUtE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,CAetE;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAExC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAEzC"}

184
dist/modules/dom/traversal.d.ts vendored Normal file
View file

@ -0,0 +1,184 @@
/**
* @file src/modules/dom/traversal.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category DOM
* @description
* * Methods for navigating the DOM tree (find, parent, children, siblings).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires ../../utils
* * Utility functions (e.g., `each` for iteration).
*/
import { jBase } from '../../core';
/**
* * Traverses the parents (heading toward the document root) of each element and finds the first element that matches the specified selector.
* @example closest('.container') => For each matched element, finds the nearest ancestor with the class 'container'.
* @param selector A string containing a selector expression.
* @returns A new jBase instance containing the matched elements.
*/
export declare function closest(this: jBase, selector: string): jBase;
/**
* * Gets the direct parent of each element in the current set. Deduplicates results.
* @example parent() => Returns a new jBase instance containing the parent elements of all matched elements, without duplicates.
* @returns A new jBase instance containing the parent elements.
*/
export declare function parent(this: jBase): jBase;
/**
* * Gets the direct children of each element in the set, optionally filtered by a selector.
* @example children() => Returns a new jBase instance containing all direct children of the matched elements.
* @example children('.item') => Returns a new jBase instance containing only the direct children that match the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance containing the children.
*/
export declare function children(this: jBase, selector?: string): jBase;
/**
* * Finds descendants (deep) that match the selector using `querySelectorAll`.
* @example findAll('.item') => Returns a new jBase instance containing all descendant elements that match the selector '.item'.
* @param selector The CSS selector to search for.
* @returns A new jBase instance with the found elements.
*/
export declare function findAll(this: jBase, selector: string): jBase;
/**
* * Recursively gets ALL descendants (not just direct children).
* @example descendants() => Returns a new jBase instance containing all descendant elements of the matched elements.
* @returns A new jBase instance with all descendants.
*/
export declare function descendants(this: jBase): jBase;
/**
* * Gets all ancestors (parents, grandparents...) up to the root. Optionally filtered.
* @example parents() => Returns a new jBase instance containing all ancestors of the matched elements, without duplicates.
* @example parents('.container') => Returns a new jBase instance containing only the ancestors that match the selector '.container'.
* @param selector (Optional) Filter selector for ancestors.
* @returns A new jBase instance with the ancestors.
*/
export declare function parents(this: jBase, selector?: string): jBase;
/**
* * Gets all ancestors UP TO (but not including) an element matching the selector.
* @example parentsUntil('.container') => Returns a new jBase instance containing all ancestors of the matched elements up to (but not including) the nearest ancestor that matches '.container'.
* @example parentsUntil('.container', '.item') => Returns a new jBase instance containing ancestors up to '.container' that also match '.item'.
* @param selector The selector where traversal stops.
* @param filter (Optional) Filter for the collected elements.
* @returns A new jBase instance.
*/
export declare function parentsUntil(this: jBase, selector: string, filter?: string): jBase;
/**
* * Recursively finds descendants but stops traversing a branch if `untilSelector` is met. Useful for finding nested elements without going too deep (e.g., nested forms).
* @example descendantsUntil('.stop-here') => Returns a new jBase instance containing all descendant elements of the matched elements, but does not include any elements that are descendants of an element matching '.stop-here'.
* @example descendantsUntil('.stop-here', '.item') => Returns a new jBase instance containing descendant elements that match '.item', but does not include any elements that are descendants of an element matching '.stop-here'.
* @param untilSelector The selector that stops recursion in a branch.
* @param filter (Optional) Selector to filter collected elements.
* @returns A new jBase instance.
*/
export declare function descendantsUntil(this: jBase, untilSelector: string, filter?: string): jBase;
/**
* * Gets the immediately following sibling.
* @example next() => Returns a new jBase instance containing the immediately following sibling of each matched element.
* @example next('.item') => Returns a new jBase instance containing the immediately following sibling that matches the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function next(this: jBase, selector?: string): jBase;
/**
* * Gets the immediately preceding sibling.
* @example prev() => Returns a new jBase instance containing the immediately preceding sibling of each matched element.
* @example prev('.item') => Returns a new jBase instance containing the immediately preceding sibling that matches the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function prev(this: jBase, selector?: string): jBase;
/**
* * Alias for `next()`.
*/
export declare function nextSibling(this: jBase, selector?: string): jBase;
/**
* * Alias for `prev()`.
*/
export declare function prevSibling(this: jBase, selector?: string): jBase;
/**
* * Alias for `next()`.
*/
export declare function sibling(this: jBase, selector?: string): jBase;
/**
* * Gets ALL following siblings.
* @example nextAll() => Returns a new jBase instance containing all following siblings of each matched element.
* @example nextAll('.item') => Returns a new jBase instance containing all following siblings that match the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function nextAll(this: jBase, selector?: string): jBase;
/**
* * Gets ALL preceding siblings.
* @example prevAll() => Returns a new jBase instance containing all preceding siblings of each matched element.
* @example prevAll('.item') => Returns a new jBase instance containing all preceding siblings that match the selector '.item'.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function prevAll(this: jBase, selector?: string): jBase;
/**
* * Gets ALL siblings (previous and next), excluding itself.
* @example siblings() => Returns a new jBase instance containing all siblings of each matched element, without duplicates.
* @example siblings('.item') => Returns a new jBase instance containing all siblings that match the selector '.item', without duplicates.
* @param selector (Optional) Filter selector.
* @returns A new jBase instance.
*/
export declare function siblings(this: jBase, selector?: string): jBase;
/**
* * Gets all following siblings UNTIL a selector is met (exclusive).
* @example nextUntil('.stop-here') => Returns a new jBase instance containing all following siblings of the matched elements up to (but not including) the nearest sibling that matches '.stop-here'.
* @example nextUntil('.stop-here', '.item') => Returns a new jBase instance containing following siblings that match '.item' up to (but not including) the nearest sibling that matches '.stop-here'.
* @param untilSelector The selector that stops the search.
* @param filter (Optional) Filter for the found elements.
* @returns A new jBase instance.
*/
export declare function nextUntil(this: jBase, untilSelector: string, filter?: string): jBase;
/**
* * Gets all preceding siblings UNTIL a selector is met (exclusive).
* @example prevUntil('.stop-here') => Returns a new jBase instance containing all preceding siblings of the matched elements up to (but not including) the nearest sibling that matches '.stop-here'.
* @example prevUntil('.stop-here', '.item') => Returns a new jBase instance containing preceding siblings that match '.item' up to (but not including) the nearest sibling that matches '.stop-here'.
* @param untilSelector The selector that stops the search.
* @param filter (Optional) Filter for the found elements.
* @returns A new jBase instance.
*/
export declare function prevUntil(this: jBase, untilSelector: string, filter?: string): jBase;
/**
* * Reduces the set to the element at the specified index. Supports negative indices.
* @example eq(0) => Returns a new jBase instance containing only the first element of the matched set.
* @example eq(-1) => Returns a new jBase instance containing only the last element of the matched set.
* @param index The position (0-based). Negative values count from the end.
* @returns A new jBase instance containing the single element (or empty).
*/
export declare function eq(this: jBase, index: number): jBase;
/**
* * Reduces the set of matched elements to the first one in the collection.
* @example first() => Returns a new jBase instance containing only the first element of the matched set.
* @param selector (Optional) Filter selector to find the first matching element.
* @returns A new jBase instance containing only the first element, allowing for further method chaining.
*/
export declare function first(this: jBase): jBase;
/**
* * Reduces the set of matched elements to the final one in the collection.
* @example last() => Returns a new jBase instance containing only the last element of the matched set.
* @returns A new jBase instance containing only the last element, allowing for further method chaining.
*/
export declare function last(this: jBase): jBase;
/**
* * Filters elements based on a selector or a function.
* @example filterBy('.active') => Returns a new jBase instance containing only the elements that match the selector '.active'.
* @example filterBy((index, el) => el.textContent.includes('Hello')) => Returns a new jBase instance containing only the elements for which the function returns true.
* @param selectorOrFn CSS selector string or filter function.
* @returns A new jBase instance with filtered elements.
*/
export declare function filterBy(this: jBase, selectorOrFn: string | ((index: number, element: Element) => boolean)): jBase;
/**
* * Removes elements from the set that match the selector or function (Inverse of filterBy).
* @example not('.active') => Returns a new jBase instance containing only the elements that do NOT match the selector '.active'.
* @example not((index, el) => el.textContent.includes('Hello')) => Returns a new jBase instance containing only the elements for which the function returns false.
* @param selectorOrFn CSS selector string or filter function.
* @returns A new jBase instance with remaining elements.
*/
export declare function not(this: jBase, selectorOrFn: string | ((index: number, element: Element) => boolean)): jBase;
//# sourceMappingURL=traversal.d.ts.map

1
dist/modules/dom/traversal.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../../../src/modules/dom/traversal.ts"],"names":[],"mappings":"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"}

60
dist/modules/effects/fade.d.ts vendored Normal file
View file

@ -0,0 +1,60 @@
/**
* @file src/modules/effects/fade.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Effects
* @description
* * Methods for fading elements in and out (fadeIn, fadeOut, fadeToggle).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires ../../utils
* * Uses utility functions for environment checks.
* @requires ./types
* * Type definitions for fade options.
*/
import { jBase } from '../../core';
import { FadeOptions } from './types';
/**
* * Fades an element in (Opacity 0 -> 1).
* @example fadeIn() => Fades in all matched elements over 300ms with display: block.
* @example fadeIn({ duration: 500, displayType: 'inline-block' }) => Fades in all matched elements over 500ms with display: inline-block.
* @example fadeIn(500) => Fades in over 500ms.
* @param options Duration in ms (default: 300) and display type (default: 'block').
* @returns The current jBase instance.
*/
export declare function fadeIn(this: jBase, options?: FadeOptions | number): jBase;
/**
* * Fades an element out (Opacity 1 -> 0) and sets display: none afterwards.
* @example fadeOut() => Fades out all matched elements over 300ms with display: none.
* @example fadeOut({ duration: 500 }) => Fades out all matched elements over 500ms with display: none.
* @example fadeOut(500) => Fades out over 500ms.
* @param options Duration in ms (default: 300).
* @returns The current jBase instance.
*/
export declare function fadeOut(this: jBase, options?: FadeOptions | number): jBase;
/**
* * Toggles between fadeIn and fadeOut based on the current display state.
* @example fadeToggle() => Fades in hidden elements and fades out visible elements over 300ms.
* @example fadeToggle({ duration: 500 }) => Fades in hidden elements and fades out visible elements over 500ms.
* @example fadeToggle({ duration: 500, displayType: 'inline-block' }) => Fades in all matched elements over 500ms with display: inline-block.
* @example fadeToggle(500) => Fades in over 500ms.
* @param options Animation options.
* @returns The current jBase instance.
*/
export declare function fadeToggle(this: jBase, options?: FadeOptions | number): jBase;
/**
* * ALIAS for fadeIn.
*/
export declare const show: typeof fadeIn;
/**
* * ALIAS for fadeOut.
*/
export declare const hide: typeof fadeOut;
/**
* * ALIAS for fadeToggle.
*/
export declare const toggle: typeof fadeToggle;
//# sourceMappingURL=fade.d.ts.map

1
dist/modules/effects/fade.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../../src/modules/effects/fade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,WAAW,GAAG,MAAW,GAAG,KAAK,CA2B7E;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,WAAW,GAAG,MAAW,GAAG,KAAK,CA0B9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,WAAW,GAAG,MAAW,GAAG,KAAK,CAcjF;AAED;;GAEG;AACH,eAAO,MAAM,IAAI,eAAS,CAAC;AAE3B;;GAEG;AACH,eAAO,MAAM,IAAI,gBAAU,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,MAAM,mBAAa,CAAC"}

36
dist/modules/effects/index.d.ts vendored Normal file
View file

@ -0,0 +1,36 @@
/**
* @file src/modules/effects/index.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Effects
* @description
* * Central entry point for visual effects. Aggregates slide, fade, and vertical animation modules.
* @requires ./slide
* * Horizontal slide effects (slideIn, slideOut).
* @requires ./vertical
* * Vertical slide effects / Accordion (slideDown, slideUp).
* @requires ./fade
* * Opacity fade effects (fadeIn, fadeOut).
*/
import * as fadeMethods from './fade';
/**
* * Aggregation of all visual effect methods. Bundles sliding and fading animations to extend the jBase prototype.
*/
export declare const effectMethods: {
fadeIn(this: import("../..").JBaseClass, options?: import("./types").FadeOptions | number): import("../..").JBaseClass;
fadeOut(this: import("../..").JBaseClass, options?: import("./types").FadeOptions | number): import("../..").JBaseClass;
fadeToggle(this: import("../..").JBaseClass, options?: import("./types").FadeOptions | number): import("../..").JBaseClass;
show: typeof fadeMethods.fadeIn;
hide: typeof fadeMethods.fadeOut;
toggle: typeof fadeMethods.fadeToggle;
slideDown(this: import("../..").JBaseClass, options?: import("./types").SlideVerticalOptions): import("../..").JBaseClass;
slideUp(this: import("../..").JBaseClass, options?: import("./types").SlideVerticalOptions): import("../..").JBaseClass;
slideToggleBox(this: import("../..").JBaseClass, options?: import("./types").SlideVerticalOptions): import("../..").JBaseClass;
slideIn(this: import("../..").JBaseClass, options?: import("./types").SlideOptions): import("../..").JBaseClass;
slideOut(this: import("../..").JBaseClass, options?: import("./types").SlideOptions): import("../..").JBaseClass;
slideToggle(this: import("../..").JBaseClass, options?: import("./types").SlideOptions): import("../..").JBaseClass;
};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/effects/index.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/effects/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,WAAW,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;CAIzB,CAAC"}

44
dist/modules/effects/slide.d.ts vendored Normal file
View file

@ -0,0 +1,44 @@
/**
* @file src/modules/effects/slide.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Effects
* @description
* * Methods for horizontal sliding effects (slideIn, slideOut, slideToggle).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires ../../utils
* * Uses utility functions for environment checks.
* @requires ./types
* * Type definitions for slide options.
*/
import { jBase } from '../../core';
import { SlideOptions } from './types';
/**
* * Slides an element (e.g., a menu) into view. Sets `transform: translateX(0)`.
* @example slideIn() => Slides in all matched elements over 300ms.
* @example slideIn({ duration: 500 }) => Slides in all matched elements over 500ms.
* @param options Direction ('left'|'right') and duration in ms.
* @returns The current jBase instance.
*/
export declare function slideIn(this: jBase, options?: SlideOptions): jBase;
/**
* * Slides an element out of view.
* @example slideOut() => Slides out all matched elements to the left over 300ms.
* @example slideOut({ direction: 'right', duration: 500 }) => Slides out all matched elements to the right over 500ms.
* @param options Direction ('left'|'right') and duration in ms.
* @returns The current jBase instance.
*/
export declare function slideOut(this: jBase, options?: SlideOptions): jBase;
/**
* * Toggles between slideIn and slideOut based on the current state.
* @example slideToggle() => Slides in hidden elements and slides out visible elements to the left over 300ms.
* @example slideToggle({ direction: 'right', duration: 500 }) => Slides in hidden elements and slides out visible elements to the right over 500ms.
* @param options Direction ('left'|'right') and duration in ms.
* @returns The current jBase instance.
*/
export declare function slideToggle(this: jBase, options?: SlideOptions): jBase;
//# sourceMappingURL=slide.d.ts.map

1
dist/modules/effects/slide.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"slide.d.ts","sourceRoot":"","sources":["../../../src/modules/effects/slide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAkBtE;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAmBvE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,YAAiB,GAAG,KAAK,CAkB1E"}

33
dist/modules/effects/types.d.ts vendored Normal file
View file

@ -0,0 +1,33 @@
/**
* @file src/modules/data/types.ts
* @version 2.0.2
* @since 2.0.2
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Data
* @description
* * Type definitions and validation helpers for data structures.
*/
/**
* * Configuration options for fade effects.
*/
export interface FadeOptions {
duration?: number;
displayType?: string;
}
/**
* * Configuration interface for slide methods.
*/
export interface SlideOptions {
direction?: 'left' | 'right';
duration?: number;
}
/**
* * Configuration options for vertical slide effects.
*/
export interface SlideVerticalOptions {
duration?: number;
displayType?: string;
}
//# sourceMappingURL=types.d.ts.map

1
dist/modules/effects/types.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/effects/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}

44
dist/modules/effects/vertical.d.ts vendored Normal file
View file

@ -0,0 +1,44 @@
/**
* @file src/modules/effects/vertical.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Effects
* @description
* * Methods for vertical sliding effects (slideDown, slideUp, slideToggle).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires ../../utils
* * Utility function to check for browser environment.
* @requires ./types
* * Type definitions for effect options.
*/
import { jBase } from '../../core';
import { SlideVerticalOptions } from './types';
/**
* * Slides an element down (animates height from 0 to auto). Sets `display` property and animates height.
* @example slideDown() => Slides down all matched elements over 300ms with display: block.
* @example slideDown({ duration: 500, displayType: 'inline-block' }) => Slides down all matched elements over 500ms with display: inline-block.
* @param options Animation duration and display type.
* @returns The current jBase instance.
*/
export declare function slideDown(this: jBase, options?: SlideVerticalOptions): jBase;
/**
* * Slides an element up (animates height to 0). Sets `display: none` after animation.
* @example slideUp() => Slides up all matched elements over 300ms with display: none.
* @example slideUp({ duration: 500 }) => Slides up all matched elements over 500ms with display: none.
* @param options Animation duration.
* @returns The current jBase instance.
*/
export declare function slideUp(this: jBase, options?: SlideVerticalOptions): jBase;
/**
* * Toggles between slideDown and slideUp based on the display state.
* @example slideToggle() => Slides in hidden elements and slides out visible elements over 300ms.
* @example slideToggle({ duration: 500 }) => Slides in hidden elements and slides out visible elements over 500ms.
* @param options Animation duration.
* @returns The current jBase instance.
*/
export declare function slideToggleBox(this: jBase, options?: SlideVerticalOptions): jBase;
//# sourceMappingURL=vertical.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"vertical.d.ts","sourceRoot":"","sources":["../../../src/modules/effects/vertical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,oBAAyB,GAAG,KAAK,CA6BhF;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,oBAAyB,GAAG,KAAK,CAwB9E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAE,oBAAyB,GAAG,KAAK,CAgBrF"}

66
dist/modules/events/binding.d.ts vendored Normal file
View file

@ -0,0 +1,66 @@
/**
* @file src/modules/events/binding.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Core event binding methods (on, off, trigger). Handles event registration and removal.
* @requires ../../core
* * Depends on the core jBase class for type definitions.
* @requires ../../utils
* * Uses utility functions for iteration and environment checks.
*/
import { jBase } from '../../core';
/**
* * Attaches an event handler function for one or more events to the selected elements.
* * This core method handles dynamic event delegation and allows passing custom data.
* @example on('click', handler) => Binds a click event handler to all matched elements.
* @example on('click', '.btn', handler) => Binds a click event handler to all current and future elements matching '.btn' within the matched elements.
* @example on('click', { key: 'value' }, handler) => Binds a click event handler and passes custom data to the event object.
* @param events One or more space-separated event types (e.g., 'click', 'mouseenter mouseleave').
* @param selectorOrDataOrHandler A CSS selector string for delegation, custom data, or the callback function.
* @param dataOrHandler Custom data to pass to `event.data`, or the callback function.
* @param handlerOrUndefined The callback function to execute when the event is triggered.
* @returns The current jBase instance for method chaining.
*/
export declare function on(this: jBase, events: string, selectorOrDataOrHandler: any, dataOrHandler?: any, handlerOrUndefined?: any): jBase;
/**
* * Removes an event handler previously attached with `.on()`.
* * Can remove all handlers for an event, or specific ones by selector or handler reference.
* @example off('click') => Removes all click handlers from the matched elements.
* @example off('click', '.btn') => Removes all click handlers that were delegated to '.btn' within the matched elements.
* @example off('click', handler) => Removes the specific click handler function from the matched elements.
* @example off('click', '.btn', handler) => Removes the specific click handler function that was delegated to '.btn' within the matched elements.
* @param events One or more space-separated event types (e.g., 'click').
* @param selectorOrHandler A CSS selector string originally used for delegation, or the specific handler function.
* @param handlerOrUndefined The specific handler function to remove.
* @returns The current jBase instance for method chaining.
*/
export declare function off(this: jBase, events: string, selectorOrHandler?: any, handlerOrUndefined?: any): jBase;
/**
* * Attaches an event handler that will be executed at most once per element and event type.
* * Automatically unbinds itself after the first execution. Supports event delegation and custom data.
* @example once('click', handler) => Binds a click event handler that executes only once for all matched elements.
* @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.
* @example once('click', { key: 'value' }, handler) => Binds a click event handler that executes only once and passes custom data to the event object.
* @param events One or more space-separated event types.
* @param selectorOrDataOrHandler A CSS selector string for delegation, custom data, or the callback function.
* @param dataOrHandler Custom data to pass to `event.data`, or the callback function.
* @param handlerOrUndefined The callback function to execute when the event is triggered.
* @returns The current jBase instance for method chaining.
*/
export declare function once(this: jBase, events: string, selectorOrDataOrHandler: any, dataOrHandler?: any, handlerOrUndefined?: any): jBase;
/**
* * Triggers an event on each element in the collection.
* @example trigger('customEvent') => Triggers 'customEvent' on all matched elements.
* @example trigger('customEvent', { key: 'value' }) => Triggers 'customEvent' on all matched elements and passes custom data to the event object.
* @example trigger('click') => Programmatically triggers a click event on all matched elements.
* @example trigger('click', { key: 'value' }) => Programmatically triggers a click event on all matched elements and passes custom data to the event object.
* @param eventName The name of the event to trigger.
* @param data Optional data to pass to the event (accessible via event.detail).
*/
export declare function trigger(this: jBase, eventName: string, data?: any): jBase;
//# sourceMappingURL=binding.d.ts.map

1
dist/modules/events/binding.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../../src/modules/events/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAInC;;;;;;;;;;;GAWG;AACH,wBAAgB,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,GAAG,GAAG,KAAK,CAiDlI;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,GAAG,GAAG,KAAK,CA4BzG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,GAAG,GAAG,KAAK,CAyBpI;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,KAAK,CAUzE"}

52
dist/modules/events/form.d.ts vendored Normal file
View file

@ -0,0 +1,52 @@
/**
* @file src/modules/events/form.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Methods for handling form events (submit, change, focus, blur, input).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Registers an event handler for the 'submit' event. Triggered when a form is submitted.
* @example submit(handler) => Binds a submit event handler to all matched forms.
* @param handler The function to execute when the event occurs.
* @returns The current jBase instance for chaining.
*/
export declare function submit(this: jBase, handler: (event: SubmitEvent) => void): jBase;
/**
* * Registers an event handler for the 'change' event. Triggered when the value of an element (<input>, <select>, <textarea>) is changed by the user and committed (e.g., on blur).
* @example change(handler) => Binds a change event handler to all matched form elements.
* @param handler The function to execute when the event occurs.
* @returns The current jBase instance for chaining.
*/
export declare function change(this: jBase, handler: (event: Event) => void): jBase;
/**
* * Registers an event handler for the 'input' event. Triggered immediately when the value changes (real-time, e.g., every keystroke).
* @example input(handler) => Binds an input event handler to all matched form elements.
* @param handler The function to execute when the event occurs.
* @returns The current jBase instance for chaining.
*/
export declare function input(this: jBase, handler: (event: Event) => void): jBase;
/**
* * Handles the 'focus' event. If a handler is provided, it binds the listener. If no handler is provided, it programmatically sets focus on the element(s).
* @example focus(handler) => Binds a focus event handler to all matched elements.
* @example focus() => Programmatically focuses the first matched element.
* @param handler (Optional) The function to execute when the event occurs.
* @returns The current jBase instance for chaining.
*/
export declare function focus(this: jBase, handler?: (event: FocusEvent) => void): jBase;
/**
* * Handles the 'blur' event (element loses focus). If a handler is provided, it binds the listener. If no handler is provided, it programmatically removes focus.
* @example blur(handler) => Binds a blur event handler to all matched elements.
* @example blur() => Programmatically blurs the first matched element.
* @param handler (Optional) The function to execute when the event occurs.
* @returns The current jBase instance for chaining.
*/
export declare function blur(this: jBase, handler?: (event: FocusEvent) => void): jBase;
//# sourceMappingURL=form.d.ts.map

1
dist/modules/events/form.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/modules/events/form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,KAAK,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,KAAK,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,KAAK,CAEzE;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAS/E;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAS9E"}

61
dist/modules/events/index.d.ts vendored Normal file
View file

@ -0,0 +1,61 @@
/**
* @file src/modules/events/index.ts
* @version 2.0.2
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Central entry point for event handling. Aggregates binding, mouse, lifecycle, keyboard, form, and touch events.
* @requires ./binding
* * General event binding (on, off).
* @requires ./mouse
* * Mouse interaction events (click, hover, etc.).
* @requires ./lifecycle
* * DOM lifecycle events (ready).
* @requires ./keyboard
* * Keyboard interaction events (keydown, keyup).
* @requires ./form
* * Form handling events (submit, change, input).
* @requires ./touch
* * Touch interaction events.
*/
/**
* * Aggregated object of all event methods. Combines logic from various sub-modules into a single object. Used to extend the `jBase` prototype via `Object.assign`.
*/
export declare const eventMethods: {
touchstart(this: import("../..").JBaseClass, handler: (event: TouchEvent) => void): import("../..").JBaseClass;
touchend(this: import("../..").JBaseClass, handler: (event: TouchEvent) => void): import("../..").JBaseClass;
touchmove(this: import("../..").JBaseClass, handler: (event: TouchEvent) => void): import("../..").JBaseClass;
touchcancel(this: import("../..").JBaseClass, handler: (event: TouchEvent) => void): import("../..").JBaseClass;
swipeLeft(this: import("../..").JBaseClass, handler: (e: TouchEvent) => void): import("../..").JBaseClass;
swipeRight(this: import("../..").JBaseClass, handler: (e: TouchEvent) => void): import("../..").JBaseClass;
swipeUp(this: import("../..").JBaseClass, handler: (e: TouchEvent) => void): import("../..").JBaseClass;
swipeDown(this: import("../..").JBaseClass, handler: (e: TouchEvent) => void): import("../..").JBaseClass;
submit(this: import("../..").JBaseClass, handler: (event: SubmitEvent) => void): import("../..").JBaseClass;
change(this: import("../..").JBaseClass, handler: (event: Event) => void): import("../..").JBaseClass;
input(this: import("../..").JBaseClass, handler: (event: Event) => void): import("../..").JBaseClass;
focus(this: import("../..").JBaseClass, handler?: (event: FocusEvent) => void): import("../..").JBaseClass;
blur(this: import("../..").JBaseClass, handler?: (event: FocusEvent) => void): import("../..").JBaseClass;
keydown(this: import("../..").JBaseClass, handler: (event: KeyboardEvent) => void): import("../..").JBaseClass;
keyup(this: import("../..").JBaseClass, handler: (event: KeyboardEvent) => void): import("../..").JBaseClass;
keypress(this: import("../..").JBaseClass, handler: (event: KeyboardEvent) => void): import("../..").JBaseClass;
pressedKey(this: import("../..").JBaseClass, targetKey: string, handler: (event: KeyboardEvent) => void): import("../..").JBaseClass;
ready(this: import("../..").JBaseClass, handler: () => void): import("../..").JBaseClass;
click(this: import("../..").JBaseClass, handler?: (event: Event) => void): import("../..").JBaseClass;
mousemove(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
mouseleave(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
mouseenter(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
mousedown(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
mouseup(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
dblclick(this: import("../..").JBaseClass, handler?: (event: MouseEvent) => void): import("../..").JBaseClass;
mouseout(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
mouseover(this: import("../..").JBaseClass, handler: (event: MouseEvent) => void): import("../..").JBaseClass;
hover(this: import("../..").JBaseClass, handlerIn: (event: MouseEvent) => void, handlerOut: (event: MouseEvent) => void): import("../..").JBaseClass;
on(this: import("../..").JBaseClass, events: string, selectorOrDataOrHandler: any, dataOrHandler?: any, handlerOrUndefined?: any): import("../..").JBaseClass;
off(this: import("../..").JBaseClass, events: string, selectorOrHandler?: any, handlerOrUndefined?: any): import("../..").JBaseClass;
once(this: import("../..").JBaseClass, events: string, selectorOrDataOrHandler: any, dataOrHandler?: any, handlerOrUndefined?: any): import("../..").JBaseClass;
trigger(this: import("../..").JBaseClass, eventName: string, data?: any): import("../..").JBaseClass;
};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/events/index.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/events/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AASH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOxB,CAAC"}

44
dist/modules/events/keyboard.d.ts vendored Normal file
View file

@ -0,0 +1,44 @@
/**
* @file src/modules/events/keyboard.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Methods for handling keyboard events (keydown, keyup, keypress).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Binds an event handler to the 'keydown' event. Fires immediately when a key is pressed (repeats if held).
* @example keydown(handler) => Binds a keydown event handler to all matched elements.
* @param handler The callback function receiving the KeyboardEvent.
* @returns The current jBase instance for method chaining.
*/
export declare function keydown(this: jBase, handler: (event: KeyboardEvent) => void): jBase;
/**
* * Binds an event handler to the 'keyup' event. Fires when a key is released.
* @example keyup(handler) => Binds a keyup event handler to all matched elements.
* @param handler The callback function receiving the KeyboardEvent.
* @returns The current jBase instance for method chaining.
*/
export declare function keyup(this: jBase, handler: (event: KeyboardEvent) => void): jBase;
/**
* * Binds an event handler to the 'keypress' event. Deprecated in modern standards.
* @deprecated Use keydown or input instead.
* @param handler The callback function receiving the KeyboardEvent.
* @returns The current jBase instance for method chaining.
*/
export declare function keypress(this: jBase, handler: (event: KeyboardEvent) => void): jBase;
/**
* * Binds an event handler for a specific key (case-insensitive).
* @example pressedKey('Enter', handler) => Binds a handler that executes when the Enter key is pressed on any matched element.
* @param targetKey The key to react to (e.g., 'm', 'Enter', 'Escape').
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function pressedKey(this: jBase, targetKey: string, handler: (event: KeyboardEvent) => void): jBase;
//# sourceMappingURL=keyboard.d.ts.map

1
dist/modules/events/keyboard.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/modules/events/keyboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,KAAK,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,KAAK,CAEjF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,KAAK,CAEpF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,KAAK,CAOzG"}

22
dist/modules/events/lifecycle.d.ts vendored Normal file
View file

@ -0,0 +1,22 @@
/**
* @file src/modules/events/lifecycle.ts
* @version 2.0.3
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Methods for handling DOM lifecycle events (e.g., ready).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Executes the handler as soon as the DOM is fully loaded and parsed. If the document is already ready (readyState 'interactive' or 'complete'), the handler executes immediately to avoid race conditions.
* @example ready(handler) => Binds a handler to execute when the DOM is ready.
* @param handler The callback function to execute when the DOM is ready.
* @returns The current jBase instance for method chaining.
*/
export declare function ready(this: jBase, handler: () => void): jBase;
//# sourceMappingURL=lifecycle.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/modules/events/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,KAAK,CAQ7D"}

89
dist/modules/events/mouse.d.ts vendored Normal file
View file

@ -0,0 +1,89 @@
/**
* @file src/modules/events/mouse.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Methods for handling mouse events (click, dblclick, hover, mouseenter, mouseleave).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Binds an event handler to the "click" JavaScript event, or triggers that event on an element.
* * If no handler is provided, it programmatically triggers a native click on all matched elements.
* @example click(handler) => Binds a click event handler to all matched elements.
* @example click() => Programmatically triggers a click event on all matched elements.
* @param handler (Optional) A function to execute each time the click event is triggered.
* @returns The current jBase instance for method chaining.
*/
export declare function click(this: jBase, handler?: (event: Event) => void): jBase;
/**
* * Binds an event handler to the 'mousemove' event. Fires continuously while the pointer moves inside the element.
* @example mousemove(handler) => Binds a mousemove event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mousemove(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'mouseleave' event. Fires when the pointer leaves the element (does not bubble).
* @example mouseleave(handler) => Binds a mouseleave event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mouseleave(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'mouseenter' event. Fires when the pointer enters the element (does not bubble).
* @example mouseenter(handler) => Binds a mouseenter event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mouseenter(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'mousedown' event. Fires as soon as a mouse button is pressed over the element.
* @example mousedown(handler) => Binds a mousedown event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mousedown(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'mouseup' event. Fires when a mouse button is released over the element.
* @example mouseup(handler) => Binds a mouseup event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mouseup(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'dblclick' event or triggers it manually.
* @example dblclick(handler) => Binds a dblclick event handler to all matched elements.
* @param handler (Optional) The callback function.
* @returns The current jBase instance.
*/
export declare function dblclick(this: jBase, handler?: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'mouseout' event. Fires when the pointer leaves the element OR one of its children (bubbles).
* @example mouseout(handler) => Binds a mouseout event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mouseout(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds an event handler to the 'mouseover' event. Fires when the pointer enters the element OR one of its children (bubbles).
* @example mouseover(handler) => Binds a mouseover event handler to all matched elements.
* @param handler The callback function.
* @returns The current jBase instance.
*/
export declare function mouseover(this: jBase, handler: (event: MouseEvent) => void): jBase;
/**
* * Binds two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
* * This is a highly convenient shorthand for chaining `.mouseenter()` and `.mouseleave()`.
* @example hover(handlerIn, handlerOut) => Binds handlerIn to mouseenter and handlerOut to mouseleave for all matched elements.
* @param handlerIn A function to execute when the mouse pointer enters the element.
* @param handlerOut A function to execute when the mouse pointer leaves the element.
* @returns The current jBase instance for method chaining.
*/
export declare function hover(this: jBase, handlerIn: (event: MouseEvent) => void, handlerOut: (event: MouseEvent) => void): jBase;
//# sourceMappingURL=mouse.d.ts.map

1
dist/modules/events/mouse.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"mouse.d.ts","sourceRoot":"","sources":["../../../src/modules/events/mouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,KAAK,CAS1E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAElF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAElF;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAelF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEjF;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEzH"}

75
dist/modules/events/touch.d.ts vendored Normal file
View file

@ -0,0 +1,75 @@
/**
* @file src/modules/events/touch.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Events
* @description
* * Methods for handling touch events (touchstart, touchend, touchmove).
* @requires ../../core
* * Depends on the core jBase class for type definitions.
*/
import { jBase } from '../../core';
/**
* * Binds an event handler to the 'touchstart' event. Triggered when a touch point is placed on the touch surface.
* @example touchstart(handler) => Binds a touchstart event handler to all matched elements.
* @param handler The callback function executed on touch start.
* @returns The current jBase instance for method chaining.
*/
export declare function touchstart(this: jBase, handler: (event: TouchEvent) => void): jBase;
/**
* * Binds an event handler to the 'touchend' event. Triggered when a touch point is removed from the touch surface.
* @example touchend(handler) => Binds a touchend event handler to all matched elements.
* @param handler The callback function executed on touch end.
* @returns The current jBase instance for method chaining.
*/
export declare function touchend(this: jBase, handler: (event: TouchEvent) => void): jBase;
/**
* * Binds an event handler to the 'touchmove' event. Triggered when a touch point moves along the touch surface. Important for swipe gestures or Drag & Drop.
* @example touchmove(handler) => Binds a touchmove event handler to all matched elements.
* @param handler The callback function executed on movement.
* @returns The current jBase instance for method chaining.
*/
export declare function touchmove(this: jBase, handler: (event: TouchEvent) => void): jBase;
/**
* * Binds an event handler to the 'touchcancel' event. Triggered when a touch point has been disrupted by the system (e.g., too many touch points or a UI popup).
* @example touchcancel(handler) => Binds a touchcancel event handler to all matched elements.
* @param handler The callback function executed on cancellation.
* @returns The current jBase instance for method chaining.
*/
export declare function touchcancel(this: jBase, handler: (event: TouchEvent) => void): jBase;
/**
* * Binds an event handler to be executed when the user swipes left across the selected elements.
* * The swipe must cover a minimum distance of 50 pixels to trigger.
* @example swipeLeft(handler) => Binds a handler to execute when a left swipe gesture is detected on all matched elements.
* @param handler A function to execute when the left swipe gesture is detected.
* @returns The current jBase instance for method chaining.
*/
export declare function swipeLeft(this: jBase, handler: (e: TouchEvent) => void): jBase;
/**
* * Binds an event handler to be executed when the user swipes right across the selected elements.
* * The swipe must cover a minimum distance of 50 pixels to trigger.
* @example swipeRight(handler) => Binds a handler to execute when a right swipe gesture is detected on all matched elements.
* @param handler A function to execute when the right swipe gesture is detected.
* @returns The current jBase instance for method chaining.
*/
export declare function swipeRight(this: jBase, handler: (e: TouchEvent) => void): jBase;
/**
* * Binds an event handler to be executed when the user swipes up across the selected elements.
* * The swipe must cover a minimum distance of 50 pixels to trigger.
* @example swipeUp(handler) => Binds a handler to execute when an upward swipe gesture is detected on all matched elements.
* @param handler A function to execute when the upward swipe gesture is detected.
* @returns The current jBase instance for method chaining.
*/
export declare function swipeUp(this: jBase, handler: (e: TouchEvent) => void): jBase;
/**
* * Binds an event handler to be executed when the user swipes down across the selected elements.
* * The swipe must cover a minimum distance of 50 pixels to trigger.
* @example swipeDown(handler) => Binds a handler to execute when a downward swipe gesture is detected on all matched elements.
* @param handler A function to execute when the downward swipe gesture is detected.
* @returns The current jBase instance for method chaining.
*/
export declare function swipeDown(this: jBase, handler: (e: TouchEvent) => void): jBase;
//# sourceMappingURL=touch.d.ts.map

1
dist/modules/events/touch.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"touch.d.ts","sourceRoot":"","sources":["../../../src/modules/events/touch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEnF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEjF;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAElF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAEpF;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAE/E;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAE5E;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,GAAG,KAAK,CAE9E"}

35
dist/modules/http/get.d.ts vendored Normal file
View file

@ -0,0 +1,35 @@
/**
* @file src/modules/http/get.ts
* @version 2.0.6
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category HTTP
* @description
* * Abstraction for HTTP GET requests.
*/
/**
* * Performs an asynchronous HTTP GET request and expects a JSON response. Includes an automatic timeout of 5000ms to avoid hanging requests.
* @example const data = await get<UserData>('/api/user/1'); => Fetches user data from the specified endpoint and parses it as JSON.
* @example const data = await get('/api/user/1', { signal: customAbortSignal }); => Fetches user data with a custom abort signal for cancellation.
* @template T The expected type of the response data (Generic).
* @param url The target URL for the request.
* @param option Optional RequestInit object to customize the fetch request.
* @returns A Promise resolving with the typed JSON data.
* @throws Error if HTTP status is not in success range (200-299) or a timeout occurs.
*/
export declare function get<T>(url: string, option?: RequestInit): Promise<T>;
/**
* * Performs an asynchronous HTTP GET request and returns the raw text content. Ideal for loading HTML fragments (Server-Side Rendering Partials) or plain text.
* @example const html = await getText('/templates/modal.html'); => Fetches an HTML template as a string for later insertion into the DOM.
* @example const text = await getText('/api/status'); => Fetches a plain text status message from the server.
* @example const html = await getText('/templates/modal.html', { signal: customAbortSignal }); => Fetches an HTML template with a custom abort signal for cancellation.
* @template T The expected type of the response data (Generic, defaults to string).
* @param url The target URL for the request.
* @param option Optional RequestInit object to customize the fetch request.
* @returns A Promise containing the response body as a string.
* @throws Error if HTTP status is not in success range (200-299).
*/
export declare function getText<T = string>(url: string, option?: RequestInit): Promise<T>;
//# sourceMappingURL=get.d.ts.map

1
dist/modules/http/get.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/modules/http/get.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,wBAAsB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAoB1E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAoBvF"}

27
dist/modules/http/index.d.ts vendored Normal file
View file

@ -0,0 +1,27 @@
/**
* @file src/modules/http/index.ts
* @version 2.1.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category HTTP
* @description
* * Central entry point for HTTP requests. Aggregates GET and POST methods.
* @requires ./get
* * HTTP GET methods (get, getText).
* @requires ./post
* * HTTP POST methods.
* @requires ./upload
* * HTTP file upload method with progress tracking.
*/
/**
* * The central HTTP client of the framework. Aggregates all HTTP methods (GET, POST, etc.) into a unified interface. Acts as a wrapper around the native `fetch` API to simplify JSON parsing, error handling, and typing.
*/
export declare const http: {
upload<T>(url: string, data: FormData | File, onProgress?: (percentage: number, loaded: number, total: number) => void): Promise<T>;
post<T>(url: string, body?: any, option?: RequestInit): Promise<T>;
get<T>(url: string, option?: RequestInit): Promise<T>;
getText<T = string>(url: string, option?: RequestInit): Promise<T>;
};
//# sourceMappingURL=index.d.ts.map

1
dist/modules/http/index.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/http/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH;;GAEG;AACH,eAAO,MAAM,IAAI;;;;;CAIhB,CAAC"}

23
dist/modules/http/post.d.ts vendored Normal file
View file

@ -0,0 +1,23 @@
/**
* @file src/modules/http/post.ts
* @version 2.0.5
* @since 2.0.2
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category HTTP
* * @description
* * Abstraction for HTTP POST requests.
*/
/**
* * Performs an asynchronous HTTP POST request to the specified URL. Automatically sets the 'Content-Type' header to 'application/json' and serializes the body.
* @example const response = await post('/api/login', { username: 'user', password: 'pass' });
* @template T The expected response type (Generic).
* @param url The target URL for the request.
* @param body The data to send (automatically JSON serialized). Default is {}.
* @param option Optional RequestInit object to customize the fetch request.
* @returns A Promise resolving with the deserialized JSON response of type T.
* @throws Error if the HTTP status code is not in the range 200-299.
*/
export declare function post<T>(url: string, body?: any, option?: RequestInit): Promise<T>;
//# sourceMappingURL=post.d.ts.map

1
dist/modules/http/post.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../src/modules/http/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,GAAQ,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CA6B3F"}

30
dist/modules/http/upload.d.ts vendored Normal file
View file

@ -0,0 +1,30 @@
/**
* @file src/modules/http/upload.ts
* @version 2.0.0
* @since 2.3.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category HTTP
* * @description
* * Abstraction for HTTP POST requests.
*/
/**
* * Performs a multipart/form-data upload with precise progress tracking.
* * Uses XMLHttpRequest under the hood because the native Fetch API lacks upload progress support.
* @example
* const fileInput = $('input[type="file"]')[0] as HTMLInputElement;
* if (fileInput && fileInput.files?.length) {
* await $.http.upload('/upload', fileInput.files[0], (percentage) => {
* // Update a progress bar using jBase
* $('#progress-bar').css('width', `${percentage}%`);
* });
* }
* @template T The expected response type (Generic).
* @param url The target endpoint.
* @param data A FormData object or a single File.
* @param onProgress Optional callback receiving the progress percentage (0-100), loaded bytes, and total bytes.
* @returns A Promise resolving to the parsed JSON response.
*/
export declare function upload<T>(url: string, data: FormData | File, onProgress?: (percentage: number, loaded: number, total: number) => void): Promise<T>;
//# sourceMappingURL=upload.d.ts.map

1
dist/modules/http/upload.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/modules/http/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAoCxJ"}

13
dist/server.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
/**
* * Parses an HTML string on the server, allowing DOM manipulation.
* @param html The raw HTML string.
* @returns An object containing the window, document, and the jBase instance setup.
*/
export declare function parseHTML(html: string): {
$: (selector: import("./types").JBaseInput) => import("./core").jBase;
document: Document;
window: Window;
html: () => string;
close: () => void;
};
//# sourceMappingURL=server.d.ts.map

1
dist/server.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM;;;;;;EAWrC"}

3027
dist/server.js vendored Normal file

File diff suppressed because it is too large Load diff

7
dist/server.js.map vendored Normal file

File diff suppressed because one or more lines are too long

51
dist/types.d.ts vendored Normal file
View file

@ -0,0 +1,51 @@
/**
* @file src/types.ts
* @version 2.0.2
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Types
* @description
* * Central type definitions, interfaces, and aliases for the jBase library.
*/
/**
* * Represents the basic DOM elements managed by a jBase instance. Includes standard HTML elements, the Document, the Window object, and generic elements (e.g., SVG).
*/
export type JBaseElement = HTMLElement | Document | Window | Element;
/**
* * Union type for all valid inputs to the main selector function $(...). Accepts CSS selectors (string), single DOM elements, NodeLists, Arrays, or null/undefined.
*/
export type JBaseInput = string | JBaseElement | NodeList | JBaseElement[] | null | undefined;
/**
* * Extracts valid CSS property names from the native CSSStyleDeclaration. Excludes methods (like setProperty) and numeric indices to ensure type safety and autocomplete.
*/
export type JBaseCSSProperty = Exclude<keyof CSSStyleDeclaration, 'length' | 'parentRule' | 'getPropertyPriority' | 'getPropertyValue' | 'item' | 'removeProperty' | 'setProperty' | number>;
/**
* * Extended event map linking native DOM events with framework-specific custom events. Serves as the base for generics in .on() and .off() to infer correct event types.
*/
export interface JBaseEventMap extends HTMLElementEventMap {
/**
* * Fired when the framework and DOM are fully initialized.
*/
'jbase:ready': CustomEvent;
}
/**
* * Generic type for event handlers. Allows TypeScript to infer the 'event' parameter type based on the event name (K).
*/
export type JBaseEventHandler<K extends keyof JBaseEventMap> = (event: JBaseEventMap[K]) => void;
/**
* * Fallback type for generic event handlers where the specific event type is unknown.
*/
export type GenericEventHandler = (event: Event) => void;
/**
* * Standardized interface for API responses in the http module.
* @template T
* * The expected type of the data payload.
*/
export interface ApiResponse<T = any> {
success: boolean;
data?: T;
error?: string;
}
//# sourceMappingURL=types.d.ts.map

1
dist/types.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,YAAY,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9F;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,mBAAmB,EAAE,QAAQ,GAAG,YAAY,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,GAAG,MAAM,CAAC,CAAC;AAE7L;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,mBAAmB;IACtD;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,aAAa,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAEjG;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAEzD;;;;GAIG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}

59
dist/utils.d.ts vendored Normal file
View file

@ -0,0 +1,59 @@
/**
* @file src/utils.ts
* @version 2.2.0
* @since 2.0.0
* @license GPL-3.0-or-later
* @copyright Sven Minio 2026
* @author Sven Minio <https://sven-minio.de>
* @category Utilities
* @description
* * General utility functions and helpers (e.g., debounce, throttle, type checks).
*/
/**
* * Creates a throttled version of the provided function. The function is executed at most once within the specified time interval, regardless of how often it is called.
* Use case: Performance optimization for high-frequency events (e.g., Scroll, Resize, Mousemove).
* @example const throttledScroll = throttle(() => { console.log('Scroll event'); }, 200); => Creates a throttled scroll event handler that logs at most once every 200 milliseconds.
* @template T The type of the original function.
* @param func The function to be throttled.
* @param limit The time interval in milliseconds during which at most one execution is permitted.
* @returns A new function that throttles calls.
*/
export declare function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void;
/**
* * Creates a debounced version of the provided function. Execution is delayed until `delay` milliseconds have passed since the last invocation.
* Use case: Waiting for user input (e.g., Live Search, Validation) to avoid unnecessary calculations.
* @example const debouncedInput = debounce(() => { console.log('Input event'); }, 300); => Creates a debounced input event handler that logs only after the user has stopped typing for 300 milliseconds.
* @template T The type of the original function.
* @param func The function to be debounced.
* @param delay The waiting time in milliseconds after the last call.
* @returns A new function that delays execution.
*/
export declare function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
/**
* * Checks if the code is running in a browser environment.
* * Verifies the existence of `window` and `requestAnimationFrame` to ensure animation support.
* * Used to safely guard DOM-dependent logic (Effects, Events) during Server-Side Rendering (SSR).
* @example const isBrowserEnv = isBrowser(); => Checks if the code is running in a browser environment.
* @returns `true` if running in a browser with animation support, otherwise `false`.
*/
export declare function isBrowser(): boolean;
/**
* * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.
* * Arrays and array-like objects with a length property are iterated by numeric index.
* * Objects are iterated via their named properties.
* * Returning 'false' in the callback breaks the loop early.
* @example each([1, 2, 3], (index, value) => { console.log(index, value); }) => Logs the index and value of each item in the array.
* @example each({ a: 1, b: 2 }, (key, value) => { console.log(key, value); }) => Logs the key and value of each property in the object.
* @template T The type of the items in the collection.
* @param collection The array, array-like object, or plain object to iterate over.
* @param callback The function that will be executed on every object.
*/
export declare function each<T>(collection: T[] | ArrayLike<T> | Record<string, T>, callback: (this: T, indexOrKey: any, value: T) => boolean | void): collection is T[] | ArrayLike<T> | Record<string, T>;
/**
* * Internal Helper: Sanitizes an HTML string by removing dangerous attributes.
* * Strips inline event handlers and javascript: protocols to mitigate XSS.
* @param htmlStr The raw HTML string.
* @returns The sanitized HTML string.
*/
export declare function sanitizeDangerousAttributes(htmlStr: string): string;
//# sourceMappingURL=utils.d.ts.map

1
dist/utils.d.ts.map vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAUpH;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAMpH;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,GAAG,UAAU,IAAI,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAoBlM;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAInE"}