@truewatchtech/cocos-sdk 0.1.0-alpha.4 → 0.1.0-alpha.7

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 (181) hide show
  1. package/README.md +49 -1
  2. package/bin/cli.cjs +48 -18
  3. package/bin/legacy-asset-hashes.json +32 -0
  4. package/bin/managed-assets.cjs +67 -0
  5. package/dist/creator2/core/client.d.ts +55 -7
  6. package/dist/creator2/core/client.d.ts.map +1 -1
  7. package/dist/creator2/core/client.js +74 -28
  8. package/dist/creator2/core/client.js.map +1 -1
  9. package/dist/creator2/core/index.d.ts +1 -1
  10. package/dist/creator2/core/index.d.ts.map +1 -1
  11. package/dist/creator2/core/index.js.map +1 -1
  12. package/dist/creator2/core/plugin-api.d.ts +15 -0
  13. package/dist/creator2/core/plugin-api.d.ts.map +1 -0
  14. package/dist/creator2/core/plugin-api.js +3 -0
  15. package/dist/creator2/core/plugin-api.js.map +1 -0
  16. package/dist/creator2/core/transport.d.ts +20 -0
  17. package/dist/creator2/core/transport.d.ts.map +1 -1
  18. package/dist/creator2/core/transport.js.map +1 -1
  19. package/dist/creator2/core/types.d.ts +0 -78
  20. package/dist/creator2/core/types.d.ts.map +1 -1
  21. package/dist/creator2/core/validation.d.ts +0 -11
  22. package/dist/creator2/core/validation.d.ts.map +1 -1
  23. package/dist/creator2/core/validation.js +0 -63
  24. package/dist/creator2/core/validation.js.map +1 -1
  25. package/dist/creator2/core/version.d.ts +1 -1
  26. package/dist/creator2/core/version.js +1 -1
  27. package/dist/creator2/creator2/auto.d.ts +1 -3
  28. package/dist/creator2/creator2/auto.d.ts.map +1 -1
  29. package/dist/creator2/creator2/auto.js +0 -25
  30. package/dist/creator2/creator2/auto.js.map +1 -1
  31. package/dist/creator2/creator2/index.d.ts +0 -7
  32. package/dist/creator2/creator2/index.d.ts.map +1 -1
  33. package/dist/creator2/creator2/index.js +1 -13
  34. package/dist/creator2/creator2/index.js.map +1 -1
  35. package/dist/creator2/creator2/transport.d.ts +0 -1
  36. package/dist/creator2/creator2/transport.d.ts.map +1 -1
  37. package/dist/creator2/creator2/transport.js +0 -4
  38. package/dist/creator2/creator2/transport.js.map +1 -1
  39. package/dist/creator3/core/client.d.ts +55 -7
  40. package/dist/creator3/core/client.d.ts.map +1 -1
  41. package/dist/creator3/core/client.js +72 -28
  42. package/dist/creator3/core/client.js.map +1 -1
  43. package/dist/creator3/core/index.d.ts +1 -1
  44. package/dist/creator3/core/index.d.ts.map +1 -1
  45. package/dist/creator3/core/index.js.map +1 -1
  46. package/dist/creator3/core/plugin-api.d.ts +15 -0
  47. package/dist/creator3/core/plugin-api.d.ts.map +1 -0
  48. package/dist/creator3/core/plugin-api.js +2 -0
  49. package/dist/creator3/core/plugin-api.js.map +1 -0
  50. package/dist/creator3/core/transport.d.ts +20 -0
  51. package/dist/creator3/core/transport.d.ts.map +1 -1
  52. package/dist/creator3/core/transport.js.map +1 -1
  53. package/dist/creator3/core/types.d.ts +0 -78
  54. package/dist/creator3/core/types.d.ts.map +1 -1
  55. package/dist/creator3/core/validation.d.ts +0 -11
  56. package/dist/creator3/core/validation.d.ts.map +1 -1
  57. package/dist/creator3/core/validation.js +0 -61
  58. package/dist/creator3/core/validation.js.map +1 -1
  59. package/dist/creator3/core/version.d.ts +1 -1
  60. package/dist/creator3/core/version.js +1 -1
  61. package/dist/creator3/creator3/auto.d.ts +1 -3
  62. package/dist/creator3/creator3/auto.d.ts.map +1 -1
  63. package/dist/creator3/creator3/auto.js +1 -24
  64. package/dist/creator3/creator3/auto.js.map +1 -1
  65. package/dist/creator3/creator3/index.d.ts +0 -7
  66. package/dist/creator3/creator3/index.d.ts.map +1 -1
  67. package/dist/creator3/creator3/index.js +1 -12
  68. package/dist/creator3/creator3/index.js.map +1 -1
  69. package/dist/creator3/creator3/transport.d.ts +0 -1
  70. package/dist/creator3/creator3/transport.d.ts.map +1 -1
  71. package/dist/creator3/creator3/transport.js +0 -4
  72. package/dist/creator3/creator3/transport.js.map +1 -1
  73. package/extensions/creator2/install-native.cjs +118 -28
  74. package/extensions/creator2/install-spm.cjs +198 -0
  75. package/extensions/creator2/legacy-asset-hashes.json +32 -0
  76. package/extensions/creator2/managed-assets.cjs +67 -0
  77. package/extensions/creator3/install-native.cjs +118 -28
  78. package/extensions/creator3/install-spm.cjs +198 -0
  79. package/extensions/creator3/legacy-asset-hashes.json +32 -0
  80. package/extensions/creator3/managed-assets.cjs +67 -0
  81. package/native/android/src/main/java/com/ft/sdk/cocos/FTBridgeTransport.java +85 -0
  82. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridge.java +2 -192
  83. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridgeModules.java +9 -0
  84. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridgeProvider.java +1 -1
  85. package/native/ios/FTCocosBridge.m +8 -203
  86. package/native/ios/FTCocosBridge.podspec +3 -4
  87. package/native/ios/Package.swift +25 -0
  88. package/native/ios/include/FTCocosBridge.h +2 -0
  89. package/package.json +10 -5
  90. package/plugin-api/package.json +4 -0
  91. package/components/creator2/ReplayPrivacy.ts +0 -23
  92. package/components/creator3/ReplayPrivacy.ts +0 -25
  93. package/dist/creator2/core/replay-async-transport.d.ts +0 -4
  94. package/dist/creator2/core/replay-async-transport.d.ts.map +0 -1
  95. package/dist/creator2/core/replay-async-transport.js +0 -67
  96. package/dist/creator2/core/replay-async-transport.js.map +0 -1
  97. package/dist/creator2/core/replay-budget.d.ts +0 -28
  98. package/dist/creator2/core/replay-budget.d.ts.map +0 -1
  99. package/dist/creator2/core/replay-budget.js +0 -113
  100. package/dist/creator2/core/replay-budget.js.map +0 -1
  101. package/dist/creator2/core/replay-diagnostics.d.ts +0 -36
  102. package/dist/creator2/core/replay-diagnostics.d.ts.map +0 -1
  103. package/dist/creator2/core/replay-diagnostics.js +0 -40
  104. package/dist/creator2/core/replay-diagnostics.js.map +0 -1
  105. package/dist/creator2/core/replay-encoding.d.ts +0 -31
  106. package/dist/creator2/core/replay-encoding.d.ts.map +0 -1
  107. package/dist/creator2/core/replay-encoding.js +0 -63
  108. package/dist/creator2/core/replay-encoding.js.map +0 -1
  109. package/dist/creator2/core/replay-file.d.ts +0 -5
  110. package/dist/creator2/core/replay-file.d.ts.map +0 -1
  111. package/dist/creator2/core/replay-file.js +0 -101
  112. package/dist/creator2/core/replay-file.js.map +0 -1
  113. package/dist/creator2/core/replay-pixels.d.ts +0 -3
  114. package/dist/creator2/core/replay-pixels.d.ts.map +0 -1
  115. package/dist/creator2/core/replay-pixels.js +0 -16
  116. package/dist/creator2/core/replay-pixels.js.map +0 -1
  117. package/dist/creator2/core/replay-privacy-nodes.d.ts +0 -14
  118. package/dist/creator2/core/replay-privacy-nodes.d.ts.map +0 -1
  119. package/dist/creator2/core/replay-privacy-nodes.js +0 -18
  120. package/dist/creator2/core/replay-privacy-nodes.js.map +0 -1
  121. package/dist/creator2/core/replay-privacy.d.ts +0 -15
  122. package/dist/creator2/core/replay-privacy.d.ts.map +0 -1
  123. package/dist/creator2/core/replay-privacy.js +0 -36
  124. package/dist/creator2/core/replay-privacy.js.map +0 -1
  125. package/dist/creator2/core/replay.d.ts +0 -99
  126. package/dist/creator2/core/replay.d.ts.map +0 -1
  127. package/dist/creator2/core/replay.js +0 -611
  128. package/dist/creator2/core/replay.js.map +0 -1
  129. package/dist/creator2/creator2/capture.d.ts +0 -17
  130. package/dist/creator2/creator2/capture.d.ts.map +0 -1
  131. package/dist/creator2/creator2/capture.js +0 -168
  132. package/dist/creator2/creator2/capture.js.map +0 -1
  133. package/dist/creator3/core/replay-async-transport.d.ts +0 -4
  134. package/dist/creator3/core/replay-async-transport.d.ts.map +0 -1
  135. package/dist/creator3/core/replay-async-transport.js +0 -16
  136. package/dist/creator3/core/replay-async-transport.js.map +0 -1
  137. package/dist/creator3/core/replay-budget.d.ts +0 -28
  138. package/dist/creator3/core/replay-budget.d.ts.map +0 -1
  139. package/dist/creator3/core/replay-budget.js +0 -105
  140. package/dist/creator3/core/replay-budget.js.map +0 -1
  141. package/dist/creator3/core/replay-diagnostics.d.ts +0 -36
  142. package/dist/creator3/core/replay-diagnostics.d.ts.map +0 -1
  143. package/dist/creator3/core/replay-diagnostics.js +0 -36
  144. package/dist/creator3/core/replay-diagnostics.js.map +0 -1
  145. package/dist/creator3/core/replay-encoding.d.ts +0 -31
  146. package/dist/creator3/core/replay-encoding.d.ts.map +0 -1
  147. package/dist/creator3/core/replay-encoding.js +0 -62
  148. package/dist/creator3/core/replay-encoding.js.map +0 -1
  149. package/dist/creator3/core/replay-file.d.ts +0 -5
  150. package/dist/creator3/core/replay-file.d.ts.map +0 -1
  151. package/dist/creator3/core/replay-file.js +0 -31
  152. package/dist/creator3/core/replay-file.js.map +0 -1
  153. package/dist/creator3/core/replay-pixels.d.ts +0 -3
  154. package/dist/creator3/core/replay-pixels.d.ts.map +0 -1
  155. package/dist/creator3/core/replay-pixels.js +0 -13
  156. package/dist/creator3/core/replay-pixels.js.map +0 -1
  157. package/dist/creator3/core/replay-privacy-nodes.d.ts +0 -14
  158. package/dist/creator3/core/replay-privacy-nodes.d.ts.map +0 -1
  159. package/dist/creator3/core/replay-privacy-nodes.js +0 -15
  160. package/dist/creator3/core/replay-privacy-nodes.js.map +0 -1
  161. package/dist/creator3/core/replay-privacy.d.ts +0 -15
  162. package/dist/creator3/core/replay-privacy.d.ts.map +0 -1
  163. package/dist/creator3/core/replay-privacy.js +0 -33
  164. package/dist/creator3/core/replay-privacy.js.map +0 -1
  165. package/dist/creator3/core/replay.d.ts +0 -99
  166. package/dist/creator3/core/replay.d.ts.map +0 -1
  167. package/dist/creator3/core/replay.js +0 -534
  168. package/dist/creator3/core/replay.js.map +0 -1
  169. package/dist/creator3/creator3/capture.d.ts +0 -17
  170. package/dist/creator3/creator3/capture.d.ts.map +0 -1
  171. package/dist/creator3/creator3/capture.js +0 -112
  172. package/dist/creator3/creator3/capture.js.map +0 -1
  173. package/dist/creator3/creator3/replay-render-cycle.d.ts +0 -9
  174. package/dist/creator3/creator3/replay-render-cycle.d.ts.map +0 -1
  175. package/dist/creator3/creator3/replay-render-cycle.js +0 -12
  176. package/dist/creator3/creator3/replay-render-cycle.js.map +0 -1
  177. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosReplayImageJobs.java +0 -55
  178. package/native/ios/FTCocosReplayImageJobs.h +0 -11
  179. package/native/ios/FTCocosReplayImageJobs.m +0 -54
  180. package/native/shared/FTReplayFileBridge.h +0 -62
  181. package/native/shared/FTReplayFileWorker.h +0 -88
@@ -1,13 +0,0 @@
1
- /** Converts tightly packed RGBA pixels from bottom-left to top-left row order. */
2
- export function flipRgbaRows(bytes, width, height) {
3
- const rowSize = width * 4;
4
- const swap = new Uint8Array(rowSize);
5
- for (let top = 0, bottom = height - 1; top < bottom; top += 1, bottom -= 1) {
6
- const topOffset = top * rowSize;
7
- const bottomOffset = bottom * rowSize;
8
- swap.set(bytes.subarray(topOffset, topOffset + rowSize));
9
- bytes.copyWithin(topOffset, bottomOffset, bottomOffset + rowSize);
10
- bytes.set(swap, bottomOffset);
11
- }
12
- }
13
- //# sourceMappingURL=replay-pixels.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay-pixels.js","sourceRoot":"","sources":["../../../../../src/core/replay-pixels.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,KAAiB,EAAE,KAAa,EAAE,MAAc;IAC3E,MAAM,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,CAAC;QAC3E,MAAM,SAAS,GAAG,GAAG,GAAG,OAAO,CAAC;QAChC,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;QACzD,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC;QAClE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { FTReplayPrivacyMode } from './types.js';
2
- /** Shape of the ReplayPrivacy editor script installed in the project's assets. */
3
- interface ReplayPrivacyComponent {
4
- node: unknown;
5
- enabledInHierarchy: boolean;
6
- isValid: boolean;
7
- readonly replayPrivacyMode: 'mask' | 'hide';
8
- }
9
- /** Resolve rules afresh for each capture, including newly instantiated prefabs. */
10
- export declare function collectReplayPrivacyNodes(overrides: ReadonlyMap<unknown, FTReplayPrivacyMode>, components: ReplayPrivacyComponent[], editBoxes: {
11
- node: unknown;
12
- }[]): Map<unknown, FTReplayPrivacyMode>;
13
- export {};
14
- //# sourceMappingURL=replay-privacy-nodes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay-privacy-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-privacy-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,kFAAkF;AAClF,UAAU,sBAAsB;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7C;AAED,mFAAmF;AACnF,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,WAAW,CAAC,OAAO,EAAE,mBAAmB,CAAC,EACpD,UAAU,EAAE,sBAAsB,EAAE,EACpC,SAAS,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EAAE,GAC7B,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAUnC"}
@@ -1,15 +0,0 @@
1
- /** Resolve rules afresh for each capture, including newly instantiated prefabs. */
2
- export function collectReplayPrivacyNodes(overrides, components, editBoxes) {
3
- const nodes = new Map(overrides);
4
- components.forEach((component) => {
5
- if (!component.isValid || !component.enabledInHierarchy || nodes.has(component.node))
6
- return;
7
- nodes.set(component.node, component.replayPrivacyMode === 'hide' ? 'hide' : 'mask');
8
- });
9
- editBoxes.forEach((editBox) => {
10
- if (!nodes.has(editBox.node))
11
- nodes.set(editBox.node, 'mask');
12
- });
13
- return nodes;
14
- }
15
- //# sourceMappingURL=replay-privacy-nodes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay-privacy-nodes.js","sourceRoot":"","sources":["../../../../../src/core/replay-privacy-nodes.ts"],"names":[],"mappings":"AAUA,mFAAmF;AACnF,MAAM,UAAU,yBAAyB,CACvC,SAAoD,EACpD,UAAoC,EACpC,SAA8B;IAE9B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QAC/B,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,OAAO;QAC7F,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { FTPrivacyRegion } from './types.js';
2
- interface FTPoint {
3
- x: number;
4
- y: number;
5
- }
6
- interface FTRect {
7
- x: number;
8
- y: number;
9
- width: number;
10
- height: number;
11
- }
12
- /** Projects a world-space node rectangle into a top-left-origin Replay frame. */
13
- export declare function projectPrivacyBounds(bounds: FTRect, frameWidth: number, frameHeight: number, screenWidth: number, screenHeight: number, project: (x: number, y: number) => FTPoint | undefined): Omit<FTPrivacyRegion, 'mode'> | undefined;
14
- export {};
15
- //# sourceMappingURL=replay-privacy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay-privacy.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-privacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,UAAU,OAAO;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,UAAU,MAAM;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,GACrD,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG,SAAS,CA6B3C"}
@@ -1,33 +0,0 @@
1
- /** Projects a world-space node rectangle into a top-left-origin Replay frame. */
2
- export function projectPrivacyBounds(bounds, frameWidth, frameHeight, screenWidth, screenHeight, project) {
3
- if ([frameWidth, frameHeight, screenWidth, screenHeight].some((size) => !Number.isFinite(size) || size <= 0)) {
4
- return undefined;
5
- }
6
- const points = [
7
- project(bounds.x, bounds.y),
8
- project(bounds.x + bounds.width, bounds.y),
9
- project(bounds.x, bounds.y + bounds.height),
10
- project(bounds.x + bounds.width, bounds.y + bounds.height),
11
- ];
12
- if (points.some((point) => !point || !Number.isFinite(point.x) || !Number.isFinite(point.y))) {
13
- return undefined;
14
- }
15
- const projected = points;
16
- const minimumX = Math.min(...projected.map((point) => point.x));
17
- const maximumX = Math.max(...projected.map((point) => point.x));
18
- const minimumY = Math.min(...projected.map((point) => point.y));
19
- const maximumY = Math.max(...projected.map((point) => point.y));
20
- // A native projection can reject its input without throwing and return a
21
- // zero vector. Do not treat its zero-area result as a valid privacy mask.
22
- if (maximumX <= minimumX || maximumY <= minimumY)
23
- return undefined;
24
- const scaleX = frameWidth / screenWidth;
25
- const scaleY = frameHeight / screenHeight;
26
- return {
27
- x: minimumX * scaleX,
28
- y: (screenHeight - maximumY) * scaleY,
29
- width: (maximumX - minimumX) * scaleX,
30
- height: (maximumY - minimumY) * scaleY,
31
- };
32
- }
33
- //# sourceMappingURL=replay-privacy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay-privacy.js","sourceRoot":"","sources":["../../../../../src/core/replay-privacy.ts"],"names":[],"mappings":"AAcA,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,UAAkB,EAClB,WAAmB,EACnB,WAAmB,EACnB,YAAoB,EACpB,OAAsD;IAEtD,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC;QAC7G,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAA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C,CAAC,CAAC,CAAC;IAChE,yEAAyE;IACzE,0EAA0E;IAC1E,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ;QAAE,OAAO,SAAS,CAAC;IACnE,MAAM,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;IACxC,MAAM,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;IAC1C,OAAO;QACL,CAAC,EAAE,QAAQ,GAAG,MAAM;QACpB,CAAC,EAAE,CAAC,YAAY,GAAG,QAAQ,CAAC,GAAG,MAAM;QACrC,KAAK,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,MAAM;QACrC,MAAM,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,MAAM;KACvC,CAAC;AACJ,CAAC"}
@@ -1,99 +0,0 @@
1
- import type { FTNativeTransport } from './transport.js';
2
- import type { FTCapturedFrame, FTPrivacyRegion, FTSessionReplayConfig, FTStoredFrame } from './types.js';
3
- export interface FTCanvasCapture {
4
- getViewportSize?(): {
5
- width: number;
6
- height: number;
7
- } | undefined;
8
- capture(maxImageDimension: number): Promise<FTCapturedFrame | undefined>;
9
- persist(frame: FTCapturedFrame, fingerprint: string): Promise<FTStoredFrame>;
10
- disposeStoredFrame(frame: FTStoredFrame): void | Promise<void>;
11
- setPrivacy(node: unknown, mode: 'mask' | 'hide' | 'unmask'): void;
12
- }
13
- export interface FTReplayPointerEvent {
14
- eventType: 'down' | 'up' | 'move';
15
- pointerId: number;
16
- normalizedX: number;
17
- normalizedY: number;
18
- timestamp: number;
19
- }
20
- export interface FTReplayPointerSource {
21
- onReplayPointer(callback: (event: FTReplayPointerEvent) => void): () => void;
22
- }
23
- export interface FTReplaySaveImageV2Result {
24
- resourceId: string;
25
- byteSize: number;
26
- width: number;
27
- height: number;
28
- mimeType?: `image/${string}`;
29
- }
30
- export interface FTReplayFrameSample {
31
- width: number;
32
- height: number;
33
- luminance: Uint8Array;
34
- }
35
- /** Cocos canvas Session Replay controls. */
36
- export declare class FTSessionReplay {
37
- private readonly transport;
38
- private readonly capture;
39
- private readonly pointerSource?;
40
- private timer;
41
- private busy;
42
- private running;
43
- private mode;
44
- private hybridReplayEnabled;
45
- private captureGeneration;
46
- private config;
47
- private imagePolicy;
48
- private budget;
49
- private lastFingerprint;
50
- private lastContextKey;
51
- private lastPrivacyKey;
52
- private lastFrameSample;
53
- private lastImageSize;
54
- private lastViewportSize;
55
- private imagePolicyEnabled;
56
- private supportsSaveImageV2;
57
- private recordCounts;
58
- private recordTouches;
59
- private pendingPointerEvents;
60
- private stopPointerTracking;
61
- constructor(transport: FTNativeTransport, capture: FTCanvasCapture, pointerSource?: FTReplayPointerSource | undefined);
62
- /**
63
- * Enables native Session Replay and starts Cocos canvas capture for a
64
- * standalone application.
65
- *
66
- * @param config - Replay sampling, capture, and touch-privacy settings.
67
- */
68
- start(config?: FTSessionReplayConfig): void;
69
- private configureCapture;
70
- /** Stops standalone Cocos canvas capture and native Session Replay. */
71
- stop(): void;
72
- /**
73
- * Changes the Session Replay privacy treatment for a Cocos node.
74
- *
75
- * `mask` obscures the node, `hide` removes the region from the replay, and
76
- * `unmask` clears an earlier code override, restoring any ReplayPrivacy
77
- * component rule or default input masking. Code overrides take priority over
78
- * a component on the same node. The node must belong to the active Cocos scene.
79
- *
80
- * @param node - Cocos node whose rendered bounds receive the privacy rule.
81
- * @param mode - Privacy treatment to apply.
82
- */
83
- setPrivacy(node: unknown, mode: 'mask' | 'hide' | 'unmask'): void;
84
- private startCapture;
85
- private stopCapture;
86
- private schedule;
87
- private readContext;
88
- private saveImage;
89
- private invokeSaveImage;
90
- private writePendingPointers;
91
- private scaledPendingPointers;
92
- private updateRecordCount;
93
- }
94
- export declare function normalizeSaveImageV2Result(value: unknown): FTReplaySaveImageV2Result;
95
- export declare function sampleReplayFrame(rgba: Uint8Array, width: number, height: number, maximumSamples?: number): FTReplayFrameSample;
96
- export declare function replayFramesLookSimilar(previous: FTReplayFrameSample | undefined, current: FTReplayFrameSample): boolean;
97
- export declare function frameFingerprint(bytes: Uint8Array): string;
98
- export declare function applyPrivacyRegions(rgba: Uint8Array, width: number, height: number, regions: FTPrivacyRegion[]): void;
99
- //# sourceMappingURL=replay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EAEf,qBAAqB,EACrB,aAAa,EACd,MAAM,YAAY,CAAC;AAQpB,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAClE,OAAO,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;IACzE,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7E,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC9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