@dooboostore/simple-web-component 1.0.42 → 1.0.44

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 (153) hide show
  1. package/README.md +689 -85
  2. package/dist/cjs/SwcAppEngine.js +3 -1
  3. package/dist/cjs/SwcAppEngine.js.map +2 -2
  4. package/dist/cjs/decorators/addEventListener.js +10 -0
  5. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  6. package/dist/cjs/decorators/applyAttribute.js +41 -30
  7. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  8. package/dist/cjs/decorators/applyClass.js +66 -23
  9. package/dist/cjs/decorators/applyClass.js.map +3 -3
  10. package/dist/cjs/decorators/applyNode.js +176 -107
  11. package/dist/cjs/decorators/applyNode.js.map +2 -2
  12. package/dist/cjs/decorators/applyProperty.js +21 -30
  13. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  14. package/dist/cjs/decorators/applySlot.js +11 -2
  15. package/dist/cjs/decorators/applySlot.js.map +2 -2
  16. package/dist/cjs/decorators/applyStyle.js +48 -17
  17. package/dist/cjs/decorators/applyStyle.js.map +3 -3
  18. package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
  19. package/dist/cjs/decorators/changedAttribute.js.map +7 -0
  20. package/dist/cjs/decorators/elementDefine.js +37 -6
  21. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  22. package/dist/cjs/decorators/emitCustomEvent.js +58 -42
  23. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  24. package/dist/cjs/decorators/index.js +1 -1
  25. package/dist/cjs/decorators/index.js.map +2 -2
  26. package/dist/cjs/decorators/publishSwcAppMessage.js +37 -23
  27. package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
  28. package/dist/cjs/decorators/query.js +96 -145
  29. package/dist/cjs/decorators/query.js.map +3 -3
  30. package/dist/cjs/decorators/queryAll.js +104 -131
  31. package/dist/cjs/decorators/queryAll.js.map +3 -3
  32. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  33. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  34. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  35. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  36. package/dist/cjs/elements/SwcAppMixin.js +17 -2
  37. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  38. package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
  39. package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
  40. package/dist/cjs/index.js +1 -0
  41. package/dist/cjs/index.js.map +2 -2
  42. package/dist/cjs/router/ElementRouter.js +4 -0
  43. package/dist/cjs/router/ElementRouter.js.map +2 -2
  44. package/dist/esm/SwcAppEngine.js +3 -1
  45. package/dist/esm/SwcAppEngine.js.map +2 -2
  46. package/dist/esm/decorators/addEventListener.js +10 -0
  47. package/dist/esm/decorators/addEventListener.js.map +2 -2
  48. package/dist/esm/decorators/applyAttribute.js +41 -30
  49. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  50. package/dist/esm/decorators/applyClass.js +66 -23
  51. package/dist/esm/decorators/applyClass.js.map +3 -3
  52. package/dist/esm/decorators/applyNode.js +176 -107
  53. package/dist/esm/decorators/applyNode.js.map +2 -2
  54. package/dist/esm/decorators/applyProperty.js +21 -30
  55. package/dist/esm/decorators/applyProperty.js.map +2 -2
  56. package/dist/esm/decorators/applySlot.js +11 -2
  57. package/dist/esm/decorators/applySlot.js.map +2 -2
  58. package/dist/esm/decorators/applyStyle.js +48 -17
  59. package/dist/esm/decorators/applyStyle.js.map +3 -3
  60. package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
  61. package/dist/esm/decorators/changedAttribute.js.map +7 -0
  62. package/dist/esm/decorators/elementDefine.js +35 -4
  63. package/dist/esm/decorators/elementDefine.js.map +2 -2
  64. package/dist/esm/decorators/emitCustomEvent.js +58 -42
  65. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  66. package/dist/esm/decorators/index.js +1 -1
  67. package/dist/esm/decorators/index.js.map +1 -1
  68. package/dist/esm/decorators/publishSwcAppMessage.js +37 -23
  69. package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
  70. package/dist/esm/decorators/query.js +96 -145
  71. package/dist/esm/decorators/query.js.map +3 -3
  72. package/dist/esm/decorators/queryAll.js +104 -131
  73. package/dist/esm/decorators/queryAll.js.map +3 -3
  74. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  75. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  76. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  77. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  78. package/dist/esm/elements/SwcAppMixin.js +18 -3
  79. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  80. package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
  81. package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
  82. package/dist/esm/index.js +1 -0
  83. package/dist/esm/index.js.map +2 -2
  84. package/dist/esm/router/ElementRouter.js +4 -0
  85. package/dist/esm/router/ElementRouter.js.map +2 -2
  86. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +900 -578
  87. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  88. package/dist/types/SwcAppEngine.d.ts.map +1 -1
  89. package/dist/types/decorators/addEventListener.d.ts +22 -14
  90. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  91. package/dist/types/decorators/applyAttribute.d.ts +61 -20
  92. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  93. package/dist/types/decorators/applyClass.d.ts +22 -36
  94. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  95. package/dist/types/decorators/applyNode.d.ts +178 -30
  96. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  97. package/dist/types/decorators/applyProperty.d.ts +53 -18
  98. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  99. package/dist/types/decorators/applySlot.d.ts +6 -0
  100. package/dist/types/decorators/applySlot.d.ts.map +1 -1
  101. package/dist/types/decorators/applyStyle.d.ts +13 -7
  102. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  103. package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
  104. package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
  105. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  106. package/dist/types/decorators/emitCustomEvent.d.ts +20 -10
  107. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  108. package/dist/types/decorators/index.d.ts +1 -1
  109. package/dist/types/decorators/index.d.ts.map +1 -1
  110. package/dist/types/decorators/publishSwcAppMessage.d.ts +19 -0
  111. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  112. package/dist/types/decorators/query.d.ts +3 -26
  113. package/dist/types/decorators/query.d.ts.map +1 -1
  114. package/dist/types/decorators/queryAll.d.ts +3 -20
  115. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  116. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
  117. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
  118. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
  119. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
  120. package/dist/types/elements/SwcAppMixin.d.ts +4 -4
  121. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  122. package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
  123. package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
  124. package/dist/types/index.d.ts +1 -0
  125. package/dist/types/index.d.ts.map +1 -1
  126. package/dist/types/router/ElementRouter.d.ts.map +1 -1
  127. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +900 -578
  128. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  129. package/package.json +7 -9
  130. package/src/SwcAppEngine.ts +3 -1
  131. package/src/decorators/addEventListener.ts +35 -24
  132. package/src/decorators/applyAttribute.ts +167 -65
  133. package/src/decorators/applyClass.ts +113 -17
  134. package/src/decorators/applyNode.ts +383 -102
  135. package/src/decorators/applyProperty.ts +99 -65
  136. package/src/decorators/applySlot.ts +24 -10
  137. package/src/decorators/applyStyle.ts +83 -13
  138. package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
  139. package/src/decorators/elementDefine.ts +47 -4
  140. package/src/decorators/emitCustomEvent.ts +62 -35
  141. package/src/decorators/index.ts +1 -1
  142. package/src/decorators/publishSwcAppMessage.ts +71 -27
  143. package/src/decorators/query.ts +90 -159
  144. package/src/decorators/queryAll.ts +92 -134
  145. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
  146. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
  147. package/src/elements/SwcAppMixin.ts +43 -24
  148. package/src/examples/RxJSOperatorsExample.ts +279 -0
  149. package/src/index.ts +2 -0
  150. package/src/router/ElementRouter.ts +4 -0
  151. package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
  152. package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
  153. package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
@@ -13,7 +13,7 @@ import {ElementApply} from "@dooboostore/core-web";
13
13
  </p>
14
14
  <!-- afterend -->
15
15
  */
16
- export type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove';
16
+ export type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';
17
17
 
18
18
  export interface ApplyNodeOptions {
19
19
  position?: ApplyNodePosition;
@@ -27,6 +27,12 @@ export interface ApplyNodeOptions {
27
27
  * Optional loading content to display while an async method is executing.
28
28
  */
29
29
  fallback?: (helper: HelperHostSet) => any;
30
+ /**
31
+ * Custom key to extract value from return object.
32
+ * If not provided, uses APPLY_NODE_METADATA_KEY by default.
33
+ * Useful when multiple @applyNode decorators are on the same method.
34
+ */
35
+ valueKey?: symbol | string;
30
36
  }
31
37
 
32
38
  export interface ApplyNodeMetadata {
@@ -47,11 +53,17 @@ export const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-no
47
53
 
48
54
  const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string, pos: ApplyNodePosition, win: Window, host?: any) => {
49
55
  if (!targetEl) return;
56
+
57
+ // Handle clearChildren - ignore return value and always clear
58
+ if (pos === 'clearChildren') {
59
+ targetEl.replaceChildren();
60
+ return [];
61
+ }
62
+
50
63
  const doc = win.document;
51
64
  const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
52
65
  const id = currentThis._swcId;
53
66
 
54
-
55
67
  const nodes: Node[] = [];
56
68
 
57
69
  if (typeof res === 'string' && pos === 'innerHtml') {
@@ -64,8 +76,6 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
64
76
 
65
77
  SwcUtils.projectProcessHtml(id, nodes, doc);
66
78
 
67
-
68
-
69
79
  const isShadowRoot = targetEl instanceof win.ShadowRoot;
70
80
  // const nodes = normalizeNodes(res, doc);
71
81
  if (pos === 'replace') {
@@ -95,8 +105,28 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
95
105
 
96
106
  /**
97
107
  * @applyNode decorator to surgically add/replace nodes to a target element.
108
+ *
109
+ * Overloads:
110
+ * - applyNode(selector, options) - Apply to specific selector
111
+ * - applyNode(options) - Apply to $this (current element)
98
112
  */
99
- export function applyNode(selector: string, options: ApplyNodeOptions = {position: 'replaceChildren'}): MethodDecorator {
113
+ export function applyNode(selector: string, options?: ApplyNodeOptions): MethodDecorator;
114
+ export function applyNode(options: ApplyNodeOptions): MethodDecorator;
115
+ export function applyNode(selectorOrOptions: string | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {
116
+ // Determine selector and options based on overload
117
+ let selector: string;
118
+ let options: ApplyNodeOptions;
119
+
120
+ if (typeof selectorOrOptions === 'string') {
121
+ // First overload: applyNode(selector, options)
122
+ selector = selectorOrOptions;
123
+ options = maybeOptions || {position: 'replaceChildren'};
124
+ } else {
125
+ // Second overload: applyNode(options) - default to $this
126
+ selector = '$this';
127
+ options = selectorOrOptions || {position: 'replaceChildren'};
128
+ }
129
+
100
130
  return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
101
131
  const constructor = targetObj.constructor;
102
132
  let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;
@@ -140,6 +170,22 @@ export function applyNode(selector: string, options: ApplyNodeOptions = {positio
140
170
  const targetEl = getTarget();
141
171
  const res = original.apply(this, args);
142
172
 
173
+ /**
174
+ * Extract value for this decorator from method return value
175
+ *
176
+ * If return value is an object with this decorator's key,
177
+ * use that value. Otherwise use the entire return value.
178
+ *
179
+ * Uses valueKey from options if provided, otherwise uses APPLY_NODE_METADATA_KEY.
180
+ */
181
+ const extractValue = (v: any) => {
182
+ const keyToUse = options.valueKey ?? APPLY_NODE_METADATA_KEY;
183
+ if (v && typeof v === 'object' && keyToUse in v) {
184
+ return v[keyToUse];
185
+ }
186
+ return v;
187
+ };
188
+
143
189
  const runApply = (target: any, val: any) => {
144
190
  const pos = options.position || 'beforeEnd';
145
191
  // Delegate HTML/node processing to applyToDom which centralizes
@@ -163,149 +209,384 @@ export function applyNode(selector: string, options: ApplyNodeOptions = {positio
163
209
 
164
210
  if (res instanceof Promise) {
165
211
  return res.then(finalRes => {
212
+ const extracted = extractValue(finalRes);
166
213
  fallbackNodes.forEach((it: any)=>it.remove());
167
- if (finalRes !== undefined && targetEl) runApply(targetEl, finalRes);
214
+ if (extracted !== undefined && targetEl) runApply(targetEl, extracted);
168
215
  return finalRes;
169
216
  });
170
217
  } else {
171
- if (res !== undefined && targetEl) runApply(targetEl, res);
218
+ const extracted = extractValue(res);
219
+ if (extracted !== undefined && targetEl) runApply(targetEl, extracted);
172
220
  return res;
173
221
  }
174
222
  };
175
223
  };
176
224
  }
177
225
 
178
- export function applyNodeThis(options: ApplyNodeOptions): MethodDecorator;
179
- export function applyNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
180
- export function applyNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
181
- const option: ApplyNodeOptions = {position: 'replaceChildren'};
182
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
183
- const opt = targetOrOptions || {};
184
- return applyNode('$this', {...option, ...opt});
185
- }
226
+ // --- Overloaded convenience functions for common patterns ---
186
227
 
187
- export function replaceChildrenNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
188
- export function replaceChildrenNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
189
- export function replaceChildrenNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
190
- const option: ApplyNodeOptions = {position: 'replaceChildren'};
191
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
192
- const opt = targetOrOptions || {};
193
- return applyNode('$this', {...opt, ...option});
228
+ /**
229
+ * @replaceChildrenNode decorator - replaces children of target element
230
+ *
231
+ * Overloads:
232
+ * - replaceChildrenNode(selector, options) - Replace children of specific selector
233
+ * - replaceChildrenNode(options) - Replace children of $this (current element)
234
+ * - @replaceChildrenNode - Bare decorator, replaces children of $this
235
+ */
236
+ export function replaceChildren(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
237
+ export function replaceChildren(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
238
+ export function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
239
+ export function replaceChildren(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
240
+ // Bare decorator usage: @replaceChildrenNode
241
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
242
+ return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);
243
+ }
244
+
245
+ if (typeof selectorOrOptions === 'string') {
246
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
247
+ }
248
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
194
249
  }
195
250
 
251
+ /**
252
+ * @clearChildrenNode decorator - clears all children of target element
253
+ *
254
+ * Overloads:
255
+ * - clearChildrenNode(selector, options) - Clear children of specific selector
256
+ * - clearChildrenNode(options) - Clear children of $this (current element)
257
+ * - @clearChildrenNode - Bare decorator, clears children of $this
258
+ */
259
+ export function clearChildrenNode(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
260
+ export function clearChildrenNode(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
261
+ export function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
262
+ export function clearChildrenNode(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
263
+ // Bare decorator usage: @clearChildrenNode
264
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
265
+ return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);
266
+ }
267
+
268
+ if (typeof selectorOrOptions === 'string') {
269
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
270
+ }
271
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
272
+ }
196
273
 
274
+ // Alias for clearChildrenNode
275
+ export const clearNode = clearChildrenNode;
197
276
 
198
- export function beforeEndNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
199
- export function beforeEndNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
200
- export function beforeEndNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
201
- const options: ApplyNodeOptions = {position: 'beforeEnd'};
202
- if (propertyKey !== undefined) return applyNode('$this', options)(targetOrOptions, propertyKey, descriptor);
203
- const opt = targetOrOptions || {};
204
- return applyNode('$this', {...opt, ...options});
277
+ /**
278
+ * @innerHtmlNode decorator - sets innerHTML of target element
279
+ *
280
+ * Overloads:
281
+ * - innerHtmlNode(selector, options) - Set innerHTML of specific selector
282
+ * - innerHtmlNode(options) - Set innerHTML of $this (current element)
283
+ * - @innerHtmlNode - Bare decorator, sets innerHTML of $this
284
+ */
285
+ export function innerHtml(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
286
+ export function innerHtml(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
287
+ export function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
288
+ export function innerHtml(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
289
+ // Bare decorator usage: @innerHtmlNode
290
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
291
+ return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);
292
+ }
293
+
294
+ if (typeof selectorOrOptions === 'string') {
295
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
296
+ }
297
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
205
298
  }
206
299
 
207
- export function beforeEndLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
208
- export function beforeEndLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
209
- export function beforeEndLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
210
- const option: ApplyNodeOptions = {position: 'beforeEnd', root: 'light'}
211
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
212
- const opt = targetOrOptions || {};
213
- return applyNode('$this', {...opt, ...option});
214
- }
300
+ // Alias for innerHtmlNode
301
+ // export const setHtmlNode = innerHtml;
215
302
 
216
- export function beforeEndShadowNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
217
- export function beforeEndShadowNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
218
- export function beforeEndShadowNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
219
- const option: ApplyNodeOptions = {position: 'beforeEnd', root: 'shadow'}
220
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
221
- const opt = targetOrOptions || {};
222
- return applyNode('$this', {...opt, ...option});
303
+ /**
304
+ * @innerHtmlLightNode decorator - sets innerHTML of light DOM element
305
+ *
306
+ * Overloads:
307
+ * - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM
308
+ * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM
309
+ * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM
310
+ */
311
+ export function innerHtmlLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
312
+ export function innerHtmlLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
313
+ export function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
314
+ export function innerHtmlLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
315
+ // Bare decorator usage: @innerHtmlLightNode
316
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
317
+ return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
318
+ }
319
+
320
+ if (typeof selectorOrOptions === 'string') {
321
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
322
+ }
323
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
223
324
  }
224
325
 
225
- export function afterBeginNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
226
- export function afterBeginNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
227
- export function afterBeginNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
228
- const option: ApplyNodeOptions = {position: 'afterBegin'};
229
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
230
- const opt = targetOrOptions || {};
231
- return applyNode('$this', {...opt, ...option});
232
- }
233
326
 
234
- export function afterBeginLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
235
- export function afterBeginLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
236
- export function afterBeginLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
237
- const option: ApplyNodeOptions = {position: 'afterBegin', root: 'light'}
238
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
239
- const opt = targetOrOptions || {};
240
- return applyNode('$this', {...opt, ...option});
327
+ /**
328
+ * @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element
329
+ *
330
+ * Overloads:
331
+ * - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM
332
+ * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM
333
+ * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM
334
+ */
335
+ export function innerHtmlShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
336
+ export function innerHtmlShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
337
+ export function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
338
+ export function innerHtmlShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
339
+ // Bare decorator usage: @innerHtmlShadowNode
340
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
341
+ return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
342
+ }
343
+
344
+ if (typeof selectorOrOptions === 'string') {
345
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
346
+ }
347
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
241
348
  }
242
349
 
243
- export function innerHtmlNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
244
- export function innerHtmlNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
245
- export function innerHtmlNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
246
- const option: ApplyNodeOptions = {position: 'innerHtml'}
247
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
248
- const opt = targetOrOptions || {};
249
- return applyNode('$this', {...opt, ...option});
250
- }
251
350
 
252
- export function innerTextNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
253
- export function innerTextNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
254
- export function innerTextNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
255
- const option: ApplyNodeOptions = {position: 'innerText'}
256
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
257
- const opt = targetOrOptions || {};
258
- return applyNode('$this', {...opt, ...option});
351
+ /**
352
+ * @innerTextNode decorator - sets innerText of target element
353
+ *
354
+ * Overloads:
355
+ * - innerTextNode(selector, options) - Set innerText of specific selector
356
+ * - innerTextNode(options) - Set innerText of $this (current element)
357
+ * - @innerTextNode - Bare decorator, sets innerText of $this
358
+ */
359
+ export function innerText(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
360
+ export function innerText(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
361
+ export function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
362
+ export function innerText(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
363
+ // Bare decorator usage: @innerTextNode
364
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
365
+ return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);
366
+ }
367
+
368
+ if (typeof selectorOrOptions === 'string') {
369
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
370
+ }
371
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
259
372
  }
260
373
 
261
- export function innerHtmlLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
262
- export function innerHtmlLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
263
- export function innerHtmlLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
264
- const option: ApplyNodeOptions = {position: 'innerHtml', root: 'light'};
265
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
266
- const opt = targetOrOptions || {};
267
- return applyNode('$this', {...opt, ...option});
374
+
375
+ /**
376
+ * @innerTextLightNode decorator - sets innerText of light DOM element
377
+ *
378
+ * Overloads:
379
+ * - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM
380
+ * - innerTextLightNode(options) - Set innerText of $this in light DOM
381
+ * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM
382
+ */
383
+ export function innerTextLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
384
+ export function innerTextLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
385
+ export function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
386
+ export function innerTextLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
387
+ // Bare decorator usage: @innerTextLightNode
388
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
389
+ return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
390
+ }
391
+
392
+ if (typeof selectorOrOptions === 'string') {
393
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
394
+ }
395
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
268
396
  }
269
397
 
270
- export function replaceChildrenLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
271
- export function replaceChildrenLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
272
- export function replaceChildrenLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
273
- const option: ApplyNodeOptions = {position: 'replaceChildren', root: 'light'};
274
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
275
- const opt = targetOrOptions || {};
276
- return applyNode('$this', {...opt, ...option});
398
+ /**
399
+ * @innerTextShadowNode decorator - sets innerText of shadow DOM element
400
+ *
401
+ * Overloads:
402
+ * - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM
403
+ * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM
404
+ * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM
405
+ */
406
+ export function innerTextShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
407
+ export function innerTextShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
408
+ export function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
409
+ export function innerTextShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
410
+ // Bare decorator usage: @innerTextShadowNode
411
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
412
+ return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
413
+ }
414
+
415
+ if (typeof selectorOrOptions === 'string') {
416
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
417
+ }
418
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
277
419
  }
278
420
 
279
- export function replaceChildrenNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
280
- return applyNode(selector, {...options, position: 'replaceChildren'});
421
+ /**
422
+ * @beforeEndNode decorator - appends nodes to target element
423
+ *
424
+ * Overloads:
425
+ * - beforeEndNode(selector, options) - Append to specific selector
426
+ * - beforeEndNode(options) - Append to $this (current element)
427
+ * - @beforeEndNode - Bare decorator, appends to $this
428
+ */
429
+ export function insertBeforeEnd(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
430
+ export function insertBeforeEnd(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
431
+ export function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
432
+ export function insertBeforeEnd(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
433
+ // Bare decorator usage: @beforeEndNode
434
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
435
+ return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);
436
+ }
437
+
438
+ if (typeof selectorOrOptions === 'string') {
439
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
440
+ }
441
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
281
442
  }
282
443
 
283
- export function innerHtmlNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
284
- return applyNode(selector, {...options, position: 'innerHtml'});
444
+
445
+ /**
446
+ * @beforeEndLightNode decorator - appends nodes to light DOM element
447
+ *
448
+ * Overloads:
449
+ * - beforeEndLightNode(selector, options) - Append to specific selector in light DOM
450
+ * - beforeEndLightNode(options) - Append to $this in light DOM
451
+ * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM
452
+ */
453
+ export function insertBeforeEndLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
454
+ export function insertBeforeEndLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
455
+ export function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
456
+ export function insertBeforeEndLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
457
+ // Bare decorator usage: @beforeEndLightNode
458
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
459
+ return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
460
+ }
461
+
462
+ if (typeof selectorOrOptions === 'string') {
463
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
464
+ }
465
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
285
466
  }
286
467
 
287
- export function innerHtmlLightNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
288
- return applyNode(selector, {...options, position: 'innerHtml', root: 'light'});
468
+
469
+ /**
470
+ * @beforeEndShadowNode decorator - appends nodes to shadow DOM element
471
+ *
472
+ * Overloads:
473
+ * - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM
474
+ * - beforeEndShadowNode(options) - Append to $this in shadow DOM
475
+ * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM
476
+ */
477
+ export function insertBeforeEndShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
478
+ export function insertBeforeEndShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
479
+ export function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
480
+ export function insertBeforeEndShadow(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
481
+ // Bare decorator usage: @beforeEndShadowNode
482
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
483
+ return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
484
+ }
485
+
486
+ if (typeof selectorOrOptions === 'string') {
487
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
488
+ }
489
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
289
490
  }
290
491
 
291
- export function innerHtmlShadowNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
292
- return applyNode(selector, {...options, position: 'innerHtml', root: 'shadow'});
492
+
493
+ /**
494
+ * @afterBeginNode decorator - prepends nodes to target element
495
+ *
496
+ * Overloads:
497
+ * - afterBeginNode(selector, options) - Prepend to specific selector
498
+ * - afterBeginNode(options) - Prepend to $this (current element)
499
+ * - @afterBeginNode - Bare decorator, prepends to $this
500
+ */
501
+ export function insertAfterBegin(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
502
+ export function insertAfterBegin(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
503
+ export function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
504
+ export function insertAfterBegin(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
505
+ // Bare decorator usage: @afterBeginNode
506
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
507
+ return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);
508
+ }
509
+
510
+ if (typeof selectorOrOptions === 'string') {
511
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
512
+ }
513
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
293
514
  }
294
515
 
295
- export function innerTextNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
296
- return applyNode(selector, {...options, position: 'innerText'});
516
+
517
+ /**
518
+ * @afterBeginLightNode decorator - prepends nodes to light DOM element
519
+ *
520
+ * Overloads:
521
+ * - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM
522
+ * - afterBeginLightNode(options) - Prepend to $this in light DOM
523
+ * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM
524
+ */
525
+ export function insertAfterBeginLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
526
+ export function insertAfterBeginLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
527
+ export function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
528
+ export function insertAfterBeginLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
529
+ // Bare decorator usage: @afterBeginLightNode
530
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
531
+ return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
532
+ }
533
+
534
+ if (typeof selectorOrOptions === 'string') {
535
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
536
+ }
537
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
297
538
  }
298
539
 
299
- export function innerTextLightNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
300
- return applyNode(selector, {...options, position: 'innerText', root: 'light'});
540
+
541
+ /**
542
+ * @replaceChildrenLightNode decorator - replaces children of light DOM element
543
+ *
544
+ * Overloads:
545
+ * - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM
546
+ * - replaceChildrenLightNode(options) - Replace children of $this in light DOM
547
+ * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM
548
+ */
549
+ export function replaceChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
550
+ export function replaceChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
551
+ export function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
552
+ export function replaceChildrenLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
553
+ // Bare decorator usage: @replaceChildrenLightNode
554
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
555
+ return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
556
+ }
557
+
558
+ if (typeof selectorOrOptions === 'string') {
559
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
560
+ }
561
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
301
562
  }
302
563
 
303
- export function innerTextShadowNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
304
- return applyNode(selector, {...options, position: 'innerText', root: 'shadow'});
564
+ /**
565
+ * @clearChildrenLightNode decorator - clears children of light DOM element
566
+ *
567
+ * Overloads:
568
+ * - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM
569
+ * - clearChildrenLightNode(options) - Clear children of $this in light DOM
570
+ * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM
571
+ */
572
+ export function clearChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
573
+ export function clearChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
574
+ export function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
575
+ export function clearChildrenLight(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
576
+ // Bare decorator usage: @clearChildrenLightNode
577
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
578
+ return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
579
+ }
580
+
581
+ if (typeof selectorOrOptions === 'string') {
582
+ return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
583
+ }
584
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
305
585
  }
306
586
 
307
587
 
308
588
 
589
+
309
590
  export const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {
310
591
  const result = new Map<string | symbol, ApplyNodeMetadata>();
311
592
  const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);