litegui.ts 1.0.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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +109 -0
  3. package/dist/@types/Inspector/index.d.ts +462 -0
  4. package/dist/@types/Inspector/index.d.ts.map +1 -0
  5. package/dist/@types/globals/index.d.ts +10 -0
  6. package/dist/@types/globals/index.d.ts.map +1 -0
  7. package/dist/Pickr/pickr.es5.min.js +3 -0
  8. package/dist/Pickr/pickr.es5.min.js.map +1 -0
  9. package/dist/Pickr/pickr.min.js +3 -0
  10. package/dist/Pickr/pickr.min.js.map +1 -0
  11. package/dist/Pickr/themes/classic.min.css +2 -0
  12. package/dist/Pickr/themes/monolith.min.css +2 -0
  13. package/dist/Pickr/themes/nano.min.css +2 -0
  14. package/dist/area.d.ts +277 -0
  15. package/dist/area.d.ts.map +1 -0
  16. package/dist/console.d.ts +27 -0
  17. package/dist/console.d.ts.map +1 -0
  18. package/dist/core.d.ts +438 -0
  19. package/dist/core.d.ts.map +1 -0
  20. package/dist/dialog.d.ts +369 -0
  21. package/dist/dialog.d.ts.map +1 -0
  22. package/dist/dragger.d.ts +132 -0
  23. package/dist/dragger.d.ts.map +1 -0
  24. package/dist/index.d.ts +17 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/inspector/array.d.ts +76 -0
  27. package/dist/inspector/array.d.ts.map +1 -0
  28. package/dist/inspector/button.d.ts +62 -0
  29. package/dist/inspector/button.d.ts.map +1 -0
  30. package/dist/inspector/checkbox.d.ts +50 -0
  31. package/dist/inspector/checkbox.d.ts.map +1 -0
  32. package/dist/inspector/color.d.ts +43 -0
  33. package/dist/inspector/color.d.ts.map +1 -0
  34. package/dist/inspector/combo.d.ts +76 -0
  35. package/dist/inspector/combo.d.ts.map +1 -0
  36. package/dist/inspector/dataTree.d.ts +20 -0
  37. package/dist/inspector/dataTree.d.ts.map +1 -0
  38. package/dist/inspector/file.d.ts +57 -0
  39. package/dist/inspector/file.d.ts.map +1 -0
  40. package/dist/inspector/flag.d.ts +36 -0
  41. package/dist/inspector/flag.d.ts.map +1 -0
  42. package/dist/inspector/icon.d.ts +60 -0
  43. package/dist/inspector/icon.d.ts.map +1 -0
  44. package/dist/inspector/index.d.ts +24 -0
  45. package/dist/inspector/index.d.ts.map +1 -0
  46. package/dist/inspector/info.d.ts +47 -0
  47. package/dist/inspector/info.d.ts.map +1 -0
  48. package/dist/inspector/inspector.d.ts +350 -0
  49. package/dist/inspector/inspector.d.ts.map +1 -0
  50. package/dist/inspector/line.d.ts +20 -0
  51. package/dist/inspector/line.d.ts.map +1 -0
  52. package/dist/inspector/list.d.ts +153 -0
  53. package/dist/inspector/list.d.ts.map +1 -0
  54. package/dist/inspector/number.d.ts +85 -0
  55. package/dist/inspector/number.d.ts.map +1 -0
  56. package/dist/inspector/pad.d.ts +66 -0
  57. package/dist/inspector/pad.d.ts.map +1 -0
  58. package/dist/inspector/seperator.d.ts +15 -0
  59. package/dist/inspector/seperator.d.ts.map +1 -0
  60. package/dist/inspector/slider.d.ts +55 -0
  61. package/dist/inspector/slider.d.ts.map +1 -0
  62. package/dist/inspector/string.d.ts +71 -0
  63. package/dist/inspector/string.d.ts.map +1 -0
  64. package/dist/inspector/stringButton.d.ts +45 -0
  65. package/dist/inspector/stringButton.d.ts.map +1 -0
  66. package/dist/inspector/tags.d.ts +53 -0
  67. package/dist/inspector/tags.d.ts.map +1 -0
  68. package/dist/inspector/textArea.d.ts +48 -0
  69. package/dist/inspector/textArea.d.ts.map +1 -0
  70. package/dist/inspector/tree.d.ts +41 -0
  71. package/dist/inspector/tree.d.ts.map +1 -0
  72. package/dist/inspector/vector.d.ts +64 -0
  73. package/dist/inspector/vector.d.ts.map +1 -0
  74. package/dist/litegui.css +2 -0
  75. package/dist/litegui.css.map +1 -0
  76. package/dist/litegui.d.ts +439 -0
  77. package/dist/litegui.d.ts.map +1 -0
  78. package/dist/litegui.js +11898 -0
  79. package/dist/litegui.js.map +1 -0
  80. package/dist/litegui.mini.js +1 -0
  81. package/dist/menubar.d.ts +279 -0
  82. package/dist/menubar.d.ts.map +1 -0
  83. package/dist/panel.d.ts +124 -0
  84. package/dist/panel.d.ts.map +1 -0
  85. package/dist/table.d.ts +105 -0
  86. package/dist/table.d.ts.map +1 -0
  87. package/dist/tabs.d.ts +426 -0
  88. package/dist/tabs.d.ts.map +1 -0
  89. package/dist/utilities.d.ts +508 -0
  90. package/dist/utilities.d.ts.map +1 -0
  91. package/dist/widgets/button.d.ts +33 -0
  92. package/dist/widgets/button.d.ts.map +1 -0
  93. package/dist/widgets/checkbox.d.ts +36 -0
  94. package/dist/widgets/checkbox.d.ts.map +1 -0
  95. package/dist/widgets/complexList.d.ts +83 -0
  96. package/dist/widgets/complexList.d.ts.map +1 -0
  97. package/dist/widgets/contextMenu.d.ts +97 -0
  98. package/dist/widgets/contextMenu.d.ts.map +1 -0
  99. package/dist/widgets/index.d.ts +10 -0
  100. package/dist/widgets/index.d.ts.map +1 -0
  101. package/dist/widgets/lineEditor.d.ts +112 -0
  102. package/dist/widgets/lineEditor.d.ts.map +1 -0
  103. package/dist/widgets/list.d.ts +59 -0
  104. package/dist/widgets/list.d.ts.map +1 -0
  105. package/dist/widgets/listBox.d.ts +47 -0
  106. package/dist/widgets/listBox.d.ts.map +1 -0
  107. package/dist/widgets/searchBox.d.ts +43 -0
  108. package/dist/widgets/searchBox.d.ts.map +1 -0
  109. package/dist/widgets/slider.d.ts +61 -0
  110. package/dist/widgets/slider.d.ts.map +1 -0
  111. package/dist/widgets/tree.d.ts +348 -0
  112. package/dist/widgets/tree.d.ts.map +1 -0
  113. package/package.json +81 -0
@@ -0,0 +1,508 @@
1
+ import { LiteGUIObject } from "./@types/globals";
2
+ import { Dialog, DialogOptions } from "./dialog";
3
+ /**
4
+ * Removes event listeners (assigned as properties) and references from a DOM element and its children.
5
+ * Used to help with garbage collection and memory leaks by breaking circular references.
6
+ * @function PurgeElement
7
+ * @param {HTMLElement} element The DOM element to purge.
8
+ */
9
+ export declare function PurgeElement(element: HTMLElement): void;
10
+ /**
11
+ * Basic object cloner. Copies own enumerable properties from original to target.
12
+ * @function CloneInsides
13
+ * @param {{ [key: string]: unknown }} [original] The source object to clone from.
14
+ * @param {{ [key: string]: unknown }} [target] The target object to copy to. If null, a new object is created.
15
+ * @returns {{ [key: string]: unknown }} The target object with copied properties.
16
+ */
17
+ export declare function CloneInsides(original?: Record<string, unknown>, target?: Record<string, unknown>): Record<string, unknown>;
18
+ /**
19
+ * Focuses an element.
20
+ * @function FocusElement
21
+ * @param {HTMLElement | Window} element The element to focus.
22
+ */
23
+ export declare function FocusElement(element: HTMLElement | Window): void;
24
+ /**
25
+ * Blurs an element.
26
+ * @function BlurElement
27
+ * @param {HTMLElement | Window} element The element to blur.
28
+ */
29
+ export declare function BlurElement(element: HTMLElement | Window): void;
30
+ /**
31
+ * Interface to hold a reference to an object property and its options.
32
+ */
33
+ export interface InstanceHolder {
34
+ /** The instance object containing the property. */
35
+ instance: Record<string, unknown>;
36
+ /** The name of the property. */
37
+ name: string;
38
+ /** Options associated with the property. */
39
+ options?: Record<string, unknown>;
40
+ }
41
+ /**
42
+ * Tries to assign a value to the instance stored in an instance holder
43
+ * @function AssignValue
44
+ * @param {InstanceHolder} holder The instance holder containing the instance and property name.
45
+ * @param {string | null | unknown[] | unknown} value The value to assign.
46
+ */
47
+ export declare function AssignValue(holder: InstanceHolder, value: string | null | unknown[] | unknown): void;
48
+ /**
49
+ * Extract all attributes from an instance (enumerable properties that are not function and a name starting with alphabetic character)
50
+ *
51
+ * @function CollectProperties
52
+ * @param {unknown} instance extract enumerable and public (name do not start with '_' ) properties from an object
53
+ * @returns {{[key:string]: unknown}} Object with "name" : value for every property
54
+ *
55
+ */
56
+ export declare function CollectProperties(instance: unknown): {
57
+ [key: string]: unknown;
58
+ };
59
+ export declare function EscapeHtmlEntities(text: string): string;
60
+ /**
61
+ * Syntax highlights a string of code by wrapping parts in HTML spans with classes.
62
+ * @function BeautifyCode
63
+ * @param {string} code The source code string to beautify.
64
+ * @param {string[]} reserved Array of reserved keywords to highlight.
65
+ * @param {boolean} skipCSS If true, suppresses the generation of the <style> block.
66
+ * @returns {string} The HTML string containing the beautified code.
67
+ */
68
+ export declare function BeautifyCode(code: string, reserved: string[], skipCSS: boolean): string;
69
+ /**
70
+ * Syntax highlights a JSON string or object by wrapping parts in HTML spans.
71
+ * @function BeautifyJSON
72
+ * @param {string | object} code The JSON string or object to beautify.
73
+ * @param {boolean} skipCSS If true, suppresses the generation of the <style> block.
74
+ * @returns {string} The HTML string containing the beautified JSON.
75
+ */
76
+ export declare function BeautifyJSON(code: string, skipCSS: boolean): string;
77
+ /**
78
+ * Converts a Data URI string into a Blob object.
79
+ * @function DataURItoBlob
80
+ * @param {string} dataURI The data URI string (e.g., "data:image/png;base64,...").
81
+ * @returns {Blob} The resulting Blob object.
82
+ */
83
+ export declare function DataURItoBlob(dataURI: string): Blob;
84
+ /**
85
+ * Converts an RGBA array to a HEXA color string.
86
+ * @function RGBAToHEXA
87
+ * @param {[number, number, number, number]} rgba Array containing r, g, b, a values.
88
+ * @returns {string} The HEXA color string (e.g., "#RRGGBBAA").
89
+ */
90
+ export declare function RGBAToHEXA(rgba: [number, number, number, number]): string;
91
+ /**
92
+ * Convert sizes in any format to a valid CSS format (number to string, negative number to calc( 100% - number px )
93
+ * @function SizeToCSS
94
+ * @param {string|Number} value
95
+ * @return {string|undefined} valid css size string
96
+ *
97
+ */
98
+ export declare function SizeToCSS(value?: number | string): string | undefined;
99
+ /**
100
+ * Triggers a simple event in an object (similar to jQuery.trigger)
101
+ * @function Trigger
102
+ * @param {unknown} element could be an HTMLEntity or a regular object
103
+ * @param {string} eventName the type of the event
104
+ * @param {unknown} params it will be stored in e.detail
105
+ */
106
+ export declare function Trigger(element: unknown, eventName: string, params?: unknown): CustomEvent<unknown>;
107
+ /**
108
+ * Interface for elements that can trigger events via a hidden __events property.
109
+ */
110
+ export interface TriggerableElement {
111
+ /** Hidden event target for handling custom events. */
112
+ __events: EventTarget;
113
+ }
114
+ /**
115
+ * Interface for elements that can dispatch events.
116
+ */
117
+ export interface DispatchableElement {
118
+ /** Dispatches a custom event. */
119
+ dispatchEvent: (event: CustomEvent<unknown>) => boolean;
120
+ }
121
+ /**
122
+ * Interface for objects that hold content within an HTMLDivElement.
123
+ */
124
+ export interface ContentHolder {
125
+ /** The HTML container for the content. */
126
+ content: HTMLDivElement;
127
+ }
128
+ /**
129
+ * Interface mixing LiteGUIObject and HTMLElement, with an add function.
130
+ */
131
+ export interface EmptyLiteGUIObject extends LiteGUIObject, HTMLElement {
132
+ /** Adds a child element or widget. */
133
+ add: (v: HTMLDivElement | LiteGUIObject) => void;
134
+ }
135
+ /**
136
+ * Interface mixing LiteGUIObject and HTMLButtonElement.
137
+ */
138
+ export interface EmptyLiteGUIButton extends LiteGUIObject, HTMLButtonElement {
139
+ }
140
+ /**
141
+ * Interface for HTMLSpanElements that reference a widget.
142
+ */
143
+ export interface TriggerableSpan extends HTMLSpanElement {
144
+ /** Reference to the widget associated with this span. */
145
+ widget: object;
146
+ }
147
+ /**
148
+ * Interface for script elements with additional metadata used by the core.
149
+ */
150
+ export interface CoreScriptElement extends HTMLScriptElement {
151
+ /** The original source URL of the script. */
152
+ originalSrc: string;
153
+ /** The numeric index or identifier of the script. */
154
+ num: number;
155
+ }
156
+ /**
157
+ * Interface extending the standard Document to include parentWindow reference.
158
+ */
159
+ export interface CoreDocument extends Document {
160
+ /** Reference to the parent window if applicable. */
161
+ parentWindow?: Window;
162
+ }
163
+ /**
164
+ * Remove from the interface, it is is an HTML element it is removed from its parent, if it is a widget the same.
165
+ * @function RemoveElement
166
+ * @param {string | LiteGUIObject | HTMLElement | HTMLElement[] | NodeListOf<HTMLElement>} element it also supports HTMLentity, selector string or Array of elements
167
+ */
168
+ export declare function RemoveElement(element: string | LiteGUIObject | HTMLElement | HTMLElement[] | NodeListOf<HTMLElement>): void;
169
+ /**
170
+ * Binds an event in an object (similar to jQuery.bind)
171
+ * If the element is not an HTML entity a new one is created, attached to the object (as non-enumerable, called __events) and used
172
+ * @function Bind
173
+ * @param {string | Object | Object[] | NodeListOf<HTMLElement>} element could be an HTMLEntity, a regular object, a query string or a regular Array of entities
174
+ * @param {String} event the string defining the event
175
+ * @param {EventListenerOrEventListenerObject} callback where to call
176
+ */
177
+ export declare function Bind(element: string | object | object[] | NodeListOf<HTMLElement>, event: string, callback: EventListenerOrEventListenerObject): void;
178
+ /**
179
+ * Unbinds an event in an object (similar to jQuery.unbind)
180
+ * @function Unbind
181
+ * @param {Object} element could be an HTMLEntity or a regular object
182
+ * @param {String} event the string defining the event
183
+ * @param {EventListenerOrEventListenerObject} callback where to call
184
+ */
185
+ export declare function Unbind(element: HTMLElement | TriggerableElement, event: string, callback: EventListenerOrEventListenerObject): void;
186
+ /**
187
+ * Removes a class
188
+ * @function RemoveClass
189
+ * @param {HTMLElement} elem
190
+ * @param {String} selector
191
+ * @param {String} className
192
+ */
193
+ export declare function RemoveClass(elem: HTMLElement, selector: string, className?: string): void;
194
+ /**
195
+ * Wrapper of document.getElementById
196
+ * @function GetById
197
+ * @param {String} id
198
+ * return {HTMLEntity}
199
+ *
200
+ */
201
+ export declare function GetById(id: string): HTMLElement | null;
202
+ /**
203
+ * Test if the cursor is inside an element
204
+ * @function IsCursorOverElement
205
+ * @param {MouseEvent} event
206
+ * @param {HTMLElement} element
207
+ *
208
+ */
209
+ export declare function IsCursorOverElement(event: MouseEvent, element: HTMLElement): boolean;
210
+ /**
211
+ * Returns the bounding client rect of an element.
212
+ * @function getRect
213
+ * @param {HTMLElement} element The element to measure.
214
+ * @returns {DOMRect} The bounding rectangle.
215
+ */
216
+ export declare function GetRect(element: HTMLElement): DOMRect;
217
+ /**
218
+ * Copy a string to the clipboard (it needs to be invoqued from a click event)
219
+ * @function ToClipboard
220
+ * @param {String | Record<string, unknown>} data
221
+ */
222
+ export declare function ToClipboard(data: string | Record<string, unknown>): void;
223
+ /**
224
+ * Insert some CSS code to the website
225
+ * @function AddCSS
226
+ * @param {String|CSSStyleDeclaration} code it could be a string with CSS rules, or an object with the style syntax.
227
+ *
228
+ */
229
+ export declare function AddCSS(code: string | CSSStyleDeclaration): void;
230
+ /**
231
+ * Requires a new CSS
232
+ * @function RequireCSS
233
+ * @param {String} url string with url or an array with several urls
234
+ * @param {Function} onComplete
235
+ *
236
+ */
237
+ export declare function RequireCSS(url: string | Array<string>, onComplete: (ev: Event) => void): void;
238
+ export interface RequestOptions {
239
+ url: string;
240
+ dataType: string;
241
+ mimeType?: string;
242
+ data?: Array<string>;
243
+ nocache?: boolean;
244
+ error?: (err: string | ProgressEvent<EventTarget>) => void;
245
+ success?: (data: unknown, xhr: XMLHttpRequest) => void;
246
+ }
247
+ /**
248
+ * Request file from url (it could be a binary, text, etc.). If you want a simplied version use
249
+ * @function Request
250
+ * @param {RequestOptions} request object with all the parameters like data (for sending forms), dataType, success, error
251
+ */
252
+ export declare function Request(request: RequestOptions): XMLHttpRequest;
253
+ /**
254
+ * Request file from url
255
+ * @function RequestText
256
+ * @param {String} url
257
+ * @param {(data: string, xhr: XMLHttpRequest) => void} onComplete
258
+ * @param {(err: string | ProgressEvent<EventTarget>) => void} onError
259
+ *
260
+ */
261
+ export declare function RequestText(url: string, onComplete: (data: unknown | string, xhr: XMLHttpRequest) => void, onError: (err: string | ProgressEvent<EventTarget>) => void): XMLHttpRequest;
262
+ /**
263
+ * Request file from url
264
+ * @function RequestJSON
265
+ * @param {String} url
266
+ * @param {(data: object, xhr: XMLHttpRequest) => void} onComplete
267
+ * @param {(err: string | ProgressEvent<EventTarget>) => void} onError
268
+ *
269
+ */
270
+ export declare function RequestJSON(url: string, onComplete: (data: object | unknown, xhr: XMLHttpRequest) => void, onError: (err: string | ProgressEvent<EventTarget>) => void): XMLHttpRequest;
271
+ /**
272
+ * Request binary file from url
273
+ * @function RequestBinary
274
+ * @param {String} url
275
+ * @param {(data: ArrayBuffer | unknown, xhr: XMLHttpRequest) => void} onComplete
276
+ * @param {(err: string | ProgressEvent<EventTarget>) => void} onError
277
+ *
278
+ */
279
+ export declare function RequestBinary(url: string, onComplete: (data: ArrayBuffer | unknown, xhr: XMLHttpRequest) => void, onError: (err: string | ProgressEvent<EventTarget>) => void): XMLHttpRequest;
280
+ /**
281
+ * Request script and inserts it in the DOM
282
+ * @function RequireScript
283
+ * @param {String|Array} url the url of the script or an array containing several urls
284
+ * @param {(scripts: Array<CoreScriptElement>) => void} onComplete
285
+ * @param {(err: string | Event, src: string, num: number) => void} onError
286
+ * @param {(src: string, num: number) => void} onProgress (if several files are required, onProgress is called after every file is added to the DOM)
287
+ *
288
+ */
289
+ export declare function RequireScript(url: string | Array<string>, onComplete: (scripts: Array<CoreScriptElement>) => void, onError: (err: string | Event, src: string, num: number) => void, onProgress: (src: string, num: number) => void, version: number): void;
290
+ /**
291
+ * Shows a generic message dialog.
292
+ * @function ShowMessage
293
+ * @param {string} content The message content.
294
+ * @param {DialogOptions} [options] Configuration options.
295
+ * @returns {Dialog} The created Dialog instance.
296
+ */
297
+ export declare function ShowMessage(content: string, options?: DialogOptions): Dialog;
298
+ /**
299
+ * Shows a dialog with a message
300
+ * @function PopupDialog
301
+ * @param {String} content
302
+ * @param {DialogOptions} [options]
303
+ * @returns {Dialog}
304
+ */
305
+ export declare function PopupDialog(content: string, options?: DialogOptions): Dialog;
306
+ /**
307
+ * Options for configuring message dialogs (alert, confirm, prompt).
308
+ */
309
+ export interface MessageOptions {
310
+ /** Whether to show a textarea for input. */
311
+ textarea?: boolean;
312
+ /** Initial value for input fields. */
313
+ value?: string;
314
+ /** Custom CSS class name for the dialog. */
315
+ className?: string;
316
+ /** Title of the dialog. */
317
+ title?: string;
318
+ /** Width of the dialog in pixels. */
319
+ width?: number;
320
+ /** Height of the dialog in pixels. */
321
+ height?: number;
322
+ /** HTML content to display in the dialog. */
323
+ content?: string;
324
+ /** If true, the dialog cannot be closed by the user. */
325
+ noclose?: boolean;
326
+ }
327
+ /**
328
+ * Shows an alert dialog with a message
329
+ * @function AlertDialog
330
+ * @param {String} content
331
+ * @param {MessageOptions} [options]
332
+ * @returns {Dialog}
333
+ */
334
+ export declare function AlertDialog(content: string, options?: MessageOptions): Dialog;
335
+ /**
336
+ * Shows a confirm dialog with a message
337
+ * @function ConfirmDialog
338
+ * @param {String} content
339
+ * @param {(value: boolean) => void} callback
340
+ * @param {MessageOptions} [options]
341
+ * @returns {Dialog}
342
+ */
343
+ export declare function ConfirmDialog(content: string, callback: (value: boolean) => void, options?: MessageOptions): Dialog;
344
+ /**
345
+ * Shows a prompt dialog with a message
346
+ * @function PromptDialog
347
+ * @param {String} content
348
+ * @param {(value?: string) => void} callback
349
+ * @param {MessageOptions} [options]
350
+ * @returns {Dialog}
351
+ */
352
+ export declare function PromptDialog(content: string, callback: (value?: string) => void, options?: MessageOptions): Dialog;
353
+ /**
354
+ * Shows a choice dialog with a message
355
+ * @function ChoiceDialog
356
+ * @param {String} content
357
+ * @param {Array<string|ContentHolder>} choices
358
+ * @param {(value: string | ContentHolder) => void} callback
359
+ * @param {MessageOptions} [options]
360
+ * @returns {Dialog}
361
+ */
362
+ export declare function ChoiceDialog(content: string, choices: Array<string | ContentHolder>, callback: (value: string | ContentHolder) => void, options?: MessageOptions): Dialog;
363
+ /**
364
+ * Loads scripts sequentially from a list of URLs.
365
+ * @function RequireScriptSerial
366
+ * @param {string | string[]} url Single URL or array of URLs to load.
367
+ * @param {(loadedScripts: GlobalEventHandlers[]) => void} onComplete Callback when all scripts are loaded.
368
+ * @param {(url: string, remaining: number) => void} onProgress Callback for progress updates.
369
+ */
370
+ export declare function RequireScriptSerial(url: string | string[], onComplete: (loadedScripts: GlobalEventHandlers[]) => void, onProgress: (url: string, remaining: number) => void): void;
371
+ /**
372
+ * Creates an HTML element
373
+ * @function CreateElement
374
+ * @param {String} tag
375
+ * @param {String} classID string containing id and classes, example: "myid .someclass .anotherclass"
376
+ * @param {String} content
377
+ * @param {string | CSSStyleDeclaration} [style]
378
+ * @param {EventListenerOrEventListenerObject[]} [events]
379
+ */
380
+ export declare function CreateElement(tag: string, classID: string, content: string, style?: string | CSSStyleDeclaration, events?: EventListenerOrEventListenerObject[]): EmptyLiteGUIObject;
381
+ /**
382
+ * Useful to create elements from a text like '<div><span class="title"></span></div>' and an object like { ".title":"mytitle" }
383
+ * @function CreateListItem
384
+ * @param {String} code
385
+ * @param {Record<string, string>} values it will use innerText in the elements that matches that selector
386
+ * @param {CSSStyleDeclaration} style
387
+ * @return {HTMLElement}
388
+ *
389
+ */
390
+ export declare function CreateListItem(code: string, values: Record<string, string>, style?: Partial<CSSStyleDeclaration> | Record<string, string>): HTMLSpanElement;
391
+ /**
392
+ * Creates a button element
393
+ * @function CreateButton
394
+ * @param {String} classID ID or class
395
+ * @param {String} content
396
+ * @param {(ev: PointerEvent) => void} callback when the button is pressed
397
+ * @param {CSSStyleDeclaration|String} style
398
+ *
399
+ */
400
+ export declare function CreateButton(classID: string, content: string, callback: (ev: PointerEvent) => void, style: CSSStyleDeclaration | string): EmptyLiteGUIButton;
401
+ /**
402
+ * Retrieves all parent elements of the given element up to the document root.
403
+ * @function GetParents
404
+ * @param {HTMLElement} element The starting element.
405
+ * @returns {HTMLElement[]} Array of parent elements.
406
+ */
407
+ export declare function GetParents(element: HTMLElement): Array<HTMLElement>;
408
+ /**
409
+ * Opens a new window with copied styles and optional scripts.
410
+ * @function NewWindow
411
+ * @param {string} title syntax title for the new window.
412
+ * @param {number} width Width of the window.
413
+ * @param {number} height Height of the window.
414
+ * @param {{ scripts?: boolean, content?: string }} [options] Configuration object.
415
+ * @param {boolean} [options.scripts] Whether to copy scripts to the new window.
416
+ * @param {string} [options.content] HTML content to inject into the new window.
417
+ * @returns {Window} The newly created window object.
418
+ */
419
+ export declare function NewWindow(title: string, width: number, height: number, options?: {
420
+ scripts?: boolean;
421
+ content?: string;
422
+ }): Window;
423
+ /**
424
+ * Triggers a download of the resource at the specified URL.
425
+ * @function DownloadURL
426
+ * @param {string} url The URL of the resource to download.
427
+ * @param {string} filename The name to save the file as.
428
+ */
429
+ export declare function DownloadURL(url: string, filename: string): void;
430
+ /**
431
+ * Triggers a download of a File or Blob object.
432
+ * @function DownloadFile
433
+ * @param {string} filename The name to save the file as.
434
+ * @param {File | Blob} data The file data.
435
+ * @param {string} dataType MIME type of the data if not specified in the Blob.
436
+ */
437
+ export declare function DownloadFile(filename: string, data: File | Blob, dataType: string): void;
438
+ /**
439
+ * Returns the URL vars ( ?foo=faa&foo2=etc )
440
+ * @function GetUrlVars
441
+ *
442
+ */
443
+ export declare function GetUrlVars(): Array<string>;
444
+ /**
445
+ * Retrieves a specific query parameter from the URL.
446
+ * @function GetUrlVar
447
+ * @param {string} name The name of the parameter.
448
+ * @returns {string} The value of the parameter.
449
+ */
450
+ export declare function GetUrlVar(name: string): string;
451
+ /**
452
+ * Makes one element draggable
453
+ * @function Draggable
454
+ * @param {HTMLElement} container the element that will be dragged
455
+ * @param {HTMLElement} dragger the area to start the dragging
456
+ * @param {(container: HTMLElement, e: MouseEvent) => void} onStart Callback when the dragging starts.
457
+ * @param {(container: HTMLElement, e: MouseEvent) => void} onFinish Callback when the dragging finishes.
458
+ * @param {(container: HTMLElement, e: MouseEvent) => boolean} onIsDraggable Callback to determine if the element is currently draggable.
459
+ */
460
+ export declare function Draggable(container: HTMLElement, dragger?: HTMLElement, onStart?: (container: HTMLElement, e: MouseEvent) => void, onFinish?: (container: HTMLElement, e: MouseEvent) => void, onIsDraggable?: (container: HTMLElement, e: MouseEvent) => boolean): void;
461
+ /**
462
+ * Clones object content
463
+ * @function CloneObject
464
+ * @param {Object} source
465
+ * @param {Object} target
466
+ *
467
+ */
468
+ export declare function CloneObject(source: any, target: any): any;
469
+ /**
470
+ * Removing spaces and dots from a string.
471
+ * @function SafeName
472
+ * @param {string} str The input string.
473
+ * @returns {string} The sanitized string.
474
+ */
475
+ export declare function SafeName(str: string): string;
476
+ /**
477
+ * Encodes an HTML string by replacing special characters with unicode.
478
+ * @function HTMLEncode
479
+ * @param {string} htmlCode The HTML string to encode.
480
+ * @returns {string} The encoded string (text content).
481
+ */
482
+ export declare function HTMLEncode(htmlCode: string): string;
483
+ /**
484
+ * Decodes a unicode string back to HTML.
485
+ * @function HTMLDecode
486
+ * @param {string} unicodeCharacter The string to decode.
487
+ * @returns {string} The decoded HTML string.
488
+ */
489
+ export declare function HTMLDecode(unicodeCharacter: string): string;
490
+ /**
491
+ * Returns the window where this element is attached (used in multi window applications)
492
+ * @function GetElementWindow
493
+ * @param {HTMLElement} element
494
+ * @return {Window} the window element
495
+ *
496
+ */
497
+ export declare function GetElementWindow(element: HTMLElement): Window | undefined;
498
+ /**
499
+ * Helper, makes drag and drop easier by enabling drag and drop in a given element
500
+ * @function CreateDropArea
501
+ * @param {HTMLElement} element the element where users could drop items
502
+ * @param {(evt: DragEvent) => boolean} onDrop function to call when the user drops the item
503
+ * @param {(evt: DragEvent, element: HTMLElement) => void} onEnter [optional] function to call when the user drags something inside
504
+ * @param {(evt: DragEvent, element: HTMLElement) => void} onExit [optional] function to call when the user drags something outside
505
+ *
506
+ */
507
+ export declare function CreateDropArea(element: HTMLElement, onDrop: (evt: DragEvent) => boolean, onEnter?: (evt: DragEvent, element: HTMLElement) => void, onExit?: (evt: DragEvent, element: HTMLElement) => void): void;
508
+ //# sourceMappingURL=utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,QA0BhD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,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AG,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKnD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAK3D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAIzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAClD,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,EACnC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,EACxD,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,QA2CvD"}
@@ -0,0 +1,33 @@
1
+ import { LiteGUIObject } from "../@types/globals";
2
+ /**
3
+ * The options for the standard button class construction.
4
+ */
5
+ export interface ButtonOptions {
6
+ /**
7
+ * Callback function to be executed when the button is clicked.
8
+ */
9
+ callback?: () => void;
10
+ }
11
+ /**
12
+ * Standard button class.
13
+ * @class Button
14
+ */
15
+ export declare class Button implements LiteGUIObject {
16
+ /** Root element of the widget */
17
+ root: HTMLDivElement;
18
+ /** Button element inside the root */
19
+ content: HTMLButtonElement;
20
+ /** Callback function to be executed when the button is clicked */
21
+ callback?: () => void;
22
+ /**
23
+ * Creates an instance of the Button widget.
24
+ * @param {string} value - The text to be displayed on the button.
25
+ * @param {ButtonOptions | Function} [options] - Configuration options or a callback function.
26
+ */
27
+ constructor(value: string, options?: (() => void) | ButtonOptions);
28
+ /**
29
+ * Triggers the click event on the button.
30
+ */
31
+ click(): void;
32
+ }
33
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/widgets/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,qBAAa,MAAO,YAAW,aAAa;IAE3C,iCAAiC;IAC1B,IAAI,EAAE,cAAc,CAAC;IAC5B,qCAAqC;IAC9B,OAAO,EAAE,iBAAiB,CAAC;IAClC,kEAAkE;IAC3D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B;;;;OAIG;gBACS,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,CAAC,MAAM,IAAI,CAAC,GAAG,aAAkB;IAsBrE;;OAEG;IACH,KAAK;CAIL"}
@@ -0,0 +1,36 @@
1
+ import { LiteGUIObject } from "../@types/globals";
2
+ /**
3
+ * Standard checkbox class.
4
+ * @class Checkbox
5
+ */
6
+ export declare class Checkbox implements LiteGUIObject {
7
+ /** Root element of the widget */
8
+ root: HTMLSpanElement;
9
+ /** Current value of the checkbox */
10
+ value: boolean;
11
+ /** Element representing the checkbox state */
12
+ element: HTMLSpanElement;
13
+ /** Callback function executed when value changes */
14
+ onChange: (value: boolean) => void;
15
+ /**
16
+ * Creates an instance of the Checkbox widget.
17
+ * @param {boolean} value - Initial value.
18
+ * @param {Function} onChange - Callback function when value changes.
19
+ */
20
+ constructor(value: boolean, onChange: (value: boolean) => void);
21
+ /**
22
+ * Sets the value of the checkbox.
23
+ * @param {boolean} value - New value.
24
+ */
25
+ setValue(value: boolean): void;
26
+ /**
27
+ * Gets the current value of the checkbox.
28
+ * @returns {boolean} The current value.
29
+ */
30
+ getValue(): boolean;
31
+ /**
32
+ * Handles click event to toggle value.
33
+ */
34
+ onClick(): void;
35
+ }
36
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/widgets/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;GAGG;AACH,qBAAa,QAAS,YAAW,aAAa;IAE7C,iCAAiC;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,oCAAoC;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,OAAO,EAAE,eAAe,CAAC;IACzB,oDAAoD;IACpD,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC;;;;OAIG;gBACS,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IAe9D;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO;IAuBvB;;;OAGG;IACH,QAAQ;IAKR;;OAEG;IACH,OAAO;CAIP"}