@lynx-js/react 0.121.2 → 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 (151) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +2 -2
  3. package/runtime/lib/core/background-function/exec-map.d.ts +11 -0
  4. package/runtime/lib/core/background-function/exec-map.js +39 -0
  5. package/runtime/lib/core/background-function/exec-map.js.map +1 -0
  6. package/runtime/lib/core/background-function/handle.d.ts +8 -0
  7. package/runtime/lib/core/background-function/handle.js +25 -0
  8. package/runtime/lib/core/background-function/handle.js.map +1 -0
  9. package/runtime/lib/core/background-function/run-on-background.d.ts +8 -0
  10. package/runtime/lib/{snapshot/worklet/call/runOnBackground.js → core/background-function/run-on-background.js} +39 -33
  11. package/runtime/lib/core/background-function/run-on-background.js.map +1 -0
  12. package/runtime/lib/core/initData.js +35 -0
  13. package/runtime/lib/core/initData.js.map +1 -1
  14. package/runtime/lib/core/lynx-page-data.js +6 -0
  15. package/runtime/lib/core/lynx-page-data.js.map +1 -1
  16. package/runtime/lib/core/lynx-update-data.js +6 -0
  17. package/runtime/lib/core/lynx-update-data.js.map +1 -1
  18. package/runtime/lib/core/runtime-destroy.d.ts +4 -0
  19. package/runtime/lib/core/runtime-destroy.js +18 -0
  20. package/runtime/lib/core/runtime-destroy.js.map +1 -0
  21. package/runtime/lib/core/thread-function-call/main-thread.d.ts +5 -0
  22. package/runtime/lib/core/thread-function-call/main-thread.js +69 -0
  23. package/runtime/lib/core/thread-function-call/main-thread.js.map +1 -0
  24. package/runtime/lib/core/thread-function-call/return-value.d.ts +2 -0
  25. package/runtime/lib/core/thread-function-call/return-value.js +67 -0
  26. package/runtime/lib/core/thread-function-call/return-value.js.map +1 -0
  27. package/runtime/lib/element-template/background/attr-slots.d.ts +1 -1
  28. package/runtime/lib/element-template/background/attr-slots.js +8 -7
  29. package/runtime/lib/element-template/background/attr-slots.js.map +1 -1
  30. package/runtime/lib/element-template/background/commit-hook.js +79 -59
  31. package/runtime/lib/element-template/background/commit-hook.js.map +1 -1
  32. package/runtime/lib/element-template/background/destroy.js +4 -0
  33. package/runtime/lib/element-template/background/destroy.js.map +1 -1
  34. package/runtime/lib/element-template/background/hydrate.js +29 -6
  35. package/runtime/lib/element-template/background/hydrate.js.map +1 -1
  36. package/runtime/lib/element-template/background/hydration-listener.js +33 -14
  37. package/runtime/lib/element-template/background/hydration-listener.js.map +1 -1
  38. package/runtime/lib/element-template/background/instance.d.ts +1 -1
  39. package/runtime/lib/element-template/background/instance.js +10 -3
  40. package/runtime/lib/element-template/background/instance.js.map +1 -1
  41. package/runtime/lib/element-template/background/render-scope.d.ts +4 -0
  42. package/runtime/lib/element-template/background/render-scope.js +43 -0
  43. package/runtime/lib/element-template/background/render-scope.js.map +1 -0
  44. package/runtime/lib/element-template/index.d.ts +2 -0
  45. package/runtime/lib/element-template/index.js +2 -0
  46. package/runtime/lib/element-template/index.js.map +1 -1
  47. package/runtime/lib/element-template/internal.d.ts +4 -1
  48. package/runtime/lib/element-template/internal.js +5 -5
  49. package/runtime/lib/element-template/internal.js.map +1 -1
  50. package/runtime/lib/element-template/lynx/env.js +2 -0
  51. package/runtime/lib/element-template/lynx/env.js.map +1 -1
  52. package/runtime/lib/element-template/native/index.js +2 -0
  53. package/runtime/lib/element-template/native/index.js.map +1 -1
  54. package/runtime/lib/element-template/native/mts-destroy.js +4 -0
  55. package/runtime/lib/element-template/native/mts-destroy.js.map +1 -1
  56. package/runtime/lib/element-template/native/patch-listener.js +41 -16
  57. package/runtime/lib/element-template/native/patch-listener.js.map +1 -1
  58. package/runtime/lib/element-template/native/reload-main-thread.js +4 -0
  59. package/runtime/lib/element-template/native/reload-main-thread.js.map +1 -1
  60. package/runtime/lib/element-template/prop-adapters/spread.d.ts +1 -4
  61. package/runtime/lib/element-template/prop-adapters/spread.js +1 -1
  62. package/runtime/lib/element-template/prop-adapters/spread.js.map +1 -1
  63. package/runtime/lib/element-template/protocol/template-type.d.ts +19 -0
  64. package/runtime/lib/element-template/protocol/template-type.js +23 -1
  65. package/runtime/lib/element-template/protocol/template-type.js.map +1 -1
  66. package/runtime/lib/element-template/protocol/types.d.ts +5 -2
  67. package/runtime/lib/element-template/protocol/types.js.map +1 -1
  68. package/runtime/lib/element-template/protocol/update-event.d.ts +15 -0
  69. package/runtime/lib/element-template/protocol/update-event.js +24 -0
  70. package/runtime/lib/element-template/protocol/update-event.js.map +1 -0
  71. package/runtime/lib/element-template/runtime/patch.d.ts +1 -1
  72. package/runtime/lib/element-template/runtime/patch.js +23 -3
  73. package/runtime/lib/element-template/runtime/patch.js.map +1 -1
  74. package/runtime/lib/element-template/runtime/render/render-opcodes.js +5 -2
  75. package/runtime/lib/element-template/runtime/render/render-opcodes.js.map +1 -1
  76. package/runtime/lib/element-template/runtime/template/attr-slot-plan.d.ts +7 -5
  77. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js +17 -4
  78. package/runtime/lib/element-template/runtime/template/attr-slot-plan.js.map +1 -1
  79. package/runtime/lib/element-template/runtime/template/handle.js +7 -1
  80. package/runtime/lib/element-template/runtime/template/handle.js.map +1 -1
  81. package/runtime/lib/element-template/runtime/template/main-thread-background-function.d.ts +10 -0
  82. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js +30 -0
  83. package/runtime/lib/element-template/runtime/template/main-thread-background-function.js.map +1 -0
  84. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.d.ts +15 -0
  85. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js +91 -0
  86. package/runtime/lib/element-template/runtime/template/main-thread-dynamic-attr-state.js.map +1 -0
  87. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.d.ts +15 -0
  88. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js +29 -0
  89. package/runtime/lib/element-template/runtime/template/main-thread-event-ctx.js.map +1 -0
  90. package/runtime/lib/element-template/runtime/template/main-thread-function.d.ts +6 -0
  91. package/runtime/lib/element-template/runtime/template/main-thread-function.js +24 -0
  92. package/runtime/lib/element-template/runtime/template/main-thread-function.js.map +1 -0
  93. package/runtime/lib/index.d.ts +3 -1
  94. package/runtime/lib/index.js +2 -1
  95. package/runtime/lib/index.js.map +1 -1
  96. package/runtime/lib/internal.d.ts +1 -1
  97. package/runtime/lib/internal.js +1 -1
  98. package/runtime/lib/internal.js.map +1 -1
  99. package/runtime/lib/lynx-api.d.ts +1 -1
  100. package/runtime/lib/lynx-api.js +1 -1
  101. package/runtime/lib/lynx-api.js.map +1 -1
  102. package/runtime/lib/{snapshot/worklet/indexMap.d.ts → shared/index-map.d.ts} +2 -2
  103. package/runtime/lib/{snapshot/worklet/indexMap.js → shared/index-map.js} +5 -3
  104. package/runtime/lib/shared/index-map.js.map +1 -0
  105. package/runtime/lib/snapshot/lifecycle/patch/commit.js +1 -1
  106. package/runtime/lib/snapshot/lifecycle/patch/commit.js.map +1 -1
  107. package/runtime/lib/snapshot/lynx/children.d.ts +13 -0
  108. package/runtime/lib/snapshot/lynx/children.js +19 -0
  109. package/runtime/lib/snapshot/lynx/children.js.map +1 -0
  110. package/runtime/lib/snapshot/lynx/tt.js +1 -1
  111. package/runtime/lib/snapshot/lynx/tt.js.map +1 -1
  112. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js +10 -31
  113. package/runtime/lib/snapshot/worklet/call/runOnMainThread.js.map +1 -1
  114. package/runtime/lib/snapshot/worklet/ctx.js +2 -2
  115. package/runtime/lib/snapshot/worklet/ctx.js.map +1 -1
  116. package/runtime/lib/snapshot/worklet/destroy.d.ts +0 -1
  117. package/runtime/lib/snapshot/worklet/destroy.js +2 -5
  118. package/runtime/lib/snapshot/worklet/destroy.js.map +1 -1
  119. package/runtime/lib/tsconfig.tsbuildinfo +1 -1
  120. package/runtime/lib/worklet-runtime/bindings/observers.d.ts +7 -0
  121. package/runtime/lib/worklet-runtime/bindings/observers.js +14 -1
  122. package/runtime/lib/worklet-runtime/bindings/observers.js.map +1 -1
  123. package/runtime/lib/worklet-runtime/delayRunOnBackground.d.ts +2 -1
  124. package/runtime/lib/worklet-runtime/delayRunOnBackground.js +6 -2
  125. package/runtime/lib/worklet-runtime/delayRunOnBackground.js.map +1 -1
  126. package/runtime/lib/worklet-runtime/hydrate.js +3 -0
  127. package/runtime/lib/worklet-runtime/hydrate.js.map +1 -1
  128. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.d.ts +1 -1
  129. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js +1 -1
  130. package/runtime/lib/worklet-runtime/jsFunctionLifecycle.js.map +1 -1
  131. package/runtime/lib/worklet-runtime/workletRuntime.js +17 -2
  132. package/runtime/lib/worklet-runtime/workletRuntime.js.map +1 -1
  133. package/runtime/worklet-runtime/dev.js +26 -8
  134. package/runtime/worklet-runtime/main.js +1 -1
  135. package/transform/dist/wasm.cjs +1 -1
  136. package/types/react.docs.d.ts +14 -0
  137. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.d.ts +0 -3
  138. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.js +0 -10
  139. package/runtime/lib/snapshot/worklet/call/delayedRunOnMainThreadData.js.map +0 -1
  140. package/runtime/lib/snapshot/worklet/call/execMap.d.ts +0 -1
  141. package/runtime/lib/snapshot/worklet/call/execMap.js +0 -43
  142. package/runtime/lib/snapshot/worklet/call/execMap.js.map +0 -1
  143. package/runtime/lib/snapshot/worklet/call/functionCall.d.ts +0 -1
  144. package/runtime/lib/snapshot/worklet/call/functionCall.js +0 -33
  145. package/runtime/lib/snapshot/worklet/call/functionCall.js.map +0 -1
  146. package/runtime/lib/snapshot/worklet/call/runOnBackground.d.ts +0 -20
  147. package/runtime/lib/snapshot/worklet/call/runOnBackground.js.map +0 -1
  148. package/runtime/lib/snapshot/worklet/call/transformToWorklet.d.ts +0 -1
  149. package/runtime/lib/snapshot/worklet/call/transformToWorklet.js +0 -22
  150. package/runtime/lib/snapshot/worklet/call/transformToWorklet.js.map +0 -1
  151. package/runtime/lib/snapshot/worklet/indexMap.js.map +0 -1
@@ -1,6 +1,9 @@
1
1
  // Copyright 2024 The Lynx Authors. All rights reserved.
2
2
  // Licensed under the Apache License Version 2.0 that can be found in the
3
3
  // LICENSE file in the root directory of this source tree.
4
+
5
+ import type { ReactLynxChildren } from '../runtime/lib/index.js';
6
+
4
7
  declare global {
5
8
  /**
6
9
  * Determines if code should be placed in the background thread, used as a compile-time define macro
@@ -68,6 +71,17 @@ export { Fragment, Suspense } from 'react';
68
71
  */
69
72
  export { Component, PureComponent, cloneElement, createElement, createRef, isValidElement } from 'react';
70
73
 
74
+ export type { ReactLynxChildren } from '../runtime/lib/index.js';
75
+
76
+ /**
77
+ * ReactLynx children utilities.
78
+ *
79
+ * Arrays returned by `map`, `forEach`, and `toArray` are frozen.
80
+ *
81
+ * @public
82
+ */
83
+ export const Children: ReactLynxChildren;
84
+
71
85
  /**
72
86
  * Renders children into a different ReactLynx element identified by a
73
87
  * `NodesRef` (e.g. from `ref={setX}` or `lynx.createSelectorQuery()`).
@@ -1,3 +0,0 @@
1
- import type { RunWorkletCtxData } from '@lynx-js/react/worklet-runtime/bindings';
2
- export declare let delayedRunOnMainThreadData: RunWorkletCtxData[];
3
- export declare function takeDelayedRunOnMainThreadData(): typeof delayedRunOnMainThreadData;
@@ -1,10 +0,0 @@
1
- // Copyright 2025 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
- export let delayedRunOnMainThreadData = [];
5
- export function takeDelayedRunOnMainThreadData() {
6
- const data = delayedRunOnMainThreadData;
7
- delayedRunOnMainThreadData = [];
8
- return data;
9
- }
10
- //# sourceMappingURL=delayedRunOnMainThreadData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delayedRunOnMainThreadData.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/call/delayedRunOnMainThreadData.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAI1D,MAAM,CAAC,IAAI,0BAA0B,GAAwB,EAAE,CAAC;AAEhE,MAAM,UAAU,8BAA8B;IAC5C,MAAM,IAAI,GAAG,0BAA0B,CAAC;IACxC,0BAA0B,GAAG,EAAE,CAAC;IAChC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,43 +0,0 @@
1
- import { IndexMap } from '../indexMap.js';
2
- /**
3
- * `WorkletExecIdMap` ensures the worklet object is not released in js context when the main thread is still holding the
4
- * worklet object (or any of its jsFnHandles). The worklet object holds the js functions which might be called by `runOnBackground()`.
5
- * If the worklet object is incorrectly released earlier, the `runOnBackground()` would result in failure.
6
- *
7
- * Every time a worklet object is sent to the main thread, an `execId` is distributed and will be sent to element
8
- * context with the worklet object. This relationship is recorded in this class. When all the references to the
9
- * worklet object are released in the main thread, a message will be sent back to remove the record here.
10
- *
11
- * @internal
12
- */
13
- export class WorkletExecIdMap extends IndexMap {
14
- add(worklet) {
15
- const execId = super.add(worklet);
16
- worklet._execId = execId;
17
- return execId;
18
- }
19
- findJsFnHandle(execId, fnId) {
20
- const worklet = this.get(execId);
21
- if (!worklet) {
22
- return undefined;
23
- }
24
- const f = (value) => {
25
- if (value === null || typeof value !== 'object') {
26
- return undefined;
27
- }
28
- const obj = value;
29
- if ('_jsFnId' in obj && obj['_jsFnId'] === fnId) {
30
- return obj;
31
- }
32
- for (const i in obj) {
33
- const result = f(obj[i]);
34
- if (result) {
35
- return result;
36
- }
37
- }
38
- return undefined;
39
- };
40
- return f(worklet);
41
- }
42
- }
43
- //# sourceMappingURL=execMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execMap.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/call/execMap.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gBAAiB,SAAQ,QAAiB;IACrC,GAAG,CAAC,OAAgB;QAClC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;QACzB,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,cAAc,CAAC,MAAc,EAAE,IAAY;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,CAAC,GAAG,CAAC,KAAc,EAA0B,EAAE;YACnD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAChD,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,GAAG,GAAG,KAAgC,CAAC;YAC7C,IAAI,SAAS,IAAI,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;gBAChD,OAAO,GAAiB,CAAC;YAC3B,CAAC;YACD,KAAK,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;gBACpB,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzB,IAAI,MAAM,EAAE,CAAC;oBACX,OAAO,MAAM,CAAC;gBAChB,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC;QAEF,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;CACF"}
@@ -1 +0,0 @@
1
- export { onFunctionCall };
@@ -1,33 +0,0 @@
1
- // Copyright 2025 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 { WorkletEvents } from '@lynx-js/react/worklet-runtime/bindings';
5
- import { destroyTasks } from '../destroy.js';
6
- import { IndexMap } from '../indexMap.js';
7
- let resolveMap;
8
- function initReturnValueListener() {
9
- const context = __JS__ ? lynx.getCoreContext() : lynx.getJSContext();
10
- resolveMap = new IndexMap();
11
- context.addEventListener(WorkletEvents.FunctionCallRet, onFunctionCallRet);
12
- destroyTasks.push(() => {
13
- context.removeEventListener(WorkletEvents.FunctionCallRet, onFunctionCallRet);
14
- resolveMap = undefined;
15
- });
16
- }
17
- /**
18
- * @internal
19
- */
20
- function onFunctionCall(resolve) {
21
- if (!resolveMap) {
22
- initReturnValueListener();
23
- }
24
- return resolveMap.add(resolve);
25
- }
26
- function onFunctionCallRet(event) {
27
- const data = JSON.parse(event.data);
28
- const resolve = resolveMap.get(data.resolveId);
29
- resolveMap.remove(data.resolveId);
30
- resolve(data.returnValue);
31
- }
32
- export { onFunctionCall };
33
- //# sourceMappingURL=functionCall.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"functionCall.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/call/functionCall.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,IAAI,UAAsD,CAAC;AAE3D,SAAS,uBAAuB;IAC9B,MAAM,OAAO,GAAiB,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;IAEnF,UAAU,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC5B,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IAE3E,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE;QACrB,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;QAC9E,UAAU,GAAG,SAAS,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,OAA6B;IACnD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,uBAAuB,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,UAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAyB;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAc,CAAyB,CAAC;IACtE,MAAM,OAAO,GAAG,UAAW,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAE,CAAC;IACjD,UAAW,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC5B,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,20 +0,0 @@
1
- /**
2
- * `runOnBackground` allows triggering js functions on the background thread asynchronously.
3
- * @param f - The js function to be called.
4
- * @returns A function. Calling which with the arguments to be passed to the js function to trigger it on the background thread. This function returns a promise that resolves to the return value of the js function.
5
- * @example
6
- * ```ts
7
- * import { runOnBackground } from '@lynx-js/react';
8
- *
9
- * async function someMainthreadFunction() {
10
- * 'main thread';
11
- * const fn = runOnBackground(() => {
12
- * return 'hello';
13
- * });
14
- * const result = await fn();
15
- }
16
- * ```
17
- * @public
18
- */
19
- declare function runOnBackground<R, Fn extends (...args: any[]) => R>(f: Fn): (...args: Parameters<Fn>) => Promise<R>;
20
- export { registerWorkletCtx, runJSFunction, runOnBackground };
@@ -1 +0,0 @@
1
- {"version":3,"file":"runOnBackground.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/call/runOnBackground.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAQ1D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE9F,OAAO,EAAE,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,cAAc,CAAC,OAAO,CAAC,CAAC;YAE1C,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC;gBACvB,oBAAoB,CAAC,GAAG,EAAE,CAAC,IAAY,EAAE,MAAc,EAAE,EAAE;oBACzD,kCAAkC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;gBACtE,CAAC,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YAED,kCAAkC,CAAC,GAAG,CAAC,OAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,OAAQ,EAAE,SAAS,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kCAAkC,CACzC,IAAY,EACZ,MAA0B,EAC1B,MAAc,EACd,SAAiB;IAEjB,IAAI,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC;QAChC,IAAI,EAAE,aAAa,CAAC,eAAe;QACnC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,GAAG,EAAE;gBACH,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,MAAM;aAChB;YACD,MAAM;YACN,SAAS;SACa,CAAC;KAC1B,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC"}
@@ -1,22 +0,0 @@
1
- let lastId = 0;
2
- /**
3
- * transform args of `runOnBackground()`.
4
- *
5
- * @internal
6
- */
7
- export function transformToWorklet(obj) {
8
- const id = ++lastId;
9
- if (typeof obj !== 'function') {
10
- // We save the error message in the object, so that we can throw it later when the function is called on the main thread.
11
- return {
12
- _jsFnId: id,
13
- _error: `Argument of runOnBackground should be a function, but got [${typeof obj}] instead`,
14
- };
15
- }
16
- obj.toJSON ??= () => '[BackgroundFunction]';
17
- return {
18
- _jsFnId: id,
19
- _fn: obj,
20
- };
21
- }
22
- //# sourceMappingURL=transformToWorklet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformToWorklet.js","sourceRoot":"","sources":["../../../../src/snapshot/worklet/call/transformToWorklet.ts"],"names":[],"mappings":"AAKA,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAA0D;IAC3F,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC;IACpB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,yHAAyH;QACzH,OAAO;YACL,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,8DAA8D,OAAO,GAAG,WAAW;SAC5F,CAAC;IACJ,CAAC;IACD,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC,sBAAsB,CAAC;IAC5C,OAAO;QACL,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,GAAG;KACT,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexMap.js","sourceRoot":"","sources":["../../../src/snapshot/worklet/indexMap.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,QAAQ;IACF,SAAS,GAAG,CAAC,CAAC;IACd,QAAQ,GAAmB,IAAI,GAAG,EAAa,CAAC;IAEnD,GAAG,CAAC,KAAQ;QACjB,MAAM,KAAK,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,GAAG,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,KAAa;QACzB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACF;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}