@aegis-framework/artemis 0.4.1 → 0.5.0
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 +547 -96
- package/dist/artemis.browser.js +2 -2
- package/dist/artemis.browser.js.map +18 -17
- package/dist/artemis.js +2 -2
- package/dist/artemis.js.map +18 -17
- package/dist/types/DOM.d.ts +189 -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/package.json +3 -4
package/dist/types/DOM.d.ts
CHANGED
|
@@ -3,381 +3,363 @@
|
|
|
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
|
|
108
|
+
* @param callback - Callback function to remove
|
|
153
109
|
*/
|
|
154
|
-
|
|
110
|
+
off(eventNames: string, callback: EventCallback): this;
|
|
111
|
+
/**
|
|
112
|
+
* Trigger events on elements
|
|
113
|
+
*
|
|
114
|
+
* @param eventNames - Space-separated event names
|
|
115
|
+
* @param detail - Custom event detail data
|
|
116
|
+
*/
|
|
117
|
+
trigger(eventNames: string, detail?: unknown): this;
|
|
155
118
|
/**
|
|
156
|
-
*
|
|
119
|
+
* Filter elements by a selector
|
|
157
120
|
*
|
|
158
|
-
* @
|
|
121
|
+
* @param selector - CSS selector to match
|
|
122
|
+
*/
|
|
123
|
+
filter(selector: string): DOM;
|
|
124
|
+
/**
|
|
125
|
+
* Check if the collection contains any elements
|
|
159
126
|
*/
|
|
160
127
|
exists(): boolean;
|
|
161
128
|
/**
|
|
162
|
-
* Get or set
|
|
129
|
+
* Get or set data attributes
|
|
163
130
|
*
|
|
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.
|
|
131
|
+
* @param name - Data attribute name (without 'data-' prefix)
|
|
132
|
+
* @param value - Value to set (if omitted, returns current value)
|
|
167
133
|
*/
|
|
168
|
-
data(name: string
|
|
134
|
+
data(name: string): string | undefined;
|
|
135
|
+
data(name: string, value: string): this;
|
|
169
136
|
/**
|
|
170
|
-
* Remove a data
|
|
137
|
+
* Remove a data attribute from all elements
|
|
171
138
|
*
|
|
172
|
-
* @param name -
|
|
173
|
-
* @returns Current instance
|
|
139
|
+
* @param name - Data attribute name to remove
|
|
174
140
|
*/
|
|
175
141
|
removeData(name: string): this;
|
|
176
142
|
/**
|
|
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.
|
|
143
|
+
* Get or set text content
|
|
181
144
|
*/
|
|
182
|
-
text(value
|
|
145
|
+
text(value: string | number): this;
|
|
146
|
+
text(): string | undefined;
|
|
183
147
|
/**
|
|
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.
|
|
148
|
+
* Get or set HTML content
|
|
188
149
|
*/
|
|
189
|
-
html(value
|
|
150
|
+
html(value: string | number): this;
|
|
151
|
+
html(): string | undefined;
|
|
190
152
|
/**
|
|
191
|
-
* Append
|
|
153
|
+
* Append content to the end of each element
|
|
192
154
|
*
|
|
193
|
-
* @param
|
|
194
|
-
* @returns Current instance
|
|
155
|
+
* @param content - HTML string or Element to append
|
|
195
156
|
*/
|
|
196
|
-
append(
|
|
157
|
+
append(content: string | Element): this;
|
|
197
158
|
/**
|
|
198
|
-
* Prepend
|
|
159
|
+
* Prepend content to the beginning of each element
|
|
199
160
|
*
|
|
200
|
-
* @param
|
|
201
|
-
* @returns Current instance
|
|
161
|
+
* @param content - HTML string or Element to prepend
|
|
202
162
|
*/
|
|
203
|
-
prepend(
|
|
163
|
+
prepend(content: string | Element): this;
|
|
204
164
|
/**
|
|
205
|
-
* Iterate over
|
|
165
|
+
* Iterate over each element in the collection
|
|
206
166
|
*
|
|
207
|
-
* @param callback -
|
|
208
|
-
* @returns Current instance
|
|
167
|
+
* @param callback - Function to call for each element
|
|
209
168
|
*/
|
|
210
169
|
each(callback: ElementCallback): this;
|
|
211
170
|
/**
|
|
212
|
-
* Get an element
|
|
171
|
+
* Get an element by index
|
|
213
172
|
*
|
|
214
|
-
* @param index -
|
|
215
|
-
* @returns HTML Element in the position indicated by the index
|
|
173
|
+
* @param index - Zero-based index
|
|
216
174
|
*/
|
|
217
|
-
get(index: number):
|
|
175
|
+
get(index: number): HTMLElement | undefined;
|
|
218
176
|
/**
|
|
219
|
-
* Get the first element in
|
|
220
|
-
*
|
|
221
|
-
* @returns DOM instance with the first element
|
|
177
|
+
* Get the first element wrapped in a new DOM instance
|
|
222
178
|
*/
|
|
223
179
|
first(): DOM;
|
|
224
180
|
/**
|
|
225
|
-
* Get the last element in
|
|
226
|
-
*
|
|
227
|
-
* @returns DOM instance with the last element
|
|
181
|
+
* Get the last element wrapped in a new DOM instance
|
|
228
182
|
*/
|
|
229
183
|
last(): DOM;
|
|
230
184
|
/**
|
|
231
|
-
*
|
|
232
|
-
* display, offsetWidth and offsetHeight properties
|
|
185
|
+
* Get element at index wrapped in a new DOM instance
|
|
233
186
|
*
|
|
234
|
-
* @
|
|
187
|
+
* @param index - Zero-based index (negative counts from end)
|
|
188
|
+
*/
|
|
189
|
+
eq(index: number): DOM;
|
|
190
|
+
/**
|
|
191
|
+
* Check if any element in the collection is visible
|
|
235
192
|
*/
|
|
236
193
|
isVisible(): boolean;
|
|
237
194
|
/**
|
|
238
|
-
* Get the
|
|
239
|
-
*
|
|
240
|
-
* @returns DOM instance of the parent elements
|
|
195
|
+
* Get the parent elements of all elements in the collection
|
|
241
196
|
*/
|
|
242
197
|
parent(): DOM;
|
|
243
198
|
/**
|
|
244
|
-
*
|
|
199
|
+
* Get all parent/ancestor elements up to the document
|
|
200
|
+
*/
|
|
201
|
+
parents(): DOM;
|
|
202
|
+
/**
|
|
203
|
+
* Find descendant elements matching a selector
|
|
245
204
|
*
|
|
246
|
-
* @param selector -
|
|
247
|
-
* @returns DOM instance with found elements
|
|
205
|
+
* @param selector - CSS selector
|
|
248
206
|
*/
|
|
249
207
|
find(selector: string): DOM;
|
|
250
208
|
/**
|
|
251
|
-
* Get the
|
|
252
|
-
*
|
|
253
|
-
* @returns Single offset object if one element, array of offset objects if multiple
|
|
209
|
+
* Get the offset position of the first element
|
|
254
210
|
*/
|
|
255
|
-
offset(): DOMOffset |
|
|
211
|
+
offset(): DOMOffset | undefined;
|
|
256
212
|
/**
|
|
257
|
-
*
|
|
258
|
-
|
|
213
|
+
* Get the width of the first element
|
|
214
|
+
*/
|
|
215
|
+
width(): number;
|
|
216
|
+
/**
|
|
217
|
+
* Get the height of the first element
|
|
218
|
+
*/
|
|
219
|
+
height(): number;
|
|
220
|
+
/**
|
|
221
|
+
* Get the closest ancestor matching a selector
|
|
259
222
|
*
|
|
260
|
-
* @param selector -
|
|
261
|
-
* @returns DOM instance with the closest HTML elements matching the selector
|
|
223
|
+
* @param selector - CSS selector
|
|
262
224
|
*/
|
|
263
225
|
closest(selector: string): DOM;
|
|
264
226
|
/**
|
|
265
|
-
*
|
|
266
|
-
* from the initial object and then follows to its parents.
|
|
227
|
+
* Get or set an attribute
|
|
267
228
|
*
|
|
268
|
-
* @param
|
|
269
|
-
* @param
|
|
270
|
-
* @returns DOM instance with the closest HTML element matching the selector
|
|
229
|
+
* @param attr - Attribute name
|
|
230
|
+
* @param value - Value to set (if omitted, returns current value)
|
|
271
231
|
*/
|
|
272
|
-
|
|
232
|
+
attribute(attr: string): string | null | undefined;
|
|
233
|
+
attribute(attr: string, value: string | number): this;
|
|
273
234
|
/**
|
|
274
|
-
*
|
|
235
|
+
* Remove an attribute from all elements
|
|
275
236
|
*
|
|
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.
|
|
237
|
+
* @param attr - Attribute name to remove
|
|
279
238
|
*/
|
|
280
|
-
|
|
239
|
+
removeAttribute(attr: string): this;
|
|
281
240
|
/**
|
|
282
|
-
* Check
|
|
241
|
+
* Check if all elements have a given attribute
|
|
283
242
|
*
|
|
284
|
-
* @param attribute -
|
|
285
|
-
* @returns Whether all elements have the attribute
|
|
243
|
+
* @param attribute - Attribute name
|
|
286
244
|
*/
|
|
287
245
|
hasAttribute(attribute: string): boolean;
|
|
288
246
|
/**
|
|
289
|
-
* Insert
|
|
247
|
+
* Insert HTML after each element
|
|
290
248
|
*
|
|
291
|
-
* @param content -
|
|
292
|
-
* @returns Current instance
|
|
249
|
+
* @param content - HTML string to insert
|
|
293
250
|
*/
|
|
294
251
|
after(content: string): this;
|
|
295
252
|
/**
|
|
296
|
-
* Insert
|
|
253
|
+
* Insert HTML before each element
|
|
297
254
|
*
|
|
298
|
-
* @param content -
|
|
299
|
-
* @returns Current instance
|
|
255
|
+
* @param content - HTML string to insert
|
|
300
256
|
*/
|
|
301
257
|
before(content: string): this;
|
|
302
258
|
/**
|
|
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.
|
|
259
|
+
* Get or set CSS styles
|
|
308
260
|
*/
|
|
309
|
-
style(
|
|
261
|
+
style(prop: string): string;
|
|
262
|
+
style(prop: StyleProperties): this;
|
|
263
|
+
style(prop: string, value: string): this;
|
|
310
264
|
/**
|
|
311
|
-
* Animate
|
|
312
|
-
* with a given time duration
|
|
265
|
+
* Animate elements using the Web Animations API
|
|
313
266
|
*
|
|
314
|
-
* @param
|
|
315
|
-
* @param
|
|
316
|
-
* @returns Current instance
|
|
267
|
+
* @param keyframes - Animation keyframes
|
|
268
|
+
* @param options - Animation options
|
|
317
269
|
*/
|
|
318
|
-
animate(
|
|
270
|
+
animate(keyframes: Keyframe[] | PropertyIndexedKeyframes, options: number | KeyframeAnimationOptions): this;
|
|
319
271
|
/**
|
|
320
|
-
*
|
|
272
|
+
* Fade elements in
|
|
321
273
|
*
|
|
322
|
-
* @param
|
|
323
|
-
* @param callback -
|
|
324
|
-
* @returns Current instance
|
|
274
|
+
* @param duration - Animation duration in ms
|
|
275
|
+
* @param callback - Function to call after animation completes
|
|
325
276
|
*/
|
|
326
|
-
fadeIn(
|
|
277
|
+
fadeIn(duration?: number, callback?: () => void): this;
|
|
327
278
|
/**
|
|
328
|
-
*
|
|
279
|
+
* Fade elements out
|
|
329
280
|
*
|
|
330
|
-
* @param
|
|
331
|
-
* @param callback -
|
|
332
|
-
* @returns Current instance
|
|
281
|
+
* @param duration - Animation duration in ms
|
|
282
|
+
* @param callback - Function to call after animation completes
|
|
333
283
|
*/
|
|
334
|
-
fadeOut(
|
|
284
|
+
fadeOut(duration?: number, callback?: () => void): this;
|
|
335
285
|
/**
|
|
336
|
-
* Check if
|
|
286
|
+
* Check if all elements match a selector
|
|
337
287
|
*
|
|
338
|
-
* @param selector -
|
|
339
|
-
* @returns Whether all elements match the selector
|
|
288
|
+
* @param selector - CSS selector
|
|
340
289
|
*/
|
|
341
290
|
matches(selector: string): boolean;
|
|
342
291
|
/**
|
|
343
|
-
* Remove all elements
|
|
344
|
-
*
|
|
345
|
-
* @returns Current instance
|
|
292
|
+
* Remove all elements from the DOM
|
|
346
293
|
*/
|
|
347
294
|
remove(): this;
|
|
348
295
|
/**
|
|
349
|
-
*
|
|
296
|
+
* Remove all child elements
|
|
297
|
+
*/
|
|
298
|
+
empty(): this;
|
|
299
|
+
/**
|
|
300
|
+
* Clone all elements in the collection
|
|
350
301
|
*
|
|
351
|
-
* @param
|
|
352
|
-
* @returns Current instance
|
|
302
|
+
* @param deep - Whether to clone child nodes (default: true)
|
|
353
303
|
*/
|
|
354
|
-
|
|
304
|
+
clone(deep?: boolean): DOM;
|
|
355
305
|
/**
|
|
356
|
-
*
|
|
306
|
+
* Replace elements with new content
|
|
357
307
|
*
|
|
358
|
-
* @
|
|
308
|
+
* @param newContent - HTML string or Element to replace with
|
|
309
|
+
*/
|
|
310
|
+
replaceWith(newContent: string | Element): this;
|
|
311
|
+
/**
|
|
312
|
+
* Reset form elements
|
|
359
313
|
*/
|
|
360
314
|
reset(): this;
|
|
361
315
|
/**
|
|
362
|
-
* Get or set a property
|
|
316
|
+
* Get or set a DOM property
|
|
317
|
+
*
|
|
318
|
+
* @param name - Property name
|
|
319
|
+
* @param value - Value to set (if omitted, returns current value)
|
|
320
|
+
*/
|
|
321
|
+
property<K extends keyof HTMLElement>(name: K, value: HTMLElement[K]): this;
|
|
322
|
+
property<K extends keyof HTMLElement>(name: K): HTMLElement[K] | undefined;
|
|
323
|
+
/**
|
|
324
|
+
* Get sibling elements
|
|
325
|
+
*/
|
|
326
|
+
siblings(): DOM;
|
|
327
|
+
/**
|
|
328
|
+
* Get the next sibling element
|
|
329
|
+
*/
|
|
330
|
+
next(): DOM;
|
|
331
|
+
/**
|
|
332
|
+
* Get the previous sibling element
|
|
333
|
+
*/
|
|
334
|
+
prev(): DOM;
|
|
335
|
+
/**
|
|
336
|
+
* Get all child elements
|
|
337
|
+
*/
|
|
338
|
+
children(): DOM;
|
|
339
|
+
/**
|
|
340
|
+
* Scroll element into view
|
|
363
341
|
*
|
|
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.
|
|
342
|
+
* @param options - Scroll options
|
|
367
343
|
*/
|
|
368
|
-
|
|
344
|
+
scrollIntoView(options?: ScrollIntoViewOptions): this;
|
|
369
345
|
}
|
|
370
346
|
/**
|
|
371
|
-
*
|
|
347
|
+
* Create a new DOM instance
|
|
372
348
|
*
|
|
373
|
-
* @param selector -
|
|
374
|
-
* @returns DOM instance
|
|
349
|
+
* @param selector - CSS selector, Element, or collection
|
|
375
350
|
*/
|
|
376
351
|
export declare function $_(selector: DOMSelector): DOM;
|
|
377
352
|
/**
|
|
378
|
-
*
|
|
353
|
+
* Execute a callback when the DOM is ready
|
|
354
|
+
*
|
|
355
|
+
* @param callback - Function to execute
|
|
356
|
+
*/
|
|
357
|
+
export declare function $_ready(callback: () => void): void;
|
|
358
|
+
/**
|
|
359
|
+
* Create a new element
|
|
379
360
|
*
|
|
380
|
-
* @param
|
|
361
|
+
* @param tagName - HTML tag name
|
|
362
|
+
* @param attributes - Optional attributes to set
|
|
381
363
|
*/
|
|
382
|
-
export declare function $
|
|
364
|
+
export declare function $_create<K extends keyof HTMLElementTagNameMap>(tagName: K, attributes?: Record<string, string>): DOM;
|
|
383
365
|
//# 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;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5E;;GAEG;AACH,qBAAa,GAAG;IACR,UAAU,EA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