@dooboostore/simple-web-component 1.0.43 → 1.0.45

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 (146) hide show
  1. package/README.md +312 -63
  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 +66 -43
  6. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  7. package/dist/cjs/decorators/applyClass.js +110 -43
  8. package/dist/cjs/decorators/applyClass.js.map +3 -3
  9. package/dist/cjs/decorators/applyNode.js +200 -112
  10. package/dist/cjs/decorators/applyNode.js.map +2 -2
  11. package/dist/cjs/decorators/applyProperty.js +49 -45
  12. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  13. package/dist/cjs/decorators/applyStyle.js +92 -37
  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 +81 -31
  18. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  19. package/dist/cjs/decorators/emitCustomEvent.js +80 -52
  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 +133 -147
  26. package/dist/cjs/decorators/query.js.map +3 -3
  27. package/dist/cjs/decorators/queryAll.js +143 -132
  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/cjs/types/window.d.js.map +1 -1
  42. package/dist/esm/SwcAppEngine.js +3 -1
  43. package/dist/esm/SwcAppEngine.js.map +2 -2
  44. package/dist/esm/decorators/addEventListener.js.map +2 -2
  45. package/dist/esm/decorators/applyAttribute.js +66 -43
  46. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  47. package/dist/esm/decorators/applyClass.js +110 -43
  48. package/dist/esm/decorators/applyClass.js.map +3 -3
  49. package/dist/esm/decorators/applyNode.js +200 -112
  50. package/dist/esm/decorators/applyNode.js.map +2 -2
  51. package/dist/esm/decorators/applyProperty.js +49 -45
  52. package/dist/esm/decorators/applyProperty.js.map +2 -2
  53. package/dist/esm/decorators/applyStyle.js +92 -37
  54. package/dist/esm/decorators/applyStyle.js.map +3 -3
  55. package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
  56. package/dist/esm/decorators/changedAttribute.js.map +7 -0
  57. package/dist/esm/decorators/elementDefine.js +79 -29
  58. package/dist/esm/decorators/elementDefine.js.map +2 -2
  59. package/dist/esm/decorators/emitCustomEvent.js +80 -52
  60. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  61. package/dist/esm/decorators/index.js +1 -1
  62. package/dist/esm/decorators/index.js.map +1 -1
  63. package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
  64. package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
  65. package/dist/esm/decorators/query.js +133 -147
  66. package/dist/esm/decorators/query.js.map +3 -3
  67. package/dist/esm/decorators/queryAll.js +143 -132
  68. package/dist/esm/decorators/queryAll.js.map +3 -3
  69. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  70. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  71. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  72. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  73. package/dist/esm/elements/SwcAppMixin.js +18 -3
  74. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  75. package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
  76. package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
  77. package/dist/esm/index.js +1 -0
  78. package/dist/esm/index.js.map +2 -2
  79. package/dist/esm/router/ElementRouter.js +4 -0
  80. package/dist/esm/router/ElementRouter.js.map +2 -2
  81. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +1118 -633
  82. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  83. package/dist/types/SwcAppEngine.d.ts.map +1 -1
  84. package/dist/types/decorators/addEventListener.d.ts +19 -15
  85. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  86. package/dist/types/decorators/applyAttribute.d.ts +45 -26
  87. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  88. package/dist/types/decorators/applyClass.d.ts +19 -38
  89. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  90. package/dist/types/decorators/applyNode.d.ts +175 -32
  91. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  92. package/dist/types/decorators/applyProperty.d.ts +38 -25
  93. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  94. package/dist/types/decorators/applyStyle.d.ts +10 -9
  95. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  96. package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
  97. package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
  98. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  99. package/dist/types/decorators/emitCustomEvent.d.ts +6 -12
  100. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  101. package/dist/types/decorators/index.d.ts +1 -1
  102. package/dist/types/decorators/index.d.ts.map +1 -1
  103. package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
  104. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  105. package/dist/types/decorators/query.d.ts +16 -29
  106. package/dist/types/decorators/query.d.ts.map +1 -1
  107. package/dist/types/decorators/queryAll.d.ts +16 -23
  108. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  109. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
  110. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
  111. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
  112. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
  113. package/dist/types/elements/SwcAppMixin.d.ts +4 -4
  114. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  115. package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
  116. package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
  117. package/dist/types/index.d.ts +1 -0
  118. package/dist/types/index.d.ts.map +1 -1
  119. package/dist/types/router/ElementRouter.d.ts.map +1 -1
  120. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +1118 -633
  121. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  122. package/package.json +1 -1
  123. package/src/SwcAppEngine.ts +3 -1
  124. package/src/decorators/addEventListener.ts +31 -25
  125. package/src/decorators/applyAttribute.ts +164 -86
  126. package/src/decorators/applyClass.ts +161 -41
  127. package/src/decorators/applyNode.ts +408 -108
  128. package/src/decorators/applyProperty.ts +100 -89
  129. package/src/decorators/applyStyle.ts +131 -37
  130. package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
  131. package/src/decorators/elementDefine.ts +96 -30
  132. package/src/decorators/emitCustomEvent.ts +92 -60
  133. package/src/decorators/index.ts +1 -1
  134. package/src/decorators/publishSwcAppMessage.ts +1 -1
  135. package/src/decorators/query.ts +155 -162
  136. package/src/decorators/queryAll.ts +157 -139
  137. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
  138. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
  139. package/src/elements/SwcAppMixin.ts +43 -24
  140. package/src/examples/RxJSOperatorsExample.ts +279 -0
  141. package/src/index.ts +2 -0
  142. package/src/router/ElementRouter.ts +4 -0
  143. package/src/types/window.d.ts +3 -0
  144. package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
  145. package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
  146. package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
@@ -13,7 +13,9 @@ 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
+
18
+ export type ApplyNodeSelector = string | ((currentThis: any, helper: HelperHostSet) => NodeList | Element | Element[] | null);
17
19
 
18
20
  export interface ApplyNodeOptions {
19
21
  position?: ApplyNodePosition;
@@ -37,12 +39,39 @@ export interface ApplyNodeOptions {
37
39
 
38
40
  export interface ApplyNodeMetadata {
39
41
  propertyKey: string | symbol;
40
- selector: string;
42
+ selector: ApplyNodeSelector;
41
43
  options: ApplyNodeOptions;
42
44
  }
43
45
 
44
46
  export const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-node');
45
47
 
48
+ /**
49
+ * Resolve selector to string or elements
50
+ * Handles function-based selectors and returns elements if applicable
51
+ */
52
+ const resolveSelector = (selector: ApplyNodeSelector, inst: any, win: Window): string | HTMLElement | null => {
53
+ if (typeof selector === 'function') {
54
+ const hostSet = SwcUtils.getHelperAndHostSet(win, inst);
55
+ const result = selector(inst, hostSet);
56
+
57
+ if (result instanceof win.Element) {
58
+ return result as HTMLElement;
59
+ }
60
+ if (result instanceof win.NodeList) {
61
+ return result.length > 0 ? (result[0] as HTMLElement) : null;
62
+ }
63
+ if (Array.isArray(result)) {
64
+ return result.length > 0 ? (result[0] as HTMLElement) : null;
65
+ }
66
+ if (result === null) {
67
+ return null;
68
+ }
69
+ // result must be a string at this point
70
+ return result as unknown as string;
71
+ }
72
+ return selector as string;
73
+ };
74
+
46
75
  // const normalizeNodes = (res: any, doc: Document): Node[] => {
47
76
  // const items = Array.isArray(res) ? res : [res];
48
77
  // return items.map(it => {
@@ -53,11 +82,17 @@ export const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-no
53
82
 
54
83
  const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string, pos: ApplyNodePosition, win: Window, host?: any) => {
55
84
  if (!targetEl) return;
85
+
86
+ // Handle clearChildren - ignore return value and always clear
87
+ if (pos === 'clearChildren') {
88
+ targetEl.replaceChildren();
89
+ return [];
90
+ }
91
+
56
92
  const doc = win.document;
57
93
  const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
58
94
  const id = currentThis._swcId;
59
95
 
60
-
61
96
  const nodes: Node[] = [];
62
97
 
63
98
  if (typeof res === 'string' && pos === 'innerHtml') {
@@ -70,8 +105,6 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
70
105
 
71
106
  SwcUtils.projectProcessHtml(id, nodes, doc);
72
107
 
73
-
74
-
75
108
  const isShadowRoot = targetEl instanceof win.ShadowRoot;
76
109
  // const nodes = normalizeNodes(res, doc);
77
110
  if (pos === 'replace') {
@@ -101,8 +134,28 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
101
134
 
102
135
  /**
103
136
  * @applyNode decorator to surgically add/replace nodes to a target element.
137
+ *
138
+ * Overloads:
139
+ * - applyNode(selector, options) - Apply to specific selector
140
+ * - applyNode(options) - Apply to $this (current element)
104
141
  */
105
- export function applyNode(selector: string, options: ApplyNodeOptions = {position: 'replaceChildren'}): MethodDecorator {
142
+ export function applyNode(selector: ApplyNodeSelector, options?: ApplyNodeOptions): MethodDecorator;
143
+ export function applyNode(options: ApplyNodeOptions): MethodDecorator;
144
+ export function applyNode(selectorOrOptions: ApplyNodeSelector | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {
145
+ // Determine selector and options based on overload
146
+ let selector: ApplyNodeSelector;
147
+ let options: ApplyNodeOptions;
148
+
149
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
150
+ // First overload: applyNode(selector, options)
151
+ selector = selectorOrOptions;
152
+ options = maybeOptions || {position: 'replaceChildren'};
153
+ } else {
154
+ // Second overload: applyNode(options) - default to $this
155
+ selector = '$this';
156
+ options = selectorOrOptions || {position: 'replaceChildren'};
157
+ }
158
+
106
159
  return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {
107
160
  const constructor = targetObj.constructor;
108
161
  let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;
@@ -132,15 +185,29 @@ export function applyNode(selector: string, options: ApplyNodeOptions = {positio
132
185
  return t;
133
186
  };
134
187
 
135
- if (selector === '$this') return applyRoot(this);
136
- if (selector === '$host') return applyRoot(hostSet.$host);
137
- if (selector === '$parentHost') return applyRoot(hostSet.$parentHost);
138
- if (selector === '$appHost') return applyRoot(hostSet.$appHost);
139
- if (selector === '$firstHost') return applyRoot(hostSet.$firstHost);
140
- if (selector === '$lastHost') return applyRoot(hostSet.$lastHost);
188
+ // Resolve selector if it's a function
189
+ const resolved = resolveSelector(selector, this, currentWin);
190
+
191
+ // If selector function returned an element directly, use it
192
+ if (resolved instanceof currentWin.Element) {
193
+ return applyRoot(resolved);
194
+ }
195
+ if (resolved === null) {
196
+ return null;
197
+ }
198
+
199
+ // Handle string selector
200
+ const stringSelector = resolved as string;
201
+
202
+ if (stringSelector === '$this') return applyRoot(this);
203
+ if (stringSelector === '$host') return applyRoot(hostSet.$host);
204
+ if (stringSelector === '$parentHost') return applyRoot(hostSet.$parentHost);
205
+ if (stringSelector === '$appHost') return applyRoot(hostSet.$appHost);
206
+ if (stringSelector === '$firstHost') return applyRoot(hostSet.$firstHost);
207
+ if (stringSelector === '$lastHost') return applyRoot(hostSet.$lastHost);
141
208
 
142
209
  const targetRoot = applyRoot(this);
143
- return targetRoot ? targetRoot.querySelector(selector) : null;
210
+ return targetRoot ? targetRoot.querySelector(stringSelector) : null;
144
211
  };
145
212
 
146
213
  const targetEl = getTarget();
@@ -199,137 +266,370 @@ export function applyNode(selector: string, options: ApplyNodeOptions = {positio
199
266
  };
200
267
  }
201
268
 
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
- }
269
+ // --- Overloaded convenience functions for common patterns ---
210
270
 
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});
271
+ /**
272
+ * @replaceChildrenNode decorator - replaces children of target element
273
+ *
274
+ * Overloads:
275
+ * - replaceChildrenNode(selector, options) - Replace children of specific selector
276
+ * - replaceChildrenNode(options) - Replace children of $this (current element)
277
+ * - @replaceChildrenNode - Bare decorator, replaces children of $this
278
+ */
279
+ export function replaceChildren(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
280
+ export function replaceChildren(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
281
+ export function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
282
+ export function replaceChildren(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
283
+ // Bare decorator usage: @replaceChildrenNode
284
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
285
+ return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);
286
+ }
287
+
288
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
289
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
290
+ }
291
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
218
292
  }
219
293
 
294
+ /**
295
+ * @clearChildrenNode decorator - clears all children of target element
296
+ *
297
+ * Overloads:
298
+ * - clearChildrenNode(selector, options) - Clear children of specific selector
299
+ * - clearChildrenNode(options) - Clear children of $this (current element)
300
+ * - @clearChildrenNode - Bare decorator, clears children of $this
301
+ */
302
+ export function clearChildrenNode(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
303
+ export function clearChildrenNode(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
304
+ export function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
305
+ export function clearChildrenNode(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
306
+ // Bare decorator usage: @clearChildrenNode
307
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
308
+ return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);
309
+ }
310
+
311
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
312
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
313
+ }
314
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
315
+ }
220
316
 
317
+ // Alias for clearChildrenNode
318
+ export const clearNode = clearChildrenNode;
221
319
 
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});
320
+ /**
321
+ * @innerHtmlNode decorator - sets innerHTML of target element
322
+ *
323
+ * Overloads:
324
+ * - innerHtmlNode(selector, options) - Set innerHTML of specific selector
325
+ * - innerHtmlNode(options) - Set innerHTML of $this (current element)
326
+ * - @innerHtmlNode - Bare decorator, sets innerHTML of $this
327
+ */
328
+ export function innerHtml(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
329
+ export function innerHtml(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
330
+ export function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
331
+ export function innerHtml(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
332
+ // Bare decorator usage: @innerHtmlNode
333
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
334
+ return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);
335
+ }
336
+
337
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
338
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
339
+ }
340
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
229
341
  }
230
342
 
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
- }
343
+ // Alias for innerHtmlNode
344
+ // export const setHtmlNode = innerHtml;
239
345
 
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});
346
+ /**
347
+ * @innerHtmlLightNode decorator - sets innerHTML of light DOM element
348
+ *
349
+ * Overloads:
350
+ * - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM
351
+ * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM
352
+ * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM
353
+ */
354
+ export function innerHtmlLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
355
+ export function innerHtmlLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
356
+ export function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
357
+ export function innerHtmlLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
358
+ // Bare decorator usage: @innerHtmlLightNode
359
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
360
+ return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
361
+ }
362
+
363
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
364
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
365
+ }
366
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
247
367
  }
248
368
 
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
369
 
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});
370
+ /**
371
+ * @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element
372
+ *
373
+ * Overloads:
374
+ * - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM
375
+ * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM
376
+ * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM
377
+ */
378
+ export function innerHtmlShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
379
+ export function innerHtmlShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
380
+ export function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
381
+ export function innerHtmlShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
382
+ // Bare decorator usage: @innerHtmlShadowNode
383
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
384
+ return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
385
+ }
386
+
387
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
388
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
389
+ }
390
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
265
391
  }
266
392
 
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
393
 
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});
394
+ /**
395
+ * @innerTextNode decorator - sets innerText of target element
396
+ *
397
+ * Overloads:
398
+ * - innerTextNode(selector, options) - Set innerText of specific selector
399
+ * - innerTextNode(options) - Set innerText of $this (current element)
400
+ * - @innerTextNode - Bare decorator, sets innerText of $this
401
+ */
402
+ export function innerText(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
403
+ export function innerText(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
404
+ export function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
405
+ export function innerText(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
406
+ // Bare decorator usage: @innerTextNode
407
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
408
+ return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);
409
+ }
410
+
411
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
412
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
413
+ }
414
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
283
415
  }
284
416
 
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});
417
+
418
+ /**
419
+ * @innerTextLightNode decorator - sets innerText of light DOM element
420
+ *
421
+ * Overloads:
422
+ * - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM
423
+ * - innerTextLightNode(options) - Set innerText of $this in light DOM
424
+ * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM
425
+ */
426
+ export function innerTextLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
427
+ export function innerTextLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
428
+ export function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
429
+ export function innerTextLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
430
+ // Bare decorator usage: @innerTextLightNode
431
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
432
+ return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
433
+ }
434
+
435
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
436
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
437
+ }
438
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
292
439
  }
293
440
 
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});
441
+ /**
442
+ * @innerTextShadowNode decorator - sets innerText of shadow DOM element
443
+ *
444
+ * Overloads:
445
+ * - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM
446
+ * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM
447
+ * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM
448
+ */
449
+ export function innerTextShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
450
+ export function innerTextShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
451
+ export function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
452
+ export function innerTextShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
453
+ // Bare decorator usage: @innerTextShadowNode
454
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
455
+ return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
456
+ }
457
+
458
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
459
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
460
+ }
461
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
301
462
  }
302
463
 
303
- export function replaceChildrenNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
304
- return applyNode(selector, {...options, position: 'replaceChildren'});
464
+ /**
465
+ * @beforeEndNode decorator - appends nodes to target element
466
+ *
467
+ * Overloads:
468
+ * - beforeEndNode(selector, options) - Append to specific selector
469
+ * - beforeEndNode(options) - Append to $this (current element)
470
+ * - @beforeEndNode - Bare decorator, appends to $this
471
+ */
472
+ export function insertBeforeEnd(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
473
+ export function insertBeforeEnd(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
474
+ export function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
475
+ export function insertBeforeEnd(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
476
+ // Bare decorator usage: @beforeEndNode
477
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
478
+ return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);
479
+ }
480
+
481
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
482
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
483
+ }
484
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
305
485
  }
306
486
 
307
- export function innerHtmlNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
308
- return applyNode(selector, {...options, position: 'innerHtml'});
487
+
488
+ /**
489
+ * @beforeEndLightNode decorator - appends nodes to light DOM element
490
+ *
491
+ * Overloads:
492
+ * - beforeEndLightNode(selector, options) - Append to specific selector in light DOM
493
+ * - beforeEndLightNode(options) - Append to $this in light DOM
494
+ * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM
495
+ */
496
+ export function insertBeforeEndLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
497
+ export function insertBeforeEndLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
498
+ export function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
499
+ export function insertBeforeEndLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
500
+ // Bare decorator usage: @beforeEndLightNode
501
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
502
+ return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
503
+ }
504
+
505
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
506
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
507
+ }
508
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
309
509
  }
310
510
 
311
- export function innerHtmlLightNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
312
- return applyNode(selector, {...options, position: 'innerHtml', root: 'light'});
511
+
512
+ /**
513
+ * @beforeEndShadowNode decorator - appends nodes to shadow DOM element
514
+ *
515
+ * Overloads:
516
+ * - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM
517
+ * - beforeEndShadowNode(options) - Append to $this in shadow DOM
518
+ * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM
519
+ */
520
+ export function insertBeforeEndShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
521
+ export function insertBeforeEndShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
522
+ export function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
523
+ export function insertBeforeEndShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
524
+ // Bare decorator usage: @beforeEndShadowNode
525
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
526
+ return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
527
+ }
528
+
529
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
530
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
531
+ }
532
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
313
533
  }
314
534
 
315
- export function innerHtmlShadowNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
316
- return applyNode(selector, {...options, position: 'innerHtml', root: 'shadow'});
535
+
536
+ /**
537
+ * @afterBeginNode decorator - prepends nodes to target element
538
+ *
539
+ * Overloads:
540
+ * - afterBeginNode(selector, options) - Prepend to specific selector
541
+ * - afterBeginNode(options) - Prepend to $this (current element)
542
+ * - @afterBeginNode - Bare decorator, prepends to $this
543
+ */
544
+ export function insertAfterBegin(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
545
+ export function insertAfterBegin(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
546
+ export function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
547
+ export function insertAfterBegin(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
548
+ // Bare decorator usage: @afterBeginNode
549
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
550
+ return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);
551
+ }
552
+
553
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
554
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
555
+ }
556
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
317
557
  }
318
558
 
319
- export function innerTextNode(selector: string, options: Omit<ApplyNodeOptions, 'position'> = {}): MethodDecorator {
320
- return applyNode(selector, {...options, position: 'innerText'});
559
+
560
+ /**
561
+ * @afterBeginLightNode decorator - prepends nodes to light DOM element
562
+ *
563
+ * Overloads:
564
+ * - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM
565
+ * - afterBeginLightNode(options) - Prepend to $this in light DOM
566
+ * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM
567
+ */
568
+ export function insertAfterBeginLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
569
+ export function insertAfterBeginLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
570
+ export function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
571
+ export function insertAfterBeginLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
572
+ // Bare decorator usage: @afterBeginLightNode
573
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
574
+ return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
575
+ }
576
+
577
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
578
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
579
+ }
580
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
321
581
  }
322
582
 
323
- export function innerTextLightNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
324
- return applyNode(selector, {...options, position: 'innerText', root: 'light'});
583
+
584
+ /**
585
+ * @replaceChildrenLightNode decorator - replaces children of light DOM element
586
+ *
587
+ * Overloads:
588
+ * - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM
589
+ * - replaceChildrenLightNode(options) - Replace children of $this in light DOM
590
+ * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM
591
+ */
592
+ export function replaceChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
593
+ export function replaceChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
594
+ export function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
595
+ export function replaceChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
596
+ // Bare decorator usage: @replaceChildrenLightNode
597
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
598
+ return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
599
+ }
600
+
601
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
602
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
603
+ }
604
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
325
605
  }
326
606
 
327
- export function innerTextShadowNode(selector: string, options: Omit<ApplyNodeOptions, 'position' | 'root'> = {}): MethodDecorator {
328
- return applyNode(selector, {...options, position: 'innerText', root: 'shadow'});
607
+ /**
608
+ * @clearChildrenLightNode decorator - clears children of light DOM element
609
+ *
610
+ * Overloads:
611
+ * - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM
612
+ * - clearChildrenLightNode(options) - Clear children of $this in light DOM
613
+ * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM
614
+ */
615
+ export function clearChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
616
+ export function clearChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
617
+ export function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
618
+ export function clearChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
619
+ // Bare decorator usage: @clearChildrenLightNode
620
+ if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
621
+ return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
622
+ }
623
+
624
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
625
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
626
+ }
627
+ return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
329
628
  }
330
629
 
331
630
 
332
631
 
632
+
333
633
  export const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {
334
634
  const result = new Map<string | symbol, ApplyNodeMetadata>();
335
635
  const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);