frosty 0.0.120 → 0.0.121

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 (99) hide show
  1. package/dist/_native.d.mts +3 -3
  2. package/dist/_native.d.mts.map +1 -1
  3. package/dist/_native.d.ts +3 -3
  4. package/dist/_native.d.ts.map +1 -1
  5. package/dist/_native.js +6 -6
  6. package/dist/_native.js.map +1 -1
  7. package/dist/_native.mjs +5 -4
  8. package/dist/_native.mjs.map +1 -1
  9. package/dist/dom.d.mts +3 -3
  10. package/dist/dom.d.ts +3 -3
  11. package/dist/dom.js +4 -4
  12. package/dist/dom.mjs +4 -4
  13. package/dist/index.d.mts +51 -51
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.d.ts +51 -51
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +28 -28
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +7 -7
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/internals/{common-BYsSVxNk.d.ts → common-l_tn3GdO.d.mts} +4 -3
  22. package/dist/internals/{common-BYsSVxNk.d.mts.map → common-l_tn3GdO.d.mts.map} +1 -1
  23. package/dist/internals/{common-BYsSVxNk.d.mts → common-l_tn3GdO.d.ts} +4 -3
  24. package/dist/internals/{common-BYsSVxNk.d.ts.map → common-l_tn3GdO.d.ts.map} +1 -1
  25. package/dist/internals/events-DFlIK-gk.js +55 -0
  26. package/dist/internals/events-DFlIK-gk.js.map +1 -0
  27. package/dist/internals/events-DIQH_mHX.mjs +53 -0
  28. package/dist/internals/events-DIQH_mHX.mjs.map +1 -0
  29. package/dist/internals/{fragment-CRbC1VFN.d.ts → fragment-C6zU3WrP.d.ts} +2 -2
  30. package/dist/internals/{fragment-CRbC1VFN.d.ts.map → fragment-C6zU3WrP.d.ts.map} +1 -1
  31. package/dist/internals/{fragment-B-zrdJZ8.d.mts → fragment-DfJ4xUny.d.mts} +2 -2
  32. package/dist/internals/{fragment-B-zrdJZ8.d.mts.map → fragment-DfJ4xUny.d.mts.map} +1 -1
  33. package/dist/internals/{state-BcId1rQb.js → index-B3K_At0T.js} +269 -326
  34. package/dist/internals/index-B3K_At0T.js.map +1 -0
  35. package/dist/internals/{state-DQ2OKak8.mjs → index-CYqgonKo.mjs} +269 -326
  36. package/dist/internals/index-CYqgonKo.mjs.map +1 -0
  37. package/dist/internals/{renderer-DlRiag_W.d.ts → index-Dm4wQ4OF.d.mts} +23 -29
  38. package/dist/internals/index-Dm4wQ4OF.d.mts.map +1 -0
  39. package/dist/internals/{renderer-eYwU4exf.d.mts → index-Dxb4qbGJ.d.ts} +23 -29
  40. package/dist/internals/index-Dxb4qbGJ.d.ts.map +1 -0
  41. package/dist/internals/renderer-BpxETChN.js +235 -0
  42. package/dist/internals/renderer-BpxETChN.js.map +1 -0
  43. package/dist/internals/{renderer-DVEtzh7O.d.ts → renderer-DYHpS9Pb.d.ts} +3 -3
  44. package/dist/internals/{renderer-DVEtzh7O.d.ts.map → renderer-DYHpS9Pb.d.ts.map} +1 -1
  45. package/dist/internals/{renderer-BJyESI8-.js → renderer-DafY1_-y.js} +13 -15
  46. package/dist/internals/{renderer-BJyESI8-.js.map → renderer-DafY1_-y.js.map} +1 -1
  47. package/dist/internals/renderer-PC8Rmcn8.mjs +233 -0
  48. package/dist/internals/renderer-PC8Rmcn8.mjs.map +1 -0
  49. package/dist/internals/{renderer-BtOijeDS.d.mts → renderer-eqt9d1wX.d.mts} +3 -3
  50. package/dist/internals/{renderer-BtOijeDS.d.mts.map → renderer-eqt9d1wX.d.mts.map} +1 -1
  51. package/dist/internals/{renderer-CJA6vv86.mjs → renderer-tH1ZrzAE.mjs} +9 -11
  52. package/dist/internals/{renderer-CJA6vv86.mjs.map → renderer-tH1ZrzAE.mjs.map} +1 -1
  53. package/dist/internals/{runtime-57ivQprw.js → runtime-B6GnZi7A.js} +2 -3
  54. package/dist/internals/runtime-B6GnZi7A.js.map +1 -0
  55. package/dist/internals/{runtime-Dp4_akLf.mjs → runtime-PoXcsgok.mjs} +2 -3
  56. package/dist/internals/runtime-PoXcsgok.mjs.map +1 -0
  57. package/dist/internals/{sync-bgrX6wfp.js → sync-BeQSFdEN.js} +24 -24
  58. package/dist/internals/sync-BeQSFdEN.js.map +1 -0
  59. package/dist/internals/{sync-UIYH-wdf.mjs → sync-Bx9yYmhM.mjs} +6 -6
  60. package/dist/internals/sync-Bx9yYmhM.mjs.map +1 -0
  61. package/dist/internals/{utils-C_f_laIp.d.mts → utils-BYUPY_UY.d.mts} +2 -2
  62. package/dist/internals/{utils-C_f_laIp.d.mts.map → utils-BYUPY_UY.d.mts.map} +1 -1
  63. package/dist/internals/{utils-QOsIvm19.d.ts → utils-DkVDgsjY.d.ts} +2 -2
  64. package/dist/internals/{utils-QOsIvm19.d.ts.map → utils-DkVDgsjY.d.ts.map} +1 -1
  65. package/dist/jsx-dev-runtime.d.mts +2 -2
  66. package/dist/jsx-dev-runtime.d.ts +2 -2
  67. package/dist/jsx-dev-runtime.js +1 -1
  68. package/dist/jsx-dev-runtime.mjs +1 -1
  69. package/dist/jsx-runtime.d.mts +2 -2
  70. package/dist/jsx-runtime.d.ts +2 -2
  71. package/dist/jsx-runtime.js +1 -1
  72. package/dist/jsx-runtime.mjs +2 -2
  73. package/dist/server-dom.d.mts +3 -3
  74. package/dist/server-dom.d.ts +3 -3
  75. package/dist/server-dom.js +4 -4
  76. package/dist/server-dom.mjs +4 -4
  77. package/dist/web.d.mts +3 -3
  78. package/dist/web.d.mts.map +1 -1
  79. package/dist/web.d.ts +3 -3
  80. package/dist/web.d.ts.map +1 -1
  81. package/dist/web.js +27 -26
  82. package/dist/web.js.map +1 -1
  83. package/dist/web.mjs +7 -6
  84. package/dist/web.mjs.map +1 -1
  85. package/package.json +2 -2
  86. package/packages/frosty-cli/package.json +1 -1
  87. package/packages/frosty-cli/yarn.lock +76 -76
  88. package/dist/internals/renderer-D7YbtgQX.mjs +0 -232
  89. package/dist/internals/renderer-D7YbtgQX.mjs.map +0 -1
  90. package/dist/internals/renderer-DK5OzE35.js +0 -234
  91. package/dist/internals/renderer-DK5OzE35.js.map +0 -1
  92. package/dist/internals/renderer-DlRiag_W.d.ts.map +0 -1
  93. package/dist/internals/renderer-eYwU4exf.d.mts.map +0 -1
  94. package/dist/internals/runtime-57ivQprw.js.map +0 -1
  95. package/dist/internals/runtime-Dp4_akLf.mjs.map +0 -1
  96. package/dist/internals/state-BcId1rQb.js.map +0 -1
  97. package/dist/internals/state-DQ2OKak8.mjs.map +0 -1
  98. package/dist/internals/sync-UIYH-wdf.mjs.map +0 -1
  99. package/dist/internals/sync-bgrX6wfp.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { N as NativeElementType, c as PropsType, C as ComponentNode } from './internals/common-BYsSVxNk.mjs';
2
- export { V as VNode, _ as _Renderer } from './internals/renderer-eYwU4exf.mjs';
3
- export { u as uniqueId } from './internals/utils-C_f_laIp.mjs';
1
+ import { N as NativeElementType, c as PropsType, a as ComponentNode } from './internals/common-l_tn3GdO.mjs';
2
+ export { V as VNode, _ as _Renderer } from './internals/index-Dm4wQ4OF.mjs';
3
+ export { u as uniqueId } from './internals/utils-BYUPY_UY.mjs';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
6
6
  import 'csstype';
@@ -1 +1 @@
1
- {"version":3,"file":"_native.d.mts","sources":["../src/core/reconciler/events.ts","../src/renderer/native.ts"],"sourcesContent":["//\n// events.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\n\nexport class EventEmitter {\n\n private _listeners: Record<string, ((...args: any[]) => void)[]> = {};\n\n register(event: string, callback: (event: string, ...args: any[]) => void) {\n if (_.isNil(this._listeners[event])) this._listeners[event] = [];\n const _callback = (...args: any[]) => callback(event, ...args);\n this._listeners[event].push(_callback);\n return {\n remove: () => {\n this._listeners[event] = _.filter(this._listeners[event], x => x !== _callback);\n },\n };\n }\n\n emit(event: string, ...args: any[]) {\n this._listeners[event]?.forEach(async callback => {\n try {\n await callback(...args)\n } catch (e) {\n console.error(e);\n }\n });\n }\n}\n","//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport { VNode } from '../core/reconciler/vnode';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;AAAO,cAAA,YAAA;AACP;AACA;AACA;AACA;AACA;AACA;;ACCO,iBAAA,oBAAA,cAAA,iBAAA,SAAA,SAAA,0BAAA,aAAA;;;;"}
1
+ {"version":3,"file":"_native.d.mts","sources":["../src/core/reconciler/events.ts","../src/renderer/native.ts"],"sourcesContent":["//\n// events.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\n\nexport class EventEmitter {\n\n private _listeners: Record<string, ((...args: any[]) => void)[]> = {};\n\n register(event: string, callback: (event: string, ...args: any[]) => void) {\n if (_.isNil(this._listeners[event])) this._listeners[event] = [];\n const _callback = (...args: any[]) => callback(event, ...args);\n this._listeners[event].push(_callback);\n return {\n remove: () => {\n this._listeners[event] = _.filter(this._listeners[event], x => x !== _callback);\n },\n };\n }\n\n emit(event: string, ...args: any[]) {\n this._listeners[event]?.forEach(async callback => {\n try {\n await callback(...args)\n } catch (e) {\n console.error(e);\n }\n });\n }\n}\n","//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport type { VNode } from '../core/reconciler';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;AAAO,cAAA,YAAA;AACP;AACA;AACA;AACA;AACA;AACA;;ACCO,iBAAA,oBAAA,cAAA,iBAAA,SAAA,SAAA,0BAAA,aAAA;;;;"}
package/dist/_native.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { N as NativeElementType, c as PropsType, C as ComponentNode } from './internals/common-BYsSVxNk.js';
2
- export { V as VNode, _ as _Renderer } from './internals/renderer-DlRiag_W.js';
3
- export { u as uniqueId } from './internals/utils-QOsIvm19.js';
1
+ import { N as NativeElementType, c as PropsType, a as ComponentNode } from './internals/common-l_tn3GdO.js';
2
+ export { V as VNode, _ as _Renderer } from './internals/index-Dxb4qbGJ.js';
3
+ export { u as uniqueId } from './internals/utils-DkVDgsjY.js';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
6
6
  import 'csstype';
@@ -1 +1 @@
1
- {"version":3,"file":"_native.d.ts","sources":["../src/core/reconciler/events.ts","../src/renderer/native.ts"],"sourcesContent":["//\n// events.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\n\nexport class EventEmitter {\n\n private _listeners: Record<string, ((...args: any[]) => void)[]> = {};\n\n register(event: string, callback: (event: string, ...args: any[]) => void) {\n if (_.isNil(this._listeners[event])) this._listeners[event] = [];\n const _callback = (...args: any[]) => callback(event, ...args);\n this._listeners[event].push(_callback);\n return {\n remove: () => {\n this._listeners[event] = _.filter(this._listeners[event], x => x !== _callback);\n },\n };\n }\n\n emit(event: string, ...args: any[]) {\n this._listeners[event]?.forEach(async callback => {\n try {\n await callback(...args)\n } catch (e) {\n console.error(e);\n }\n });\n }\n}\n","//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport { VNode } from '../core/reconciler/vnode';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;AAAO,cAAA,YAAA;AACP;AACA;AACA;AACA;AACA;AACA;;ACCO,iBAAA,oBAAA,cAAA,iBAAA,SAAA,SAAA,0BAAA,aAAA;;;;"}
1
+ {"version":3,"file":"_native.d.ts","sources":["../src/core/reconciler/events.ts","../src/renderer/native.ts"],"sourcesContent":["//\n// events.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\n\nexport class EventEmitter {\n\n private _listeners: Record<string, ((...args: any[]) => void)[]> = {};\n\n register(event: string, callback: (event: string, ...args: any[]) => void) {\n if (_.isNil(this._listeners[event])) this._listeners[event] = [];\n const _callback = (...args: any[]) => callback(event, ...args);\n this._listeners[event].push(_callback);\n return {\n remove: () => {\n this._listeners[event] = _.filter(this._listeners[event], x => x !== _callback);\n },\n };\n }\n\n emit(event: string, ...args: any[]) {\n this._listeners[event]?.forEach(async callback => {\n try {\n await callback(...args)\n } catch (e) {\n console.error(e);\n }\n });\n }\n}\n","//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport type { VNode } from '../core/reconciler';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;AAAO,cAAA,YAAA;AACP;AACA;AACA;AACA;AACA;AACA;;ACCO,iBAAA,oBAAA,cAAA,iBAAA,SAAA,SAAA,0BAAA,aAAA;;;;"}
package/dist/_native.js CHANGED
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var runtime = require('./internals/runtime-57ivQprw.js');
4
- var renderer = require('./internals/renderer-DK5OzE35.js');
5
- var state = require('./internals/state-BcId1rQb.js');
3
+ var runtime = require('./internals/runtime-B6GnZi7A.js');
4
+ var renderer = require('./internals/renderer-BpxETChN.js');
5
+ var index = require('./internals/index-B3K_At0T.js');
6
+ var events = require('./internals/events-DFlIK-gk.js');
6
7
  require('lodash');
7
8
  require('nextick');
8
9
  require('myers.js');
@@ -37,8 +38,7 @@ function _createNativeElement(type, props, key) {
37
38
 
38
39
  exports.NativeElementType = runtime.NativeElementType;
39
40
  exports._Renderer = renderer._Renderer;
40
- exports.EventEmitter = state.EventEmitter;
41
- exports.VNode = state.VNode;
42
- exports.uniqueId = state.uniqueId;
41
+ exports.uniqueId = index.uniqueId;
42
+ exports.EventEmitter = events.EventEmitter;
43
43
  exports._createNativeElement = _createNativeElement;
44
44
  //# sourceMappingURL=_native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_native.js","sources":["../../src/renderer/native.ts"],"sourcesContent":["//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport { VNode } from '../core/reconciler/vnode';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":["_createElement"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAWgB,oBAAoB,CAClC,IAA8B,EAC9B,KAAgB,EAChB,GAAqB,EAAA;IAErB,OAAOA,sBAAc,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AAChD;;;;;;;;;"}
1
+ {"version":3,"file":"_native.js","sources":["../../src/renderer/native.ts"],"sourcesContent":["//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport type { VNode } from '../core/reconciler';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":["_createElement"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAWgB,oBAAoB,CAClC,IAA8B,EAC9B,KAAgB,EAChB,GAAqB,EAAA;IAErB,OAAOA,sBAAc,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AAChD;;;;;;;;"}
package/dist/_native.mjs CHANGED
@@ -1,7 +1,8 @@
1
- import { _ as _createElement } from './internals/runtime-Dp4_akLf.mjs';
2
- export { N as NativeElementType } from './internals/runtime-Dp4_akLf.mjs';
3
- export { _ as _Renderer } from './internals/renderer-D7YbtgQX.mjs';
4
- export { d as EventEmitter, V as VNode, u as uniqueId } from './internals/state-DQ2OKak8.mjs';
1
+ import { _ as _createElement } from './internals/runtime-PoXcsgok.mjs';
2
+ export { N as NativeElementType } from './internals/runtime-PoXcsgok.mjs';
3
+ export { _ as _Renderer } from './internals/renderer-PC8Rmcn8.mjs';
4
+ export { u as uniqueId } from './internals/index-CYqgonKo.mjs';
5
+ export { E as EventEmitter } from './internals/events-DIQH_mHX.mjs';
5
6
  import 'lodash';
6
7
  import 'nextick';
7
8
  import 'myers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"_native.mjs","sources":["../../src/renderer/native.ts"],"sourcesContent":["//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport { VNode } from '../core/reconciler/vnode';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAWgB,oBAAoB,CAClC,IAA8B,EAC9B,KAAgB,EAChB,GAAqB,EAAA;IAErB,OAAO,cAAc,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AAChD;;;;"}
1
+ {"version":3,"file":"_native.mjs","sources":["../../src/renderer/native.ts"],"sourcesContent":["//\n// native.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { _createElement, PropsType } from '../core/types/runtime';\nimport { ComponentNode, NativeElementType } from '../core/types/component';\n\nexport { _Renderer } from '../core/renderer';\nexport { uniqueId } from '../core/utils';\nexport { EventEmitter } from '../core/reconciler/events';\nexport type { VNode } from '../core/reconciler';\nexport { NativeElementType } from '../core/types/component';\n\nexport function _createNativeElement(\n type: typeof NativeElementType,\n props: PropsType,\n key?: string | number\n): ComponentNode {\n return _createElement(type, { ...props, key });\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAWgB,oBAAoB,CAClC,IAA8B,EAC9B,KAAgB,EAChB,GAAqB,EAAA;IAErB,OAAO,cAAc,CAAC,IAAI,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC;AAChD;;;;"}
package/dist/dom.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as _DOMRenderer } from './internals/renderer-BtOijeDS.mjs';
2
- import './internals/common-BYsSVxNk.mjs';
1
+ import { _ as _DOMRenderer } from './internals/renderer-eqt9d1wX.mjs';
2
+ import './internals/common-l_tn3GdO.mjs';
3
3
  import '@o2ter/utils-js';
4
4
  import 'lodash';
5
5
  import 'csstype';
6
- import './internals/renderer-eYwU4exf.mjs';
6
+ import './internals/index-Dm4wQ4OF.mjs';
7
7
  import 'jsdom';
8
8
 
9
9
  declare class DOMRenderer extends _DOMRenderer {
package/dist/dom.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as _DOMRenderer } from './internals/renderer-DVEtzh7O.js';
2
- import './internals/common-BYsSVxNk.js';
1
+ import { _ as _DOMRenderer } from './internals/renderer-DYHpS9Pb.js';
2
+ import './internals/common-l_tn3GdO.js';
3
3
  import '@o2ter/utils-js';
4
4
  import 'lodash';
5
5
  import 'csstype';
6
- import './internals/renderer-DlRiag_W.js';
6
+ import './internals/index-Dxb4qbGJ.js';
7
7
  import 'jsdom';
8
8
 
9
9
  declare class DOMRenderer extends _DOMRenderer {
package/dist/dom.js CHANGED
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var renderer = require('./internals/renderer-BJyESI8-.js');
3
+ var renderer = require('./internals/renderer-DafY1_-y.js');
4
4
  require('lodash');
5
5
  require('myers.js');
6
- require('./internals/renderer-DK5OzE35.js');
7
- require('./internals/state-BcId1rQb.js');
8
- require('./internals/runtime-57ivQprw.js');
6
+ require('./internals/renderer-BpxETChN.js');
7
+ require('./internals/index-B3K_At0T.js');
8
+ require('./internals/runtime-B6GnZi7A.js');
9
9
  require('nextick');
10
10
  require('postcss');
11
11
  require('postcss-js');
package/dist/dom.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as _DOMRenderer } from './internals/renderer-CJA6vv86.mjs';
1
+ import { _ as _DOMRenderer } from './internals/renderer-tH1ZrzAE.mjs';
2
2
  import 'lodash';
3
3
  import 'myers.js';
4
- import './internals/renderer-D7YbtgQX.mjs';
5
- import './internals/state-DQ2OKak8.mjs';
6
- import './internals/runtime-Dp4_akLf.mjs';
4
+ import './internals/renderer-PC8Rmcn8.mjs';
5
+ import './internals/index-CYqgonKo.mjs';
6
+ import './internals/runtime-PoXcsgok.mjs';
7
7
  import 'nextick';
8
8
  import 'postcss';
9
9
  import 'postcss-js';
package/dist/index.d.mts CHANGED
@@ -1,11 +1,58 @@
1
- import { _ as _ElementType, N as NativeElementType, P as PropsWithChildren, C as ComponentNode, S as SetStateAction, a as ComponentType, E as ElementNode, R as RefObject, b as Ref, c as PropsType } from './internals/common-BYsSVxNk.mjs';
2
- export { h as CSSProperties, e as ClassName, j as ComponentProps, k as ComponentPropsWithoutRef, m as ComponentRef, g as ExtendedCSSProperties, i as RefAttribute, l as RefCallback, f as StyleProp, d as createElement } from './internals/common-BYsSVxNk.mjs';
3
- export { F as Fragment } from './internals/fragment-B-zrdJZ8.mjs';
1
+ import { C as ComponentType, E as ElementNode, _ as _ElementType, N as NativeElementType, P as PropsWithChildren, a as ComponentNode, S as SetStateAction, R as RefObject, b as Ref, c as PropsType } from './internals/common-l_tn3GdO.mjs';
2
+ export { h as CSSProperties, e as ClassName, j as ComponentProps, k as ComponentPropsWithoutRef, m as ComponentRef, g as ExtendedCSSProperties, i as RefAttribute, l as RefCallback, f as StyleProp, d as createElement } from './internals/common-l_tn3GdO.mjs';
3
+ export { F as Fragment } from './internals/fragment-DfJ4xUny.mjs';
4
4
  import _ from 'lodash';
5
5
  import { Awaitable } from '@o2ter/utils-js';
6
- export { m as mergeRefs } from './internals/utils-C_f_laIp.mjs';
6
+ export { m as mergeRefs } from './internals/utils-BYUPY_UY.mjs';
7
7
  import 'csstype';
8
8
 
9
+ type Context<Value> = ReturnType<typeof _createContext<Value>>;
10
+ type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
11
+ declare const _createContext: <Value extends unknown>(defaultValue: Value) => ComponentType<{
12
+ value: Value;
13
+ children?: ElementNode | ((value: Value) => ElementNode);
14
+ }> & {
15
+ Consumer: ComponentType<{
16
+ children: (value: Value) => ElementNode;
17
+ }>;
18
+ };
19
+ /**
20
+ * Creates a new context object with an optional default value.
21
+ *
22
+ * A context object allows you to share a value across a component tree
23
+ * without explicitly passing it as a prop to every level.
24
+ *
25
+ * @template Value - The type of the value to be stored in the context.
26
+ * @param - The default value for the context.
27
+ * @returns A context object that can be used to provide and consume the value.
28
+ */
29
+ declare function createContext<Value>(defaultValue: Value): Context<Value>;
30
+ declare function createContext<Value = undefined>(): Context<Value | undefined>;
31
+ /**
32
+ * A hook that retrieves the current value of a context and optionally applies
33
+ * a selector function to transform the context value. This hook ensures that the component
34
+ * subscribes to the context and re-renders when the context value changes.
35
+ *
36
+ * @template T - The type of the context value.
37
+ * @template R - The type of the transformed value returned by the selector.
38
+ * @param context - The context object to retrieve the value from.
39
+ * @param selector - An optional selector function to transform the context value.
40
+ * Defaults to an identity function.
41
+ * @returns - The current value of the context, optionally transformed by the selector.
42
+ *
43
+ * @throws - Throws an error if the provided context is invalid or if the hook
44
+ * is used outside of a render function.
45
+ *
46
+ * @example
47
+ * const MyContext = createContext({ user: null });
48
+ *
49
+ * function MyComponent() {
50
+ * const user = useContext(MyContext, context => context.user);
51
+ * return <div>{user ? `Hello, ${user.name}` : 'Hello, Guest'}</div>;
52
+ * }
53
+ */
54
+ declare const useContext: <T, R = T>(context: Context<T>, selector?: (state: T) => R) => R;
55
+
9
56
  /**
10
57
  * Create a pair of Parent and Child components.
11
58
  *
@@ -359,53 +406,6 @@ declare const useAsyncDebounce: <T extends (...args: any) => PromiseLike<any>>(c
359
406
  */
360
407
  declare const useEffect: (effect: (signal: AbortSignal) => Awaitable<void | (() => Awaitable<void>)>, deps?: any) => void;
361
408
 
362
- type Context<Value> = ReturnType<typeof _createContext<Value>>;
363
- type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;
364
- declare const _createContext: <Value extends unknown>(defaultValue: Value) => ComponentType<{
365
- value: Value;
366
- children?: ElementNode | ((value: Value) => ElementNode);
367
- }> & {
368
- Consumer: ComponentType<{
369
- children: (value: Value) => ElementNode;
370
- }>;
371
- };
372
- /**
373
- * Creates a new context object with an optional default value.
374
- *
375
- * A context object allows you to share a value across a component tree
376
- * without explicitly passing it as a prop to every level.
377
- *
378
- * @template Value - The type of the value to be stored in the context.
379
- * @param - The default value for the context.
380
- * @returns A context object that can be used to provide and consume the value.
381
- */
382
- declare function createContext<Value>(defaultValue: Value): Context<Value>;
383
- declare function createContext<Value = undefined>(): Context<Value | undefined>;
384
- /**
385
- * A hook that retrieves the current value of a context and optionally applies
386
- * a selector function to transform the context value. This hook ensures that the component
387
- * subscribes to the context and re-renders when the context value changes.
388
- *
389
- * @template T - The type of the context value.
390
- * @template R - The type of the transformed value returned by the selector.
391
- * @param context - The context object to retrieve the value from.
392
- * @param selector - An optional selector function to transform the context value.
393
- * Defaults to an identity function.
394
- * @returns - The current value of the context, optionally transformed by the selector.
395
- *
396
- * @throws - Throws an error if the provided context is invalid or if the hook
397
- * is used outside of a render function.
398
- *
399
- * @example
400
- * const MyContext = createContext({ user: null });
401
- *
402
- * function MyComponent() {
403
- * const user = useContext(MyContext, context => context.user);
404
- * return <div>{user ? `Hello, ${user.name}` : 'Hello, Guest'}</div>;
405
- * }
406
- */
407
- declare const useContext: <T, R = T>(context: Context<T>, selector?: (state: T) => R) => R;
408
-
409
409
  /**
410
410
  * A utility function that memoizes the result of a factory function.
411
411
  *