@lynx-js/react 0.121.1 → 0.122.0

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 (240) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/package.json +5 -5
  3. package/runtime/lazy/element-template-import.js +73 -0
  4. package/runtime/lazy/import.js +4 -0
  5. package/runtime/lazy/target.js +23 -0
  6. package/runtime/lib/core/background-function/exec-map.d.ts +11 -0
  7. package/runtime/lib/core/background-function/exec-map.js +39 -0
  8. package/runtime/lib/core/background-function/exec-map.js.map +1 -0
  9. package/runtime/lib/core/background-function/handle.d.ts +8 -0
  10. package/runtime/lib/core/background-function/handle.js +25 -0
  11. package/runtime/lib/core/background-function/handle.js.map +1 -0
  12. package/runtime/lib/core/background-function/run-on-background.d.ts +8 -0
  13. package/runtime/lib/{snapshot/worklet/call/runOnBackground.js → core/background-function/run-on-background.js} +39 -33
  14. package/runtime/lib/core/background-function/run-on-background.js.map +1 -0
  15. package/runtime/lib/{snapshot/legacy-react-runtime/index.d.ts → core/compat/legacy-react-runtime.d.ts} +4 -4
  16. package/runtime/lib/{snapshot/legacy-react-runtime/index.js → core/compat/legacy-react-runtime.js} +6 -6
  17. package/runtime/lib/core/compat/legacy-react-runtime.js.map +1 -0
  18. package/runtime/lib/{snapshot → core}/compat/lynxComponent.d.ts +2 -1
  19. package/runtime/lib/{snapshot → core}/compat/lynxComponent.js +11 -5
  20. package/runtime/lib/core/compat/lynxComponent.js.map +1 -0
  21. package/runtime/lib/core/component.d.ts +2 -0
  22. package/runtime/lib/{snapshot/lynx → core}/component.js +37 -31
  23. package/runtime/lib/core/component.js.map +1 -0
  24. package/runtime/lib/core/initData.js +35 -0
  25. package/runtime/lib/core/initData.js.map +1 -1
  26. package/runtime/lib/{snapshot/lynx/dynamic-js.js → core/lynx/dynamic-import.js} +1 -1
  27. package/runtime/lib/core/lynx/dynamic-import.js.map +1 -0
  28. package/runtime/lib/core/lynx/lazy-bundle.js.map +1 -0
  29. package/runtime/lib/core/lynx/runtime-backend.d.ts +5 -0
  30. package/runtime/lib/core/lynx/runtime-backend.js +20 -0
  31. package/runtime/lib/core/lynx/runtime-backend.js.map +1 -0
  32. package/runtime/lib/core/lynx-page-data.js +6 -0
  33. package/runtime/lib/core/lynx-page-data.js.map +1 -1
  34. package/runtime/lib/core/lynx-update-data.js +6 -0
  35. package/runtime/lib/core/lynx-update-data.js.map +1 -1
  36. package/runtime/lib/core/performance.d.ts +30 -0
  37. package/runtime/lib/core/performance.js +145 -0
  38. package/runtime/lib/core/performance.js.map +1 -0
  39. package/runtime/lib/core/runtime-destroy.d.ts +4 -0
  40. package/runtime/lib/core/runtime-destroy.js +18 -0
  41. package/runtime/lib/core/runtime-destroy.js.map +1 -0
  42. package/runtime/lib/core/thread-function-call/main-thread.d.ts +5 -0
  43. package/runtime/lib/core/thread-function-call/main-thread.js +69 -0
  44. package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -0
  45. package/runtime/lib/core/thread-function-call/return-value.d.ts +2 -0
  46. package/runtime/lib/core/thread-function-call/return-value.js +67 -0
  47. package/runtime/lib/core/thread-function-call/return-value.js.map +1 -0
  48. package/runtime/lib/element-template/background/attr-slots.d.ts +1 -1
  49. package/runtime/lib/element-template/background/attr-slots.js +8 -7
  50. package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
  51. package/runtime/lib/element-template/background/commit-hook.js +81 -61
  52. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  53. package/runtime/lib/element-template/background/destroy.js +4 -0
  54. package/runtime/lib/element-template/background/destroy.js.map +1 -1
  55. package/runtime/lib/element-template/background/document.js +7 -1
  56. package/runtime/lib/element-template/background/document.js.map +1 -1
  57. package/runtime/lib/element-template/background/hydrate.d.ts +2 -3
  58. package/runtime/lib/element-template/background/hydrate.js +237 -58
  59. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  60. package/runtime/lib/element-template/background/hydration-listener.js +38 -38
  61. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  62. package/runtime/lib/element-template/background/instance.d.ts +31 -4
  63. package/runtime/lib/element-template/background/instance.js +219 -31
  64. package/runtime/lib/element-template/background/instance.js.map +1 -1
  65. package/runtime/lib/element-template/background/render-scope.d.ts +4 -0
  66. package/runtime/lib/element-template/background/render-scope.js +43 -0
  67. package/runtime/lib/element-template/background/render-scope.js.map +1 -0
  68. package/runtime/lib/element-template/debug/alog.d.ts +14 -0
  69. package/runtime/lib/element-template/debug/alog.js +23 -0
  70. package/runtime/lib/element-template/debug/alog.js.map +1 -1
  71. package/runtime/lib/element-template/debug/elementPAPICall.js +1 -0
  72. package/runtime/lib/element-template/debug/elementPAPICall.js.map +1 -1
  73. package/runtime/lib/element-template/index.d.ts +5 -2
  74. package/runtime/lib/element-template/index.js +8 -7
  75. package/runtime/lib/element-template/index.js.map +1 -1
  76. package/runtime/lib/element-template/internal.d.ts +7 -0
  77. package/runtime/lib/element-template/internal.js +9 -9
  78. package/runtime/lib/element-template/internal.js.map +1 -1
  79. package/runtime/lib/element-template/lynx/env.js +2 -0
  80. package/runtime/lib/element-template/lynx/env.js.map +1 -1
  81. package/runtime/lib/element-template/lynx/performance.d.ts +0 -21
  82. package/runtime/lib/element-template/lynx/performance.js +4 -121
  83. package/runtime/lib/element-template/lynx/performance.js.map +1 -1
  84. package/runtime/lib/element-template/native/index.js +3 -1
  85. package/runtime/lib/element-template/native/index.js.map +1 -1
  86. package/runtime/lib/element-template/native/main-thread-api.js +1 -1
  87. package/runtime/lib/element-template/native/main-thread-api.js.map +1 -1
  88. package/runtime/lib/element-template/native/mts-destroy.js +6 -0
  89. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
  90. package/runtime/lib/element-template/native/patch-listener.js +42 -17
  91. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  92. package/runtime/lib/element-template/native/reload-background.d.ts +1 -0
  93. package/runtime/lib/element-template/native/{reload.js → reload-background.js} +1 -26
  94. package/runtime/lib/element-template/native/reload-background.js.map +1 -0
  95. package/runtime/lib/element-template/native/{reload.d.ts → reload-main-thread.d.ts} +0 -1
  96. package/runtime/lib/element-template/native/reload-main-thread.js +39 -0
  97. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -0
  98. package/runtime/lib/element-template/prop-adapters/spread.d.ts +1 -4
  99. package/runtime/lib/element-template/prop-adapters/spread.js +1 -1
  100. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
  101. package/runtime/lib/element-template/protocol/opcodes.d.ts +3 -0
  102. package/runtime/lib/element-template/protocol/opcodes.js +3 -0
  103. package/runtime/lib/element-template/protocol/opcodes.js.map +1 -1
  104. package/runtime/lib/element-template/protocol/template-type.d.ts +25 -0
  105. package/runtime/lib/element-template/protocol/template-type.js +42 -0
  106. package/runtime/lib/element-template/protocol/template-type.js.map +1 -0
  107. package/runtime/lib/element-template/protocol/types.d.ts +38 -15
  108. package/runtime/lib/element-template/protocol/types.js.map +1 -1
  109. package/runtime/lib/element-template/protocol/update-event.d.ts +15 -0
  110. package/runtime/lib/element-template/protocol/update-event.js +24 -0
  111. package/runtime/lib/element-template/protocol/update-event.js.map +1 -0
  112. package/runtime/lib/element-template/runtime/list/list.d.ts +65 -0
  113. package/runtime/lib/element-template/runtime/list/list.js +587 -0
  114. package/runtime/lib/element-template/runtime/list/list.js.map +1 -0
  115. package/runtime/lib/element-template/runtime/patch.d.ts +1 -1
  116. package/runtime/lib/element-template/runtime/patch.js +198 -75
  117. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  118. package/runtime/lib/element-template/runtime/render/render-main-thread.js +13 -0
  119. package/runtime/lib/element-template/runtime/render/render-main-thread.js.map +1 -1
  120. package/runtime/lib/element-template/runtime/render/render-opcodes.js +83 -43
  121. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -1
  122. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js +32 -1
  123. package/runtime/lib/element-template/runtime/render/render-to-opcodes.js.map +1 -1
  124. package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +7 -5
  125. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +17 -4
  126. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
  127. package/runtime/lib/element-template/runtime/template/handle.d.ts +3 -2
  128. package/runtime/lib/element-template/runtime/template/handle.js +11 -0
  129. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  130. package/runtime/lib/element-template/runtime/template/main-thread-background-function.d.ts +10 -0
  131. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +30 -0
  132. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -0
  133. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +15 -0
  134. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +91 -0
  135. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -0
  136. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.d.ts +15 -0
  137. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js +29 -0
  138. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js.map +1 -0
  139. package/runtime/lib/element-template/runtime/template/main-thread-function.d.ts +6 -0
  140. package/runtime/lib/element-template/runtime/template/main-thread-function.js +24 -0
  141. package/runtime/lib/element-template/runtime/template/main-thread-function.js.map +1 -0
  142. package/runtime/lib/element-template/runtime/template/registry.d.ts +2 -0
  143. package/runtime/lib/element-template/runtime/template/registry.js +5 -0
  144. package/runtime/lib/element-template/runtime/template/registry.js.map +1 -1
  145. package/runtime/lib/element-template/runtime-backend-marker.js +6 -0
  146. package/runtime/lib/element-template/runtime-backend-marker.js.map +1 -0
  147. package/runtime/lib/index.d.ts +4 -2
  148. package/runtime/lib/index.js +5 -2
  149. package/runtime/lib/index.js.map +1 -1
  150. package/runtime/lib/internal.d.ts +5 -4
  151. package/runtime/lib/internal.js +6 -5
  152. package/runtime/lib/internal.js.map +1 -1
  153. package/runtime/lib/lynx-api.d.ts +1 -1
  154. package/runtime/lib/lynx-api.js +1 -1
  155. package/runtime/lib/lynx-api.js.map +1 -1
  156. package/runtime/lib/runtime-backend-marker.js +6 -0
  157. package/runtime/lib/runtime-backend-marker.js.map +1 -0
  158. package/runtime/lib/{snapshot/worklet/indexMap.d.ts → shared/index-map.d.ts} +2 -2
  159. package/runtime/lib/{snapshot/worklet/indexMap.js → shared/index-map.js} +5 -3
  160. package/runtime/lib/shared/index-map.js.map +1 -0
  161. package/runtime/lib/snapshot/lifecycle/patch/commit.js +2 -2
  162. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  163. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js +1 -1
  164. package/runtime/lib/snapshot/lifecycle/patch/updateMainThread.js.map +1 -1
  165. package/runtime/lib/snapshot/lynx/calledByNative.js +1 -1
  166. package/runtime/lib/snapshot/lynx/calledByNative.js.map +1 -1
  167. package/runtime/lib/snapshot/lynx/children.d.ts +13 -0
  168. package/runtime/lib/snapshot/lynx/children.js +19 -0
  169. package/runtime/lib/snapshot/lynx/children.js.map +1 -0
  170. package/runtime/lib/snapshot/lynx/performance.d.ts +0 -21
  171. package/runtime/lib/snapshot/lynx/performance.js +7 -121
  172. package/runtime/lib/snapshot/lynx/performance.js.map +1 -1
  173. package/runtime/lib/snapshot/lynx/tt.js +2 -2
  174. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  175. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js +1 -1
  176. package/runtime/lib/snapshot/snapshot/backgroundSnapshot.js.map +1 -1
  177. package/runtime/lib/snapshot/snapshot/snapshot.js +1 -1
  178. package/runtime/lib/snapshot/snapshot/snapshot.js.map +1 -1
  179. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js +10 -31
  180. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -1
  181. package/runtime/lib/snapshot/worklet/ctx.js +2 -2
  182. package/runtime/lib/snapshot/worklet/ctx.js.map +1 -1
  183. package/runtime/lib/snapshot/worklet/destroy.d.ts +0 -1
  184. package/runtime/lib/snapshot/worklet/destroy.js +2 -5
  185. package/runtime/lib/snapshot/worklet/destroy.js.map +1 -1
  186. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  187. package/runtime/lib/worklet-runtime/bindings/observers.d.ts +7 -0
  188. package/runtime/lib/worklet-runtime/bindings/observers.js +14 -1
  189. package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
  190. package/runtime/lib/worklet-runtime/delayRunOnBackground.d.ts +2 -1
  191. package/runtime/lib/worklet-runtime/delayRunOnBackground.js +6 -2
  192. package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -1
  193. package/runtime/lib/worklet-runtime/hydrate.js +3 -0
  194. package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
  195. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +1 -1
  196. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +1 -1
  197. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
  198. package/runtime/lib/worklet-runtime/workletRuntime.js +17 -2
  199. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  200. package/runtime/worklet-runtime/dev.js +26 -9
  201. package/runtime/worklet-runtime/main.js +1 -1
  202. package/testing-library/dist/{rslib-runtime.js → 0~rslib-runtime.js} +14 -13
  203. package/testing-library/dist/env/vitest.js +1 -1
  204. package/testing-library/dist/plugins/index.js +1 -1
  205. package/testing-library/dist/pure.js +18 -18
  206. package/testing-library/dist/rstest-config.js +2 -4
  207. package/testing-library/dist/setupFiles/common/bootstrap.js +1 -0
  208. package/testing-library/dist/setupFiles/common/runtime-setup.js +1 -1
  209. package/testing-library/dist/setupFiles/inner/rstest.js +2 -1
  210. package/testing-library/dist/setupFiles/inner/vitest.js +2 -1
  211. package/testing-library/dist/type-entry/index.js +1 -0
  212. package/transform/dist/wasm.cjs +113 -40
  213. package/types/react.docs.d.ts +14 -0
  214. package/runtime/lib/element-template/native/reload.js.map +0 -1
  215. package/runtime/lib/snapshot/compat/lynxComponent.js.map +0 -1
  216. package/runtime/lib/snapshot/legacy-react-runtime/index.js.map +0 -1
  217. package/runtime/lib/snapshot/lynx/component.js.map +0 -1
  218. package/runtime/lib/snapshot/lynx/dynamic-js.js.map +0 -1
  219. package/runtime/lib/snapshot/lynx/lazy-bundle.js.map +0 -1
  220. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.d.ts +0 -3
  221. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.js +0 -10
  222. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.js.map +0 -1
  223. package/runtime/lib/snapshot/worklet/call/execMap.js +0 -43
  224. package/runtime/lib/snapshot/worklet/call/execMap.js.map +0 -1
  225. package/runtime/lib/snapshot/worklet/call/functionCall.d.ts +0 -1
  226. package/runtime/lib/snapshot/worklet/call/functionCall.js +0 -33
  227. package/runtime/lib/snapshot/worklet/call/functionCall.js.map +0 -1
  228. package/runtime/lib/snapshot/worklet/call/runOnBackground.d.ts +0 -20
  229. package/runtime/lib/snapshot/worklet/call/runOnBackground.js.map +0 -1
  230. package/runtime/lib/snapshot/worklet/call/transformToWorklet.d.ts +0 -1
  231. package/runtime/lib/snapshot/worklet/call/transformToWorklet.js +0 -22
  232. package/runtime/lib/snapshot/worklet/call/transformToWorklet.js.map +0 -1
  233. package/runtime/lib/snapshot/worklet/indexMap.js.map +0 -1
  234. package/testing-library/dist/881.js +0 -1
  235. /package/runtime/lib/{snapshot/lynx/dynamic-js.d.ts → core/lynx/dynamic-import.d.ts} +0 -0
  236. /package/runtime/lib/{snapshot → core}/lynx/lazy-bundle.d.ts +0 -0
  237. /package/runtime/lib/{snapshot → core}/lynx/lazy-bundle.js +0 -0
  238. /package/runtime/lib/{snapshot/lynx/component.d.ts → element-template/runtime-backend-marker.d.ts} +0 -0
  239. /package/runtime/lib/{snapshot/worklet/call/execMap.d.ts → runtime-backend-marker.d.ts} +0 -0
  240. /package/testing-library/dist/{0~123.js → 0~@rstest/adapter-rsbuild.js} +0 -0
@@ -0,0 +1,39 @@
1
+ // Copyright 2026 The Lynx Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+ import { applyUpdatePageData } from '../../core/lynx-page-data.js';
5
+ import { increaseReloadVersion } from '../../core/reload-version.js';
6
+ import { profileEnd, profileStart } from '../debug/profile.js';
7
+ import { destroyAllElementTemplateListStates } from '../runtime/list/list.js';
8
+ import { __page } from '../runtime/page/page.js';
9
+ import { __root, setRoot } from '../runtime/page/root-instance.js';
10
+ import { removeMainThreadRootRefs, renderMainThread } from '../runtime/render/render-main-thread.js';
11
+ import { resetTemplateId } from '../runtime/template/handle.js';
12
+ import { resetElementTemplateMainThreadBackgroundFunctionRuntime } from '../runtime/template/main-thread-background-function.js';
13
+ import { clearMainThreadDynamicAttrState } from '../runtime/template/main-thread-dynamic-attr-state.js';
14
+ import { elementTemplateRegistry } from '../runtime/template/registry.js';
15
+ export function reloadMainThread(data, options) {
16
+ if (typeof __PROFILE__ !== 'undefined' && __PROFILE__) {
17
+ profileStart('ReactLynx::reloadMainThread');
18
+ }
19
+ try {
20
+ increaseReloadVersion();
21
+ applyUpdatePageData(data, options);
22
+ destroyAllElementTemplateListStates();
23
+ elementTemplateRegistry.clear();
24
+ clearMainThreadDynamicAttrState();
25
+ resetElementTemplateMainThreadBackgroundFunctionRuntime();
26
+ resetTemplateId();
27
+ const oldRoot = __root;
28
+ removeMainThreadRootRefs();
29
+ setRoot({ __jsx: oldRoot.__jsx });
30
+ renderMainThread();
31
+ __FlushElementTree(__page, options);
32
+ }
33
+ finally {
34
+ if (typeof __PROFILE__ !== 'undefined' && __PROFILE__) {
35
+ profileEnd();
36
+ }
37
+ }
38
+ }
39
+ //# sourceMappingURL=reload-main-thread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reload-main-thread.js","sourceRoot":"","sources":["../../../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;QAClC,gBAAgB,EAAE,CAAC;QAEnB,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;YACtD,UAAU,EAAE,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,5 +1,2 @@
1
1
  import type { SerializableValue } from '../protocol/types.js';
2
- export interface SpreadAttrAdapterContext {
3
- previousPreparedValue?: unknown;
4
- }
5
- export declare function prepareSpreadAttrSlot(handleId: number, attrSlotIndex: number, value: unknown, _context?: SpreadAttrAdapterContext): SerializableValue | null;
2
+ export declare function prepareSpreadAttrSlot(handleId: number, attrSlotIndex: number, value: unknown): SerializableValue | null;
@@ -11,7 +11,7 @@ function isEventPropKey(key) {
11
11
  function isSpreadRecord(value) {
12
12
  return value !== null && typeof value === 'object' && !Array.isArray(value);
13
13
  }
14
- export function prepareSpreadAttrSlot(handleId, attrSlotIndex, value, _context) {
14
+ export function prepareSpreadAttrSlot(handleId, attrSlotIndex, value) {
15
15
  if (value === false || !isSpreadRecord(value)) {
16
16
  return null;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"spread.js","sourceRoot":"","sources":["../../../src/element-template/prop-adapters/spread.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAOrD,MAAM,kBAAkB,GAAG,kEAAkE,CAAC;AAC9F,MAAM,wBAAwB,GAAG,6EAA6E,CAAC;AAE/G,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,Q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,KAAK,QAAQ,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YACjE,SAAS;QACX,CAAC;QAED,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YAC3C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAsB,CAAC;YAC7D,SAAS;QACX,CAAC;QAED,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;YAClB,MAAM,QAAQ,GAAG,yBAAyB,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;YAC3E,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;YAC7B,CAAC;YACD,SAAS;QACX,CAAC;QAED,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,QAAQ,CAAC,GAAG,CAAC,GAAG,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,KAAK;gBACxF,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;YAChD,SAAS;QACX,CAAC;QAED,IACE,WAAW,KAAK,SAAS;eACtB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;eACpB,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;eACxB,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC;eAClC,OAAO,WAAW,KAAK,UAAU,EACpC,CAAC;YACD,SAAS;QACX,CAAC;QAED,QAAQ,CAAC,GAAG,CAAC,GAAG,WAAgC,CAAC;IACnD,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -4,5 +4,8 @@ export declare const ElementTemplateUpdateOps: {
4
4
  readonly insertNode: 3;
5
5
  readonly removeNode: 4;
6
6
  readonly createTypedElement: 5;
7
+ readonly insertTypedListItem: 6;
8
+ readonly removeTypedListItem: 7;
9
+ readonly updateTypedListItem: 8;
7
10
  };
8
11
  export type ElementTemplateUpdateOp = typeof ElementTemplateUpdateOps[keyof typeof ElementTemplateUpdateOps];
@@ -7,5 +7,8 @@ export const ElementTemplateUpdateOps = {
7
7
  insertNode: 3,
8
8
  removeNode: 4,
9
9
  createTypedElement: 5,
10
+ insertTypedListItem: 6,
11
+ removeTypedListItem: 7,
12
+ updateTypedListItem: 8,
10
13
  };
11
14
  //# sourceMappingURL=opcodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"opcodes.js","sourceRoot":"","sources":["../../../src/element-template/protocol/opcodes.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;IACb,kBAAkB,EAAE,CAAC;CACb,CAAC"}
1
+ {"version":3,"file":"opcodes.js","sourceRoot":"","sources":["../../../src/element-template/protocol/opcodes.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,cAAc,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC;IACf,UAAU,EAAE,CAAC;IACb,UAAU,EAAE,CAAC;IACb,kBAAkB,EAAE,CAAC;IACrB,mBAAmB,EAAE,CAAC;IACtB,mBAAmB,EAAE,CAAC;IACtB,mBAAmB,EAAE,CAAC;CACd,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface ParsedElementTemplateType {
2
+ templateKey: string;
3
+ bundleUrl: string | null;
4
+ }
5
+ /**
6
+ * The `globDynamicComponentEntry` value baked into main-bundle templates. It
7
+ * denotes "the main card", which is equivalent to having no `bundleUrl`, so it
8
+ * normalizes to `null` everywhere the template type is parsed.
9
+ */
10
+ export declare const MAIN_BUNDLE_URL_SENTINEL = "__Card__";
11
+ export declare function parseElementTemplateType(type: string): ParsedElementTemplateType;
12
+ /**
13
+ * The native identity for a template: the bundle-scoped key the main-thread
14
+ * registers it under. The main card has no bundle, so its sentinel is stripped
15
+ * to a bare `templateKey` (preserving native behavior); lazy bundles keep their
16
+ * `${bundleUrl}:${templateKey}` form.
17
+ */
18
+ export declare function elementTemplateIdentityKey(templateKey: string, bundleUrl: string | null | undefined): string;
19
+ /**
20
+ * The full `${globDynamicComponentEntry}:${templateKey}` tag the transform bakes
21
+ * into compiled templates and uses as the `__etAttrPlanMap` key. It always keeps
22
+ * the `__Card__` sentinel for the main card (unlike {@link elementTemplateIdentityKey},
23
+ * which strips it). Inverse of {@link parseElementTemplateType}.
24
+ */
25
+ export declare function elementTemplateTypeTag(templateKey: string, bundleUrl: string | null | undefined): string;
@@ -0,0 +1,42 @@
1
+ // Copyright 2026 The Lynx Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+ /**
5
+ * The `globDynamicComponentEntry` value baked into main-bundle templates. It
6
+ * denotes "the main card", which is equivalent to having no `bundleUrl`, so it
7
+ * normalizes to `null` everywhere the template type is parsed.
8
+ */
9
+ export const MAIN_BUNDLE_URL_SENTINEL = '__Card__';
10
+ export function parseElementTemplateType(type) {
11
+ const delimiter = type.lastIndexOf(':');
12
+ if (delimiter < 0) {
13
+ return {
14
+ templateKey: type,
15
+ bundleUrl: null,
16
+ };
17
+ }
18
+ const bundleUrl = type.slice(0, delimiter);
19
+ return {
20
+ templateKey: type.slice(delimiter + 1),
21
+ bundleUrl: bundleUrl === MAIN_BUNDLE_URL_SENTINEL ? null : bundleUrl,
22
+ };
23
+ }
24
+ /**
25
+ * The native identity for a template: the bundle-scoped key the main-thread
26
+ * registers it under. The main card has no bundle, so its sentinel is stripped
27
+ * to a bare `templateKey` (preserving native behavior); lazy bundles keep their
28
+ * `${bundleUrl}:${templateKey}` form.
29
+ */
30
+ export function elementTemplateIdentityKey(templateKey, bundleUrl) {
31
+ return bundleUrl == null ? templateKey : `${bundleUrl}:${templateKey}`;
32
+ }
33
+ /**
34
+ * The full `${globDynamicComponentEntry}:${templateKey}` tag the transform bakes
35
+ * into compiled templates and uses as the `__etAttrPlanMap` key. It always keeps
36
+ * the `__Card__` sentinel for the main card (unlike {@link elementTemplateIdentityKey},
37
+ * which strips it). Inverse of {@link parseElementTemplateType}.
38
+ */
39
+ export function elementTemplateTypeTag(templateKey, bundleUrl) {
40
+ return `${bundleUrl ?? MAIN_BUNDLE_URL_SENTINEL}:${templateKey}`;
41
+ }
42
+ //# sourceMappingURL=template-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-type.js","sourceRoot":"","sources":["../../../src/element-template/protocol/template-type.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAO1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;AAEnD,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO;YACL,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAC3C,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;QACtC,SAAS,EAAE,SAAS,KAAK,wBAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;KACrE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,WAAmB,EACnB,SAAoC;IAEpC,OAAO,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,WAAW,EAAE,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,WAAmB,EACnB,SAAoC;IAEpC,OAAO,GAAG,SAAS,IAAI,wBAAwB,IAAI,WAAW,EAAE,CAAC;AACnE,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { RunWorkletCtxData } from '@lynx-js/react/worklet-runtime/bindings';
1
2
  import { ElementTemplateUpdateOps } from './opcodes.js';
2
3
  export type SerializableValue = string | number | boolean | null | SerializableValue[] | {
3
4
  [key: string]: SerializableValue;
@@ -11,12 +12,19 @@ export type RuntimeAttributeSlotValue = SerializableValue | ((...args: unknown[]
11
12
  };
12
13
  export type RuntimeTypedElementAttributes = Record<string, RuntimeAttributeSlotValue>;
13
14
  export type TypedElementAttributesCommand = Record<string, SerializableValue>;
15
+ export type RuntimeElementSlots = Array<ElementRef[] | null | undefined>;
16
+ export type ElementTemplateHandleSlotsCommand = Array<number[] | null | undefined>;
17
+ export type SerializedEtNodeSlots = Array<SerializedEtNode[] | null | undefined>;
14
18
  export interface ElementTemplateHandleRefCommandValue {
15
19
  __etHandleRef: number;
16
20
  [key: string]: SerializableValue;
17
21
  }
22
+ export interface UpdateTypedListItemCommand extends ElementTemplateHandleRefCommandValue {
23
+ type: string;
24
+ platformInfo: Record<string, SerializableValue>;
25
+ }
18
26
  export interface RuntimeOptionsCommand extends Record<string, SerializableValue> {
19
- listChildren?: ElementTemplateHandleRefCommandValue[];
27
+ listChildren?: UpdateTypedListItemCommand[];
20
28
  }
21
29
  export type SerializedRuntimeOptionValue = SerializableValue | SerializedEtNode | SerializedRuntimeOptionValue[] | {
22
30
  [key: string]: SerializedRuntimeOptionValue;
@@ -24,29 +32,25 @@ export type SerializedRuntimeOptionValue = SerializableValue | SerializedEtNode
24
32
  export type SerializedRuntimeOptions = Record<string, SerializedRuntimeOptionValue>;
25
33
  export interface SerializedEtNodeBase {
26
34
  attributeSlots?: SerializableValue[] | null;
27
- elementSlots?: SerializedEtNode[][] | null;
35
+ elementSlots?: SerializedEtNodeSlots | null;
28
36
  uid: number | string;
29
37
  options?: SerializedRuntimeOptions | null;
30
38
  }
31
39
  export interface SerializedCompiledNode extends SerializedEtNodeBase {
32
40
  templateKey: string;
33
41
  bundleUrl?: string;
42
+ attributeSlots?: SerializableValue[] | null;
34
43
  }
35
44
  export interface SerializedTypedNode extends SerializedEtNodeBase {
36
- type: string;
45
+ tag: string;
46
+ attributes?: TypedElementAttributesCommand | null;
37
47
  }
38
48
  export type SerializedEtNode = SerializedCompiledNode | SerializedTypedNode;
39
49
  export interface ElementTemplateHydrateCommitContext {
40
50
  instances: SerializedEtNode[];
41
51
  reloadVersion?: number;
42
52
  }
43
- export interface SerializedElementTemplate {
44
- templateKey: string;
45
- bundleUrl?: string;
46
- attributeSlots?: SerializableValue[] | null;
47
- elementSlots?: SerializedElementTemplate[][] | null;
48
- uid: number | string;
49
- options?: SerializedRuntimeOptions | null;
53
+ export interface SerializedElementTemplate extends SerializedCompiledNode {
50
54
  }
51
55
  export type CreateTemplateCommand = [
52
56
  typeof ElementTemplateUpdateOps.createTemplate,
@@ -54,7 +58,7 @@ export type CreateTemplateCommand = [
54
58
  templateKey: string,
55
59
  bundleUrl: string | null | undefined,
56
60
  attributeSlots: SerializableValue[] | null | undefined,
57
- elementSlots: number[][] | null | undefined
61
+ elementSlots: ElementTemplateHandleSlotsCommand | null | undefined
58
62
  ];
59
63
  export type SetAttributeCommand = [
60
64
  typeof ElementTemplateUpdateOps.setAttribute,
@@ -81,10 +85,27 @@ export type CreateTypedElementCommand = [
81
85
  handleId: number,
82
86
  type: string,
83
87
  attributes: TypedElementAttributesCommand | null | undefined,
84
- elementSlots: number[][] | null | undefined,
88
+ elementSlots: ElementTemplateHandleSlotsCommand | null | undefined,
85
89
  options: RuntimeOptionsCommand | null | undefined
86
90
  ];
87
- export type ElementTemplateUpdateCommand = CreateTemplateCommand | SetAttributeCommand | InsertNodeCommand | RemoveNodeCommand | CreateTypedElementCommand;
91
+ export type InsertTypedListItemCommand = [
92
+ typeof ElementTemplateUpdateOps.insertTypedListItem,
93
+ listHandleId: number,
94
+ item: UpdateTypedListItemCommand,
95
+ beforeHandleId: number
96
+ ];
97
+ export type RemoveTypedListItemCommand = [
98
+ typeof ElementTemplateUpdateOps.removeTypedListItem,
99
+ listHandleId: number,
100
+ itemHandleId: number,
101
+ removedSubtreeHandleIds: number[]
102
+ ];
103
+ export type UpdateTypedListItemInfoCommand = [
104
+ typeof ElementTemplateUpdateOps.updateTypedListItem,
105
+ listHandleId: number,
106
+ item: UpdateTypedListItemCommand
107
+ ];
108
+ export type ElementTemplateUpdateCommand = CreateTemplateCommand | SetAttributeCommand | InsertNodeCommand | RemoveNodeCommand | CreateTypedElementCommand | InsertTypedListItemCommand | RemoveTypedListItemCommand | UpdateTypedListItemInfoCommand;
88
109
  export type ElementTemplateUpdateCommandStream = ElementTemplateUpdateCommand[number][];
89
110
  export interface ElementTemplateFlushOptions {
90
111
  pipelineOptions?: PipelineOptions;
@@ -93,6 +114,8 @@ export interface ElementTemplateFlushOptions {
93
114
  export interface ElementTemplateUpdateCommitContext {
94
115
  ops: ElementTemplateUpdateCommandStream;
95
116
  flushOptions: ElementTemplateFlushOptions;
96
- flowIds?: number[];
97
- reloadVersion?: number;
117
+ flowIds?: number[] | undefined;
118
+ isHydration?: boolean | undefined;
119
+ reloadVersion?: number | undefined;
120
+ delayedRunOnMainThreadData?: RunWorkletCtxData[] | undefined;
98
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/element-template/protocol/types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/element-template/protocol/types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAI1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ElementTemplateUpdateCommitContext } from './types.js';
2
+ export interface ElementTemplateUpdatePatchOptions {
3
+ pipelineOptions?: PipelineOptions | undefined;
4
+ reloadVersion?: number | undefined;
5
+ flowIds?: number[] | undefined;
6
+ }
7
+ export interface ElementTemplateUpdateEventData {
8
+ payload: string;
9
+ patchOptions: ElementTemplateUpdatePatchOptions;
10
+ }
11
+ export interface ElementTemplateUpdateEvent extends RuntimeProxy.Event {
12
+ data: ElementTemplateUpdateEventData;
13
+ }
14
+ export declare function createElementTemplateUpdateEvent(payload: ElementTemplateUpdateCommitContext): ElementTemplateUpdateEvent;
15
+ export declare function parseElementTemplateUpdateEventPayload(data: unknown): ElementTemplateUpdateCommitContext;
@@ -0,0 +1,24 @@
1
+ // Copyright 2026 The Lynx Authors. All rights reserved.
2
+ // Licensed under the Apache License Version 2.0 that can be found in the
3
+ // LICENSE file in the root directory of this source tree.
4
+ import { ElementTemplateLifecycleConstant } from './lifecycle-constant.js';
5
+ export function createElementTemplateUpdateEvent(payload) {
6
+ const flowIds = payload.ops.length > 0 && payload.flowIds && payload.flowIds.length > 0
7
+ ? payload.flowIds
8
+ : undefined;
9
+ return {
10
+ type: ElementTemplateLifecycleConstant.update,
11
+ data: {
12
+ payload: JSON.stringify(payload),
13
+ patchOptions: {
14
+ pipelineOptions: payload.flushOptions.pipelineOptions,
15
+ reloadVersion: payload.reloadVersion,
16
+ flowIds,
17
+ },
18
+ },
19
+ };
20
+ }
21
+ export function parseElementTemplateUpdateEventPayload(data) {
22
+ return JSON.parse(data.payload);
23
+ }
24
+ //# sourceMappingURL=update-event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-event.js","sourceRoot":"","sources":["../../../src/element-template/protocol/update-event.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAkB3E,MAAM,UAAU,gCAAgC,CAC9C,OAA2C;IAE3C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QACrF,CAAC,CAAC,OAAO,CAAC,OAAO;QACjB,CAAC,CAAC,SAAS,CAAC;IACd,OAAO;QACL,IAAI,EAAE,gCAAgC,CAAC,MAAM;QAC7C,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAChC,YAAY,EAAE;gBACZ,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC,eAAe;gBACrD,aAAa,EAAE,OAAO,CAAC,aAAa;gBACpC,OAAO;aACR;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sCAAsC,CACpD,IAAa;IAEb,OAAO,IAAI,CAAC,KAAK,CAAE,IAAuC,CAAC,OAAO,CAAuC,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,65 @@
1
+ import type { RuntimeTypedElementAttributes, SerializableValue } from '../../protocol/types.js';
2
+ export type ETListItemPlatformInfo = Record<string, SerializableValue>;
3
+ export interface ETListItemMeta {
4
+ templateKey: string;
5
+ platformInfo: ETListItemPlatformInfo;
6
+ }
7
+ interface ETListItemRecord extends ETListItemMeta {
8
+ uid: number;
9
+ ref: ElementRef;
10
+ attached: boolean;
11
+ needsAttachMove: boolean;
12
+ skipNextEnqueue: boolean;
13
+ }
14
+ interface ETListCallbacks {
15
+ componentAtIndex: ComponentAtIndexCallback;
16
+ componentAtIndexes: ComponentAtIndexesCallback;
17
+ enqueueComponent: EnqueueComponentCallback;
18
+ }
19
+ export interface ETListState {
20
+ listHandleId: number | null;
21
+ holderRef: ElementRef | null;
22
+ items: ETListItemRecord[];
23
+ callbackItemBySign: Map<number, ETListItemRecord>;
24
+ destroyed: boolean;
25
+ hasAttachedMoves: boolean;
26
+ attributes: RuntimeTypedElementAttributes;
27
+ callbacks: ETListCallbacks;
28
+ }
29
+ export interface ETListUpdateItem extends ETListItemMeta {
30
+ uid: number;
31
+ ref: ElementRef;
32
+ }
33
+ export interface ETListUpdateInfo {
34
+ insertAction: Array<{
35
+ position: number;
36
+ type: string;
37
+ } & ETListItemPlatformInfo>;
38
+ removeAction: number[];
39
+ updateAction: Array<{
40
+ from: number;
41
+ to: number;
42
+ type: string;
43
+ flush: boolean;
44
+ } & ETListItemPlatformInfo>;
45
+ }
46
+ export interface ETListFlushResult {
47
+ uid: number;
48
+ attributes: RuntimeTypedElementAttributes;
49
+ removedSubtreeHandleIds?: number[];
50
+ }
51
+ export declare function registerElementTemplateListItem(uid: number, ref: ElementRef, meta: ETListItemMeta): void;
52
+ export declare function createElementTemplateListState(listItemUids: readonly number[], attributes?: RuntimeTypedElementAttributes | null): ETListState;
53
+ export declare function createElementTemplateListInitialUpdateInfo(state: ETListState): ETListUpdateInfo;
54
+ export declare function createElementTemplateListStateFromItems(items: ETListUpdateItem[], attributes?: RuntimeTypedElementAttributes | null): ETListState;
55
+ export declare function registerElementTemplateListState(uid: number, state: ETListState, needsInitialFlush: boolean, holderRef: ElementRef): void;
56
+ export declare function markElementTemplateListDestroyed(uid: number): number[] | undefined;
57
+ export declare function destroyAllElementTemplateListStates(): void;
58
+ export declare function updateElementTemplateListAttributes(uid: number, attributes: RuntimeTypedElementAttributes | null | undefined, updateListInfo?: ETListUpdateInfo): RuntimeTypedElementAttributes | null;
59
+ export declare function insertElementTemplateListItem(uid: number, item: ETListUpdateItem, beforeUid: number): void;
60
+ export declare function removeElementTemplateListItem(uid: number, itemUid: number, removedSubtreeHandleIds: readonly number[]): void;
61
+ export declare function updateElementTemplateListItem(uid: number, item: ETListUpdateItem): void;
62
+ export declare function flushPendingElementTemplateListUpdates(): ETListFlushResult[];
63
+ export declare function flushInitialElementTemplateListUpdates(): ETListFlushResult[];
64
+ export declare function composeElementTemplateListAttributes(attributes: RuntimeTypedElementAttributes | null | undefined, state: ETListState, updateListInfo?: ETListUpdateInfo): RuntimeTypedElementAttributes;
65
+ export {};