@aegis-framework/artemis 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +555 -96
- package/dist/artemis.browser.js +2 -2
- package/dist/artemis.browser.js.map +19 -18
- package/dist/artemis.js +2 -2
- package/dist/artemis.js.map +18 -17
- package/dist/types/DOM.d.ts +190 -207
- package/dist/types/DOM.d.ts.map +1 -1
- package/dist/types/Debug.d.ts +73 -2
- package/dist/types/Debug.d.ts.map +1 -1
- package/dist/types/FileSystem.d.ts +55 -38
- package/dist/types/FileSystem.d.ts.map +1 -1
- package/dist/types/Form.d.ts +41 -16
- package/dist/types/Form.d.ts.map +1 -1
- package/dist/types/Platform.d.ts +62 -63
- package/dist/types/Platform.d.ts.map +1 -1
- package/dist/types/Preload.d.ts +70 -11
- package/dist/types/Preload.d.ts.map +1 -1
- package/dist/types/Request.d.ts +111 -47
- package/dist/types/Request.d.ts.map +1 -1
- package/dist/types/Space.d.ts +19 -6
- package/dist/types/Space.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/IndexedDB.d.ts +10 -7
- package/dist/types/SpaceAdapter/IndexedDB.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/LocalStorage.d.ts +18 -8
- package/dist/types/SpaceAdapter/LocalStorage.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/RemoteStorage.d.ts +15 -2
- package/dist/types/SpaceAdapter/RemoteStorage.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/SessionStorage.d.ts +21 -2
- package/dist/types/SpaceAdapter/SessionStorage.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/types.d.ts +32 -1
- package/dist/types/SpaceAdapter/types.d.ts.map +1 -1
- package/dist/types/Text.d.ts +34 -23
- package/dist/types/Text.d.ts.map +1 -1
- package/dist/types/Util.d.ts +18 -14
- package/dist/types/Util.d.ts.map +1 -1
- package/dist/types/browser.d.ts.map +1 -1
- package/package.json +10 -11
package/dist/types/DOM.d.ts
CHANGED
|
@@ -3,381 +3,364 @@
|
|
|
3
3
|
* DOM
|
|
4
4
|
* ==============================
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* Type for elements that can be used as a selector
|
|
8
|
-
*/
|
|
9
6
|
export type DOMSelector = string | Element | Element[] | NodeList | NodeListOf<Element> | HTMLElement[] | DOM | null;
|
|
10
|
-
/**
|
|
11
|
-
* Type for style properties object
|
|
12
|
-
*/
|
|
13
7
|
export type StyleProperties = Record<string, string | number>;
|
|
14
|
-
/**
|
|
15
|
-
* Type for offset object
|
|
16
|
-
*/
|
|
17
8
|
export interface DOMOffset {
|
|
18
9
|
top: number;
|
|
19
10
|
left: number;
|
|
20
11
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Event callback type
|
|
23
|
-
*/
|
|
24
12
|
export type EventCallback = (event: Event) => void;
|
|
25
|
-
|
|
26
|
-
* Element callback type
|
|
27
|
-
*/
|
|
28
|
-
export type ElementCallback = (element: Element) => void;
|
|
13
|
+
export type ElementCallback = (element: HTMLElement, index: number) => void;
|
|
29
14
|
/**
|
|
30
15
|
* Simple DOM manipulation functions
|
|
31
16
|
*/
|
|
32
17
|
export declare class DOM {
|
|
33
|
-
collection:
|
|
18
|
+
collection: HTMLElement[];
|
|
34
19
|
length: number;
|
|
35
|
-
_selector: DOMSelector;
|
|
36
|
-
/**
|
|
37
|
-
* Create a new DOM object
|
|
38
|
-
*
|
|
39
|
-
* @param selector - Selector or DOM element to use
|
|
40
|
-
*/
|
|
41
20
|
constructor(selector: DOMSelector);
|
|
42
21
|
/**
|
|
43
|
-
* Hide elements by setting
|
|
44
|
-
*
|
|
45
|
-
* @returns Current instance
|
|
22
|
+
* Hide elements by setting display to none
|
|
46
23
|
*/
|
|
47
24
|
hide(): this;
|
|
48
25
|
/**
|
|
49
|
-
* Show elements by setting
|
|
26
|
+
* Show elements by setting display property
|
|
50
27
|
*
|
|
51
|
-
* @param display - Display
|
|
52
|
-
* @returns Current instance
|
|
28
|
+
* @param display - Display value (default: 'block')
|
|
53
29
|
*/
|
|
54
30
|
show(display?: string): this;
|
|
55
31
|
/**
|
|
56
|
-
* Add a class to
|
|
32
|
+
* Add a class to all elements
|
|
57
33
|
*
|
|
58
34
|
* @param newClass - Class name to add
|
|
59
|
-
* @returns Current instance
|
|
60
35
|
*/
|
|
61
36
|
addClass(newClass: string): this;
|
|
62
37
|
/**
|
|
63
|
-
* Remove a
|
|
38
|
+
* Remove a class or all classes from all elements
|
|
64
39
|
*
|
|
65
|
-
* @param oldClass - Class to remove
|
|
66
|
-
* @returns Current instance
|
|
40
|
+
* @param oldClass - Class name to remove (if omitted, removes all classes)
|
|
67
41
|
*/
|
|
68
|
-
removeClass(oldClass?: string
|
|
42
|
+
removeClass(oldClass?: string): this;
|
|
69
43
|
/**
|
|
70
|
-
* Toggle
|
|
44
|
+
* Toggle one or more classes on all elements
|
|
71
45
|
*
|
|
72
|
-
* @param classes - Space
|
|
73
|
-
* @returns Current instance
|
|
46
|
+
* @param classes - Space-separated class names to toggle
|
|
74
47
|
*/
|
|
75
48
|
toggleClass(classes: string): this;
|
|
76
49
|
/**
|
|
77
|
-
* Check if
|
|
50
|
+
* Check if all elements have a given class
|
|
78
51
|
*
|
|
79
|
-
* @param classToCheck - Class name to check
|
|
80
|
-
* @returns Whether all elements have the class
|
|
52
|
+
* @param classToCheck - Class name to check
|
|
81
53
|
*/
|
|
82
54
|
hasClass(classToCheck: string): boolean;
|
|
83
55
|
/**
|
|
84
|
-
* Get or set the value
|
|
85
|
-
*
|
|
86
|
-
* @param value - Value to set to the elements
|
|
87
|
-
* @returns If a value is provided, returns current instance. Otherwise returns the value(s) - single value if one element, array if multiple.
|
|
56
|
+
* Get or set the value of form elements
|
|
88
57
|
*/
|
|
89
|
-
value(value
|
|
58
|
+
value(value: string | number): this;
|
|
59
|
+
value(): string | undefined;
|
|
90
60
|
/**
|
|
91
|
-
* Focus
|
|
92
|
-
*
|
|
93
|
-
* @returns Current instance
|
|
61
|
+
* Focus the first element in the collection
|
|
94
62
|
*/
|
|
95
63
|
focus(): this;
|
|
96
64
|
/**
|
|
97
|
-
*
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
65
|
+
* Blur (unfocus) the first element in the collection
|
|
66
|
+
*/
|
|
67
|
+
blur(): this;
|
|
68
|
+
/**
|
|
69
|
+
* Attach a click event handler
|
|
101
70
|
*/
|
|
102
71
|
click(callback: EventCallback): this;
|
|
103
72
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* @param callback - Callback function to run when the event is triggered
|
|
107
|
-
* @returns Current instance
|
|
73
|
+
* Attach a keyup event handler
|
|
108
74
|
*/
|
|
109
75
|
keyup(callback: EventCallback): this;
|
|
110
76
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* @param callback - Callback function to run when the event is triggered
|
|
114
|
-
* @returns Current instance
|
|
77
|
+
* Attach a keydown event handler
|
|
115
78
|
*/
|
|
116
79
|
keydown(callback: EventCallback): this;
|
|
117
80
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* @param callback - Callback function to run when the event is triggered
|
|
121
|
-
* @returns Current instance
|
|
81
|
+
* Attach a submit event handler
|
|
122
82
|
*/
|
|
123
83
|
submit(callback: EventCallback): this;
|
|
124
84
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param callback - Callback function to run when the event is triggered
|
|
128
|
-
* @returns Current instance
|
|
85
|
+
* Attach a change event handler
|
|
129
86
|
*/
|
|
130
87
|
change(callback: EventCallback): this;
|
|
131
88
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* @param callback - Callback function to run when the event is triggered
|
|
135
|
-
* @returns Current instance
|
|
89
|
+
* Attach a scroll event handler
|
|
136
90
|
*/
|
|
137
91
|
scroll(callback: EventCallback): this;
|
|
138
92
|
/**
|
|
139
|
-
*
|
|
93
|
+
* Attach an input event handler
|
|
94
|
+
*/
|
|
95
|
+
input(callback: EventCallback): this;
|
|
96
|
+
/**
|
|
97
|
+
* Attach event handlers to elements
|
|
140
98
|
*
|
|
141
|
-
* @param
|
|
142
|
-
* @param
|
|
143
|
-
* @param callback - Callback function
|
|
144
|
-
* @returns Current instance
|
|
99
|
+
* @param eventNames - Space-separated event names
|
|
100
|
+
* @param targetOrCallback - Either a selector for delegation or a callback
|
|
101
|
+
* @param callback - Callback function (required if using delegation)
|
|
145
102
|
*/
|
|
146
|
-
on(
|
|
103
|
+
on(eventNames: string, targetOrCallback: string | EventCallback, callback?: EventCallback): this;
|
|
147
104
|
/**
|
|
148
|
-
*
|
|
149
|
-
* Applies to ALL elements in the collection
|
|
105
|
+
* Remove event handlers from elements
|
|
150
106
|
*
|
|
151
|
-
* @param
|
|
152
|
-
* @
|
|
107
|
+
* @param eventNames - Space-separated event names (optional - omit to remove all)
|
|
108
|
+
* @param targetOrCallback - Either a selector for delegation or a callback (optional)
|
|
109
|
+
* @param callback - Callback function (required if using delegation removal)
|
|
153
110
|
*/
|
|
154
|
-
|
|
111
|
+
off(eventNames?: string, targetOrCallback?: string | EventCallback, callback?: EventCallback): this;
|
|
112
|
+
/**
|
|
113
|
+
* Trigger events on elements
|
|
114
|
+
*
|
|
115
|
+
* @param eventNames - Space-separated event names
|
|
116
|
+
* @param detail - Custom event detail data
|
|
117
|
+
*/
|
|
118
|
+
trigger(eventNames: string, detail?: unknown): this;
|
|
155
119
|
/**
|
|
156
|
-
*
|
|
120
|
+
* Filter elements by a selector
|
|
157
121
|
*
|
|
158
|
-
* @
|
|
122
|
+
* @param selector - CSS selector to match
|
|
123
|
+
*/
|
|
124
|
+
filter(selector: string): DOM;
|
|
125
|
+
/**
|
|
126
|
+
* Check if the collection contains any elements
|
|
159
127
|
*/
|
|
160
128
|
exists(): boolean;
|
|
161
129
|
/**
|
|
162
|
-
* Get or set
|
|
130
|
+
* Get or set data attributes
|
|
163
131
|
*
|
|
164
|
-
* @param name -
|
|
165
|
-
* @param value - Value
|
|
166
|
-
* @returns If no value is provided, returns the value(s) - single value if one element, array if multiple.
|
|
132
|
+
* @param name - Data attribute name (without 'data-' prefix)
|
|
133
|
+
* @param value - Value to set (if omitted, returns current value)
|
|
167
134
|
*/
|
|
168
|
-
data(name: string
|
|
135
|
+
data(name: string): string | undefined;
|
|
136
|
+
data(name: string, value: string): this;
|
|
169
137
|
/**
|
|
170
|
-
* Remove a data
|
|
138
|
+
* Remove a data attribute from all elements
|
|
171
139
|
*
|
|
172
|
-
* @param name -
|
|
173
|
-
* @returns Current instance
|
|
140
|
+
* @param name - Data attribute name to remove
|
|
174
141
|
*/
|
|
175
142
|
removeData(name: string): this;
|
|
176
143
|
/**
|
|
177
|
-
* Get or set
|
|
178
|
-
*
|
|
179
|
-
* @param value - Value to set the text to
|
|
180
|
-
* @returns If no value is provided, returns the text(s) - single value if one element, array if multiple.
|
|
144
|
+
* Get or set text content
|
|
181
145
|
*/
|
|
182
|
-
text(value
|
|
146
|
+
text(value: string | number): this;
|
|
147
|
+
text(): string | undefined;
|
|
183
148
|
/**
|
|
184
|
-
* Get or set
|
|
185
|
-
*
|
|
186
|
-
* @param value - Value to set the HTML to
|
|
187
|
-
* @returns If no value is provided, returns the HTML(s) - single value if one element, array if multiple.
|
|
149
|
+
* Get or set HTML content
|
|
188
150
|
*/
|
|
189
|
-
html(value
|
|
151
|
+
html(value: string | number): this;
|
|
152
|
+
html(): string | undefined;
|
|
190
153
|
/**
|
|
191
|
-
* Append
|
|
154
|
+
* Append content to the end of each element
|
|
192
155
|
*
|
|
193
|
-
* @param
|
|
194
|
-
* @returns Current instance
|
|
156
|
+
* @param content - HTML string or Element to append
|
|
195
157
|
*/
|
|
196
|
-
append(
|
|
158
|
+
append(content: string | Element): this;
|
|
197
159
|
/**
|
|
198
|
-
* Prepend
|
|
160
|
+
* Prepend content to the beginning of each element
|
|
199
161
|
*
|
|
200
|
-
* @param
|
|
201
|
-
* @returns Current instance
|
|
162
|
+
* @param content - HTML string or Element to prepend
|
|
202
163
|
*/
|
|
203
|
-
prepend(
|
|
164
|
+
prepend(content: string | Element): this;
|
|
204
165
|
/**
|
|
205
|
-
* Iterate over
|
|
166
|
+
* Iterate over each element in the collection
|
|
206
167
|
*
|
|
207
|
-
* @param callback -
|
|
208
|
-
* @returns Current instance
|
|
168
|
+
* @param callback - Function to call for each element
|
|
209
169
|
*/
|
|
210
170
|
each(callback: ElementCallback): this;
|
|
211
171
|
/**
|
|
212
|
-
* Get an element
|
|
172
|
+
* Get an element by index
|
|
213
173
|
*
|
|
214
|
-
* @param index -
|
|
215
|
-
* @returns HTML Element in the position indicated by the index
|
|
174
|
+
* @param index - Zero-based index
|
|
216
175
|
*/
|
|
217
|
-
get(index: number):
|
|
176
|
+
get(index: number): HTMLElement | undefined;
|
|
218
177
|
/**
|
|
219
|
-
* Get the first element in
|
|
220
|
-
*
|
|
221
|
-
* @returns DOM instance with the first element
|
|
178
|
+
* Get the first element wrapped in a new DOM instance
|
|
222
179
|
*/
|
|
223
180
|
first(): DOM;
|
|
224
181
|
/**
|
|
225
|
-
* Get the last element in
|
|
226
|
-
*
|
|
227
|
-
* @returns DOM instance with the last element
|
|
182
|
+
* Get the last element wrapped in a new DOM instance
|
|
228
183
|
*/
|
|
229
184
|
last(): DOM;
|
|
230
185
|
/**
|
|
231
|
-
*
|
|
232
|
-
* display, offsetWidth and offsetHeight properties
|
|
186
|
+
* Get element at index wrapped in a new DOM instance
|
|
233
187
|
*
|
|
234
|
-
* @
|
|
188
|
+
* @param index - Zero-based index (negative counts from end)
|
|
189
|
+
*/
|
|
190
|
+
eq(index: number): DOM;
|
|
191
|
+
/**
|
|
192
|
+
* Check if any element in the collection is visible
|
|
235
193
|
*/
|
|
236
194
|
isVisible(): boolean;
|
|
237
195
|
/**
|
|
238
|
-
* Get the
|
|
239
|
-
*
|
|
240
|
-
* @returns DOM instance of the parent elements
|
|
196
|
+
* Get the parent elements of all elements in the collection
|
|
241
197
|
*/
|
|
242
198
|
parent(): DOM;
|
|
243
199
|
/**
|
|
244
|
-
*
|
|
200
|
+
* Get all parent/ancestor elements up to the document
|
|
201
|
+
*/
|
|
202
|
+
parents(): DOM;
|
|
203
|
+
/**
|
|
204
|
+
* Find descendant elements matching a selector
|
|
245
205
|
*
|
|
246
|
-
* @param selector -
|
|
247
|
-
* @returns DOM instance with found elements
|
|
206
|
+
* @param selector - CSS selector
|
|
248
207
|
*/
|
|
249
208
|
find(selector: string): DOM;
|
|
250
209
|
/**
|
|
251
|
-
* Get the
|
|
252
|
-
*
|
|
253
|
-
* @returns Single offset object if one element, array of offset objects if multiple
|
|
210
|
+
* Get the offset position of the first element
|
|
254
211
|
*/
|
|
255
|
-
offset(): DOMOffset |
|
|
212
|
+
offset(): DOMOffset | undefined;
|
|
256
213
|
/**
|
|
257
|
-
*
|
|
258
|
-
|
|
214
|
+
* Get the width of the first element
|
|
215
|
+
*/
|
|
216
|
+
width(): number;
|
|
217
|
+
/**
|
|
218
|
+
* Get the height of the first element
|
|
219
|
+
*/
|
|
220
|
+
height(): number;
|
|
221
|
+
/**
|
|
222
|
+
* Get the closest ancestor matching a selector
|
|
259
223
|
*
|
|
260
|
-
* @param selector -
|
|
261
|
-
* @returns DOM instance with the closest HTML elements matching the selector
|
|
224
|
+
* @param selector - CSS selector
|
|
262
225
|
*/
|
|
263
226
|
closest(selector: string): DOM;
|
|
264
227
|
/**
|
|
265
|
-
*
|
|
266
|
-
* from the initial object and then follows to its parents.
|
|
228
|
+
* Get or set an attribute
|
|
267
229
|
*
|
|
268
|
-
* @param
|
|
269
|
-
* @param
|
|
270
|
-
* @returns DOM instance with the closest HTML element matching the selector
|
|
230
|
+
* @param attr - Attribute name
|
|
231
|
+
* @param value - Value to set (if omitted, returns current value)
|
|
271
232
|
*/
|
|
272
|
-
|
|
233
|
+
attribute(attr: string): string | null | undefined;
|
|
234
|
+
attribute(attr: string, value: string | number): this;
|
|
273
235
|
/**
|
|
274
|
-
*
|
|
236
|
+
* Remove an attribute from all elements
|
|
275
237
|
*
|
|
276
|
-
* @param
|
|
277
|
-
* @param value - Value to set the attribute to
|
|
278
|
-
* @returns If no value is provided, returns the attribute value(s) - single value if one element, array if multiple.
|
|
238
|
+
* @param attr - Attribute name to remove
|
|
279
239
|
*/
|
|
280
|
-
|
|
240
|
+
removeAttribute(attr: string): this;
|
|
281
241
|
/**
|
|
282
|
-
* Check
|
|
242
|
+
* Check if all elements have a given attribute
|
|
283
243
|
*
|
|
284
|
-
* @param attribute -
|
|
285
|
-
* @returns Whether all elements have the attribute
|
|
244
|
+
* @param attribute - Attribute name
|
|
286
245
|
*/
|
|
287
246
|
hasAttribute(attribute: string): boolean;
|
|
288
247
|
/**
|
|
289
|
-
* Insert
|
|
248
|
+
* Insert HTML after each element
|
|
290
249
|
*
|
|
291
|
-
* @param content -
|
|
292
|
-
* @returns Current instance
|
|
250
|
+
* @param content - HTML string to insert
|
|
293
251
|
*/
|
|
294
252
|
after(content: string): this;
|
|
295
253
|
/**
|
|
296
|
-
* Insert
|
|
254
|
+
* Insert HTML before each element
|
|
297
255
|
*
|
|
298
|
-
* @param content -
|
|
299
|
-
* @returns Current instance
|
|
256
|
+
* @param content - HTML string to insert
|
|
300
257
|
*/
|
|
301
258
|
before(content: string): this;
|
|
302
259
|
/**
|
|
303
|
-
* Get or
|
|
304
|
-
*
|
|
305
|
-
* @param properties - Properties to change or get. Can be either an individual property or a JSON object with key-value pairs
|
|
306
|
-
* @param value - Value to set the property to when only changing one property
|
|
307
|
-
* @returns If a property is given but not a value for it, returns the style value(s) - single value if one element, array if multiple.
|
|
260
|
+
* Get or set CSS styles
|
|
308
261
|
*/
|
|
309
|
-
style(
|
|
262
|
+
style(prop: string): string;
|
|
263
|
+
style(prop: StyleProperties): this;
|
|
264
|
+
style(prop: string, value: string): this;
|
|
310
265
|
/**
|
|
311
|
-
* Animate
|
|
312
|
-
* with a given time duration
|
|
266
|
+
* Animate elements using the Web Animations API
|
|
313
267
|
*
|
|
314
|
-
* @param
|
|
315
|
-
* @param
|
|
316
|
-
* @returns Current instance
|
|
268
|
+
* @param keyframes - Animation keyframes
|
|
269
|
+
* @param options - Animation options
|
|
317
270
|
*/
|
|
318
|
-
animate(
|
|
271
|
+
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes, options: number | KeyframeAnimationOptions): this;
|
|
319
272
|
/**
|
|
320
|
-
*
|
|
273
|
+
* Fade elements in
|
|
321
274
|
*
|
|
322
|
-
* @param
|
|
323
|
-
* @param callback -
|
|
324
|
-
* @returns Current instance
|
|
275
|
+
* @param duration - Animation duration in ms
|
|
276
|
+
* @param callback - Function to call after animation completes
|
|
325
277
|
*/
|
|
326
|
-
fadeIn(
|
|
278
|
+
fadeIn(duration?: number, callback?: () => void): this;
|
|
327
279
|
/**
|
|
328
|
-
*
|
|
280
|
+
* Fade elements out
|
|
329
281
|
*
|
|
330
|
-
* @param
|
|
331
|
-
* @param callback -
|
|
332
|
-
* @returns Current instance
|
|
282
|
+
* @param duration - Animation duration in ms
|
|
283
|
+
* @param callback - Function to call after animation completes
|
|
333
284
|
*/
|
|
334
|
-
fadeOut(
|
|
285
|
+
fadeOut(duration?: number, callback?: () => void): this;
|
|
335
286
|
/**
|
|
336
|
-
* Check if
|
|
287
|
+
* Check if all elements match a selector
|
|
337
288
|
*
|
|
338
|
-
* @param selector -
|
|
339
|
-
* @returns Whether all elements match the selector
|
|
289
|
+
* @param selector - CSS selector
|
|
340
290
|
*/
|
|
341
291
|
matches(selector: string): boolean;
|
|
342
292
|
/**
|
|
343
|
-
* Remove all elements
|
|
344
|
-
*
|
|
345
|
-
* @returns Current instance
|
|
293
|
+
* Remove all elements from the DOM
|
|
346
294
|
*/
|
|
347
295
|
remove(): this;
|
|
348
296
|
/**
|
|
349
|
-
*
|
|
297
|
+
* Remove all child elements
|
|
298
|
+
*/
|
|
299
|
+
empty(): this;
|
|
300
|
+
/**
|
|
301
|
+
* Clone all elements in the collection
|
|
350
302
|
*
|
|
351
|
-
* @param
|
|
352
|
-
* @returns Current instance
|
|
303
|
+
* @param deep - Whether to clone child nodes (default: true)
|
|
353
304
|
*/
|
|
354
|
-
|
|
305
|
+
clone(deep?: boolean): DOM;
|
|
355
306
|
/**
|
|
356
|
-
*
|
|
307
|
+
* Replace elements with new content
|
|
357
308
|
*
|
|
358
|
-
* @
|
|
309
|
+
* @param newContent - HTML string or Element to replace with
|
|
310
|
+
*/
|
|
311
|
+
replaceWith(newContent: string | Element): this;
|
|
312
|
+
/**
|
|
313
|
+
* Reset form elements
|
|
359
314
|
*/
|
|
360
315
|
reset(): this;
|
|
361
316
|
/**
|
|
362
|
-
* Get or set a property
|
|
317
|
+
* Get or set a DOM property
|
|
318
|
+
*
|
|
319
|
+
* @param name - Property name
|
|
320
|
+
* @param value - Value to set (if omitted, returns current value)
|
|
321
|
+
*/
|
|
322
|
+
property<K extends keyof HTMLElement>(name: K, value: HTMLElement[K]): this;
|
|
323
|
+
property<K extends keyof HTMLElement>(name: K): HTMLElement[K] | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* Get sibling elements
|
|
326
|
+
*/
|
|
327
|
+
siblings(): DOM;
|
|
328
|
+
/**
|
|
329
|
+
* Get the next sibling element
|
|
330
|
+
*/
|
|
331
|
+
next(): DOM;
|
|
332
|
+
/**
|
|
333
|
+
* Get the previous sibling element
|
|
334
|
+
*/
|
|
335
|
+
prev(): DOM;
|
|
336
|
+
/**
|
|
337
|
+
* Get all child elements
|
|
338
|
+
*/
|
|
339
|
+
children(): DOM;
|
|
340
|
+
/**
|
|
341
|
+
* Scroll element into view
|
|
363
342
|
*
|
|
364
|
-
* @param
|
|
365
|
-
* @param value - Value to set the property to
|
|
366
|
-
* @returns If no value is provided, returns the property value(s) - single value if one element, array if multiple.
|
|
343
|
+
* @param options - Scroll options
|
|
367
344
|
*/
|
|
368
|
-
|
|
345
|
+
scrollIntoView(options?: ScrollIntoViewOptions): this;
|
|
369
346
|
}
|
|
370
347
|
/**
|
|
371
|
-
*
|
|
348
|
+
* Create a new DOM instance
|
|
372
349
|
*
|
|
373
|
-
* @param selector -
|
|
374
|
-
* @returns DOM instance
|
|
350
|
+
* @param selector - CSS selector, Element, or collection
|
|
375
351
|
*/
|
|
376
352
|
export declare function $_(selector: DOMSelector): DOM;
|
|
377
353
|
/**
|
|
378
|
-
*
|
|
354
|
+
* Execute a callback when the DOM is ready
|
|
355
|
+
*
|
|
356
|
+
* @param callback - Function to execute
|
|
357
|
+
*/
|
|
358
|
+
export declare function $_ready(callback: () => void): void;
|
|
359
|
+
/**
|
|
360
|
+
* Create a new element
|
|
379
361
|
*
|
|
380
|
-
* @param
|
|
362
|
+
* @param tagName - HTML tag name
|
|
363
|
+
* @param attributes - Optional attributes to set
|
|
381
364
|
*/
|
|
382
|
-
export declare function $
|
|
365
|
+
export declare function $_create<K extends keyof HTMLElementTagNameMap>(tagName: K, attributes?: Record<string, string>): DOM;
|
|
383
366
|
//# sourceMappingURL=DOM.d.ts.map
|
package/dist/types/DOM.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DOM.d.ts","sourceRoot":"","sources":["../../src/DOM.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"DOM.d.ts","sourceRoot":"","sources":["../../src/DOM.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,EAAE,GAAG,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC;AAErH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AACnD,MAAM,MAAM,eAAe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