@dooboostore/simple-web-component 1.0.52 → 1.0.54

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 (47) hide show
  1. package/README.md +7 -8
  2. package/dist/cjs/decorators/addEventListener.js +8 -3
  3. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  4. package/dist/cjs/decorators/applyNode.js +15 -0
  5. package/dist/cjs/decorators/applyNode.js.map +2 -2
  6. package/dist/cjs/decorators/requestAnimationFrame.js +10 -2
  7. package/dist/cjs/decorators/requestAnimationFrame.js.map +2 -2
  8. package/dist/cjs/decorators/setInterval.js +4 -2
  9. package/dist/cjs/decorators/setInterval.js.map +2 -2
  10. package/dist/cjs/decorators/setTimeout.js +4 -2
  11. package/dist/cjs/decorators/setTimeout.js.map +2 -2
  12. package/dist/cjs/decorators/subscribeSwcAppMessage.js +14 -1
  13. package/dist/cjs/decorators/subscribeSwcAppMessage.js.map +2 -2
  14. package/dist/esm/decorators/addEventListener.js +8 -3
  15. package/dist/esm/decorators/addEventListener.js.map +2 -2
  16. package/dist/esm/decorators/applyNode.js +15 -0
  17. package/dist/esm/decorators/applyNode.js.map +2 -2
  18. package/dist/esm/decorators/requestAnimationFrame.js +10 -2
  19. package/dist/esm/decorators/requestAnimationFrame.js.map +2 -2
  20. package/dist/esm/decorators/setInterval.js +4 -2
  21. package/dist/esm/decorators/setInterval.js.map +2 -2
  22. package/dist/esm/decorators/setTimeout.js +4 -2
  23. package/dist/esm/decorators/setTimeout.js.map +2 -2
  24. package/dist/esm/decorators/subscribeSwcAppMessage.js +14 -1
  25. package/dist/esm/decorators/subscribeSwcAppMessage.js.map +2 -2
  26. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +51 -6
  27. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +3 -3
  28. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  29. package/dist/types/decorators/applyNode.d.ts +12 -0
  30. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  31. package/dist/types/decorators/requestAnimationFrame.d.ts +7 -4
  32. package/dist/types/decorators/requestAnimationFrame.d.ts.map +1 -1
  33. package/dist/types/decorators/setInterval.d.ts +6 -4
  34. package/dist/types/decorators/setInterval.d.ts.map +1 -1
  35. package/dist/types/decorators/setTimeout.d.ts +6 -4
  36. package/dist/types/decorators/setTimeout.d.ts.map +1 -1
  37. package/dist/types/decorators/subscribeSwcAppMessage.d.ts +12 -0
  38. package/dist/types/decorators/subscribeSwcAppMessage.d.ts.map +1 -1
  39. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +51 -6
  40. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +3 -3
  41. package/package.json +3 -3
  42. package/src/decorators/addEventListener.ts +10 -3
  43. package/src/decorators/applyNode.ts +30 -0
  44. package/src/decorators/requestAnimationFrame.ts +17 -5
  45. package/src/decorators/setInterval.ts +9 -5
  46. package/src/decorators/setTimeout.ts +9 -5
  47. package/src/decorators/subscribeSwcAppMessage.ts +27 -0
@@ -30,6 +30,10 @@ const applyToDom = (currentThis, targetEl, res, pos, win, host) => {
30
30
  targetEl.replaceChildren();
31
31
  return [];
32
32
  }
33
+ if (pos === "remove") {
34
+ (targetEl instanceof win.ShadowRoot ? targetEl.host : targetEl).remove();
35
+ return [];
36
+ }
33
37
  const doc = win.document;
34
38
  const hostSet = SwcUtils.getHelperAndHostSet(currentThis);
35
39
  const id = currentThis._swcId;
@@ -129,6 +133,7 @@ function applyNode(selectorOrOptions, maybeOptions) {
129
133
  };
130
134
  const runApply = (target, val) => {
131
135
  const pos = options.position || "beforeEnd";
136
+ if (pos === "remove" && !val) return;
132
137
  const processedVal = val;
133
138
  if (!options.filter || options.filter(target, processedVal, { currentThis: this, helper: hostSet })) {
134
139
  applyToDom(this, target, processedVal, pos, currentWin);
@@ -173,6 +178,15 @@ function clearChildrenNode(selectorOrOptions, maybeOptions, descriptor) {
173
178
  return applyNode({ ...selectorOrOptions, position: "clearChildren" });
174
179
  }
175
180
  const clearNode = clearChildrenNode;
181
+ function removeNode(selectorOrOptions, maybeOptions, descriptor) {
182
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
183
+ return applyNode({ position: "remove" })(selectorOrOptions, maybeOptions, descriptor);
184
+ }
185
+ if (typeof selectorOrOptions === "string" || typeof selectorOrOptions === "function") {
186
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "remove" });
187
+ }
188
+ return applyNode({ ...selectorOrOptions, position: "remove" });
189
+ }
176
190
  function innerHtml(selectorOrOptions, maybeOptions, descriptor) {
177
191
  if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
178
192
  return applyNode({ position: "innerHtml" })(selectorOrOptions, maybeOptions, descriptor);
@@ -380,6 +394,7 @@ export {
380
394
  insertBeforeEndLight,
381
395
  insertBeforeEndShadow,
382
396
  node,
397
+ removeNode,
383
398
  replaceChildren,
384
399
  replaceChildrenLight,
385
400
  skipIfEmpty,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/applyNode.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport {SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet, SwcRootType} from '../types';\nimport { SwcUtils} from \"../utils/Utils\";\nimport {findAllStateMetadata} from \"./state\";\nimport {ElementApply} from \"@dooboostore/core-web\";\n/*\n<!-- beforebegin -->\n<p> <-- it's me\n <!-- afterbegin -->\n foo\n <!-- beforeend -->\n</p>\n<!-- afterend -->\n */\nexport type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';\n\nexport type ApplyNodeFnSelector = SwcFnSelector;\nexport type ApplyNodeSelector = SwcSelector;\n\n// \uACF5\uD1B5 \uC635\uC158 \u2014 root \uC5C6\uC74C\nexport interface ApplyNodeBaseOptions {\n position?: ApplyNodePosition;\n filter?: (target: HTMLElement | ShadowRoot, newValue: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n fallback?: (helper: HelperHostSet) => any;\n valueKey?: symbol | string;\n}\n\n// \uBB38\uC790\uC5F4 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uD5C8\uC6A9\nexport type ApplyNodeQueryOptions = ApplyNodeBaseOptions & { root?: SwcRootType };\n// \uD568\uC218 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uAE08\uC9C0\nexport type ApplyNodeNonQueryOptions = ApplyNodeBaseOptions;\nexport type ApplyNodeOptions = ApplyNodeQueryOptions;\n\n// \uC140\uB809\uD130 \uC885\uB958\uC5D0 \uB530\uB77C \uC635\uC158 \uD0C0\uC785 \uBD84\uAE30\nexport type ApplyNodeOptionsOf<S extends ApplyNodeSelector> = S extends string ? ApplyNodeQueryOptions : ApplyNodeNonQueryOptions;\n\nexport interface ApplyNodeMetadata {\n propertyKey: string | symbol;\n selector: ApplyNodeSelector;\n options: ApplyNodeOptions;\n}\n\nexport const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-node');\n\n/**\n * Resolve selector to string or elements\n * Handles function-based selectors and returns elements if applicable\n */\nconst resolveSelector = (selector: ApplyNodeSelector, inst: any, win: Window): string | HTMLElement | null => {\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(inst);\n const result = selector(inst, hostSet);\n \n if (result instanceof win.Element) {\n return result as HTMLElement;\n }\n if (result instanceof win.NodeList) {\n return result.length > 0 ? (result[0] as HTMLElement) : null;\n }\n if (Array.isArray(result)) {\n return result.length > 0 ? (result[0] as HTMLElement) : null;\n }\n if (result === null) {\n return null;\n }\n // result must be a string at this point\n return result as unknown as string;\n }\n return selector as string;\n};\n\n// const normalizeNodes = (res: any, doc: Document): Node[] => {\n// const items = Array.isArray(res) ? res : [res];\n// return items.map(it => {\n// if (it instanceof Node) return it;\n// return doc.createTextNode(it !== undefined && it !== null ? String(it) : '');\n// });\n// };\n\nconst applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string | (Node | string)[] | NodeList, pos: ApplyNodePosition, win: Window, host?: any) => {\n if (!targetEl) return;\n \n // Handle clearChildren - ignore return value and always clear\n if (pos === 'clearChildren') {\n targetEl.replaceChildren();\n return [];\n }\n \n const doc = win.document;\n const hostSet = SwcUtils.getHelperAndHostSet(currentThis);\n const id = currentThis._swcId;\n\n // \uB9AC\uD134\uAC12 \u2192 \uB178\uB4DC: Node \uADF8\uB300\uB85C / \uBB38\uC790\uC5F4\uC740 innerText \uBA74 \uD14D\uC2A4\uD2B8, \uADF8 \uC678 \uC704\uCE58\uB294 HTML / \uBC30\uC5F4\u00B7NodeList \uB294 \uD56D\uBAA9\uB9C8\uB2E4.\n // Node \uD310\uB2E8\uC740 nodeType \uC73C\uB85C \u2014 \uB2E4\uB978 window(iframe) \uC5D0\uC11C \uB9CC\uB4E0 \uB178\uB4DC\uB294 instanceof win.Node \uAC00 false \uB77C\uC11C.\n const toNodes = (v: any): Node[] => {\n if (v === null || v === undefined || v === false) return [];\n if (typeof v === 'object' && typeof v.nodeType === 'number') return [v];\n if (typeof v === 'object' && typeof v.length === 'number') return Array.from(v as ArrayLike<any>).flatMap(toNodes);\n if (pos === 'innerText') return [doc.createTextNode(String(v))];\n const t = doc.createElement('template');\n t.innerHTML = String(v);\n return Array.from(t.content.childNodes);\n };\n const nodes: Node[] = toNodes(res);\n\n SwcUtils.projectProcessHtml(id, nodes, doc);\n\n const isShadowRoot = targetEl instanceof win.ShadowRoot;\n // const nodes = normalizeNodes(res, doc);\n if (pos === 'replace') {\n if (!isShadowRoot) targetEl.replaceWith(...nodes);\n } else if (pos === 'innerHtml') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'innerText') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'replaceChildren') {\n targetEl.replaceChildren(...nodes);\n } else {\n if (pos === 'beforeEnd') {\n targetEl.append(...nodes)\n }\n else if (pos === 'afterBegin') targetEl.prepend(...nodes);\n else if (pos === 'beforeBegin' && !isShadowRoot) targetEl.before(...nodes);\n else if (pos === 'afterEnd' && !isShadowRoot) targetEl.after(...nodes);\n }\n\n const stateContext: any = {...hostSet};\n findAllStateMetadata(currentThis).forEach(it => {\n stateContext[it.name] = currentThis[it.propertyKey]\n })\n new ElementApply(targetEl, {id: id}).apply({target: 'noInitialized', context: stateContext, bind: currentThis});\n return nodes;\n};\n\n/**\n * @applyNode decorator to surgically add/replace nodes to a target element.\n * \n * Overloads:\n * - applyNode(selector, options) - Apply to specific selector\n * - applyNode(options) - Apply to $this (current element)\n */\nexport function applyNode(selector: string, options?: ApplyNodeQueryOptions): MethodDecorator;\nexport function applyNode(selector: ApplyNodeFnSelector, options?: ApplyNodeNonQueryOptions): MethodDecorator;\nexport function applyNode(options: ApplyNodeQueryOptions): MethodDecorator;\nexport function applyNode(selectorOrOptions: ApplyNodeSelector | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {\n // Determine selector and options based on overload\n let selector: ApplyNodeSelector;\n let options: ApplyNodeOptions;\n\n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n // First overload: applyNode(selector, options)\n selector = selectorOrOptions;\n options = maybeOptions || {position: 'replaceChildren'};\n } else {\n // Second overload: applyNode(options) - default to $this\n selector = '$this';\n options = selectorOrOptions || {position: 'replaceChildren'};\n }\n\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ApplyNodeMetadata>();\n ReflectUtils.defineMetadata(APPLY_NODE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, {propertyKey, selector, options});\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n\n const currentWin = SwcUtils.resolveWindow(this);\n const currentDoc = currentWin.document;\n const hostSet = SwcUtils.getHelperAndHostSet(this);\n\n const getTarget = () => {\n const r = options.root || 'auto';\n const applyRoot = (t: any) => {\n if (!t) return t;\n if (r === 'auto') return t.shadowRoot || t;\n if (r === 'shadow') return t.shadowRoot;\n if (r === 'light') return t;\n if (r === 'all') return t.shadowRoot || t;\n return t;\n };\n\n // Resolve selector if it's a function\n const resolved = resolveSelector(selector, this, currentWin);\n \n // If selector function returned an element directly, use it\n if (resolved instanceof currentWin.Element) {\n return applyRoot(resolved);\n }\n if (resolved === null) {\n return null;\n }\n\n // Handle string selector\n const stringSelector = resolved as string;\n\n if (stringSelector === '$this') return applyRoot(this);\n if (stringSelector === '$host') return applyRoot(hostSet.$host);\n if (stringSelector === '$parentHost') return applyRoot(hostSet.$parentHost);\n if (stringSelector === '$appHost') return applyRoot(hostSet.$appHost);\n if (stringSelector === '$firstHost') return applyRoot(hostSet.$firstHost);\n if (stringSelector === '$lastHost') return applyRoot(hostSet.$lastHost);\n\n const targetRoot = applyRoot(this);\n return targetRoot ? targetRoot.querySelector(stringSelector) : null;\n };\n\n const targetEl = getTarget();\n const res = original.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses APPLY_NODE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options.valueKey ?? APPLY_NODE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const runApply = (target: any, val: any) => {\n const pos = options.position || 'beforeEnd';\n // Delegate HTML/node processing to applyToDom which centralizes\n // processing. runApply should not call processHtml itself to avoid\n // duplicate processing.\n const processedVal = val;\n\n // \uC0AC\uC6A9\uC790\uAC00 filter\uB97C \uBA85\uC2DC\uD558\uBA74 \uADF8 \uC870\uAC74\uC73C\uB85C, \uC544\uB2C8\uBA74 \uD56D\uC0C1 \uC801\uC6A9\n if (!options.filter || options.filter(target, processedVal, {currentThis: this, helper: hostSet})) {\n applyToDom(this, target, processedVal, pos, currentWin);\n }\n };\n\n\n const fallbackNodes: Node[] = [];\n if (targetEl && options.fallback) {\n const loadingRes = options.fallback.call(this, hostSet);\n // applyToDom expects a Window as the 4th argument\n fallbackNodes.push(...applyToDom(this, targetEl, loadingRes, options.position || 'beforeEnd', currentWin));\n }\n\n if (res instanceof Promise) {\n return res.then(finalRes => {\n const extracted = extractValue(finalRes);\n fallbackNodes.forEach((it: any)=>it.remove());\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return finalRes;\n });\n } else {\n const extracted = extractValue(res);\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return res;\n }\n };\n };\n}\n\n// --- Overloaded convenience functions for common patterns ---\n\n/**\n * @replaceChildrenNode decorator - replaces children of target element\n * \n * Overloads:\n * - replaceChildrenNode(selector, options) - Replace children of specific selector\n * - replaceChildrenNode(options) - Replace children of $this (current element)\n * - @replaceChildrenNode - Bare decorator, replaces children of $this\n */\nexport type ApplyNodeQueryOptionsNoPos = Omit<ApplyNodeQueryOptions, 'position'>;\nexport type ApplyNodeNonQueryOptionsNoPos = Omit<ApplyNodeNonQueryOptions, 'position'>;\nexport type ApplyNodeOptionsOfNoPos<S extends ApplyNodeSelector> = S extends string ? ApplyNodeQueryOptionsNoPos : ApplyNodeNonQueryOptionsNoPos;\n\nexport function replaceChildren(selector: string, options?: ApplyNodeQueryOptionsNoPos): MethodDecorator;\nexport function replaceChildren(selector: ApplyNodeFnSelector, options?: ApplyNodeNonQueryOptionsNoPos): MethodDecorator;\nexport function replaceChildren(options: ApplyNodeQueryOptionsNoPos): MethodDecorator;\nexport function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildren(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n}\n\n/**\n * @clearChildrenNode decorator - clears all children of target element\n * \n * Overloads:\n * - clearChildrenNode(selector, options) - Clear children of specific selector\n * - clearChildrenNode(options) - Clear children of $this (current element)\n * - @clearChildrenNode - Bare decorator, clears children of $this\n */\nexport function clearChildrenNode(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenNode(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n}\n\n// Alias for clearChildrenNode\nexport const clearNode = clearChildrenNode;\n\n/**\n * @innerHtmlNode decorator - sets innerHTML of target element\n * \n * Overloads:\n * - innerHtmlNode(selector, options) - Set innerHTML of specific selector\n * - innerHtmlNode(options) - Set innerHTML of $this (current element)\n * - @innerHtmlNode - Bare decorator, sets innerHTML of $this\n */\nexport function innerHtml(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtml(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n}\n\n// Alias for innerHtmlNode\n// export const setHtmlNode = innerHtml;\n\n/**\n * @innerHtmlLightNode decorator - sets innerHTML of light DOM element\n * \n * Overloads:\n * - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM\n * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM\n * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM\n */\nexport function innerHtmlLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n}\n\n\n/**\n * @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element\n * \n * Overloads:\n * - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM\n * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM\n * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM\n */\nexport function innerHtmlShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n}\n\n\n/**\n * @innerTextNode decorator - sets innerText of target element\n * \n * Overloads:\n * - innerTextNode(selector, options) - Set innerText of specific selector\n * - innerTextNode(options) - Set innerText of $this (current element)\n * - @innerTextNode - Bare decorator, sets innerText of $this\n */\nexport function innerText(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerText(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n}\n\n\n/**\n * @innerTextLightNode decorator - sets innerText of light DOM element\n * \n * Overloads:\n * - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM\n * - innerTextLightNode(options) - Set innerText of $this in light DOM\n * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM\n */\nexport function innerTextLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n}\n\n/**\n * @innerTextShadowNode decorator - sets innerText of shadow DOM element\n * \n * Overloads:\n * - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM\n * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM\n * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM\n */\nexport function innerTextShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n}\n\n/**\n * @beforeEndNode decorator - appends nodes to target element\n * \n * Overloads:\n * - beforeEndNode(selector, options) - Append to specific selector\n * - beforeEndNode(options) - Append to $this (current element)\n * - @beforeEndNode - Bare decorator, appends to $this\n */\nexport function insertBeforeEnd(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEnd(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n}\n\n\n/**\n * @beforeEndLightNode decorator - appends nodes to light DOM element\n * \n * Overloads:\n * - beforeEndLightNode(selector, options) - Append to specific selector in light DOM\n * - beforeEndLightNode(options) - Append to $this in light DOM\n * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM\n */\nexport function insertBeforeEndLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n}\n\n\n/**\n * @beforeEndShadowNode decorator - appends nodes to shadow DOM element\n * \n * Overloads:\n * - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM\n * - beforeEndShadowNode(options) - Append to $this in shadow DOM\n * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM\n */\nexport function insertBeforeEndShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n}\n\n\n/**\n * @afterBeginNode decorator - prepends nodes to target element\n * \n * Overloads:\n * - afterBeginNode(selector, options) - Prepend to specific selector\n * - afterBeginNode(options) - Prepend to $this (current element)\n * - @afterBeginNode - Bare decorator, prepends to $this\n */\nexport function insertAfterBegin(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBegin(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n}\n\n\n/**\n * @afterBeginLightNode decorator - prepends nodes to light DOM element\n * \n * Overloads:\n * - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM\n * - afterBeginLightNode(options) - Prepend to $this in light DOM\n * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM\n */\nexport function insertAfterBeginLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBeginLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n}\n\n\n/**\n * @replaceChildrenLightNode decorator - replaces children of light DOM element\n * \n * Overloads:\n * - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM\n * - replaceChildrenLightNode(options) - Replace children of $this in light DOM\n * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM\n */\nexport function replaceChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n}\n\n/**\n * @clearChildrenLightNode decorator - clears children of light DOM element\n * \n * Overloads:\n * - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM\n * - clearChildrenLightNode(options) - Clear children of $this in light DOM\n * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM\n */\nexport function clearChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n}\n\n\n\n\n// \u2500\u2500\u2500 Aliases \u2500\u2500\u2500\nexport const apply = applyNode;\nexport const node = applyNode;\n\n// \u2500\u2500\u2500 \uD3B8\uC758 \uD5EC\uD37C (selector/root \uC0DD\uB7B5) \u2500\u2500\u2500\n\nexport function applyAppHost(options: ApplyNodeQueryOptions): MethodDecorator;\nexport function applyAppHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function applyAppHost(optionsOrTarget?: ApplyNodeQueryOptions | Object, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n if ((typeof propertyKey === 'string' || typeof propertyKey === 'symbol') && descriptor !== undefined) {\n return (applyNode('$appHost', {}) as any)(optionsOrTarget, propertyKey, descriptor);\n }\n return applyNode('$appHost', optionsOrTarget as ApplyNodeQueryOptions);\n}\nexport function applyLight(selector: string, options?: Omit<ApplyNodeQueryOptions, 'root'>): MethodDecorator {\n return applyNode(selector, {...options ?? {}, root: 'light'});\n}\nexport function applyShadow(selector: string, options?: Omit<ApplyNodeQueryOptions, 'root'>): MethodDecorator {\n return applyNode(selector, {...options ?? {}, root: 'shadow'});\n}\nexport function applyAll(selector: string, options?: Omit<ApplyNodeQueryOptions, 'root'>): MethodDecorator {\n return applyNode(selector, {...options ?? {}, root: 'all'});\n}\n\nexport const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {\n const result = new Map<string | symbol, ApplyNodeMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};\n// \u2500\u2500\u2500 filter \uC720\uD2F8 (applyNode/replace*/innerHtml* options.filter\uC6A9) \u2500\u2500\u2500\n// filter\uB294 true \uBC18\uD658 \uC2DC \uC801\uC6A9, false \uBC18\uD658 \uC2DC \uC2A4\uD0B5.\n\nconst filterScopeOf = (target: HTMLElement | ShadowRoot): Element | null => {\n if (target && typeof (target as HTMLElement).querySelector === 'function') {\n return target as unknown as Element;\n }\n const host = (target as ShadowRoot)?.host as unknown as Element | undefined;\n return host && typeof host.querySelector === 'function' ? host : null;\n};\n\nconst tagNameOf = (node: any): string | null => {\n const tag = node?.tagName;\n return typeof tag === 'string' ? tag.toLowerCase() : null;\n};\n\n// \uC0C8 \uB178\uB4DC\uC640 \uAC19\uC740 \uD0DC\uADF8\uAC00 target \uC548\uC5D0 \uC774\uBBF8 \uC788\uC73C\uBA74 \uC2A4\uD0B5 (SSR adopting\uC6A9).\nexport const skipIfSameTagPresent = (target: HTMLElement | ShadowRoot, newValue: any): boolean => {\n const nodes = (Array.isArray(newValue) ? newValue : [newValue]).filter((n) => tagNameOf(n) !== null);\n if (nodes.length === 0) return true;\n const scope = filterScopeOf(target);\n if (!scope) return true;\n return !nodes.some((n) => scope.querySelector(tagNameOf(n)!));\n};\n\n// \uC9C0\uC815 selector\uAC00 target \uC548\uC5D0 \uC774\uBBF8 \uC788\uC73C\uBA74 \uC2A4\uD0B5 (\uAC19\uC740 path \uCFFC\uB9AC \uBCC0\uACBD \uC2DC \uD398\uC774\uC9C0 \uC7AC\uC0DD\uC131 \uBC29\uC9C0\uC6A9).\n// \uC0AC\uC6A9: @innerHtmlLight({ filter: skipIfExists('center-math-page') })\nexport const skipIfExists = (selector: string) =>\n (target: HTMLElement | ShadowRoot): boolean => {\n const scope = filterScopeOf(target);\n if (!scope) return true;\n return !scope.querySelector(selector);\n };\n\n// \uC0C8 \uAC12\uC774 \uBE44\uC5B4\uC788\uC73C\uBA74 \uC2A4\uD0B5 (null/''/\uBE48 \uBC30\uC5F4).\nexport const skipIfEmpty = (_target: HTMLElement | ShadowRoot, newValue: any): boolean => {\n if (newValue === null || newValue === undefined || newValue === false) return false;\n if (typeof newValue === 'string') return newValue.trim().length > 0;\n if (Array.isArray(newValue)) return newValue.length > 0;\n return true;\n};\n\n// \uD14D\uC2A4\uD2B8\uAC00 \uB2EC\uB77C\uC9C8 \uB54C\uB9CC \uC801\uC6A9 (\uD3F4\uB9C1 \uAC31\uC2E0\uC6A9).\nexport const applyIfChanged = (target: HTMLElement | ShadowRoot, newValue: any): boolean => {\n const textOf = (v: any): string => {\n if (typeof v === 'string') return v;\n if (Array.isArray(v)) return v.map(textOf).join('');\n return typeof v?.textContent === 'string' ? v.textContent : '';\n };\n const current = typeof (target as HTMLElement)?.textContent === 'string' ? (target as HTMLElement).textContent! : '';\n return current !== textOf(newValue);\n};\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAE3B,SAAS,gBAAe;AACxB,SAAQ,4BAA2B;AACnC,SAAQ,oBAAmB;AAsCpB,MAAM,0BAA0B,OAAO,IAAI,iCAAiC;AAMnF,MAAM,kBAAkB,CAAC,UAA6B,MAAW,QAA6C;AAC5G,MAAI,OAAO,aAAa,YAAY;AAClC,UAAM,UAAU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AAM,QAAQ,cAAc,MAAM;AAClC,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,CAAC,MAAM,cAAc,QAAQ;AACtC;AAGK,MAAM,cAAc,CAAC,SAAmC,aAA2B;AACxF,MAAI,aAAa,QAAQ,aAAa,UAAa,aAAa,MAAO,QAAO;AAC9E,MAAI,OAAO,aAAa,SAAU,QAAO,SAAS,KAAK,EAAE,SAAS;AAClE,MAAI,MAAM,QAAQ,QAAQ,EAAG,QAAO,SAAS,SAAS;AACtD,SAAO;AACT;AAGO,MAAM,iBAAiB,CAAC,QAAkC,aAA2B;AAC1F,QAAM,SAAS,CAAC,MAAmB;AACjC,QAAI,OAAO,MAAM,SAAU,QAAO;AAClC,QAAI,MAAM,QAAQ,CAAC,EAAG,QAAO,EAAE,IAAI,MAAM,EAAE,KAAK,EAAE;AAClD,WAAO,OAAO,GAAG,gBAAgB,WAAW,EAAE,cAAc;AAAA,EAC9D;AACA,QAAM,UAAU,OAAQ,QAAwB,gBAAgB,WAAY,OAAuB,cAAe;AAClH,SAAO,YAAY,OAAO,QAAQ;AACpC;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport {SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet, SwcRootType} from '../types';\nimport { SwcUtils} from \"../utils/Utils\";\nimport {findAllStateMetadata} from \"./state\";\nimport {ElementApply} from \"@dooboostore/core-web\";\n/*\n<!-- beforebegin -->\n<p> <-- it's me\n <!-- afterbegin -->\n foo\n <!-- beforeend -->\n</p>\n<!-- afterend -->\n */\nexport type ApplyNodePosition = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd' | 'replace' | 'replaceChildren' | 'innerHtml' | 'innerText' | 'remove' | 'clearChildren';\n\nexport type ApplyNodeFnSelector = SwcFnSelector;\nexport type ApplyNodeSelector = SwcSelector;\n\n// \uACF5\uD1B5 \uC635\uC158 \u2014 root \uC5C6\uC74C\nexport interface ApplyNodeBaseOptions {\n position?: ApplyNodePosition;\n filter?: (target: HTMLElement | ShadowRoot, newValue: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n fallback?: (helper: HelperHostSet) => any;\n valueKey?: symbol | string;\n}\n\n// \uBB38\uC790\uC5F4 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uD5C8\uC6A9\nexport type ApplyNodeQueryOptions = ApplyNodeBaseOptions & { root?: SwcRootType };\n// \uD568\uC218 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uAE08\uC9C0\nexport type ApplyNodeNonQueryOptions = ApplyNodeBaseOptions;\nexport type ApplyNodeOptions = ApplyNodeQueryOptions;\n\n// \uC140\uB809\uD130 \uC885\uB958\uC5D0 \uB530\uB77C \uC635\uC158 \uD0C0\uC785 \uBD84\uAE30\nexport type ApplyNodeOptionsOf<S extends ApplyNodeSelector> = S extends string ? ApplyNodeQueryOptions : ApplyNodeNonQueryOptions;\n\nexport interface ApplyNodeMetadata {\n propertyKey: string | symbol;\n selector: ApplyNodeSelector;\n options: ApplyNodeOptions;\n}\n\nexport const APPLY_NODE_METADATA_KEY = Symbol.for('simple-web-component:apply-node');\n\n/**\n * Resolve selector to string or elements\n * Handles function-based selectors and returns elements if applicable\n */\nconst resolveSelector = (selector: ApplyNodeSelector, inst: any, win: Window): string | HTMLElement | null => {\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(inst);\n const result = selector(inst, hostSet);\n \n if (result instanceof win.Element) {\n return result as HTMLElement;\n }\n if (result instanceof win.NodeList) {\n return result.length > 0 ? (result[0] as HTMLElement) : null;\n }\n if (Array.isArray(result)) {\n return result.length > 0 ? (result[0] as HTMLElement) : null;\n }\n if (result === null) {\n return null;\n }\n // result must be a string at this point\n return result as unknown as string;\n }\n return selector as string;\n};\n\n// const normalizeNodes = (res: any, doc: Document): Node[] => {\n// const items = Array.isArray(res) ? res : [res];\n// return items.map(it => {\n// if (it instanceof Node) return it;\n// return doc.createTextNode(it !== undefined && it !== null ? String(it) : '');\n// });\n// };\n\nconst applyToDom = (currentThis: any, targetEl: HTMLElement, res: Node | string | (Node | string)[] | NodeList, pos: ApplyNodePosition, win: Window, host?: any) => {\n if (!targetEl) return;\n \n // Handle clearChildren - ignore return value and always clear\n if (pos === 'clearChildren') {\n targetEl.replaceChildren();\n return [];\n }\n\n // remove: \uB300\uC0C1 \uC790\uCCB4\uB97C DOM\uC5D0\uC11C \uB5C0\uB2E4. $this \uCC98\uB7FC shadow root \uB85C \uC7A1\uD614\uC73C\uBA74 \uADF8 \uC8FC\uC778 \uC5D8\uB9AC\uBA3C\uD2B8\uB97C \uB5C0\uB2E4.\n if (pos === 'remove') {\n (targetEl instanceof win.ShadowRoot ? (targetEl as any).host : targetEl).remove();\n return [];\n }\n \n const doc = win.document;\n const hostSet = SwcUtils.getHelperAndHostSet(currentThis);\n const id = currentThis._swcId;\n\n // \uB9AC\uD134\uAC12 \u2192 \uB178\uB4DC: Node \uADF8\uB300\uB85C / \uBB38\uC790\uC5F4\uC740 innerText \uBA74 \uD14D\uC2A4\uD2B8, \uADF8 \uC678 \uC704\uCE58\uB294 HTML / \uBC30\uC5F4\u00B7NodeList \uB294 \uD56D\uBAA9\uB9C8\uB2E4.\n // Node \uD310\uB2E8\uC740 nodeType \uC73C\uB85C \u2014 \uB2E4\uB978 window(iframe) \uC5D0\uC11C \uB9CC\uB4E0 \uB178\uB4DC\uB294 instanceof win.Node \uAC00 false \uB77C\uC11C.\n const toNodes = (v: any): Node[] => {\n if (v === null || v === undefined || v === false) return [];\n if (typeof v === 'object' && typeof v.nodeType === 'number') return [v];\n if (typeof v === 'object' && typeof v.length === 'number') return Array.from(v as ArrayLike<any>).flatMap(toNodes);\n if (pos === 'innerText') return [doc.createTextNode(String(v))];\n const t = doc.createElement('template');\n t.innerHTML = String(v);\n return Array.from(t.content.childNodes);\n };\n const nodes: Node[] = toNodes(res);\n\n SwcUtils.projectProcessHtml(id, nodes, doc);\n\n const isShadowRoot = targetEl instanceof win.ShadowRoot;\n // const nodes = normalizeNodes(res, doc);\n if (pos === 'replace') {\n if (!isShadowRoot) targetEl.replaceWith(...nodes);\n } else if (pos === 'innerHtml') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'innerText') {\n targetEl.replaceChildren(...nodes);\n } else if (pos === 'replaceChildren') {\n targetEl.replaceChildren(...nodes);\n } else {\n if (pos === 'beforeEnd') {\n targetEl.append(...nodes)\n }\n else if (pos === 'afterBegin') targetEl.prepend(...nodes);\n else if (pos === 'beforeBegin' && !isShadowRoot) targetEl.before(...nodes);\n else if (pos === 'afterEnd' && !isShadowRoot) targetEl.after(...nodes);\n }\n\n const stateContext: any = {...hostSet};\n findAllStateMetadata(currentThis).forEach(it => {\n stateContext[it.name] = currentThis[it.propertyKey]\n })\n new ElementApply(targetEl, {id: id}).apply({target: 'noInitialized', context: stateContext, bind: currentThis});\n return nodes;\n};\n\n/**\n * @applyNode decorator to surgically add/replace nodes to a target element.\n * \n * Overloads:\n * - applyNode(selector, options) - Apply to specific selector\n * - applyNode(options) - Apply to $this (current element)\n */\nexport function applyNode(selector: string, options?: ApplyNodeQueryOptions): MethodDecorator;\nexport function applyNode(selector: ApplyNodeFnSelector, options?: ApplyNodeNonQueryOptions): MethodDecorator;\nexport function applyNode(options: ApplyNodeQueryOptions): MethodDecorator;\nexport function applyNode(selectorOrOptions: ApplyNodeSelector | ApplyNodeOptions, maybeOptions?: ApplyNodeOptions): MethodDecorator {\n // Determine selector and options based on overload\n let selector: ApplyNodeSelector;\n let options: ApplyNodeOptions;\n\n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n // First overload: applyNode(selector, options)\n selector = selectorOrOptions;\n options = maybeOptions || {position: 'replaceChildren'};\n } else {\n // Second overload: applyNode(options) - default to $this\n selector = '$this';\n options = selectorOrOptions || {position: 'replaceChildren'};\n }\n\n return (targetObj: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = targetObj.constructor;\n let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor) as Map<string | symbol, ApplyNodeMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ApplyNodeMetadata>();\n ReflectUtils.defineMetadata(APPLY_NODE_METADATA_KEY, metaList, constructor);\n }\n metaList.set(propertyKey, {propertyKey, selector, options});\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n\n const currentWin = SwcUtils.resolveWindow(this);\n const currentDoc = currentWin.document;\n const hostSet = SwcUtils.getHelperAndHostSet(this);\n\n const getTarget = () => {\n const r = options.root || 'auto';\n const applyRoot = (t: any) => {\n if (!t) return t;\n if (r === 'auto') return t.shadowRoot || t;\n if (r === 'shadow') return t.shadowRoot;\n if (r === 'light') return t;\n if (r === 'all') return t.shadowRoot || t;\n return t;\n };\n\n // Resolve selector if it's a function\n const resolved = resolveSelector(selector, this, currentWin);\n \n // If selector function returned an element directly, use it\n if (resolved instanceof currentWin.Element) {\n return applyRoot(resolved);\n }\n if (resolved === null) {\n return null;\n }\n\n // Handle string selector\n const stringSelector = resolved as string;\n\n if (stringSelector === '$this') return applyRoot(this);\n if (stringSelector === '$host') return applyRoot(hostSet.$host);\n if (stringSelector === '$parentHost') return applyRoot(hostSet.$parentHost);\n if (stringSelector === '$appHost') return applyRoot(hostSet.$appHost);\n if (stringSelector === '$firstHost') return applyRoot(hostSet.$firstHost);\n if (stringSelector === '$lastHost') return applyRoot(hostSet.$lastHost);\n\n const targetRoot = applyRoot(this);\n return targetRoot ? targetRoot.querySelector(stringSelector) : null;\n };\n\n const targetEl = getTarget();\n const res = original.apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses APPLY_NODE_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = options.valueKey ?? APPLY_NODE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const runApply = (target: any, val: any) => {\n const pos = options.position || 'beforeEnd';\n // remove \uB294 \uAC12\uC774 '\uC9C0\uC6B8\uC9C0 \uB9D0\uC9C0' \uB2E4: truthy \uC77C \uB54C\uB9CC \uC9C0\uC6B4\uB2E4 (undefined \uB294 \uC704\uC5D0\uC11C \uC774\uBBF8 \uAC78\uB7EC\uC9D0)\n if (pos === 'remove' && !val) return;\n // Delegate HTML/node processing to applyToDom which centralizes\n // processing. runApply should not call processHtml itself to avoid\n // duplicate processing.\n const processedVal = val;\n\n // \uC0AC\uC6A9\uC790\uAC00 filter\uB97C \uBA85\uC2DC\uD558\uBA74 \uADF8 \uC870\uAC74\uC73C\uB85C, \uC544\uB2C8\uBA74 \uD56D\uC0C1 \uC801\uC6A9\n if (!options.filter || options.filter(target, processedVal, {currentThis: this, helper: hostSet})) {\n applyToDom(this, target, processedVal, pos, currentWin);\n }\n };\n\n\n const fallbackNodes: Node[] = [];\n if (targetEl && options.fallback) {\n const loadingRes = options.fallback.call(this, hostSet);\n // applyToDom expects a Window as the 4th argument\n fallbackNodes.push(...applyToDom(this, targetEl, loadingRes, options.position || 'beforeEnd', currentWin));\n }\n\n if (res instanceof Promise) {\n return res.then(finalRes => {\n const extracted = extractValue(finalRes);\n fallbackNodes.forEach((it: any)=>it.remove());\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return finalRes;\n });\n } else {\n const extracted = extractValue(res);\n if (extracted !== undefined && targetEl) runApply(targetEl, extracted);\n return res;\n }\n };\n };\n}\n\n// --- Overloaded convenience functions for common patterns ---\n\n/**\n * @replaceChildrenNode decorator - replaces children of target element\n * \n * Overloads:\n * - replaceChildrenNode(selector, options) - Replace children of specific selector\n * - replaceChildrenNode(options) - Replace children of $this (current element)\n * - @replaceChildrenNode - Bare decorator, replaces children of $this\n */\nexport type ApplyNodeQueryOptionsNoPos = Omit<ApplyNodeQueryOptions, 'position'>;\nexport type ApplyNodeNonQueryOptionsNoPos = Omit<ApplyNodeNonQueryOptions, 'position'>;\nexport type ApplyNodeOptionsOfNoPos<S extends ApplyNodeSelector> = S extends string ? ApplyNodeQueryOptionsNoPos : ApplyNodeNonQueryOptionsNoPos;\n\nexport function replaceChildren(selector: string, options?: ApplyNodeQueryOptionsNoPos): MethodDecorator;\nexport function replaceChildren(selector: ApplyNodeFnSelector, options?: ApplyNodeNonQueryOptionsNoPos): MethodDecorator;\nexport function replaceChildren(options: ApplyNodeQueryOptionsNoPos): MethodDecorator;\nexport function replaceChildren(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildren(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'replaceChildren'});\n}\n\n/**\n * @clearChildrenNode decorator - clears all children of target element\n * \n * Overloads:\n * - clearChildrenNode(selector, options) - Clear children of specific selector\n * - clearChildrenNode(options) - Clear children of $this (current element)\n * - @clearChildrenNode - Bare decorator, clears children of $this\n */\nexport function clearChildrenNode(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function clearChildrenNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenNode(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'clearChildren'});\n}\n\n// Alias for clearChildrenNode\nexport const clearNode = clearChildrenNode;\n\n/**\n * @removeNode - \uBA54\uC11C\uB4DC \uBC18\uD658\uAC12\uC774 truthy \uBA74 \uB300\uC0C1 \uC5D8\uB9AC\uBA3C\uD2B8\uB97C DOM\uC5D0\uC11C \uC81C\uAC70\uD55C\uB2E4.\n * \uBC18\uD658\uAC12(valueKey \uAC00 \uC788\uC73C\uBA74 \uADF8 \uAC12)\uC774 falsy(undefined / null / false / 0 / '')\uBA74 \uC81C\uAC70\uD558\uC9C0 \uC54A\uB294\uB2E4. \uBC18\uD658\uAC12\uC740 \uADF8\uB300\uB85C \uD1B5\uACFC.\n * \uC120\uD0DD\uC790\uC5D0 \uB9DE\uB294 \uCCAB \uBC88\uC9F8 \uC5D8\uB9AC\uBA3C\uD2B8\uB97C \uC9C0\uC6B4\uB2E4. \uC120\uD0DD\uC790\uAC00 \uC5C6\uAC70\uB098 '$this' \uBA74 \uC790\uAE30 \uC790\uC2E0\uC744 \uC9C0\uC6B4\uB2E4.\n *\n * - @removeNode('.toast') / @removeNode('.toast', { valueKey: 'close' })\n * - @removeNode({ valueKey: 'done' }) ($this)\n * - @removeNode ($this, bare)\n */\nexport function removeNode(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function removeNode(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function removeNode(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function removeNode(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'remove'})(selectorOrOptions as Object, maybeOptions, descriptor);\n }\n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'remove'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'remove'});\n}\n\n/**\n * @innerHtmlNode decorator - sets innerHTML of target element\n * \n * Overloads:\n * - innerHtmlNode(selector, options) - Set innerHTML of specific selector\n * - innerHtmlNode(options) - Set innerHTML of $this (current element)\n * - @innerHtmlNode - Bare decorator, sets innerHTML of $this\n */\nexport function innerHtml(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtml(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerHtml'});\n}\n\n// Alias for innerHtmlNode\n// export const setHtmlNode = innerHtml;\n\n/**\n * @innerHtmlLightNode decorator - sets innerHTML of light DOM element\n * \n * Overloads:\n * - innerHtmlLightNode(selector, options) - Set innerHTML of specific selector in light DOM\n * - innerHtmlLightNode(options) - Set innerHTML of $this in light DOM\n * - @innerHtmlLightNode - Bare decorator, sets innerHTML of $this in light DOM\n */\nexport function innerHtmlLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'light'});\n}\n\n\n/**\n * @innerHtmlShadowNode decorator - sets innerHTML of shadow DOM element\n * \n * Overloads:\n * - innerHtmlShadowNode(selector, options) - Set innerHTML of specific selector in shadow DOM\n * - innerHtmlShadowNode(options) - Set innerHTML of $this in shadow DOM\n * - @innerHtmlShadowNode - Bare decorator, sets innerHTML of $this in shadow DOM\n */\nexport function innerHtmlShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerHtmlShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerHtmlShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerHtmlShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerHtml', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerHtml', root: 'shadow'});\n}\n\n\n/**\n * @innerTextNode decorator - sets innerText of target element\n * \n * Overloads:\n * - innerTextNode(selector, options) - Set innerText of specific selector\n * - innerTextNode(options) - Set innerText of $this (current element)\n * - @innerTextNode - Bare decorator, sets innerText of $this\n */\nexport function innerText(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function innerText(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerText(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'innerText'});\n}\n\n\n/**\n * @innerTextLightNode decorator - sets innerText of light DOM element\n * \n * Overloads:\n * - innerTextLightNode(selector, options) - Set innerText of specific selector in light DOM\n * - innerTextLightNode(options) - Set innerText of $this in light DOM\n * - @innerTextLightNode - Bare decorator, sets innerText of $this in light DOM\n */\nexport function innerTextLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'light'});\n}\n\n/**\n * @innerTextShadowNode decorator - sets innerText of shadow DOM element\n * \n * Overloads:\n * - innerTextShadowNode(selector, options) - Set innerText of specific selector in shadow DOM\n * - innerTextShadowNode(options) - Set innerText of $this in shadow DOM\n * - @innerTextShadowNode - Bare decorator, sets innerText of $this in shadow DOM\n */\nexport function innerTextShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function innerTextShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function innerTextShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @innerTextShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'innerText', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'innerText', root: 'shadow'});\n}\n\n/**\n * @beforeEndNode decorator - appends nodes to target element\n * \n * Overloads:\n * - beforeEndNode(selector, options) - Append to specific selector\n * - beforeEndNode(options) - Append to $this (current element)\n * - @beforeEndNode - Bare decorator, appends to $this\n */\nexport function insertBeforeEnd(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertBeforeEnd(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEnd(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'beforeEnd'});\n}\n\n\n/**\n * @beforeEndLightNode decorator - appends nodes to light DOM element\n * \n * Overloads:\n * - beforeEndLightNode(selector, options) - Append to specific selector in light DOM\n * - beforeEndLightNode(options) - Append to $this in light DOM\n * - @beforeEndLightNode - Bare decorator, appends to $this in light DOM\n */\nexport function insertBeforeEndLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'light'});\n}\n\n\n/**\n * @beforeEndShadowNode decorator - appends nodes to shadow DOM element\n * \n * Overloads:\n * - beforeEndShadowNode(selector, options) - Append to specific selector in shadow DOM\n * - beforeEndShadowNode(options) - Append to $this in shadow DOM\n * - @beforeEndShadowNode - Bare decorator, appends to $this in shadow DOM\n */\nexport function insertBeforeEndShadow(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertBeforeEndShadow(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertBeforeEndShadow(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @beforeEndShadowNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'beforeEnd', root: 'shadow'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'beforeEnd', root: 'shadow'});\n}\n\n\n/**\n * @afterBeginNode decorator - prepends nodes to target element\n * \n * Overloads:\n * - afterBeginNode(selector, options) - Prepend to specific selector\n * - afterBeginNode(options) - Prepend to $this (current element)\n * - @afterBeginNode - Bare decorator, prepends to $this\n */\nexport function insertAfterBegin(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(options: Omit<ApplyNodeOptions, 'position'>): MethodDecorator;\nexport function insertAfterBegin(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBegin(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position'>, position: 'afterBegin'});\n}\n\n\n/**\n * @afterBeginLightNode decorator - prepends nodes to light DOM element\n * \n * Overloads:\n * - afterBeginLightNode(selector, options) - Prepend to specific selector in light DOM\n * - afterBeginLightNode(options) - Prepend to $this in light DOM\n * - @afterBeginLightNode - Bare decorator, prepends to $this in light DOM\n */\nexport function insertAfterBeginLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function insertAfterBeginLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function insertAfterBeginLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @afterBeginLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'afterBegin', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'afterBegin', root: 'light'});\n}\n\n\n/**\n * @replaceChildrenLightNode decorator - replaces children of light DOM element\n * \n * Overloads:\n * - replaceChildrenLightNode(selector, options) - Replace children of specific selector in light DOM\n * - replaceChildrenLightNode(options) - Replace children of $this in light DOM\n * - @replaceChildrenLightNode - Bare decorator, replaces children of $this in light DOM\n */\nexport function replaceChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function replaceChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function replaceChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @replaceChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'replaceChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'replaceChildren', root: 'light'});\n}\n\n/**\n * @clearChildrenLightNode decorator - clears children of light DOM element\n * \n * Overloads:\n * - clearChildrenLightNode(selector, options) - Clear children of specific selector in light DOM\n * - clearChildrenLightNode(options) - Clear children of $this in light DOM\n * - @clearChildrenLightNode - Bare decorator, clears children of $this in light DOM\n */\nexport function clearChildrenLight(selector: ApplyNodeSelector, options?: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(options: Omit<ApplyNodeOptions, 'position' | 'root'>): MethodDecorator;\nexport function clearChildrenLight(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clearChildrenLight(selectorOrOptions?: ApplyNodeSelector | Omit<ApplyNodeOptions, 'position' | 'root'> | Object, maybeOptions?: Omit<ApplyNodeOptions, 'position' | 'root'> | string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n // Bare decorator usage: @clearChildrenLightNode\n if (descriptor !== undefined && (typeof maybeOptions === 'symbol' || typeof maybeOptions === 'string')) {\n return applyNode({position: 'clearChildren', root: 'light'})(selectorOrOptions, maybeOptions, descriptor);\n }\n \n if (typeof selectorOrOptions === 'string' || typeof selectorOrOptions === 'function') {\n return applyNode(selectorOrOptions as any, {...maybeOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n }\n return applyNode({...selectorOrOptions as Omit<ApplyNodeOptions, 'position' | 'root'>, position: 'clearChildren', root: 'light'});\n}\n\n\n\n\n// \u2500\u2500\u2500 Aliases \u2500\u2500\u2500\nexport const apply = applyNode;\nexport const node = applyNode;\n\n// \u2500\u2500\u2500 \uD3B8\uC758 \uD5EC\uD37C (selector/root \uC0DD\uB7B5) \u2500\u2500\u2500\n\nexport function applyAppHost(options: ApplyNodeQueryOptions): MethodDecorator;\nexport function applyAppHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function applyAppHost(optionsOrTarget?: ApplyNodeQueryOptions | Object, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | PropertyDescriptor | void {\n if ((typeof propertyKey === 'string' || typeof propertyKey === 'symbol') && descriptor !== undefined) {\n return (applyNode('$appHost', {}) as any)(optionsOrTarget, propertyKey, descriptor);\n }\n return applyNode('$appHost', optionsOrTarget as ApplyNodeQueryOptions);\n}\nexport function applyLight(selector: string, options?: Omit<ApplyNodeQueryOptions, 'root'>): MethodDecorator {\n return applyNode(selector, {...options ?? {}, root: 'light'});\n}\nexport function applyShadow(selector: string, options?: Omit<ApplyNodeQueryOptions, 'root'>): MethodDecorator {\n return applyNode(selector, {...options ?? {}, root: 'shadow'});\n}\nexport function applyAll(selector: string, options?: Omit<ApplyNodeQueryOptions, 'root'>): MethodDecorator {\n return applyNode(selector, {...options ?? {}, root: 'all'});\n}\n\nexport const findAllApplyNodeMetadata = (target: any): Map<string | symbol, ApplyNodeMetadata> => {\n const result = new Map<string | symbol, ApplyNodeMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ApplyNodeMetadata>>(APPLY_NODE_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};\n// \u2500\u2500\u2500 filter \uC720\uD2F8 (applyNode/replace*/innerHtml* options.filter\uC6A9) \u2500\u2500\u2500\n// filter\uB294 true \uBC18\uD658 \uC2DC \uC801\uC6A9, false \uBC18\uD658 \uC2DC \uC2A4\uD0B5.\n\nconst filterScopeOf = (target: HTMLElement | ShadowRoot): Element | null => {\n if (target && typeof (target as HTMLElement).querySelector === 'function') {\n return target as unknown as Element;\n }\n const host = (target as ShadowRoot)?.host as unknown as Element | undefined;\n return host && typeof host.querySelector === 'function' ? host : null;\n};\n\nconst tagNameOf = (node: any): string | null => {\n const tag = node?.tagName;\n return typeof tag === 'string' ? tag.toLowerCase() : null;\n};\n\n// \uC0C8 \uB178\uB4DC\uC640 \uAC19\uC740 \uD0DC\uADF8\uAC00 target \uC548\uC5D0 \uC774\uBBF8 \uC788\uC73C\uBA74 \uC2A4\uD0B5 (SSR adopting\uC6A9).\nexport const skipIfSameTagPresent = (target: HTMLElement | ShadowRoot, newValue: any): boolean => {\n const nodes = (Array.isArray(newValue) ? newValue : [newValue]).filter((n) => tagNameOf(n) !== null);\n if (nodes.length === 0) return true;\n const scope = filterScopeOf(target);\n if (!scope) return true;\n return !nodes.some((n) => scope.querySelector(tagNameOf(n)!));\n};\n\n// \uC9C0\uC815 selector\uAC00 target \uC548\uC5D0 \uC774\uBBF8 \uC788\uC73C\uBA74 \uC2A4\uD0B5 (\uAC19\uC740 path \uCFFC\uB9AC \uBCC0\uACBD \uC2DC \uD398\uC774\uC9C0 \uC7AC\uC0DD\uC131 \uBC29\uC9C0\uC6A9).\n// \uC0AC\uC6A9: @innerHtmlLight({ filter: skipIfExists('center-math-page') })\nexport const skipIfExists = (selector: string) =>\n (target: HTMLElement | ShadowRoot): boolean => {\n const scope = filterScopeOf(target);\n if (!scope) return true;\n return !scope.querySelector(selector);\n };\n\n// \uC0C8 \uAC12\uC774 \uBE44\uC5B4\uC788\uC73C\uBA74 \uC2A4\uD0B5 (null/''/\uBE48 \uBC30\uC5F4).\nexport const skipIfEmpty = (_target: HTMLElement | ShadowRoot, newValue: any): boolean => {\n if (newValue === null || newValue === undefined || newValue === false) return false;\n if (typeof newValue === 'string') return newValue.trim().length > 0;\n if (Array.isArray(newValue)) return newValue.length > 0;\n return true;\n};\n\n// \uD14D\uC2A4\uD2B8\uAC00 \uB2EC\uB77C\uC9C8 \uB54C\uB9CC \uC801\uC6A9 (\uD3F4\uB9C1 \uAC31\uC2E0\uC6A9).\nexport const applyIfChanged = (target: HTMLElement | ShadowRoot, newValue: any): boolean => {\n const textOf = (v: any): string => {\n if (typeof v === 'string') return v;\n if (Array.isArray(v)) return v.map(textOf).join('');\n return typeof v?.textContent === 'string' ? v.textContent : '';\n };\n const current = typeof (target as HTMLElement)?.textContent === 'string' ? (target as HTMLElement).textContent! : '';\n return current !== textOf(newValue);\n};\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAE3B,SAAS,gBAAe;AACxB,SAAQ,4BAA2B;AACnC,SAAQ,oBAAmB;AAsCpB,MAAM,0BAA0B,OAAO,IAAI,iCAAiC;AAMnF,MAAM,kBAAkB,CAAC,UAA6B,MAAW,QAA6C;AAC5G,MAAI,OAAO,aAAa,YAAY;AAClC,UAAM,UAAU,SAAS,oBAAoB,IAAI;AACjD,UAAM,SAAS,SAAS,MAAM,OAAO;AAErC,QAAI,kBAAkB,IAAI,SAAS;AACjC,aAAO;AAAA,IACT;AACA,QAAI,kBAAkB,IAAI,UAAU;AAClC,aAAO,OAAO,SAAS,IAAK,OAAO,CAAC,IAAoB;AAAA,IAC1D;AACA,QAAI,MAAM,QAAQ,MAAM,GAAG;AACzB,aAAO,OAAO,SAAS,IAAK,OAAO,CAAC,IAAoB;AAAA,IAC1D;AACA,QAAI,WAAW,MAAM;AACnB,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAUA,MAAM,aAAa,CAAC,aAAkB,UAAuB,KAAmD,KAAwB,KAAa,SAAe;AAClK,MAAI,CAAC,SAAU;AAGf,MAAI,QAAQ,iBAAiB;AAC3B,aAAS,gBAAgB;AACzB,WAAO,CAAC;AAAA,EACV;AAGA,MAAI,QAAQ,UAAU;AACpB,KAAC,oBAAoB,IAAI,aAAc,SAAiB,OAAO,UAAU,OAAO;AAChF,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,MAAM,IAAI;AAChB,QAAM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,aAAa,MAAO,QAAO;AAC9E,MAAI,OAAO,aAAa,SAAU,QAAO,SAAS,KAAK,EAAE,SAAS;AAClE,MAAI,MAAM,QAAQ,QAAQ,EAAG,QAAO,SAAS,SAAS;AACtD,SAAO;AACT;AAGO,MAAM,iBAAiB,CAAC,QAAkC,aAA2B;AAC1F,QAAM,SAAS,CAAC,MAAmB;AACjC,QAAI,OAAO,MAAM,SAAU,QAAO;AAClC,QAAI,MAAM,QAAQ,CAAC,EAAG,QAAO,EAAE,IAAI,MAAM,EAAE,KAAK,EAAE;AAClD,WAAO,OAAO,GAAG,gBAAgB,WAAW,EAAE,cAAc;AAAA,EAC9D;AACA,QAAM,UAAU,OAAQ,QAAwB,gBAAgB,WAAY,OAAuB,cAAe;AAClH,SAAO,YAAY,OAAO,QAAQ;AACpC;",
6
6
  "names": ["node"]
7
7
  }
@@ -25,7 +25,7 @@ const startFrameLoop = (win, entries, frameFn) => {
25
25
  };
26
26
  const applyRequestAnimationFrame = (options, target, propertyKey, descriptor) => {
27
27
  const constructor = target.constructor;
28
- const normalizedOptions = { ...options, type: options.type ?? "returnValue" };
28
+ const normalizedOptions = { ...options, type: options.type ?? "onConnected" };
29
29
  let metaList = ReflectUtils.getOwnMetadata(REQUEST_ANIMATION_FRAME_METADATA_KEY, constructor);
30
30
  if (!metaList) {
31
31
  metaList = [];
@@ -87,10 +87,18 @@ class RequestAnimationFrameLifeCycler {
87
87
  inst.__swc_requestAnimationFrameIds = [];
88
88
  }
89
89
  }
90
+ function requestAnimationFrameReturnValue(optionsOrTarget, propertyKey, descriptor) {
91
+ if (propertyKey !== void 0) {
92
+ applyRequestAnimationFrame({ type: "returnValue" }, optionsOrTarget, propertyKey, descriptor);
93
+ return;
94
+ }
95
+ return (target, propertyKey2, descriptor2) => applyRequestAnimationFrame({ ...optionsOrTarget ?? {}, type: "returnValue" }, target, propertyKey2, descriptor2);
96
+ }
90
97
  export {
91
98
  REQUEST_ANIMATION_FRAME_METADATA_KEY,
92
99
  RequestAnimationFrameLifeCycler,
93
100
  findAllRequestAnimationFrameMetadata,
94
- requestAnimationFrame
101
+ requestAnimationFrame,
102
+ requestAnimationFrameReturnValue
95
103
  };
96
104
  //# sourceMappingURL=requestAnimationFrame.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/requestAnimationFrame.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { ElementDefineLifeCycler, HelperHostSet } from '../types';\n\nexport const REQUEST_ANIMATION_FRAME_METADATA_KEY = Symbol.for('simple-web-component:request-animation-frame');\n\nexport type RequestAnimationFrameType = 'onConnected' | 'returnValue';\n\nexport interface RequestAnimationFrameOptions {\n /**\n * 'onConnected' - connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uB8E8\uD504 \uC2DC\uC791 (\uB9E4 \uD504\uB808\uC784 \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C), disconnect \uC2DC \uC790\uB3D9 \uC815\uB9AC.\n * 'returnValue'(\uAE30\uBCF8\uAC12) - \uC790\uB3D9 \uC2DC\uC791 \uC5C6\uC74C. \uAC1C\uBC1C\uC790\uAC00 \uC774 \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC2DC\uC791\uB418\uACE0,\n * \uADF8 \uD638\uCD9C\uC758 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uC2E4\uC81C\uB85C \uB9E4 \uD504\uB808\uC784 \uD638\uCD9C\uB420 \uD568\uC218\uAC00 \uB41C\uB2E4.\n */\n type?: RequestAnimationFrameType;\n /** \uB8E8\uD504 \uC2DC\uC791 \uC9C1\uD6C4 1\uD68C \uD638\uCD9C (\uB514\uBC84\uAE45/\uB85C\uAE45\uC6A9). id\uB294 \uCCAB requestAnimationFrame \uBC18\uD658\uAC12 - cleanup\uC740 \uC790\uB3D9\uC73C\uB85C \uCC98\uB9AC\uB418\uBBC0\uB85C \uC9C1\uC811 \uCDE8\uC18C\uD560 \uD544\uC694 \uC5C6\uC74C. */\n created?: (set: HelperHostSet, id: number) => void;\n /**\n * type:'returnValue' \uC804\uC6A9 - \uB9AC\uD134\uAC12\uC774 \uD568\uC218\uBA74 \uADF8 \uC790\uCCB4\uB97C, \uAC1D\uCCB4\uBA74 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC77C \uB54C \uADF8 \uAC12\uC744\n * \"\uB9E4 \uD504\uB808\uC784 \uD638\uCD9C\uB420 \uD568\uC218\"\uB85C \uC0AC\uC6A9\uD55C\uB2E4. \uC548 \uC8FC\uBA74 REQUEST_ANIMATION_FRAME_METADATA_KEY\uB85C \uD3F4\uBC31\uD55C\uB2E4 -\n * applyAttribute.ts/applyNode.ts\uC758 valueKey\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158.\n */\n valueKey?: symbol | string;\n}\n\nexport interface RequestAnimationFrameMetadata {\n propertyKey: string | symbol;\n options: RequestAnimationFrameOptions;\n}\n\n/**\n * \uD504\uB808\uC784 \uCF5C\uBC31 \uC2DC\uADF8\uB2C8\uCC98.\n * - timestamp: \uC774\uBC88 \uD504\uB808\uC784\uC758 \uC2DC\uAC01 (requestAnimationFrame\uC774 \uB118\uACA8\uC8FC\uB294 \uAC12)\n * - prevValue: \uC9C1\uC804 \uD638\uCD9C\uC774 \uB9AC\uD134\uD55C \uAC12 (\uCCAB \uD638\uCD9C\uC5D0\uC11C\uB294 undefined)\n * \uB9AC\uD134\uAC12\uC774 undefined/null\uC774\uBA74 \uB2E4\uC74C \uD504\uB808\uC784\uC744 \uC608\uC57D\uD558\uC9C0 \uC54A\uACE0 \uB8E8\uD504\uAC00 \uBA48\uCD98\uB2E4 (\uAC1C\uBC1C\uC790\uAC00 \uC885\uB8CC\uB97C \uC81C\uC5B4).\n * undefined/null\uC774 \uC544\uB2CC \uAC12\uC744 \uB9AC\uD134\uD558\uBA74 \uADF8 \uAC12 \uADF8\uB300\uB85C \uB2E4\uC74C \uD638\uCD9C\uC758 prevValue\uB85C \uC804\uB2EC\uB41C\uB2E4.\n */\nexport type FrameCallback = (timestamp: number, prevValue?: any) => any;\n\nconst getActiveEntries = (inst: any): number[] => (inst.__swc_requestAnimationFrameIds ??= []);\n\nconst startFrameLoop = (win: Window, entries: number[], frameFn: FrameCallback): number => {\n let currentId = 0;\n const step = (timestamp: number, prevValue?: any) => {\n const idx = entries.indexOf(currentId);\n if (idx >= 0) entries.splice(idx, 1);\n let result: any;\n try {\n result = frameFn(timestamp, prevValue);\n } catch (e) {\n console.error('[SWC] requestAnimationFrame callback error:', e);\n return;\n }\n if (result === undefined || result === null) return; // \uAC1C\uBC1C\uC790\uAC00 \uC885\uB8CC\uB97C \uC2E0\uD638\uD568 - \uB2E4\uC74C \uD504\uB808\uC784 \uC608\uC57D \uC548 \uD568\n currentId = win.requestAnimationFrame(ts => step(ts, result));\n entries.push(currentId);\n };\n currentId = win.requestAnimationFrame(ts => step(ts, undefined));\n entries.push(currentId);\n return currentId;\n};\n\nconst applyRequestAnimationFrame = (options: RequestAnimationFrameOptions, target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor | void => {\n const constructor = target.constructor;\n const normalizedOptions: RequestAnimationFrameOptions = { ...options, type: options.type ?? 'returnValue' };\n\n let metaList = ReflectUtils.getOwnMetadata(REQUEST_ANIMATION_FRAME_METADATA_KEY, constructor) as RequestAnimationFrameMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(REQUEST_ANIMATION_FRAME_METADATA_KEY, metaList, constructor);\n }\n metaList.push({ propertyKey, options: normalizedOptions });\n\n if (normalizedOptions.type === 'onConnected' || !descriptor) {\n return; // LifeCycler\uAC00 connect/disconnect\uB97C \uC804\uB2F4 - wrapping \uBD88\uD544\uC694\n }\n\n const original = descriptor.value;\n descriptor.value = function (this: any, ...args: any[]) {\n const res = original.apply(this, args);\n // valueKey\uB97C \uC548 \uC8FC\uBA74 \uC774 \uB370\uCF54\uB808\uC774\uD130 \uC804\uC6A9 METADATA_KEY\uB85C \uD3F4\uBC31 (applyAttribute.ts/applyNode.ts\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158)\n const vk = normalizedOptions.valueKey ?? REQUEST_ANIMATION_FRAME_METADATA_KEY;\n const frameFn: FrameCallback | undefined =\n typeof res === 'function' ? res : res && typeof res === 'object' && typeof res[vk] === 'function' ? res[vk] : undefined;\n\n if (frameFn) {\n ensureInit(this);\n const win = SwcUtils.resolveWindow(this);\n const id = startFrameLoop(win, getActiveEntries(this), frameFn);\n normalizedOptions.created?.(SwcUtils.getHelperAndHostSet(this), id);\n }\n return res;\n };\n return descriptor;\n};\n\n/**\n * type:'onConnected' - connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uB9E4 \uD504\uB808\uC784 \uB8E8\uD504\uB97C \uC2DC\uC791\uD558\uACE0, disconnect \uC2DC \uC790\uB3D9\uC73C\uB85C cancelAnimationFrame \uD55C\uB2E4.\n * type:'returnValue'(\uAE30\uBCF8\uAC12) - \uBA54\uC11C\uB4DC\uB97C \uAC10\uC2F8\uC9C0 \uC54A\uB294 \uB300\uC2E0, \uD638\uCD9C\uB420 \uB54C\uB9C8\uB2E4(\uAC1C\uBC1C\uC790\uAC00 \uC9C1\uC811 \uD638\uCD9C) \uC6D0\uBCF8 \uB85C\uC9C1\uC744\n * \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uACE0 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uD568\uC218\uBA74 \uADF8 \uD568\uC218\uB97C \uB9E4 \uD504\uB808\uC784 \uD638\uCD9C\uB418\uB294 \uB8E8\uD504\uB85C \uB4F1\uB85D\uD55C\uB2E4.\n * \uC6D0\uBCF8 \uB9AC\uD134\uAC12\uC740 \uADF8\uB300\uB85C \uD1B5\uACFC\uC2DC\uD0A4\uBBC0\uB85C \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0 \uC2A4\uD0DD\uD574\uB3C4 \uC21C\uC11C\uC5D0 \uC0C1\uAD00\uC5C6\uC774 \uC548\uC804\uD558\uB2E4.\n *\n * \uC635\uC158 \uC5C6\uC774 `@requestAnimationFrame` \uADF8\uB300\uB85C \uBD99\uC5EC\uB3C4 \uB418\uACE0, `@requestAnimationFrame({...})`\uCC98\uB7FC \uC635\uC158\uC744 \uC904 \uC218\uB3C4 \uC788\uB2E4.\n */\nexport function requestAnimationFrame(options: RequestAnimationFrameOptions): MethodDecorator;\nexport function requestAnimationFrame(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function requestAnimationFrame(optionsOrTarget?: RequestAnimationFrameOptions | Object, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey !== undefined) {\n // \uC635\uC158 \uC5C6\uC774: @requestAnimationFrame\n applyRequestAnimationFrame({}, optionsOrTarget as Object, propertyKey, descriptor);\n return;\n }\n // \uC635\uC158\uACFC \uD568\uAED8: @requestAnimationFrame({...})\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n return applyRequestAnimationFrame((optionsOrTarget as RequestAnimationFrameOptions) ?? {}, target, propertyKey, descriptor);\n };\n}\n\nexport const findAllRequestAnimationFrameMetadata = (target: any): RequestAnimationFrameMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return (ReflectUtils.findAllMetadata<RequestAnimationFrameMetadata[]>(REQUEST_ANIMATION_FRAME_METADATA_KEY, constructor) || []).flat();\n};\n\nexport class RequestAnimationFrameLifeCycler implements ElementDefineLifeCycler {\n onConnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n inst.__swc_requestAnimationFrameIds = []; // \uC7AC\uC5F0\uACB0 \uB300\uBE44 \uB9AC\uC14B\n const entries = getActiveEntries(inst);\n for (const meta of findAllRequestAnimationFrameMetadata(inst)) {\n if (meta.options.type !== 'onConnected') continue; // returnValue \uD0C0\uC785\uC740 \uC218\uB3D9 \uD638\uCD9C\uC744 \uAE30\uB2E4\uB9BC\n const frameFn: FrameCallback = (timestamp, prevValue) => inst[meta.propertyKey](timestamp, prevValue);\n const id = startFrameLoop(helperHostSet.$w, entries, frameFn);\n meta.options.created?.(helperHostSet, id);\n }\n }\n\n onDisconnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n for (const id of inst.__swc_requestAnimationFrameIds ?? []) {\n try {\n helperHostSet.$w.cancelAnimationFrame(id);\n } catch (e) {\n console.error('[SWC] cancelAnimationFrame error:', e);\n }\n }\n inst.__swc_requestAnimationFrameIds = [];\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAGlB,MAAM,uCAAuC,OAAO,IAAI,8CAA8C;AAmC7G,MAAM,mBAAmB,CAAC,SAAyB,KAAK,mCAAL,KAAK,iCAAmC,CAAC;AAE5F,MAAM,iBAAiB,CAAC,KAAa,SAAmB,YAAmC;AACzF,MAAI,YAAY;AAChB,QAAM,OAAO,CAAC,WAAmB,cAAoB;AACnD,UAAM,MAAM,QAAQ,QAAQ,SAAS;AACrC,QAAI,OAAO,EAAG,SAAQ,OAAO,KAAK,CAAC;AACnC,QAAI;AACJ,QAAI;AACF,eAAS,QAAQ,WAAW,SAAS;AAAA,IACvC,SAAS,GAAG;AACV,cAAQ,MAAM,+CAA+C,CAAC;AAC9D;AAAA,IACF;AACA,QAAI,WAAW,UAAa,WAAW,KAAM;AAC7C,gBAAY,IAAI,sBAAsB,QAAM,KAAK,IAAI,MAAM,CAAC;AAC5D,YAAQ,KAAK,SAAS;AAAA,EACxB;AACA,cAAY,IAAI,sBAAsB,QAAM,KA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AAiD;AACpG,QAAM,cAAc,OAAO,WAAW,aAAa,SAAS,OAAO;AACnE,UAAQ,aAAa,gBAAiD,sCAAsC,WAAW,KAAK,CAAC,GAAG,KAAK;AACvI;AAEO,MAAM,gCAAmE;AAAA,EAC9E,YAAY,eAAoC;AAC9C,UAAM,OAAO,cAAc;AAC3B,SAAK,iCAAiC,CAAC;AACvC,UAAM,UAAU,iBAAiB,IAAI;AACrC,eAAW,QAAQ,qCAAqC,IAAI,GAAG;AAC7D,UAAI,KAAK,QAAQ,SAAS,cAAe;AACzC,YAAM,UAAyB,CAAC,WAAW,cAAc,KAAK,KAAK,WAAW,EAAE,WAAW,SAAS;AACpG,YAAM,KAAK,eAAe,cAAc,IAAI,SAAS,OAAO;AAC5D,WAAK,QAAQ,UAAU,eAAe,EAAE;AAAA,IAC1C;AAAA,EACF;AAAA,EAEA,eAAe,eAAoC;AACjD,UAAM,OAAO,cAAc;AAC3B,eAAW,MAAM,KAAK,kCAAkC,CAAC,GAAG;AAC1D,UAAI;AACF,sBAAc,GAAG,qBAAqB,EAAE;AAAA,MAC1C,SAAS,GAAG;AACV,gBAAQ,MAAM,qCAAqC,CAAC;AAAA,MACtD;AAAA,IACF;AACA,SAAK,iCAAiC,CAAC;AAAA,EACzC;AACF;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { ElementDefineLifeCycler, HelperHostSet } from '../types';\n\nexport const REQUEST_ANIMATION_FRAME_METADATA_KEY = Symbol.for('simple-web-component:request-animation-frame');\n\nexport type RequestAnimationFrameType = 'onConnected' | 'returnValue';\n\nexport interface RequestAnimationFrameOptions {\n /**\n * 'onConnected'(\uAE30\uBCF8\uAC12) - connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uB8E8\uD504 \uC2DC\uC791 (\uB9E4 \uD504\uB808\uC784 \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C), disconnect \uC2DC \uC790\uB3D9 \uC815\uB9AC.\n * 'returnValue' - \uC790\uB3D9 \uC2DC\uC791 \uC5C6\uC74C. \uAC1C\uBC1C\uC790\uAC00 \uC774 \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC2DC\uC791\uB418\uACE0,\n * \uADF8 \uD638\uCD9C\uC758 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uC2E4\uC81C\uB85C \uB9E4 \uD504\uB808\uC784 \uD638\uCD9C\uB420 \uD568\uC218\uAC00 \uB41C\uB2E4.\n */\n type?: RequestAnimationFrameType;\n /** \uB8E8\uD504 \uC2DC\uC791 \uC9C1\uD6C4 1\uD68C \uD638\uCD9C (\uB514\uBC84\uAE45/\uB85C\uAE45\uC6A9). id\uB294 \uCCAB requestAnimationFrame \uBC18\uD658\uAC12 - cleanup\uC740 \uC790\uB3D9\uC73C\uB85C \uCC98\uB9AC\uB418\uBBC0\uB85C \uC9C1\uC811 \uCDE8\uC18C\uD560 \uD544\uC694 \uC5C6\uC74C. */\n created?: (set: HelperHostSet, id: number) => void;\n /**\n * type:'returnValue' \uC804\uC6A9 - \uB9AC\uD134\uAC12\uC774 \uD568\uC218\uBA74 \uADF8 \uC790\uCCB4\uB97C, \uAC1D\uCCB4\uBA74 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC77C \uB54C \uADF8 \uAC12\uC744\n * \"\uB9E4 \uD504\uB808\uC784 \uD638\uCD9C\uB420 \uD568\uC218\"\uB85C \uC0AC\uC6A9\uD55C\uB2E4. \uC548 \uC8FC\uBA74 REQUEST_ANIMATION_FRAME_METADATA_KEY\uB85C \uD3F4\uBC31\uD55C\uB2E4 -\n * applyAttribute.ts/applyNode.ts\uC758 valueKey\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158.\n */\n valueKey?: symbol | string;\n}\n\nexport interface RequestAnimationFrameMetadata {\n propertyKey: string | symbol;\n options: RequestAnimationFrameOptions;\n}\n\n/**\n * \uD504\uB808\uC784 \uCF5C\uBC31 \uC2DC\uADF8\uB2C8\uCC98.\n * - timestamp: \uC774\uBC88 \uD504\uB808\uC784\uC758 \uC2DC\uAC01 (requestAnimationFrame\uC774 \uB118\uACA8\uC8FC\uB294 \uAC12)\n * - prevValue: \uC9C1\uC804 \uD638\uCD9C\uC774 \uB9AC\uD134\uD55C \uAC12 (\uCCAB \uD638\uCD9C\uC5D0\uC11C\uB294 undefined)\n * \uB9AC\uD134\uAC12\uC774 undefined/null\uC774\uBA74 \uB2E4\uC74C \uD504\uB808\uC784\uC744 \uC608\uC57D\uD558\uC9C0 \uC54A\uACE0 \uB8E8\uD504\uAC00 \uBA48\uCD98\uB2E4 (\uAC1C\uBC1C\uC790\uAC00 \uC885\uB8CC\uB97C \uC81C\uC5B4).\n * undefined/null\uC774 \uC544\uB2CC \uAC12\uC744 \uB9AC\uD134\uD558\uBA74 \uADF8 \uAC12 \uADF8\uB300\uB85C \uB2E4\uC74C \uD638\uCD9C\uC758 prevValue\uB85C \uC804\uB2EC\uB41C\uB2E4.\n */\nexport type FrameCallback = (timestamp: number, prevValue?: any) => any;\n\nconst getActiveEntries = (inst: any): number[] => (inst.__swc_requestAnimationFrameIds ??= []);\n\nconst startFrameLoop = (win: Window, entries: number[], frameFn: FrameCallback): number => {\n let currentId = 0;\n const step = (timestamp: number, prevValue?: any) => {\n const idx = entries.indexOf(currentId);\n if (idx >= 0) entries.splice(idx, 1);\n let result: any;\n try {\n result = frameFn(timestamp, prevValue);\n } catch (e) {\n console.error('[SWC] requestAnimationFrame callback error:', e);\n return;\n }\n if (result === undefined || result === null) return; // \uAC1C\uBC1C\uC790\uAC00 \uC885\uB8CC\uB97C \uC2E0\uD638\uD568 - \uB2E4\uC74C \uD504\uB808\uC784 \uC608\uC57D \uC548 \uD568\n currentId = win.requestAnimationFrame(ts => step(ts, result));\n entries.push(currentId);\n };\n currentId = win.requestAnimationFrame(ts => step(ts, undefined));\n entries.push(currentId);\n return currentId;\n};\n\nconst applyRequestAnimationFrame = (options: RequestAnimationFrameOptions, target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor | void => {\n const constructor = target.constructor;\n const normalizedOptions: RequestAnimationFrameOptions = { ...options, type: options.type ?? 'onConnected' };\n\n let metaList = ReflectUtils.getOwnMetadata(REQUEST_ANIMATION_FRAME_METADATA_KEY, constructor) as RequestAnimationFrameMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(REQUEST_ANIMATION_FRAME_METADATA_KEY, metaList, constructor);\n }\n metaList.push({ propertyKey, options: normalizedOptions });\n\n if (normalizedOptions.type === 'onConnected' || !descriptor) {\n return; // LifeCycler\uAC00 connect/disconnect\uB97C \uC804\uB2F4 - wrapping \uBD88\uD544\uC694\n }\n\n const original = descriptor.value;\n descriptor.value = function (this: any, ...args: any[]) {\n const res = original.apply(this, args);\n // valueKey\uB97C \uC548 \uC8FC\uBA74 \uC774 \uB370\uCF54\uB808\uC774\uD130 \uC804\uC6A9 METADATA_KEY\uB85C \uD3F4\uBC31 (applyAttribute.ts/applyNode.ts\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158)\n const vk = normalizedOptions.valueKey ?? REQUEST_ANIMATION_FRAME_METADATA_KEY;\n const frameFn: FrameCallback | undefined =\n typeof res === 'function' ? res : res && typeof res === 'object' && typeof res[vk] === 'function' ? res[vk] : undefined;\n\n if (frameFn) {\n ensureInit(this);\n const win = SwcUtils.resolveWindow(this);\n const id = startFrameLoop(win, getActiveEntries(this), frameFn);\n normalizedOptions.created?.(SwcUtils.getHelperAndHostSet(this), id);\n }\n return res;\n };\n return descriptor;\n};\n\n/**\n * type:'onConnected'(\uAE30\uBCF8\uAC12) - connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uB9E4 \uD504\uB808\uC784 \uB8E8\uD504\uB97C \uC2DC\uC791\uD558\uACE0, disconnect \uC2DC \uC790\uB3D9\uC73C\uB85C cancelAnimationFrame \uD55C\uB2E4.\n * type:'returnValue' (@requestAnimationFrameReturnValue) - \uBA54\uC11C\uB4DC\uB97C \uAC10\uC2F8\uC9C0 \uC54A\uB294 \uB300\uC2E0, \uD638\uCD9C\uB420 \uB54C\uB9C8\uB2E4(\uAC1C\uBC1C\uC790\uAC00 \uC9C1\uC811 \uD638\uCD9C) \uC6D0\uBCF8 \uB85C\uC9C1\uC744\n * \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uACE0 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uD568\uC218\uBA74 \uADF8 \uD568\uC218\uB97C \uB9E4 \uD504\uB808\uC784 \uD638\uCD9C\uB418\uB294 \uB8E8\uD504\uB85C \uB4F1\uB85D\uD55C\uB2E4.\n * \uC6D0\uBCF8 \uB9AC\uD134\uAC12\uC740 \uADF8\uB300\uB85C \uD1B5\uACFC\uC2DC\uD0A4\uBBC0\uB85C \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0 \uC2A4\uD0DD\uD574\uB3C4 \uC21C\uC11C\uC5D0 \uC0C1\uAD00\uC5C6\uC774 \uC548\uC804\uD558\uB2E4.\n *\n * \uC635\uC158 \uC5C6\uC774 `@requestAnimationFrame` \uADF8\uB300\uB85C \uBD99\uC5EC\uB3C4 \uB418\uACE0, `@requestAnimationFrame({...})`\uCC98\uB7FC \uC635\uC158\uC744 \uC904 \uC218\uB3C4 \uC788\uB2E4.\n */\nexport function requestAnimationFrame(options: RequestAnimationFrameOptions): MethodDecorator;\nexport function requestAnimationFrame(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function requestAnimationFrame(optionsOrTarget?: RequestAnimationFrameOptions | Object, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey !== undefined) {\n // \uC635\uC158 \uC5C6\uC774: @requestAnimationFrame\n applyRequestAnimationFrame({}, optionsOrTarget as Object, propertyKey, descriptor);\n return;\n }\n // \uC635\uC158\uACFC \uD568\uAED8: @requestAnimationFrame({...})\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n return applyRequestAnimationFrame((optionsOrTarget as RequestAnimationFrameOptions) ?? {}, target, propertyKey, descriptor);\n };\n}\n\nexport const findAllRequestAnimationFrameMetadata = (target: any): RequestAnimationFrameMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return (ReflectUtils.findAllMetadata<RequestAnimationFrameMetadata[]>(REQUEST_ANIMATION_FRAME_METADATA_KEY, constructor) || []).flat();\n};\n\nexport class RequestAnimationFrameLifeCycler implements ElementDefineLifeCycler {\n onConnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n inst.__swc_requestAnimationFrameIds = []; // \uC7AC\uC5F0\uACB0 \uB300\uBE44 \uB9AC\uC14B\n const entries = getActiveEntries(inst);\n for (const meta of findAllRequestAnimationFrameMetadata(inst)) {\n if (meta.options.type !== 'onConnected') continue; // returnValue \uD0C0\uC785\uC740 \uC218\uB3D9 \uD638\uCD9C\uC744 \uAE30\uB2E4\uB9BC\n const frameFn: FrameCallback = (timestamp, prevValue) => inst[meta.propertyKey](timestamp, prevValue);\n const id = startFrameLoop(helperHostSet.$w, entries, frameFn);\n meta.options.created?.(helperHostSet, id);\n }\n }\n\n onDisconnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n for (const id of inst.__swc_requestAnimationFrameIds ?? []) {\n try {\n helperHostSet.$w.cancelAnimationFrame(id);\n } catch (e) {\n console.error('[SWC] cancelAnimationFrame error:', e);\n }\n }\n inst.__swc_requestAnimationFrameIds = [];\n }\n}\n\n/** \uC218\uB3D9 \uC2DC\uC791: \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC2DC\uC791\uB418\uACE0, \uADF8 \uB9AC\uD134 \uD568\uC218\uAC00 \uB9E4 \uD504\uB808\uC784 \uB3C8\uB2E4. = @requestAnimationFrame({ type: 'returnValue' }) */\nexport function requestAnimationFrameReturnValue(options: Omit<RequestAnimationFrameOptions, 'type'>): MethodDecorator;\nexport function requestAnimationFrameReturnValue(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function requestAnimationFrameReturnValue(optionsOrTarget?: Omit<RequestAnimationFrameOptions, 'type'> | Object, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): MethodDecorator | void {\n if (propertyKey !== undefined) {\n applyRequestAnimationFrame({ type: 'returnValue' }, optionsOrTarget as Object, propertyKey, descriptor);\n return;\n }\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) =>\n applyRequestAnimationFrame({ ...((optionsOrTarget as RequestAnimationFrameOptions) ?? {}), type: 'returnValue' }, target, propertyKey, descriptor);\n}\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AAGlB,MAAM,uCAAuC,OAAO,IAAI,8CAA8C;AAmC7G,MAAM,mBAAmB,CAAC,SAAyB,KAAK,mCAAL,KAAK,iCAAmC,CAAC;AAE5F,MAAM,iBAAiB,CAAC,KAAa,SAAmB,YAAmC;AACzF,MAAI,YAAY;AAChB,QAAM,OAAO,CAAC,WAAmB,cAAoB;AACnD,UAAM,MAAM,QAAQ,QAAQ,SAAS;AACrC,QAAI,OAAO,EAAG,SAAQ,OAAO,KAAK,CAAC;AACnC,QAAI;AACJ,QAAI;AACF,eAAS,QAAQ,WAAW,SAAS;AAAA,IACvC,SAAS,GAAG;AACV,cAAQ,MAAM,+CAA+C,CAAC;AAC9D;AAAA,IACF;AACA,QAAI,WAAW,UAAa,WAAW,KAAM;AAC7C,gBAAY,IAAI,sBAAsB,QAAM,KAAK,IAAI,MAAM,CAAC;AAC5D,YAAQ,KAAK,SAAS;AAAA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,EAC5H;AACF;AAEO,MAAM,uCAAuC,CAAC,WAAiD;AACpG,QAAM,cAAc,OAAO,WAAW,aAAa,SAAS,OAAO;AACnE,UAAQ,aAAa,gBAAiD,sCAAsC,WAAW,KAAK,CAAC,GAAG,KAAK;AACvI;AAEO,MAAM,gCAAmE;AAAA,EAC9E,YAAY,eAAoC;AAC9C,UAAM,OAAO,cAAc;AAC3B,SAAK,iCAAiC,CAAC;AACvC,UAAM,UAAU,iBAAiB,IAAI;AACrC,eAAW,QAAQ,qCAAqC,IAAI,GAAG;AAC7D,UAAI,KAAK,QAAQ,SAAS,cAAe;AACzC,YAAM,UAAyB,CAAC,WAAW,cAAc,KAAK,KAAK,WAAW,EAAE,WAAW,SAAS;AACpG,YAAM,KAAK,eAAe,cAAc,IAAI,SAAS,OAAO;AAC5D,WAAK,QAAQ,UAAU,eAAe,EAAE;AAAA,IAC1C;AAAA,EACF;AAAA,EAEA,eAAe,eAAoC;AACjD,UAAM,OAAO,cAAc;AAC3B,eAAW,MAAM,KAAK,kCAAkC,CAAC,GAAG;AAC1D,UAAI;AACF,sBAAc,GAAG,qBAAqB,EAAE;AAAA,MAC1C,SAAS,GAAG;AACV,gBAAQ,MAAM,qCAAqC,CAAC;AAAA,MACtD;AAAA,IACF;AACA,SAAK,iCAAiC,CAAC;AAAA,EACzC;AACF;AAKO,SAAS,iCAAiC,iBAAuE,aAA+B,YAAyD;AAC9M,MAAI,gBAAgB,QAAW;AAC7B,+BAA2B,EAAE,MAAM,cAAc,GAAG,iBAA2B,aAAa,UAAU;AACtG;AAAA,EACF;AACA,SAAO,CAAC,QAAgBD,cAA8BC,gBACpD,2BAA2B,EAAE,GAAK,mBAAoD,CAAC,GAAI,MAAM,cAAc,GAAG,QAAQD,cAAaC,WAAU;AACrJ;",
6
6
  "names": ["propertyKey", "descriptor"]
7
7
  }
@@ -7,7 +7,7 @@ const getActiveEntries = (inst) => inst.__swc_intervalIds ?? (inst.__swc_interva
7
7
  function setInterval(interval, options = {}) {
8
8
  return (target, propertyKey, descriptor) => {
9
9
  const constructor = target.constructor;
10
- const normalizedOptions = { ...options, type: options.type ?? "returnValue" };
10
+ const normalizedOptions = { ...options, type: options.type ?? "onConnected" };
11
11
  let metaList = ReflectUtils.getOwnMetadata(SET_INTERVAL_METADATA_KEY, constructor);
12
12
  if (!metaList) {
13
13
  metaList = [];
@@ -97,10 +97,12 @@ class SetIntervalLifeCycler {
97
97
  inst.__swc_intervalIds = [];
98
98
  }
99
99
  }
100
+ const setIntervalReturnValue = (interval, options = {}) => setInterval(interval, { ...options, type: "returnValue" });
100
101
  export {
101
102
  SET_INTERVAL_METADATA_KEY,
102
103
  SetIntervalLifeCycler,
103
104
  findAllSetIntervalMetadata,
104
- setInterval
105
+ setInterval,
106
+ setIntervalReturnValue
105
107
  };
106
108
  //# sourceMappingURL=setInterval.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/setInterval.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { buildSwcParameterArgs } from './parameter';\nimport { ElementDefineLifeCycler, HelperHostSet } from '../types';\n\nexport const SET_INTERVAL_METADATA_KEY = Symbol.for('simple-web-component:set-interval');\n\nexport type SetIntervalType = 'onConnected' | 'returnValue';\n\nexport interface SetIntervalOptions {\n /**\n * 'onConnected' (connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uC2DC\uC791, disconnect \uC2DC \uC790\uB3D9 \uC815\uB9AC) |\n * 'returnValue' (\uAE30\uBCF8\uAC12 - \uC790\uB3D9 \uC2DC\uC791 \uC5C6\uC74C. \uAC1C\uBC1C\uC790\uAC00 \uC774 \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC2DC\uC791\uB418\uACE0,\n * \uADF8 \uD638\uCD9C\uC758 \uB9AC\uD134\uAC12\uC774 \uC2E4\uC81C\uB85C \uBC18\uBCF5 \uC2E4\uD589\uB420 \uD568\uC218\uAC00 \uB41C\uB2E4 - \uC544\uB798 \uC124\uBA85 \uCC38\uACE0).\n */\n type?: SetIntervalType;\n /** \uB9E4 tick\uB9C8\uB2E4 \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uC5D0 \uB118\uAE38 \uC778\uC790\uB97C \uACC4\uC0B0. type:'onConnected'\uC5D0\uC11C\uB9CC \uC758\uBBF8\uAC00 \uC788\uC74C (\uC5C6\uC73C\uBA74 \uC778\uC790 \uC5C6\uC774 \uD638\uCD9C). */\n parameter?: (set: HelperHostSet) => any[];\n /** \uD0C0\uC774\uBA38 \uB4F1\uB85D \uC9C1\uD6C4 1\uD68C \uD638\uCD9C (\uB514\uBC84\uAE45/\uB85C\uAE45\uC6A9). id\uB294 \uC2E4\uC81C setInterval \uBC18\uD658\uAC12 - cleanup\uC740 \uC790\uB3D9\uC73C\uB85C \uCC98\uB9AC\uB418\uBBC0\uB85C \uC9C1\uC811 clear\uD560 \uD544\uC694 \uC5C6\uC74C. */\n created?: (set: HelperHostSet, id: number) => void;\n /** [type:'onConnected' \uC804\uC6A9] \uB9E4 tick \uC2E4\uD589 \uC5EC\uBD80 \uAC8C\uC774\uD2B8. Promise<boolean>\uB3C4 \uAC00\uB2A5. false\uBA74 \uC774 tick \uC2A4\uD0B5. */\n filter?: (set: HelperHostSet) => boolean | Promise<boolean>;\n /** [type:'onConnected' \uC804\uC6A9] tick \uD578\uB4E4\uB7EC \uC9C1\uC804 \uD6C5. await\uB418\uACE0, \uB9AC\uD134\uAC12\uC740 @setIntervalBeforeReturn \uC73C\uB85C \uC8FC\uC785\uB41C\uB2E4. */\n before?: (set: HelperHostSet) => any | Promise<any>;\n /** [type:'onConnected' \uC804\uC6A9] tick \uD578\uB4E4\uB7EC\uAC00 \uC131\uACF5/\uC2E4\uD328\uD574\uB3C4 \uD56D\uC0C1 \uC2E4\uD589\uB418\uB294 \uC815\uB9AC \uD6C5. ctx\uB85C \uC778\uC790/\uACB0\uACFC/\uC5D0\uB7EC. */\n finally?: (set: HelperHostSet, ctx: { args: any[]; result?: any; error?: any }) => any | Promise<any>;\n /**\n * type:'onConnected' - \uB9E4 tick\uB9C8\uB2E4 \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uC758 \uB9AC\uD134\uAC12\uC774 \uAC1D\uCCB4\uC774\uACE0 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC774\uBA74 (id: number)\uB85C \uD638\uCD9C\uD55C\uB2E4.\n * type:'returnValue' - \uB9AC\uD134\uAC12\uC774 \uD568\uC218\uBA74 \uADF8 \uC790\uCCB4\uB97C, \uAC1D\uCCB4\uBA74 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC77C \uB54C \uADF8 \uAC12\uC744 \"\uC2E4\uC81C\uB85C \uBC18\uBCF5 \uC2E4\uD589\uB420 \uD568\uC218\"\uB85C \uC0AC\uC6A9\uD55C\uB2E4.\n * \uC548 \uC8FC\uBA74 SET_INTERVAL_METADATA_KEY\uB85C \uD3F4\uBC31\uD55C\uB2E4 - applyAttribute.ts/applyNode.ts\uC758 valueKey\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158\n * (\uB9AC\uD134 \uAC1D\uCCB4\uC5D0\uC11C \uC774 \uB370\uCF54\uB808\uC774\uD130 \uBAAB\uB9CC \uBF51\uC544 \uC4F0\uACE0, \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uC2A4\uD0DD\uD560 \uB54C\uB9CC \uCEE4\uC2A4\uD140 \uD0A4\uB85C \uAD6C\uBD84\uD558\uBA74 \uB41C\uB2E4).\n */\n valueKey?: symbol | string;\n}\n\nexport interface SetIntervalMetadata {\n propertyKey: string | symbol;\n interval: number;\n options: SetIntervalOptions;\n}\n\nconst getActiveEntries = (inst: any): number[] => (inst.__swc_intervalIds ??= []);\n\n/**\n * type:'onConnected' - connect \uC2DC \uC790\uB3D9\uC73C\uB85C setInterval\uC744 \uAC78\uACE0, disconnect \uC2DC \uC790\uB3D9\uC73C\uB85C clearInterval \uD55C\uB2E4.\n * type:'returnValue'(\uAE30\uBCF8\uAC12) - \uBA54\uC11C\uB4DC\uB97C \uAC10\uC2F8\uC9C0 \uC54A\uB294 \uB300\uC2E0, \uD638\uCD9C\uB420 \uB54C\uB9C8\uB2E4(\uAC1C\uBC1C\uC790\uAC00 \uC9C1\uC811 \uD638\uCD9C) \uC6D0\uBCF8 \uB85C\uC9C1\uC744\n * \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uACE0 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uD568\uC218\uBA74 \uADF8 \uD568\uC218\uB97C \uC0C8 setInterval\uC758 \uBC18\uBCF5 \uCF5C\uBC31\uC73C\uB85C \uB4F1\uB85D\uD55C\uB2E4.\n * \uD638\uCD9C\uD560 \uB54C\uB9C8\uB2E4 \uBCC4\uB3C4\uC758 \uC0C8 \uD0C0\uC774\uBA38\uAC00 \uC0DD\uAE30\uBA70, disconnect \uC2DC \uC804\uBD80 \uC815\uB9AC\uB41C\uB2E4. \uC6D0\uBCF8 \uB9AC\uD134\uAC12\uC740 \uADF8\uB300\uB85C \uD1B5\uACFC\uC2DC\uD0A4\uBBC0\uB85C\n * \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0 \uC2A4\uD0DD\uD574\uB3C4 \uC21C\uC11C\uC5D0 \uC0C1\uAD00\uC5C6\uC774 \uC548\uC804\uD558\uB2E4.\n */\nexport function setInterval(interval: number, options: SetIntervalOptions = {}): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n const normalizedOptions: SetIntervalOptions = { ...options, type: options.type ?? 'returnValue' };\n\n let metaList = ReflectUtils.getOwnMetadata(SET_INTERVAL_METADATA_KEY, constructor) as SetIntervalMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(SET_INTERVAL_METADATA_KEY, metaList, constructor);\n }\n metaList.push({ propertyKey, interval, options: normalizedOptions });\n\n if (normalizedOptions.type === 'onConnected' || !descriptor) {\n return; // LifeCycler\uAC00 connect/disconnect\uB97C \uC804\uB2F4 - wrapping \uBD88\uD544\uC694\n }\n\n const original = descriptor.value;\n descriptor.value = function (this: any, ...args: any[]) {\n const res = original.apply(this, args);\n // valueKey\uB97C \uC548 \uC8FC\uBA74 \uC774 \uB370\uCF54\uB808\uC774\uD130 \uC804\uC6A9 METADATA_KEY\uB85C \uD3F4\uBC31 (applyAttribute.ts/applyNode.ts\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158)\n const vk = normalizedOptions.valueKey ?? SET_INTERVAL_METADATA_KEY;\n const tickFn: ((id: number) => void) | undefined =\n typeof res === 'function' ? res : res && typeof res === 'object' && typeof res[vk] === 'function' ? res[vk] : undefined;\n\n if (tickFn) {\n ensureInit(this);\n const win = SwcUtils.resolveWindow(this);\n const id = win.setInterval(() => {\n try {\n tickFn(id);\n } catch (e) {\n console.error('[SWC] setInterval tick error:', e);\n }\n }, interval);\n normalizedOptions.created?.(SwcUtils.getHelperAndHostSet(this), id);\n getActiveEntries(this).push(id);\n }\n return res;\n };\n return descriptor;\n };\n}\n\nexport const findAllSetIntervalMetadata = (target: any): SetIntervalMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return (ReflectUtils.findAllMetadata<SetIntervalMetadata[]>(SET_INTERVAL_METADATA_KEY, constructor) || []).flat();\n};\n\nexport class SetIntervalLifeCycler implements ElementDefineLifeCycler {\n onConnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n inst.__swc_intervalIds = []; // \uC7AC\uC5F0\uACB0 \uB300\uBE44 \uB9AC\uC14B\n for (const meta of findAllSetIntervalMetadata(inst)) {\n if (meta.options.type !== 'onConnected') continue; // returnValue \uD0C0\uC785\uC740 \uC218\uB3D9 \uD638\uCD9C\uC744 \uAE30\uB2E4\uB9BC\n const id = helperHostSet.$w.setInterval(() => {\n void (async () => {\n const helper = SwcUtils.getHelperAndHostSet(inst);\n if (meta.options.filter && !(await meta.options.filter(helper))) return;\n const paramArgs = meta.options.parameter?.(helperHostSet) ?? [];\n const hostSet = SwcUtils.getHostSet(inst);\n const helperSet = SwcUtils.getHelperSet(helperHostSet.$w);\n const buildArgs = (beforeReturn: any) => buildSwcParameterArgs(inst, meta.propertyKey, {\n hostSet, helperHostSet: helper, helperSet, setIntervalBeforeReturn: beforeReturn\n }, [...paramArgs, beforeReturn]);\n let args = buildArgs(undefined);\n if (meta.options.before) { const br = await meta.options.before(helper); args = buildArgs(br); }\n let result: any, error: any;\n try {\n result = await inst[meta.propertyKey](...args);\n const vk = meta.options.valueKey ?? SET_INTERVAL_METADATA_KEY;\n if (result && typeof result === 'object' && typeof result[vk] === 'function') result[vk](id);\n } catch (e) {\n error = e;\n } finally {\n if (meta.options.finally) await meta.options.finally(helper, { args, result, error });\n }\n if (error) console.error('[SWC] setInterval tick error:', error);\n })().catch(e => console.error('[SWC] setInterval tick error:', e));\n }, meta.interval);\n meta.options.created?.(helperHostSet, id);\n getActiveEntries(inst).push(id);\n }\n }\n\n onDisconnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n for (const id of inst.__swc_intervalIds ?? []) {\n try {\n helperHostSet.$w.clearInterval(id);\n } catch (e) {\n console.error('[SWC] clearInterval error:', e);\n }\n }\n inst.__swc_intervalIds = [];\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,6BAA6B;AAG/B,MAAM,4BAA4B,OAAO,IAAI,mCAAmC;AAoCvF,MAAM,mBAAmB,CAAC,SAAyB,KAAK,sBAAL,KAAK,oBAAsB,CAAC;AASxE,SA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QACjE,GAAG,EAAE,MAAM,OAAK,QAAQ,MAAM,iCAAiC,CAAC,CAAC;AAAA,MACnE,GAAG,KAAK,QAAQ;AAChB,WAAK,QAAQ,UAAU,eAAe,EAAE;AACxC,uBAAiB,IAAI,EAAE,KAAK,EAAE;AAAA,IAChC;AAAA,EACF;AAAA,EAEA,eAAe,eAAoC;AACjD,UAAM,OAAO,cAAc;AAC3B,eAAW,MAAM,KAAK,qBAAqB,CAAC,GAAG;AAC7C,UAAI;AACF,sBAAc,GAAG,cAAc,EAAE;AAAA,MACnC,SAAS,GAAG;AACV,gBAAQ,MAAM,8BAA8B,CAAC;AAAA,MAC/C;AAAA,IACF;AACA,SAAK,oBAAoB,CAAC;AAAA,EAC5B;AACF;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { buildSwcParameterArgs } from './parameter';\nimport { ElementDefineLifeCycler, HelperHostSet } from '../types';\n\nexport const SET_INTERVAL_METADATA_KEY = Symbol.for('simple-web-component:set-interval');\n\nexport type SetIntervalType = 'onConnected' | 'returnValue';\n\nexport interface SetIntervalOptions {\n /**\n * 'onConnected' (\uAE30\uBCF8\uAC12 - connect \uC2DC \uC790\uB3D9\uC73C\uB85C \uC2DC\uC791, disconnect \uC2DC \uC790\uB3D9 \uC815\uB9AC) |\n * 'returnValue' (\uC790\uB3D9 \uC2DC\uC791 \uC5C6\uC74C. \uAC1C\uBC1C\uC790\uAC00 \uC774 \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC2DC\uC791\uB418\uACE0,\n * \uADF8 \uD638\uCD9C\uC758 \uB9AC\uD134\uAC12\uC774 \uC2E4\uC81C\uB85C \uBC18\uBCF5 \uC2E4\uD589\uB420 \uD568\uC218\uAC00 \uB41C\uB2E4 - \uC544\uB798 \uC124\uBA85 \uCC38\uACE0).\n */\n type?: SetIntervalType;\n /** \uB9E4 tick\uB9C8\uB2E4 \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uC5D0 \uB118\uAE38 \uC778\uC790\uB97C \uACC4\uC0B0. type:'onConnected'\uC5D0\uC11C\uB9CC \uC758\uBBF8\uAC00 \uC788\uC74C (\uC5C6\uC73C\uBA74 \uC778\uC790 \uC5C6\uC774 \uD638\uCD9C). */\n parameter?: (set: HelperHostSet) => any[];\n /** \uD0C0\uC774\uBA38 \uB4F1\uB85D \uC9C1\uD6C4 1\uD68C \uD638\uCD9C (\uB514\uBC84\uAE45/\uB85C\uAE45\uC6A9). id\uB294 \uC2E4\uC81C setInterval \uBC18\uD658\uAC12 - cleanup\uC740 \uC790\uB3D9\uC73C\uB85C \uCC98\uB9AC\uB418\uBBC0\uB85C \uC9C1\uC811 clear\uD560 \uD544\uC694 \uC5C6\uC74C. */\n created?: (set: HelperHostSet, id: number) => void;\n /** [type:'onConnected' \uC804\uC6A9] \uB9E4 tick \uC2E4\uD589 \uC5EC\uBD80 \uAC8C\uC774\uD2B8. Promise<boolean>\uB3C4 \uAC00\uB2A5. false\uBA74 \uC774 tick \uC2A4\uD0B5. */\n filter?: (set: HelperHostSet) => boolean | Promise<boolean>;\n /** [type:'onConnected' \uC804\uC6A9] tick \uD578\uB4E4\uB7EC \uC9C1\uC804 \uD6C5. await\uB418\uACE0, \uB9AC\uD134\uAC12\uC740 @setIntervalBeforeReturn \uC73C\uB85C \uC8FC\uC785\uB41C\uB2E4. */\n before?: (set: HelperHostSet) => any | Promise<any>;\n /** [type:'onConnected' \uC804\uC6A9] tick \uD578\uB4E4\uB7EC\uAC00 \uC131\uACF5/\uC2E4\uD328\uD574\uB3C4 \uD56D\uC0C1 \uC2E4\uD589\uB418\uB294 \uC815\uB9AC \uD6C5. ctx\uB85C \uC778\uC790/\uACB0\uACFC/\uC5D0\uB7EC. */\n finally?: (set: HelperHostSet, ctx: { args: any[]; result?: any; error?: any }) => any | Promise<any>;\n /**\n * type:'onConnected' - \uB9E4 tick\uB9C8\uB2E4 \uB370\uCF54\uB808\uC774\uD2B8\uB41C \uBA54\uC11C\uB4DC\uC758 \uB9AC\uD134\uAC12\uC774 \uAC1D\uCCB4\uC774\uACE0 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC774\uBA74 (id: number)\uB85C \uD638\uCD9C\uD55C\uB2E4.\n * type:'returnValue' - \uB9AC\uD134\uAC12\uC774 \uD568\uC218\uBA74 \uADF8 \uC790\uCCB4\uB97C, \uAC1D\uCCB4\uBA74 \uC774 \uD0A4\uC758 \uAC12\uC774 \uD568\uC218\uC77C \uB54C \uADF8 \uAC12\uC744 \"\uC2E4\uC81C\uB85C \uBC18\uBCF5 \uC2E4\uD589\uB420 \uD568\uC218\"\uB85C \uC0AC\uC6A9\uD55C\uB2E4.\n * \uC548 \uC8FC\uBA74 SET_INTERVAL_METADATA_KEY\uB85C \uD3F4\uBC31\uD55C\uB2E4 - applyAttribute.ts/applyNode.ts\uC758 valueKey\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158\n * (\uB9AC\uD134 \uAC1D\uCCB4\uC5D0\uC11C \uC774 \uB370\uCF54\uB808\uC774\uD130 \uBAAB\uB9CC \uBF51\uC544 \uC4F0\uACE0, \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uC2A4\uD0DD\uD560 \uB54C\uB9CC \uCEE4\uC2A4\uD140 \uD0A4\uB85C \uAD6C\uBD84\uD558\uBA74 \uB41C\uB2E4).\n */\n valueKey?: symbol | string;\n}\n\nexport interface SetIntervalMetadata {\n propertyKey: string | symbol;\n interval: number;\n options: SetIntervalOptions;\n}\n\nconst getActiveEntries = (inst: any): number[] => (inst.__swc_intervalIds ??= []);\n\n/**\n * type:'onConnected'(\uAE30\uBCF8\uAC12) - connect \uC2DC \uC790\uB3D9\uC73C\uB85C setInterval\uC744 \uAC78\uACE0, disconnect \uC2DC \uC790\uB3D9\uC73C\uB85C clearInterval \uD55C\uB2E4.\n * type:'returnValue' (@setIntervalReturnValue) - \uBA54\uC11C\uB4DC\uB97C \uAC10\uC2F8\uC9C0 \uC54A\uB294 \uB300\uC2E0, \uD638\uCD9C\uB420 \uB54C\uB9C8\uB2E4(\uAC1C\uBC1C\uC790\uAC00 \uC9C1\uC811 \uD638\uCD9C) \uC6D0\uBCF8 \uB85C\uC9C1\uC744\n * \uADF8\uB300\uB85C \uC2E4\uD589\uD558\uACE0 \uB9AC\uD134\uAC12(\uB610\uB294 valueKey\uB85C \uBF51\uC740 \uAC12)\uC774 \uD568\uC218\uBA74 \uADF8 \uD568\uC218\uB97C \uC0C8 setInterval\uC758 \uBC18\uBCF5 \uCF5C\uBC31\uC73C\uB85C \uB4F1\uB85D\uD55C\uB2E4.\n * \uD638\uCD9C\uD560 \uB54C\uB9C8\uB2E4 \uBCC4\uB3C4\uC758 \uC0C8 \uD0C0\uC774\uBA38\uAC00 \uC0DD\uAE30\uBA70, disconnect \uC2DC \uC804\uBD80 \uC815\uB9AC\uB41C\uB2E4. \uC6D0\uBCF8 \uB9AC\uD134\uAC12\uC740 \uADF8\uB300\uB85C \uD1B5\uACFC\uC2DC\uD0A4\uBBC0\uB85C\n * \uB2E4\uB978 \uB370\uCF54\uB808\uC774\uD130\uC640 \uAC19\uC740 \uBA54\uC11C\uB4DC\uC5D0 \uC2A4\uD0DD\uD574\uB3C4 \uC21C\uC11C\uC5D0 \uC0C1\uAD00\uC5C6\uC774 \uC548\uC804\uD558\uB2E4.\n */\nexport function setInterval(interval: number, options: SetIntervalOptions = {}): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const constructor = target.constructor;\n const normalizedOptions: SetIntervalOptions = { ...options, type: options.type ?? 'onConnected' };\n\n let metaList = ReflectUtils.getOwnMetadata(SET_INTERVAL_METADATA_KEY, constructor) as SetIntervalMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(SET_INTERVAL_METADATA_KEY, metaList, constructor);\n }\n metaList.push({ propertyKey, interval, options: normalizedOptions });\n\n if (normalizedOptions.type === 'onConnected' || !descriptor) {\n return; // LifeCycler\uAC00 connect/disconnect\uB97C \uC804\uB2F4 - wrapping \uBD88\uD544\uC694\n }\n\n const original = descriptor.value;\n descriptor.value = function (this: any, ...args: any[]) {\n const res = original.apply(this, args);\n // valueKey\uB97C \uC548 \uC8FC\uBA74 \uC774 \uB370\uCF54\uB808\uC774\uD130 \uC804\uC6A9 METADATA_KEY\uB85C \uD3F4\uBC31 (applyAttribute.ts/applyNode.ts\uC640 \uB3D9\uC77C\uD55C \uCEE8\uBCA4\uC158)\n const vk = normalizedOptions.valueKey ?? SET_INTERVAL_METADATA_KEY;\n const tickFn: ((id: number) => void) | undefined =\n typeof res === 'function' ? res : res && typeof res === 'object' && typeof res[vk] === 'function' ? res[vk] : undefined;\n\n if (tickFn) {\n ensureInit(this);\n const win = SwcUtils.resolveWindow(this);\n const id = win.setInterval(() => {\n try {\n tickFn(id);\n } catch (e) {\n console.error('[SWC] setInterval tick error:', e);\n }\n }, interval);\n normalizedOptions.created?.(SwcUtils.getHelperAndHostSet(this), id);\n getActiveEntries(this).push(id);\n }\n return res;\n };\n return descriptor;\n };\n}\n\nexport const findAllSetIntervalMetadata = (target: any): SetIntervalMetadata[] => {\n const constructor = typeof target === 'function' ? target : target.constructor;\n return (ReflectUtils.findAllMetadata<SetIntervalMetadata[]>(SET_INTERVAL_METADATA_KEY, constructor) || []).flat();\n};\n\nexport class SetIntervalLifeCycler implements ElementDefineLifeCycler {\n onConnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n inst.__swc_intervalIds = []; // \uC7AC\uC5F0\uACB0 \uB300\uBE44 \uB9AC\uC14B\n for (const meta of findAllSetIntervalMetadata(inst)) {\n if (meta.options.type !== 'onConnected') continue; // returnValue \uD0C0\uC785\uC740 \uC218\uB3D9 \uD638\uCD9C\uC744 \uAE30\uB2E4\uB9BC\n const id = helperHostSet.$w.setInterval(() => {\n void (async () => {\n const helper = SwcUtils.getHelperAndHostSet(inst);\n if (meta.options.filter && !(await meta.options.filter(helper))) return;\n const paramArgs = meta.options.parameter?.(helperHostSet) ?? [];\n const hostSet = SwcUtils.getHostSet(inst);\n const helperSet = SwcUtils.getHelperSet(helperHostSet.$w);\n const buildArgs = (beforeReturn: any) => buildSwcParameterArgs(inst, meta.propertyKey, {\n hostSet, helperHostSet: helper, helperSet, setIntervalBeforeReturn: beforeReturn\n }, [...paramArgs, beforeReturn]);\n let args = buildArgs(undefined);\n if (meta.options.before) { const br = await meta.options.before(helper); args = buildArgs(br); }\n let result: any, error: any;\n try {\n result = await inst[meta.propertyKey](...args);\n const vk = meta.options.valueKey ?? SET_INTERVAL_METADATA_KEY;\n if (result && typeof result === 'object' && typeof result[vk] === 'function') result[vk](id);\n } catch (e) {\n error = e;\n } finally {\n if (meta.options.finally) await meta.options.finally(helper, { args, result, error });\n }\n if (error) console.error('[SWC] setInterval tick error:', error);\n })().catch(e => console.error('[SWC] setInterval tick error:', e));\n }, meta.interval);\n meta.options.created?.(helperHostSet, id);\n getActiveEntries(inst).push(id);\n }\n }\n\n onDisconnected(helperHostSet: HelperHostSet): void {\n const inst = helperHostSet.$this;\n for (const id of inst.__swc_intervalIds ?? []) {\n try {\n helperHostSet.$w.clearInterval(id);\n } catch (e) {\n console.error('[SWC] clearInterval error:', e);\n }\n }\n inst.__swc_intervalIds = [];\n }\n}\n\n/** \uC218\uB3D9 \uC2DC\uC791: \uBA54\uC11C\uB4DC\uB97C \uC9C1\uC811 \uD638\uCD9C\uD574\uC57C \uC2DC\uC791\uB41C\uB2E4. = @setInterval(interval, { type: 'returnValue' }) */\nexport const setIntervalReturnValue = (interval: number, options: Omit<SetIntervalOptions, 'type'> = {}): MethodDecorator =>\n setInterval(interval, { ...options, type: 'returnValue' });\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,6BAA6B;A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AK,QAAQ,QAAQ,QAAQ,EAAE,MAAM,QAAQ,MAAM,CAAC;AAAA,UACtF;AACA,cAAI,MAAO,SAAQ,MAAM,iCAAiC,KAAK;AAAA,QACjE,GAAG,EAAE,MAAM,OAAK,QAAQ,MAAM,iCAAiC,CAAC,CAAC;AAAA,MACnE,GAAG,KAAK,QAAQ;AAChB,WAAK,QAAQ,UAAU,eAAe,EAAE;AACxC,uBAAiB,IAAI,EAAE,KAAK,EAAE;AAAA,IAChC;AAAA,EACF;AAAA,EAEA,eAAe,eAAoC;AACjD,UAAM,OAAO,cAAc;AAC3B,eAAW,MAAM,KAAK,qBAAqB,CAAC,GAAG;AAC7C,UAAI;AACF,sBAAc,GAAG,cAAc,EAAE;AAAA,MACnC,SAAS,GAAG;AACV,gBAAQ,MAAM,8BAA8B,CAAC;AAAA,MAC/C;AAAA,IACF;AACA,SAAK,oBAAoB,CAAC;AAAA,EAC5B;AACF;AAGO,MAAM,yBAAyB,CAAC,UAAkB,UAA4C,CAAC,MACpG,YAAY,UAAU,EAAE,GAAG,SAAS,MAAM,cAAc,CAAC;",
6
6
  "names": []
7
7
  }
@@ -7,7 +7,7 @@ const getActiveEntries = (inst) => inst.__swc_timeoutIds ?? (inst.__swc_timeoutI
7
7
  function setTimeout(delay, options = {}) {
8
8
  return (target, propertyKey, descriptor) => {
9
9
  const constructor = target.constructor;
10
- const normalizedOptions = { ...options, type: options.type ?? "returnValue" };
10
+ const normalizedOptions = { ...options, type: options.type ?? "onConnected" };
11
11
  let metaList = ReflectUtils.getOwnMetadata(SET_TIMEOUT_METADATA_KEY, constructor);
12
12
  if (!metaList) {
13
13
  metaList = [];
@@ -100,10 +100,12 @@ class SetTimeoutLifeCycler {
100
100
  inst.__swc_timeoutIds = [];
101
101
  }
102
102
  }
103
+ const setTimeoutReturnValue = (delay, options = {}) => setTimeout(delay, { ...options, type: "returnValue" });
103
104
  export {
104
105
  SET_TIMEOUT_METADATA_KEY,
105
106
  SetTimeoutLifeCycler,
106
107
  findAllSetTimeoutMetadata,
107
- setTimeout
108
+ setTimeout,
109
+ setTimeoutReturnValue
108
110
  };
109
111
  //# sourceMappingURL=setTimeout.js.map