@dooboostore/simple-web-component 1.0.44 → 1.0.46

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 (95) hide show
  1. package/README.md +25 -25
  2. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  3. package/dist/cjs/decorators/applyAttribute.js +36 -15
  4. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  5. package/dist/cjs/decorators/applyClass.js +53 -22
  6. package/dist/cjs/decorators/applyClass.js.map +2 -2
  7. package/dist/cjs/decorators/applyNode.js +54 -24
  8. package/dist/cjs/decorators/applyNode.js.map +2 -2
  9. package/dist/cjs/decorators/applyProperty.js +38 -17
  10. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  11. package/dist/cjs/decorators/applyStyle.js +53 -22
  12. package/dist/cjs/decorators/applyStyle.js.map +2 -2
  13. package/dist/cjs/decorators/elementDefine.js +49 -33
  14. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  15. package/dist/cjs/decorators/emitCustomEvent.js +61 -47
  16. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  17. package/dist/cjs/decorators/lifecycles.js +11 -36
  18. package/dist/cjs/decorators/lifecycles.js.map +2 -2
  19. package/dist/cjs/decorators/query.js +91 -56
  20. package/dist/cjs/decorators/query.js.map +2 -2
  21. package/dist/cjs/decorators/queryAll.js +104 -66
  22. package/dist/cjs/decorators/queryAll.js.map +2 -2
  23. package/dist/cjs/elements/SwcAppMixin.js +6 -2
  24. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  25. package/dist/cjs/types/window.d.js.map +1 -1
  26. package/dist/esm/decorators/addEventListener.js.map +2 -2
  27. package/dist/esm/decorators/applyAttribute.js +36 -15
  28. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  29. package/dist/esm/decorators/applyClass.js +53 -22
  30. package/dist/esm/decorators/applyClass.js.map +2 -2
  31. package/dist/esm/decorators/applyNode.js +54 -24
  32. package/dist/esm/decorators/applyNode.js.map +2 -2
  33. package/dist/esm/decorators/applyProperty.js +38 -17
  34. package/dist/esm/decorators/applyProperty.js.map +2 -2
  35. package/dist/esm/decorators/applyStyle.js +53 -22
  36. package/dist/esm/decorators/applyStyle.js.map +2 -2
  37. package/dist/esm/decorators/elementDefine.js +50 -34
  38. package/dist/esm/decorators/elementDefine.js.map +2 -2
  39. package/dist/esm/decorators/emitCustomEvent.js +61 -47
  40. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  41. package/dist/esm/decorators/lifecycles.js +11 -36
  42. package/dist/esm/decorators/lifecycles.js.map +2 -2
  43. package/dist/esm/decorators/query.js +91 -56
  44. package/dist/esm/decorators/query.js.map +2 -2
  45. package/dist/esm/decorators/queryAll.js +104 -66
  46. package/dist/esm/decorators/queryAll.js.map +2 -2
  47. package/dist/esm/elements/SwcAppMixin.js +6 -2
  48. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  49. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +572 -320
  50. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +3 -3
  51. package/dist/types/decorators/addEventListener.d.ts +7 -6
  52. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  53. package/dist/types/decorators/applyAttribute.d.ts +13 -8
  54. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  55. package/dist/types/decorators/applyClass.d.ts +8 -7
  56. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  57. package/dist/types/decorators/applyNode.d.ts +18 -17
  58. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  59. package/dist/types/decorators/applyProperty.d.ts +14 -9
  60. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  61. package/dist/types/decorators/applyStyle.d.ts +6 -5
  62. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  63. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  64. package/dist/types/decorators/emitCustomEvent.d.ts +3 -2
  65. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  66. package/dist/types/decorators/lifecycles.d.ts +12 -13
  67. package/dist/types/decorators/lifecycles.d.ts.map +1 -1
  68. package/dist/types/decorators/query.d.ts +15 -5
  69. package/dist/types/decorators/query.d.ts.map +1 -1
  70. package/dist/types/decorators/queryAll.d.ts +15 -5
  71. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  72. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  73. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +572 -320
  74. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +3 -3
  75. package/package.json +3 -3
  76. package/src/decorators/addEventListener.ts +9 -7
  77. package/src/decorators/applyAttribute.ts +60 -27
  78. package/src/decorators/applyClass.ts +78 -32
  79. package/src/decorators/applyNode.ts +118 -73
  80. package/src/decorators/applyProperty.ts +63 -30
  81. package/src/decorators/applyStyle.ts +76 -30
  82. package/src/decorators/elementDefine.ts +57 -37
  83. package/src/decorators/emitCustomEvent.ts +63 -39
  84. package/src/decorators/lifecycles.ts +53 -52
  85. package/src/decorators/query.ts +111 -49
  86. package/src/decorators/queryAll.ts +121 -61
  87. package/src/elements/SwcAppMixin.ts +7 -3
  88. package/src/types/window.d.ts +3 -0
  89. package/dist/cjs/examples/RxJSOperatorsExample.js +0 -285
  90. package/dist/cjs/examples/RxJSOperatorsExample.js.map +0 -7
  91. package/dist/esm/examples/RxJSOperatorsExample.js +0 -266
  92. package/dist/esm/examples/RxJSOperatorsExample.js.map +0 -7
  93. package/dist/types/examples/RxJSOperatorsExample.d.ts +0 -94
  94. package/dist/types/examples/RxJSOperatorsExample.d.ts.map +0 -1
  95. package/src/examples/RxJSOperatorsExample.ts +0 -279
@@ -15,6 +15,8 @@ import {ElementApply} from "@dooboostore/core-web";
15
15
  */
16
16
  export type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';
17
17
 
18
+ export type ApplyNodeSelector = string | ((currentThis: any, helper: HelperHostSet) => NodeList | Element | Element[] | null);
19
+
18
20
  export interface ApplyNodeOptions {
19
21
  position?: ApplyNodePosition;
20
22
  root?: SwcRootType;
@@ -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 => {
@@ -66,7 +95,9 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
66
95
 
67
96
  const nodes: Node[] = [];
68
97
 
69
- if (typeof res === 'string' && pos === 'innerHtml') {
98
+ if (res instanceof win.Node) {
99
+ nodes.push(res);
100
+ } else if (typeof res === 'string' && pos === 'innerHtml') {
70
101
  const t = win.document.createElement('template');
71
102
  t.innerHTML = res;
72
103
  nodes.push(...Array.from(t.content.childNodes));
@@ -110,14 +141,14 @@ const applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string,
110
141
  * - applyNode(selector, options) - Apply to specific selector
111
142
  * - applyNode(options) - Apply to $this (current element)
112
143
  */
113
- export function applyNode(selector: string, options?: ApplyNodeOptions): MethodDecorator;
144
+ export function applyNode(selector: ApplyNodeSelector, options?: ApplyNodeOptions): MethodDecorator;
114
145
  export function applyNode(options: ApplyNodeOptions): MethodDecorator;
115
- export function applyNode(selectorOrOptions: string | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {
146
+ export function applyNode(selectorOrOptions: ApplyNodeSelector | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {
116
147
  // Determine selector and options based on overload
117
- let selector: string;
148
+ let selector: ApplyNodeSelector;
118
149
  let options: ApplyNodeOptions;
119
150
 
120
- if (typeof selectorOrOptions === 'string') {
151
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
121
152
  // First overload: applyNode(selector, options)
122
153
  selector = selectorOrOptions;
123
154
  options = maybeOptions || {position: 'replaceChildren'};
@@ -156,15 +187,29 @@ export function applyNode(selectorOrOptions: string | ApplyNodeOptions, maybeOpt
156
187
  return t;
157
188
  };
158
189
 
159
- if (selector === '$this') return applyRoot(this);
160
- if (selector === '$host') return applyRoot(hostSet.$host);
161
- if (selector === '$parentHost') return applyRoot(hostSet.$parentHost);
162
- if (selector === '$appHost') return applyRoot(hostSet.$appHost);
163
- if (selector === '$firstHost') return applyRoot(hostSet.$firstHost);
164
- if (selector === '$lastHost') return applyRoot(hostSet.$lastHost);
190
+ // Resolve selector if it's a function
191
+ const resolved = resolveSelector(selector, this, currentWin);
192
+
193
+ // If selector function returned an element directly, use it
194
+ if (resolved instanceof currentWin.Element) {
195
+ return applyRoot(resolved);
196
+ }
197
+ if (resolved === null) {
198
+ return null;
199
+ }
200
+
201
+ // Handle string selector
202
+ const stringSelector = resolved as string;
203
+
204
+ if (stringSelector === '$this') return applyRoot(this);
205
+ if (stringSelector === '$host') return applyRoot(hostSet.$host);
206
+ if (stringSelector === '$parentHost') return applyRoot(hostSet.$parentHost);
207
+ if (stringSelector === '$appHost') return applyRoot(hostSet.$appHost);
208
+ if (stringSelector === '$firstHost') return applyRoot(hostSet.$firstHost);
209
+ if (stringSelector === '$lastHost') return applyRoot(hostSet.$lastHost);
165
210
 
166
211
  const targetRoot = applyRoot(this);
167
- return targetRoot ? targetRoot.querySelector(selector) : null;
212
+ return targetRoot ? targetRoot.querySelector(stringSelector) : null;
168
213
  };
169
214
 
170
215
  const targetEl = getTarget();
@@ -233,17 +278,17 @@ export function applyNode(selectorOrOptions: string | ApplyNodeOptions, maybeOpt
233
278
  * - replaceChildrenNode(options) - Replace children of $this (current element)
234
279
  * - @replaceChildrenNode - Bare decorator, replaces children of $this
235
280
  */
236
- export function replaceChildren(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
281
+ export function replaceChildren(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
237
282
  export function replaceChildren(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
238
283
  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 {
284
+ export function replaceChildren(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
240
285
  // Bare decorator usage: @replaceChildrenNode
241
286
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
242
287
  return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);
243
288
  }
244
289
 
245
- if (typeof selectorOrOptions === 'string') {
246
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
290
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
291
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
247
292
  }
248
293
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});
249
294
  }
@@ -256,17 +301,17 @@ export function replaceChildren(selectorOrOptions?: string | Omit<ApplyNodeOptio
256
301
  * - clearChildrenNode(options) - Clear children of $this (current element)
257
302
  * - @clearChildrenNode - Bare decorator, clears children of $this
258
303
  */
259
- export function clearChildrenNode(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
304
+ export function clearChildrenNode(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
260
305
  export function clearChildrenNode(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
261
306
  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 {
307
+ export function clearChildrenNode(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
263
308
  // Bare decorator usage: @clearChildrenNode
264
309
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
265
310
  return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);
266
311
  }
267
312
 
268
- if (typeof selectorOrOptions === 'string') {
269
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
313
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
314
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
270
315
  }
271
316
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});
272
317
  }
@@ -282,17 +327,17 @@ export const clearNode = clearChildrenNode;
282
327
  * - innerHtmlNode(options) - Set innerHTML of $this (current element)
283
328
  * - @innerHtmlNode - Bare decorator, sets innerHTML of $this
284
329
  */
285
- export function innerHtml(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
330
+ export function innerHtml(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
286
331
  export function innerHtml(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
287
332
  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 {
333
+ export function innerHtml(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
289
334
  // Bare decorator usage: @innerHtmlNode
290
335
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
291
336
  return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);
292
337
  }
293
338
 
294
- if (typeof selectorOrOptions === 'string') {
295
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
339
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
340
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
296
341
  }
297
342
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});
298
343
  }
@@ -308,17 +353,17 @@ export function innerHtml(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'p
308
353
  * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM
309
354
  * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM
310
355
  */
311
- export function innerHtmlLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
356
+ export function innerHtmlLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
312
357
  export function innerHtmlLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
313
358
  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 {
359
+ export function innerHtmlLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
315
360
  // Bare decorator usage: @innerHtmlLightNode
316
361
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
317
362
  return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
318
363
  }
319
364
 
320
- if (typeof selectorOrOptions === 'string') {
321
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
365
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
366
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
322
367
  }
323
368
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});
324
369
  }
@@ -332,17 +377,17 @@ export function innerHtmlLight(selectorOrOptions?: string | Omit<ApplyNodeOption
332
377
  * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM
333
378
  * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM
334
379
  */
335
- export function innerHtmlShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
380
+ export function innerHtmlShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
336
381
  export function innerHtmlShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
337
382
  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 {
383
+ export function innerHtmlShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
339
384
  // Bare decorator usage: @innerHtmlShadowNode
340
385
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
341
386
  return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
342
387
  }
343
388
 
344
- if (typeof selectorOrOptions === 'string') {
345
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
389
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
390
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
346
391
  }
347
392
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});
348
393
  }
@@ -356,17 +401,17 @@ export function innerHtmlShadow(selectorOrOptions?: string | Omit<ApplyNodeOptio
356
401
  * - innerTextNode(options) - Set innerText of $this (current element)
357
402
  * - @innerTextNode - Bare decorator, sets innerText of $this
358
403
  */
359
- export function innerText(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
404
+ export function innerText(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
360
405
  export function innerText(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
361
406
  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 {
407
+ export function innerText(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
363
408
  // Bare decorator usage: @innerTextNode
364
409
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
365
410
  return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);
366
411
  }
367
412
 
368
- if (typeof selectorOrOptions === 'string') {
369
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
413
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
414
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
370
415
  }
371
416
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});
372
417
  }
@@ -380,17 +425,17 @@ export function innerText(selectorOrOptions?: string | Omit<ApplyNodeOptions, 'p
380
425
  * - innerTextLightNode(options) - Set innerText of $this in light DOM
381
426
  * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM
382
427
  */
383
- export function innerTextLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
428
+ export function innerTextLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
384
429
  export function innerTextLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
385
430
  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 {
431
+ export function innerTextLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
387
432
  // Bare decorator usage: @innerTextLightNode
388
433
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
389
434
  return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
390
435
  }
391
436
 
392
- if (typeof selectorOrOptions === 'string') {
393
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
437
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
438
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
394
439
  }
395
440
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});
396
441
  }
@@ -403,17 +448,17 @@ export function innerTextLight(selectorOrOptions?: string | Omit<ApplyNodeOption
403
448
  * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM
404
449
  * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM
405
450
  */
406
- export function innerTextShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
451
+ export function innerTextShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
407
452
  export function innerTextShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
408
453
  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 {
454
+ export function innerTextShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
410
455
  // Bare decorator usage: @innerTextShadowNode
411
456
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
412
457
  return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
413
458
  }
414
459
 
415
- if (typeof selectorOrOptions === 'string') {
416
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
460
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
461
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
417
462
  }
418
463
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});
419
464
  }
@@ -426,17 +471,17 @@ export function innerTextShadow(selectorOrOptions?: string | Omit<ApplyNodeOptio
426
471
  * - beforeEndNode(options) - Append to $this (current element)
427
472
  * - @beforeEndNode - Bare decorator, appends to $this
428
473
  */
429
- export function insertBeforeEnd(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
474
+ export function insertBeforeEnd(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
430
475
  export function insertBeforeEnd(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
431
476
  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 {
477
+ export function insertBeforeEnd(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
433
478
  // Bare decorator usage: @beforeEndNode
434
479
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
435
480
  return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);
436
481
  }
437
482
 
438
- if (typeof selectorOrOptions === 'string') {
439
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
483
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
484
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
440
485
  }
441
486
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});
442
487
  }
@@ -450,17 +495,17 @@ export function insertBeforeEnd(selectorOrOptions?: string | Omit<ApplyNodeOptio
450
495
  * - beforeEndLightNode(options) - Append to $this in light DOM
451
496
  * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM
452
497
  */
453
- export function insertBeforeEndLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
498
+ export function insertBeforeEndLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
454
499
  export function insertBeforeEndLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
455
500
  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 {
501
+ export function insertBeforeEndLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
457
502
  // Bare decorator usage: @beforeEndLightNode
458
503
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
459
504
  return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
460
505
  }
461
506
 
462
- if (typeof selectorOrOptions === 'string') {
463
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
507
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
508
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
464
509
  }
465
510
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});
466
511
  }
@@ -474,17 +519,17 @@ export function insertBeforeEndLight(selectorOrOptions?: string | Omit<ApplyNode
474
519
  * - beforeEndShadowNode(options) - Append to $this in shadow DOM
475
520
  * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM
476
521
  */
477
- export function insertBeforeEndShadow(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
522
+ export function insertBeforeEndShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
478
523
  export function insertBeforeEndShadow(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
479
524
  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 {
525
+ export function insertBeforeEndShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
481
526
  // Bare decorator usage: @beforeEndShadowNode
482
527
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
483
528
  return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);
484
529
  }
485
530
 
486
- if (typeof selectorOrOptions === 'string') {
487
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
531
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
532
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
488
533
  }
489
534
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});
490
535
  }
@@ -498,17 +543,17 @@ export function insertBeforeEndShadow(selectorOrOptions?: string | Omit<ApplyNod
498
543
  * - afterBeginNode(options) - Prepend to $this (current element)
499
544
  * - @afterBeginNode - Bare decorator, prepends to $this
500
545
  */
501
- export function insertAfterBegin(selector: string, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
546
+ export function insertAfterBegin(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
502
547
  export function insertAfterBegin(options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;
503
548
  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 {
549
+ export function insertAfterBegin(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
505
550
  // Bare decorator usage: @afterBeginNode
506
551
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
507
552
  return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);
508
553
  }
509
554
 
510
- if (typeof selectorOrOptions === 'string') {
511
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
555
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
556
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
512
557
  }
513
558
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});
514
559
  }
@@ -522,17 +567,17 @@ export function insertAfterBegin(selectorOrOptions?: string | Omit<ApplyNodeOpti
522
567
  * - afterBeginLightNode(options) - Prepend to $this in light DOM
523
568
  * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM
524
569
  */
525
- export function insertAfterBeginLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
570
+ export function insertAfterBeginLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
526
571
  export function insertAfterBeginLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
527
572
  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 {
573
+ export function insertAfterBeginLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
529
574
  // Bare decorator usage: @afterBeginLightNode
530
575
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
531
576
  return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
532
577
  }
533
578
 
534
- if (typeof selectorOrOptions === 'string') {
535
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
579
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
580
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
536
581
  }
537
582
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});
538
583
  }
@@ -546,17 +591,17 @@ export function insertAfterBeginLight(selectorOrOptions?: string | Omit<ApplyNod
546
591
  * - replaceChildrenLightNode(options) - Replace children of $this in light DOM
547
592
  * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM
548
593
  */
549
- export function replaceChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
594
+ export function replaceChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
550
595
  export function replaceChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
551
596
  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 {
597
+ export function replaceChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
553
598
  // Bare decorator usage: @replaceChildrenLightNode
554
599
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
555
600
  return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
556
601
  }
557
602
 
558
- if (typeof selectorOrOptions === 'string') {
559
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
603
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
604
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
560
605
  }
561
606
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});
562
607
  }
@@ -569,17 +614,17 @@ export function replaceChildrenLight(selectorOrOptions?: string | Omit<ApplyNode
569
614
  * - clearChildrenLightNode(options) - Clear children of $this in light DOM
570
615
  * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM
571
616
  */
572
- export function clearChildrenLight(selector: string, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
617
+ export function clearChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
573
618
  export function clearChildrenLight(options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;
574
619
  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 {
620
+ export function clearChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {
576
621
  // Bare decorator usage: @clearChildrenLightNode
577
622
  if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {
578
623
  return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);
579
624
  }
580
625
 
581
- if (typeof selectorOrOptions === 'string') {
582
- return applyNode(selectorOrOptions, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
626
+ if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {
627
+ return applyNode(selectorOrOptions as ApplyNodeSelector, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
583
628
  }
584
629
  return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});
585
630
  }