@dooboostore/simple-web-component 1.0.43 → 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 (144) hide show
  1. package/README.md +298 -49
  2. package/dist/cjs/SwcAppEngine.js +3 -1
  3. package/dist/cjs/SwcAppEngine.js.map +2 -2
  4. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  5. package/dist/cjs/decorators/applyAttribute.js +30 -28
  6. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  7. package/dist/cjs/decorators/applyClass.js +57 -21
  8. package/dist/cjs/decorators/applyClass.js.map +3 -3
  9. package/dist/cjs/decorators/applyNode.js +165 -105
  10. package/dist/cjs/decorators/applyNode.js.map +2 -2
  11. package/dist/cjs/decorators/applyProperty.js +11 -28
  12. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  13. package/dist/cjs/decorators/applyStyle.js +39 -15
  14. package/dist/cjs/decorators/applyStyle.js.map +3 -3
  15. package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
  16. package/dist/cjs/decorators/changedAttribute.js.map +7 -0
  17. package/dist/cjs/decorators/elementDefine.js +37 -6
  18. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  19. package/dist/cjs/decorators/emitCustomEvent.js +56 -42
  20. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  21. package/dist/cjs/decorators/index.js +1 -1
  22. package/dist/cjs/decorators/index.js.map +2 -2
  23. package/dist/cjs/decorators/publishSwcAppMessage.js +5 -5
  24. package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
  25. package/dist/cjs/decorators/query.js +96 -145
  26. package/dist/cjs/decorators/query.js.map +3 -3
  27. package/dist/cjs/decorators/queryAll.js +104 -131
  28. package/dist/cjs/decorators/queryAll.js.map +3 -3
  29. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  30. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  31. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  32. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  33. package/dist/cjs/elements/SwcAppMixin.js +17 -2
  34. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  35. package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
  36. package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
  37. package/dist/cjs/index.js +1 -0
  38. package/dist/cjs/index.js.map +2 -2
  39. package/dist/cjs/router/ElementRouter.js +4 -0
  40. package/dist/cjs/router/ElementRouter.js.map +2 -2
  41. package/dist/esm/SwcAppEngine.js +3 -1
  42. package/dist/esm/SwcAppEngine.js.map +2 -2
  43. package/dist/esm/decorators/addEventListener.js.map +2 -2
  44. package/dist/esm/decorators/applyAttribute.js +30 -28
  45. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  46. package/dist/esm/decorators/applyClass.js +57 -21
  47. package/dist/esm/decorators/applyClass.js.map +3 -3
  48. package/dist/esm/decorators/applyNode.js +165 -105
  49. package/dist/esm/decorators/applyNode.js.map +2 -2
  50. package/dist/esm/decorators/applyProperty.js +11 -28
  51. package/dist/esm/decorators/applyProperty.js.map +2 -2
  52. package/dist/esm/decorators/applyStyle.js +39 -15
  53. package/dist/esm/decorators/applyStyle.js.map +3 -3
  54. package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
  55. package/dist/esm/decorators/changedAttribute.js.map +7 -0
  56. package/dist/esm/decorators/elementDefine.js +35 -4
  57. package/dist/esm/decorators/elementDefine.js.map +2 -2
  58. package/dist/esm/decorators/emitCustomEvent.js +56 -42
  59. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  60. package/dist/esm/decorators/index.js +1 -1
  61. package/dist/esm/decorators/index.js.map +1 -1
  62. package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
  63. package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
  64. package/dist/esm/decorators/query.js +96 -145
  65. package/dist/esm/decorators/query.js.map +3 -3
  66. package/dist/esm/decorators/queryAll.js +104 -131
  67. package/dist/esm/decorators/queryAll.js.map +3 -3
  68. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  69. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  70. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  71. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  72. package/dist/esm/elements/SwcAppMixin.js +18 -3
  73. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  74. package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
  75. package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/index.js.map +2 -2
  78. package/dist/esm/router/ElementRouter.js +4 -0
  79. package/dist/esm/router/ElementRouter.js.map +2 -2
  80. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +759 -512
  81. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  82. package/dist/types/SwcAppEngine.d.ts.map +1 -1
  83. package/dist/types/decorators/addEventListener.d.ts +17 -14
  84. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  85. package/dist/types/decorators/applyAttribute.d.ts +35 -20
  86. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  87. package/dist/types/decorators/applyClass.d.ts +16 -36
  88. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  89. package/dist/types/decorators/applyNode.d.ts +172 -30
  90. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  91. package/dist/types/decorators/applyProperty.d.ts +27 -18
  92. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  93. package/dist/types/decorators/applyStyle.d.ts +7 -7
  94. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  95. package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
  96. package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
  97. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  98. package/dist/types/decorators/emitCustomEvent.d.ts +3 -10
  99. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  100. package/dist/types/decorators/index.d.ts +1 -1
  101. package/dist/types/decorators/index.d.ts.map +1 -1
  102. package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
  103. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  104. package/dist/types/decorators/query.d.ts +3 -26
  105. package/dist/types/decorators/query.d.ts.map +1 -1
  106. package/dist/types/decorators/queryAll.d.ts +3 -20
  107. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  108. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
  109. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
  110. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
  111. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
  112. package/dist/types/elements/SwcAppMixin.d.ts +4 -4
  113. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  114. package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
  115. package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
  116. package/dist/types/index.d.ts +1 -0
  117. package/dist/types/index.d.ts.map +1 -1
  118. package/dist/types/router/ElementRouter.d.ts.map +1 -1
  119. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +759 -512
  120. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  121. package/package.json +3 -3
  122. package/src/SwcAppEngine.ts +3 -1
  123. package/src/decorators/addEventListener.ts +28 -24
  124. package/src/decorators/applyAttribute.ts +109 -63
  125. package/src/decorators/applyClass.ts +89 -15
  126. package/src/decorators/applyNode.ts +357 -100
  127. package/src/decorators/applyProperty.ts +42 -63
  128. package/src/decorators/applyStyle.ts +59 -11
  129. package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
  130. package/src/decorators/elementDefine.ts +47 -4
  131. package/src/decorators/emitCustomEvent.ts +44 -36
  132. package/src/decorators/index.ts +1 -1
  133. package/src/decorators/publishSwcAppMessage.ts +1 -1
  134. package/src/decorators/query.ts +90 -159
  135. package/src/decorators/queryAll.ts +92 -134
  136. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
  137. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
  138. package/src/elements/SwcAppMixin.ts +43 -24
  139. package/src/examples/RxJSOperatorsExample.ts +279 -0
  140. package/src/index.ts +2 -0
  141. package/src/router/ElementRouter.ts +4 -0
  142. package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
  143. package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
  144. 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;
@@ -53,11 +53,17 @@ export const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-no
53
53
 
54
54
  const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string, pos: ApplyNodePosition, win: Window, host?: any) => {
55
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
+
56
63
  const doc = win.document;
57
64
  const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
58
65
  const id = currentThis._swcId;
59
66
 
60
-
61
67
  const nodes: Node[] = [];
62
68
 
63
69
  if (typeof res === 'string' && pos === 'innerHtml') {
@@ -70,8 +76,6 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
70
76
 
71
77
  SwcUtils.projectProcessHtml(id, nodes, doc);
72
78
 
73
-
74
-
75
79
  const isShadowRoot = targetEl instanceof win.ShadowRoot;
76
80
  // const nodes = normalizeNodes(res, doc);
77
81
  if (pos === 'replace') {
@@ -101,8 +105,28 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
101
105
 
102
106
  /**
103
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)
104
112
  */
105
- 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
+
106
130
  return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
107
131
  const constructor = targetObj.constructor;
108
132
  let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;
@@ -199,137 +223,370 @@ export function applyNode(selector: string, options: ApplyNodeOptions = {positio
199
223
  };
200
224
  }
201
225
 
202
- export function applyNodeThis(options: ApplyNodeOptions): MethodDecorator;
203
- export function applyNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
204
- export function applyNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
205
- const option: ApplyNodeOptions = {position: 'replaceChildren'};
206
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
207
- const opt = targetOrOptions || {};
208
- return applyNode('$this', {...option, ...opt});
209
- }
226
+ // --- Overloaded convenience functions for common patterns ---
210
227
 
211
- export function replaceChildrenNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
212
- export function replaceChildrenNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
213
- export function replaceChildrenNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
214
- const option: ApplyNodeOptions = {position: 'replaceChildren'};
215
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
216
- const opt = targetOrOptions || {};
217
- 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'});
218
249
  }
219
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
+ }
220
273
 
274
+ // Alias for clearChildrenNode
275
+ export const clearNode = clearChildrenNode;
221
276
 
222
- export function beforeEndNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
223
- export function beforeEndNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
224
- export function beforeEndNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
225
- const options: ApplyNodeOptions = {position: 'beforeEnd'};
226
- if (propertyKey !== undefined) return applyNode('$this', options)(targetOrOptions, propertyKey, descriptor);
227
- const opt = targetOrOptions || {};
228
- 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'});
229
298
  }
230
299
 
231
- export function beforeEndLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
232
- export function beforeEndLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
233
- export function beforeEndLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
234
- const option: ApplyNodeOptions = {position: 'beforeEnd', root: 'light'}
235
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
236
- const opt = targetOrOptions || {};
237
- return applyNode('$this', {...opt, ...option});
238
- }
300
+ // Alias for innerHtmlNode
301
+ // export const setHtmlNode = innerHtml;
239
302
 
240
- export function beforeEndShadowNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
241
- export function beforeEndShadowNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
242
- export function beforeEndShadowNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
243
- const option: ApplyNodeOptions = {position: 'beforeEnd', root: 'shadow'}
244
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
245
- const opt = targetOrOptions || {};
246
- 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'});
247
324
  }
248
325
 
249
- export function afterBeginNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
250
- export function afterBeginNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
251
- export function afterBeginNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
252
- const option: ApplyNodeOptions = {position: 'afterBegin'};
253
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
254
- const opt = targetOrOptions || {};
255
- return applyNode('$this', {...opt, ...option});
256
- }
257
326
 
258
- export function afterBeginLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
259
- export function afterBeginLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
260
- export function afterBeginLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
261
- const option: ApplyNodeOptions = {position: 'afterBegin', root: 'light'}
262
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
263
- const opt = targetOrOptions || {};
264
- 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'});
265
348
  }
266
349
 
267
- export function innerHtmlNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
268
- export function innerHtmlNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
269
- export function innerHtmlNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
270
- const option: ApplyNodeOptions = {position: 'innerHtml'}
271
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
272
- const opt = targetOrOptions || {};
273
- return applyNode('$this', {...opt, ...option});
274
- }
275
350
 
276
- export function innerTextNodeThis(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
277
- export function innerTextNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
278
- export function innerTextNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
279
- const option: ApplyNodeOptions = {position: 'innerText'}
280
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
281
- const opt = targetOrOptions || {};
282
- 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'});
283
372
  }
284
373
 
285
- export function innerHtmlLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
286
- export function innerHtmlLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
287
- export function innerHtmlLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
288
- const option: ApplyNodeOptions = {position: 'innerHtml', root: 'light'};
289
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
290
- const opt = targetOrOptions || {};
291
- 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'});
292
396
  }
293
397
 
294
- export function replaceChildrenLightNodeThis(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
295
- export function replaceChildrenLightNodeThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;
296
- export function replaceChildrenLightNodeThis(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {
297
- const option: ApplyNodeOptions = {position: 'replaceChildren', root: 'light'};
298
- if (propertyKey !== undefined) return applyNode('$this', option)(targetOrOptions, propertyKey, descriptor);
299
- const opt = targetOrOptions || {};
300
- 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'});
301
419
  }
302
420
 
303
- export function replaceChildrenNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
304
- 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'});
305
442
  }
306
443
 
307
- export function innerHtmlNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
308
- 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'});
309
466
  }
310
467
 
311
- export function innerHtmlLightNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
312
- 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'});
313
490
  }
314
491
 
315
- export function innerHtmlShadowNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
316
- 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'});
317
514
  }
318
515
 
319
- export function innerTextNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
320
- 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'});
321
538
  }
322
539
 
323
- export function innerTextLightNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
324
- 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'});
325
562
  }
326
563
 
327
- export function innerTextShadowNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
328
- 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'});
329
585
  }
330
586
 
331
587
 
332
588
 
589
+
333
590
  export const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {
334
591
  const result = new Map<string | symbol, ApplyNodeMetadata>();
335
592
  const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);