katanakit-js 2.2.1 → 2.12.9

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 (148) hide show
  1. package/README.md +72 -437
  2. package/dist/adapters/astro/astro.service.d.ts +103 -15
  3. package/dist/adapters/astro/astro.service.d.ts.map +1 -1
  4. package/dist/adapters/astro/astro.service.js +145 -75
  5. package/dist/adapters/astro/astro.service.js.map +1 -1
  6. package/dist/adapters/astro/index.d.ts +1 -1
  7. package/dist/adapters/astro/index.d.ts.map +1 -1
  8. package/dist/adapters/astro/index.js +1 -1
  9. package/dist/adapters/astro/index.js.map +1 -1
  10. package/dist/adapters/astro/rss.service.d.ts +85 -105
  11. package/dist/adapters/astro/rss.service.d.ts.map +1 -1
  12. package/dist/adapters/astro/rss.service.js +172 -168
  13. package/dist/adapters/astro/rss.service.js.map +1 -1
  14. package/dist/adapters/astro/seo.service.d.ts +10 -0
  15. package/dist/adapters/astro/seo.service.d.ts.map +1 -0
  16. package/dist/adapters/astro/seo.service.js +3 -0
  17. package/dist/adapters/astro/seo.service.js.map +1 -0
  18. package/dist/adapters/express/app.d.ts +30 -1
  19. package/dist/adapters/express/app.d.ts.map +1 -1
  20. package/dist/adapters/express/app.js +31 -3
  21. package/dist/adapters/express/app.js.map +1 -1
  22. package/dist/adapters/express/index.d.ts +2 -2
  23. package/dist/adapters/express/index.d.ts.map +1 -1
  24. package/dist/adapters/express/index.js +2 -2
  25. package/dist/adapters/express/index.js.map +1 -1
  26. package/dist/adapters/express/main.js +2 -2
  27. package/dist/adapters/express/main.js.map +1 -1
  28. package/dist/adapters/express/products.controller.d.ts +67 -8
  29. package/dist/adapters/express/products.controller.d.ts.map +1 -1
  30. package/dist/adapters/express/products.controller.js +105 -49
  31. package/dist/adapters/express/products.controller.js.map +1 -1
  32. package/dist/adapters/express/server.d.ts +37 -13
  33. package/dist/adapters/express/server.d.ts.map +1 -1
  34. package/dist/adapters/express/server.js +118 -53
  35. package/dist/adapters/express/server.js.map +1 -1
  36. package/dist/adapters/nuxt/nuxt.service.d.ts +8 -6
  37. package/dist/adapters/nuxt/nuxt.service.d.ts.map +1 -1
  38. package/dist/adapters/nuxt/nuxt.service.js +34 -10
  39. package/dist/adapters/nuxt/nuxt.service.js.map +1 -1
  40. package/dist/adapters/vue/vue.service.d.ts +5 -2
  41. package/dist/adapters/vue/vue.service.d.ts.map +1 -1
  42. package/dist/adapters/vue/vue.service.js +41 -7
  43. package/dist/adapters/vue/vue.service.js.map +1 -1
  44. package/dist/config/index.d.ts +2 -1
  45. package/dist/config/index.d.ts.map +1 -1
  46. package/dist/config/index.js +1 -1
  47. package/dist/config/index.js.map +1 -1
  48. package/dist/config/seo-meta.types.d.ts +177 -0
  49. package/dist/config/seo-meta.types.d.ts.map +1 -0
  50. package/dist/config/seo-meta.types.js +11 -0
  51. package/dist/config/seo-meta.types.js.map +1 -0
  52. package/dist/config/seo.service.d.ts +41 -58
  53. package/dist/config/seo.service.d.ts.map +1 -1
  54. package/dist/config/seo.service.js +468 -136
  55. package/dist/config/seo.service.js.map +1 -1
  56. package/dist/config/site.config.d.ts +10 -50
  57. package/dist/config/site.config.d.ts.map +1 -1
  58. package/dist/config/site.config.js +8 -36
  59. package/dist/config/site.config.js.map +1 -1
  60. package/dist/core/index.d.ts +1 -3
  61. package/dist/core/index.d.ts.map +1 -1
  62. package/dist/core/index.js +1 -3
  63. package/dist/core/index.js.map +1 -1
  64. package/dist/core/services/dates.service.d.ts +149 -22
  65. package/dist/core/services/dates.service.d.ts.map +1 -1
  66. package/dist/core/services/dates.service.js +201 -54
  67. package/dist/core/services/dates.service.js.map +1 -1
  68. package/dist/core/services/error.service.d.ts +32 -20
  69. package/dist/core/services/error.service.d.ts.map +1 -1
  70. package/dist/core/services/error.service.js +44 -32
  71. package/dist/core/services/error.service.js.map +1 -1
  72. package/dist/core/services/formatter.service.d.ts +245 -35
  73. package/dist/core/services/formatter.service.d.ts.map +1 -1
  74. package/dist/core/services/formatter.service.js +281 -57
  75. package/dist/core/services/formatter.service.js.map +1 -1
  76. package/dist/core/services/generator.service.d.ts +115 -26
  77. package/dist/core/services/generator.service.d.ts.map +1 -1
  78. package/dist/core/services/generator.service.js +191 -56
  79. package/dist/core/services/generator.service.js.map +1 -1
  80. package/dist/core/services/geometry.service.d.ts +369 -39
  81. package/dist/core/services/geometry.service.d.ts.map +1 -1
  82. package/dist/core/services/geometry.service.js +424 -66
  83. package/dist/core/services/geometry.service.js.map +1 -1
  84. package/dist/core/services/http.service.d.ts +244 -21
  85. package/dist/core/services/http.service.d.ts.map +1 -1
  86. package/dist/core/services/http.service.js +419 -98
  87. package/dist/core/services/http.service.js.map +1 -1
  88. package/dist/core/services/logger.service.d.ts +95 -29
  89. package/dist/core/services/logger.service.d.ts.map +1 -1
  90. package/dist/core/services/logger.service.js +167 -41
  91. package/dist/core/services/logger.service.js.map +1 -1
  92. package/dist/core/services/reactive.service.d.ts +146 -19
  93. package/dist/core/services/reactive.service.d.ts.map +1 -1
  94. package/dist/core/services/reactive.service.js +278 -137
  95. package/dist/core/services/reactive.service.js.map +1 -1
  96. package/dist/core/services/timing.service.d.ts +142 -20
  97. package/dist/core/services/timing.service.d.ts.map +1 -1
  98. package/dist/core/services/timing.service.js +324 -185
  99. package/dist/core/services/timing.service.js.map +1 -1
  100. package/dist/core/services/utils.service.d.ts +228 -43
  101. package/dist/core/services/utils.service.d.ts.map +1 -1
  102. package/dist/core/services/utils.service.js +305 -125
  103. package/dist/core/services/utils.service.js.map +1 -1
  104. package/dist/infrastructure/dom/dom.service.d.ts +307 -44
  105. package/dist/infrastructure/dom/dom.service.d.ts.map +1 -1
  106. package/dist/infrastructure/dom/dom.service.js +408 -129
  107. package/dist/infrastructure/dom/dom.service.js.map +1 -1
  108. package/dist/infrastructure/index.d.ts +0 -3
  109. package/dist/infrastructure/index.d.ts.map +1 -1
  110. package/dist/infrastructure/index.js +0 -3
  111. package/dist/infrastructure/index.js.map +1 -1
  112. package/dist/infrastructure/observer/observer.service.d.ts +124 -31
  113. package/dist/infrastructure/observer/observer.service.d.ts.map +1 -1
  114. package/dist/infrastructure/observer/observer.service.js +227 -131
  115. package/dist/infrastructure/observer/observer.service.js.map +1 -1
  116. package/dist/infrastructure/sensors/sensors.service.d.ts +154 -22
  117. package/dist/infrastructure/sensors/sensors.service.d.ts.map +1 -1
  118. package/dist/infrastructure/sensors/sensors.service.js +264 -112
  119. package/dist/infrastructure/sensors/sensors.service.js.map +1 -1
  120. package/dist/infrastructure/storage/storage.service.d.ts +123 -45
  121. package/dist/infrastructure/storage/storage.service.d.ts.map +1 -1
  122. package/dist/infrastructure/storage/storage.service.js +236 -66
  123. package/dist/infrastructure/storage/storage.service.js.map +1 -1
  124. package/dist/infrastructure/theme/theme.service.d.ts +93 -29
  125. package/dist/infrastructure/theme/theme.service.d.ts.map +1 -1
  126. package/dist/infrastructure/theme/theme.service.js +198 -96
  127. package/dist/infrastructure/theme/theme.service.js.map +1 -1
  128. package/dist/infrastructure/viewport/viewport.service.d.ts +233 -35
  129. package/dist/infrastructure/viewport/viewport.service.d.ts.map +1 -1
  130. package/dist/infrastructure/viewport/viewport.service.js +358 -139
  131. package/dist/infrastructure/viewport/viewport.service.js.map +1 -1
  132. package/dist/infrastructure/worker/worker.service.d.ts +84 -38
  133. package/dist/infrastructure/worker/worker.service.d.ts.map +1 -1
  134. package/dist/infrastructure/worker/worker.service.js +234 -133
  135. package/dist/infrastructure/worker/worker.service.js.map +1 -1
  136. package/dist/prisma/index.d.ts +2 -0
  137. package/dist/prisma/index.d.ts.map +1 -0
  138. package/dist/prisma/index.js +2 -0
  139. package/dist/prisma/index.js.map +1 -0
  140. package/dist/prisma/schema.json +11 -33
  141. package/dist/prisma/use-prisma.d.ts +68 -0
  142. package/dist/prisma/use-prisma.d.ts.map +1 -0
  143. package/dist/prisma/use-prisma.js +82 -0
  144. package/dist/prisma/use-prisma.js.map +1 -0
  145. package/dist/types/index.d.ts +20 -12
  146. package/dist/types/index.d.ts.map +1 -1
  147. package/package.json +124 -125
  148. package/CHANGELOG.md +0 -101
@@ -1,49 +1,312 @@
1
- import type { IDomService } from "../../types/index.js";
2
- export declare class DomService implements IDomService {
3
- private static instance;
4
- private constructor();
5
- static getInstance(): DomService;
6
- useIsBrowser: () => boolean;
7
- useGetRoot: () => HTMLElement | null;
8
- useGetBody: () => HTMLBodyElement | null;
9
- private RESOLVE;
10
- useGetElementById: <T extends HTMLElement = HTMLElement>(id: string) => T | null;
11
- useGetElementByClass: <T extends HTMLElement = HTMLElement>(className: string) => T | null;
12
- useQuerySelector: {
13
- <K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
14
- <E extends Element = HTMLElement>(selector: string): E | null;
15
- };
16
- useQuerySelectorAll: {
17
- <K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K][];
18
- <E extends Element = HTMLElement>(selector: string): E[];
19
- };
20
- useAddClass: (target: Element | string, className: string) => void;
21
- useRemoveClass: (target: Element | string, className: string | string[]) => void;
22
- useToggleClass: (target: Element | string, className: string, force?: boolean) => boolean | undefined;
23
- useHasClass: (target: Element | string, className: string) => boolean;
24
- useGetAttribute: (target: Element | string, attr: string) => string | null;
25
- useSetAttribute: (target: Element | string, attr: string, value: string) => void;
26
- useRemoveAttribute: (target: Element | string, attr: string) => void;
27
- useGetDataAttribute: (target: HTMLElement | string, key: string) => string | undefined;
28
- useSetDataAttribute: (target: HTMLElement | string, key: string, value: string) => void;
29
- useOn: <K extends keyof HTMLElementEventMap>(target: EventTarget | string, event: K, callback: (event: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => (() => void) | null;
30
- useCreateElement: <T extends keyof HTMLElementTagNameMap>(tagName: T, options?: ElementCreationOptions) => HTMLElementTagNameMap[T];
31
- /**
32
- * Sets innerHTML on the target element.
33
- * WARNING: this is an XSS sink. Only pass trusted HTML. For user-supplied
34
- * content, use `useSetText` (textContent) instead, or sanitize with DOMPurify.
35
- */
36
- useSetHtml: (target: Element | string, html: string) => void;
37
- useSetText: (target: Element | string, text: string) => void;
38
- useAppend: (target: Element | string, child: Element | string) => void;
39
- useRemove: (target: Element | string) => void;
40
- }
41
- export declare const DOM_SERVICE: DomService;
42
- export declare const useIsBrowser: () => boolean, useGetRoot: () => HTMLElement | null, useGetBody: () => HTMLBodyElement | null, useGetElementById: <T extends HTMLElement = HTMLElement>(id: string) => T | null, useGetElementByClass: <T extends HTMLElement = HTMLElement>(className: string) => T | null, useQuerySelector: {
1
+ /**
2
+ * Checks whether the code is running in a browser environment.
3
+ *
4
+ * @returns `true` if both `window` and `document` are defined.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * if (useIsBrowser()) {
9
+ * // safe to access DOM APIs
10
+ * }
11
+ * ```
12
+ */
13
+ export declare const useIsBrowser: () => boolean;
14
+ /**
15
+ * Returns the root `<html>` element, or `null` outside a browser.
16
+ *
17
+ * @returns The `document.documentElement` element.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const root = useGetRoot();
22
+ * root?.setAttribute("lang", "en");
23
+ * ```
24
+ */
25
+ export declare const useGetRoot: () => HTMLElement | null;
26
+ /**
27
+ * Returns the `<body>` element, or `null` outside a browser.
28
+ *
29
+ * @returns The `document.body` element cast as `HTMLBodyElement`.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const body = useGetBody();
34
+ * body?.classList.add("loaded");
35
+ * ```
36
+ */
37
+ export declare const useGetBody: () => HTMLBodyElement | null;
38
+ /**
39
+ * Finds an element by its `id` attribute.
40
+ *
41
+ * @typeParam T - The expected HTMLElement subtype.
42
+ * @param id - The element id (without `#`).
43
+ * @returns The matching element, or `null`.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const btn = useGetElementById<HTMLButtonElement>("submit-btn");
48
+ * ```
49
+ */
50
+ export declare const useGetElementById: <T extends HTMLElement = HTMLElement>(id: string) => T | null;
51
+ /**
52
+ * Finds the first element matching a class name.
53
+ *
54
+ * @typeParam T - The expected HTMLElement subtype.
55
+ * @param className - A class name, with or without a leading `.`.
56
+ * @returns The matching element, or `null`.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const card = useGetElementByClass(".card");
61
+ * const card2 = useGetElementByClass("card"); // equivalent
62
+ * ```
63
+ */
64
+ export declare const useGetElementByClass: <T extends HTMLElement = HTMLElement>(className: string) => T | null;
65
+ /**
66
+ * Returns the first element matching a CSS selector.
67
+ *
68
+ * @typeParam E - The expected Element subtype.
69
+ * @param selector - A CSS selector string.
70
+ * @returns The matching element, or `null`.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const el = useQuerySelector<HTMLElement>(".my-class");
75
+ * ```
76
+ */
77
+ export declare const useQuerySelector: {
43
78
  <K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K] | null;
44
79
  <E extends Element = HTMLElement>(selector: string): E | null;
45
- }, useQuerySelectorAll: {
80
+ };
81
+ /**
82
+ * Returns all elements matching a CSS selector.
83
+ *
84
+ * @typeParam E - The expected Element subtype.
85
+ * @param selector - A CSS selector string.
86
+ * @returns An array of matching elements.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const items = useQuerySelectorAll<HTMLLIElement>("li.item");
91
+ * items.forEach(el => console.log(el.textContent));
92
+ * ```
93
+ */
94
+ export declare const useQuerySelectorAll: {
46
95
  <K extends keyof HTMLElementTagNameMap>(selector: K): HTMLElementTagNameMap[K][];
47
96
  <E extends Element = HTMLElement>(selector: string): E[];
48
- }, useAddClass: (target: Element | string, className: string) => void, useRemoveClass: (target: Element | string, className: string | string[]) => void, useToggleClass: (target: Element | string, className: string, force?: boolean) => boolean | undefined, useHasClass: (target: Element | string, className: string) => boolean, useGetAttribute: (target: Element | string, attr: string) => string | null, useSetAttribute: (target: Element | string, attr: string, value: string) => void, useRemoveAttribute: (target: Element | string, attr: string) => void, useGetDataAttribute: (target: HTMLElement | string, key: string) => string | undefined, useSetDataAttribute: (target: HTMLElement | string, key: string, value: string) => void, useOn: <K extends keyof HTMLElementEventMap>(target: EventTarget | string, event: K, callback: (event: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => (() => void) | null, useCreateElement: <T extends keyof HTMLElementTagNameMap>(tagName: T, options?: ElementCreationOptions) => HTMLElementTagNameMap[T], useSetHtml: (target: Element | string, html: string) => void, useSetText: (target: Element | string, text: string) => void, useAppend: (target: Element | string, child: Element | string) => void, useRemove: (target: Element | string) => void;
97
+ };
98
+ /**
99
+ * Adds one or more CSS classes to the target element.
100
+ *
101
+ * @param target - A CSS selector string or an Element instance.
102
+ * @param className - The class name to add.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * useAddClass("#header", "sticky");
107
+ * useAddClass(myElement, "visible");
108
+ * ```
109
+ */
110
+ export declare const useAddClass: (target: Element | string, className: string) => void;
111
+ /**
112
+ * Removes CSS class(es) from the target element.
113
+ *
114
+ * @param target - A CSS selector string or an Element instance.
115
+ * @param className - A single class name or an array of class names to remove.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * useRemoveClass("#header", "sticky");
120
+ * useRemoveClass(myElement, ["visible", "active"]);
121
+ * ```
122
+ */
123
+ export declare const useRemoveClass: (target: Element | string, className: string | string[]) => void;
124
+ /**
125
+ * Toggles a CSS class on the target element.
126
+ *
127
+ * @param target - A CSS selector string or an Element instance.
128
+ * @param className - The class name to toggle.
129
+ * @param force - If provided, forces the class on (`true`) or off (`false`).
130
+ * @returns `true` if the class is now present, `false` if removed, or `undefined` if element not found.
131
+ *
132
+ * @example
133
+ * ```ts
134
+ * useToggleClass(".sidebar", "open");
135
+ * useToggleClass(".sidebar", "hidden", false);
136
+ * ```
137
+ */
138
+ export declare const useToggleClass: (target: Element | string, className: string, force?: boolean) => boolean | undefined;
139
+ /**
140
+ * Checks whether the target element has a given CSS class.
141
+ *
142
+ * @param target - A CSS selector string or an Element instance.
143
+ * @param className - The class name to check.
144
+ * @returns `true` if the class exists, `false` otherwise.
145
+ *
146
+ * @example
147
+ * ```ts
148
+ * if (useHasClass(".btn", "disabled")) {
149
+ * // button is disabled
150
+ * }
151
+ * ```
152
+ */
153
+ export declare const useHasClass: (target: Element | string, className: string) => boolean;
154
+ /**
155
+ * Gets the value of an attribute from the target element.
156
+ *
157
+ * @param target - A CSS selector string or an Element instance.
158
+ * @param attr - The attribute name.
159
+ * @returns The attribute value, or `null` if not present or element not found.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * const href = useGetAttribute("a.link", "href");
164
+ * ```
165
+ */
166
+ export declare const useGetAttribute: (target: Element | string, attr: string) => string | null;
167
+ /**
168
+ * Sets an attribute on the target element with XSS protection.
169
+ * Blocks event-handler attributes (`on*`) and `javascript:` URLs.
170
+ *
171
+ * @param target - A CSS selector string or an Element instance.
172
+ * @param attr - The attribute name.
173
+ * @param value - The value to set.
174
+ * @throws {Error} If the attribute is an event handler or contains a `javascript:` URL.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * useSetAttribute("img.hero", "src", "/photo.jpg");
179
+ * useSetAttribute("a.link", "href", "https://example.com");
180
+ * ```
181
+ */
182
+ export declare const useSetAttribute: (target: Element | string, attr: string, value: string) => void;
183
+ /**
184
+ * Removes an attribute from the target element.
185
+ *
186
+ * @param target - A CSS selector string or an Element instance.
187
+ * @param attr - The attribute name to remove.
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * useRemoveAttribute("input", "disabled");
192
+ * ```
193
+ */
194
+ export declare const useRemoveAttribute: (target: Element | string, attr: string) => void;
195
+ /**
196
+ * Gets a `data-*` attribute value from the target element.
197
+ *
198
+ * @param target - A CSS selector string or an HTMLElement instance.
199
+ * @param key - The data key (without the `data-` prefix).
200
+ * @returns The data attribute value, or `undefined`.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * const id = useGetDataAttribute("tr.row", "userId");
205
+ * ```
206
+ */
207
+ export declare const useGetDataAttribute: (target: HTMLElement | string, key: string) => string | undefined;
208
+ /**
209
+ * Sets a `data-*` attribute on the target element.
210
+ *
211
+ * @param target - A CSS selector string or an HTMLElement instance.
212
+ * @param key - The data key (without the `data-` prefix).
213
+ * @param value - The value to set.
214
+ *
215
+ * @example
216
+ * ```ts
217
+ * useSetDataAttribute("tr.row", "status", "active");
218
+ * ```
219
+ */
220
+ export declare const useSetDataAttribute: (target: HTMLElement | string, key: string, value: string) => void;
221
+ /**
222
+ * Attaches an event listener to the target element and returns a cleanup function.
223
+ *
224
+ * @typeParam K - The event type key from `HTMLElementEventMap`.
225
+ * @param target - An EventTarget instance or a CSS selector string.
226
+ * @param event - The event name to listen for.
227
+ * @param callback - The event handler.
228
+ * @param options - Optional `addEventListener` options.
229
+ * @returns A function that removes the listener, or `null` if not in a browser.
230
+ *
231
+ * @example
232
+ * ```ts
233
+ * const off = useOn("#btn", "click", (e) => console.log("clicked", e));
234
+ * // later:
235
+ * off?.();
236
+ * ```
237
+ */
238
+ export declare const useOn: <K extends keyof HTMLElementEventMap>(target: EventTarget | string, event: K, callback: (event: HTMLElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => (() => void) | null;
239
+ /**
240
+ * Creates a new HTML element.
241
+ *
242
+ * @typeParam T - The tag name from `HTMLElementTagNameMap`.
243
+ * @param tagName - The tag name to create.
244
+ * @param options - Optional element creation options.
245
+ * @returns The newly created element.
246
+ * @throws {Error} If called outside a browser environment.
247
+ *
248
+ * @example
249
+ * ```ts
250
+ * const div = useCreateElement("div");
251
+ * const input = useCreateElement("input", { is: "custom-input" });
252
+ * ```
253
+ */
254
+ export declare const useCreateElement: <T extends keyof HTMLElementTagNameMap>(tagName: T, options?: ElementCreationOptions) => HTMLElementTagNameMap[T];
255
+ /**
256
+ * Sets `innerHTML` on the target element.
257
+ *
258
+ * **XSS risk:** this is an HTML injection sink. Never pass unsanitized
259
+ * user input. Prefer {@link useSetText} for plain text, or sanitize with
260
+ * a trusted library (e.g. DOMPurify) before calling this function.
261
+ *
262
+ * @param target - A CSS selector string or an Element instance.
263
+ * @param html - The HTML string to set.
264
+ *
265
+ * @example
266
+ * ```ts
267
+ * // Safe — trusted static markup
268
+ * useSetHtml("#banner", "<strong>Hello</strong>");
269
+ *
270
+ * // Unsafe — do NOT do this with user content
271
+ * // useSetHtml("#out", userInput);
272
+ * ```
273
+ */
274
+ export declare const useSetHtml: (target: Element | string, html: string) => void;
275
+ /**
276
+ * Sets the `textContent` of the target element (safe for user input).
277
+ *
278
+ * @param target - A CSS selector string or an Element instance.
279
+ * @param text - The plain text to set.
280
+ *
281
+ * @example
282
+ * ```ts
283
+ * useSetText("#greeting", "Hello, world!");
284
+ * ```
285
+ */
286
+ export declare const useSetText: (target: Element | string, text: string) => void;
287
+ /**
288
+ * Appends a child element to the target parent.
289
+ *
290
+ * @param target - A CSS selector string or an Element instance (the parent).
291
+ * @param child - A CSS selector string or an Element instance (the child).
292
+ *
293
+ * @example
294
+ * ```ts
295
+ * const item = useCreateElement("li");
296
+ * useSetText(item, "New item");
297
+ * useAppend("ul.list", item);
298
+ * ```
299
+ */
300
+ export declare const useAppend: (target: Element | string, child: Element | string) => void;
301
+ /**
302
+ * Removes the target element from the DOM.
303
+ *
304
+ * @param target - A CSS selector string or an Element instance.
305
+ *
306
+ * @example
307
+ * ```ts
308
+ * useRemove(".modal-overlay");
309
+ * ```
310
+ */
311
+ export declare const useRemove: (target: Element | string) => void;
49
312
  //# sourceMappingURL=dom.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.service.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/dom/dom.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKxD,qBAAa,UAAW,YAAW,WAAW;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAa;IAEpC,OAAO,eAAiB;IAExB,OAAc,WAAW,IAAI,UAAU,CAKtC;IAEM,YAAY,QAAO,OAAO,CACiC;IAE3D,UAAU,QAAO,WAAW,GAAG,IAAI,CAGxC;IAEK,UAAU,QAAO,eAAe,GAAG,IAAI,CAG5C;IAEF,OAAO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