@truewatchtech/cocos-sdk 0.1.0-alpha.3
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.
- package/LICENSE +202 -0
- package/README.md +51 -0
- package/THIRD_PARTY_NOTICES +5 -0
- package/bin/cli.cjs +130 -0
- package/creator2/package.json +4 -0
- package/creator3/package.json +5 -0
- package/dist/creator2/core/auto-tracking.d.ts +35 -0
- package/dist/creator2/core/auto-tracking.d.ts.map +1 -0
- package/dist/creator2/core/auto-tracking.js +337 -0
- package/dist/creator2/core/auto-tracking.js.map +1 -0
- package/dist/creator2/core/client.d.ts +74 -0
- package/dist/creator2/core/client.d.ts.map +1 -0
- package/dist/creator2/core/client.js +176 -0
- package/dist/creator2/core/client.js.map +1 -0
- package/dist/creator2/core/index.d.ts +3 -0
- package/dist/creator2/core/index.d.ts.map +1 -0
- package/dist/creator2/core/index.js +6 -0
- package/dist/creator2/core/index.js.map +1 -0
- package/dist/creator2/core/modules.d.ts +159 -0
- package/dist/creator2/core/modules.d.ts.map +1 -0
- package/dist/creator2/core/modules.js +319 -0
- package/dist/creator2/core/modules.js.map +1 -0
- package/dist/creator2/core/replay-budget.d.ts +28 -0
- package/dist/creator2/core/replay-budget.d.ts.map +1 -0
- package/dist/creator2/core/replay-budget.js +113 -0
- package/dist/creator2/core/replay-budget.js.map +1 -0
- package/dist/creator2/core/replay-diagnostics.d.ts +36 -0
- package/dist/creator2/core/replay-diagnostics.d.ts.map +1 -0
- package/dist/creator2/core/replay-diagnostics.js +40 -0
- package/dist/creator2/core/replay-diagnostics.js.map +1 -0
- package/dist/creator2/core/replay-encoding.d.ts +31 -0
- package/dist/creator2/core/replay-encoding.d.ts.map +1 -0
- package/dist/creator2/core/replay-encoding.js +63 -0
- package/dist/creator2/core/replay-encoding.js.map +1 -0
- package/dist/creator2/core/replay-pixels.d.ts +3 -0
- package/dist/creator2/core/replay-pixels.d.ts.map +1 -0
- package/dist/creator2/core/replay-pixels.js +16 -0
- package/dist/creator2/core/replay-pixels.js.map +1 -0
- package/dist/creator2/core/replay-privacy.d.ts +15 -0
- package/dist/creator2/core/replay-privacy.d.ts.map +1 -0
- package/dist/creator2/core/replay-privacy.js +36 -0
- package/dist/creator2/core/replay-privacy.js.map +1 -0
- package/dist/creator2/core/replay.d.ts +97 -0
- package/dist/creator2/core/replay.d.ts.map +1 -0
- package/dist/creator2/core/replay.js +578 -0
- package/dist/creator2/core/replay.js.map +1 -0
- package/dist/creator2/core/transport.d.ts +16 -0
- package/dist/creator2/core/transport.d.ts.map +1 -0
- package/dist/creator2/core/transport.js +33 -0
- package/dist/creator2/core/transport.js.map +1 -0
- package/dist/creator2/core/types.d.ts +260 -0
- package/dist/creator2/core/types.d.ts.map +1 -0
- package/dist/creator2/core/types.js +3 -0
- package/dist/creator2/core/types.js.map +1 -0
- package/dist/creator2/core/validation.d.ts +14 -0
- package/dist/creator2/core/validation.d.ts.map +1 -0
- package/dist/creator2/core/validation.js +81 -0
- package/dist/creator2/core/validation.js.map +1 -0
- package/dist/creator2/core/version.d.ts +9 -0
- package/dist/creator2/core/version.d.ts.map +1 -0
- package/dist/creator2/core/version.js +14 -0
- package/dist/creator2/core/version.js.map +1 -0
- package/dist/creator2/creator2/auto.d.ts +9 -0
- package/dist/creator2/creator2/auto.d.ts.map +1 -0
- package/dist/creator2/creator2/auto.js +65 -0
- package/dist/creator2/creator2/auto.js.map +1 -0
- package/dist/creator2/creator2/capture.d.ts +17 -0
- package/dist/creator2/creator2/capture.d.ts.map +1 -0
- package/dist/creator2/creator2/capture.js +175 -0
- package/dist/creator2/creator2/capture.js.map +1 -0
- package/dist/creator2/creator2/index.d.ts +12 -0
- package/dist/creator2/creator2/index.d.ts.map +1 -0
- package/dist/creator2/creator2/index.js +41 -0
- package/dist/creator2/creator2/index.js.map +1 -0
- package/dist/creator2/creator2/transport.d.ts +7 -0
- package/dist/creator2/creator2/transport.d.ts.map +1 -0
- package/dist/creator2/creator2/transport.js +34 -0
- package/dist/creator2/creator2/transport.js.map +1 -0
- package/dist/creator3/core/auto-tracking.d.ts +35 -0
- package/dist/creator3/core/auto-tracking.d.ts.map +1 -0
- package/dist/creator3/core/auto-tracking.js +247 -0
- package/dist/creator3/core/auto-tracking.js.map +1 -0
- package/dist/creator3/core/client.d.ts +74 -0
- package/dist/creator3/core/client.d.ts.map +1 -0
- package/dist/creator3/core/client.js +158 -0
- package/dist/creator3/core/client.js.map +1 -0
- package/dist/creator3/core/index.d.ts +3 -0
- package/dist/creator3/core/index.d.ts.map +1 -0
- package/dist/creator3/core/index.js +2 -0
- package/dist/creator3/core/index.js.map +1 -0
- package/dist/creator3/core/modules.d.ts +159 -0
- package/dist/creator3/core/modules.d.ts.map +1 -0
- package/dist/creator3/core/modules.js +293 -0
- package/dist/creator3/core/modules.js.map +1 -0
- package/dist/creator3/core/replay-budget.d.ts +28 -0
- package/dist/creator3/core/replay-budget.d.ts.map +1 -0
- package/dist/creator3/core/replay-budget.js +105 -0
- package/dist/creator3/core/replay-budget.js.map +1 -0
- package/dist/creator3/core/replay-diagnostics.d.ts +36 -0
- package/dist/creator3/core/replay-diagnostics.d.ts.map +1 -0
- package/dist/creator3/core/replay-diagnostics.js +36 -0
- package/dist/creator3/core/replay-diagnostics.js.map +1 -0
- package/dist/creator3/core/replay-encoding.d.ts +31 -0
- package/dist/creator3/core/replay-encoding.d.ts.map +1 -0
- package/dist/creator3/core/replay-encoding.js +62 -0
- package/dist/creator3/core/replay-encoding.js.map +1 -0
- package/dist/creator3/core/replay-pixels.d.ts +3 -0
- package/dist/creator3/core/replay-pixels.d.ts.map +1 -0
- package/dist/creator3/core/replay-pixels.js +13 -0
- package/dist/creator3/core/replay-pixels.js.map +1 -0
- package/dist/creator3/core/replay-privacy.d.ts +15 -0
- package/dist/creator3/core/replay-privacy.d.ts.map +1 -0
- package/dist/creator3/core/replay-privacy.js +33 -0
- package/dist/creator3/core/replay-privacy.js.map +1 -0
- package/dist/creator3/core/replay.d.ts +97 -0
- package/dist/creator3/core/replay.d.ts.map +1 -0
- package/dist/creator3/core/replay.js +520 -0
- package/dist/creator3/core/replay.js.map +1 -0
- package/dist/creator3/core/transport.d.ts +16 -0
- package/dist/creator3/core/transport.d.ts.map +1 -0
- package/dist/creator3/core/transport.js +27 -0
- package/dist/creator3/core/transport.js.map +1 -0
- package/dist/creator3/core/types.d.ts +260 -0
- package/dist/creator3/core/types.d.ts.map +1 -0
- package/dist/creator3/core/types.js +2 -0
- package/dist/creator3/core/types.js.map +1 -0
- package/dist/creator3/core/validation.d.ts +14 -0
- package/dist/creator3/core/validation.d.ts.map +1 -0
- package/dist/creator3/core/validation.js +75 -0
- package/dist/creator3/core/validation.js.map +1 -0
- package/dist/creator3/core/version.d.ts +9 -0
- package/dist/creator3/core/version.d.ts.map +1 -0
- package/dist/creator3/core/version.js +11 -0
- package/dist/creator3/core/version.js.map +1 -0
- package/dist/creator3/creator3/auto.d.ts +9 -0
- package/dist/creator3/creator3/auto.d.ts.map +1 -0
- package/dist/creator3/creator3/auto.js +73 -0
- package/dist/creator3/creator3/auto.js.map +1 -0
- package/dist/creator3/creator3/capture.d.ts +17 -0
- package/dist/creator3/creator3/capture.d.ts.map +1 -0
- package/dist/creator3/creator3/capture.js +119 -0
- package/dist/creator3/creator3/capture.js.map +1 -0
- package/dist/creator3/creator3/index.d.ts +12 -0
- package/dist/creator3/creator3/index.d.ts.map +1 -0
- package/dist/creator3/creator3/index.js +23 -0
- package/dist/creator3/creator3/index.js.map +1 -0
- package/dist/creator3/creator3/replay-render-cycle.d.ts +9 -0
- package/dist/creator3/creator3/replay-render-cycle.d.ts.map +1 -0
- package/dist/creator3/creator3/replay-render-cycle.js +12 -0
- package/dist/creator3/creator3/replay-render-cycle.js.map +1 -0
- package/dist/creator3/creator3/transport.d.ts +8 -0
- package/dist/creator3/creator3/transport.d.ts.map +1 -0
- package/dist/creator3/creator3/transport.js +24 -0
- package/dist/creator3/creator3/transport.js.map +1 -0
- package/dist/creator3/package.json +1 -0
- package/extensions/creator2/install-native.cjs +333 -0
- package/extensions/creator2/main.js +23 -0
- package/extensions/creator2/package.json +6 -0
- package/extensions/creator3/dist/builder.js +9 -0
- package/extensions/creator3/dist/hooks.js +70 -0
- package/extensions/creator3/dist/main.js +4 -0
- package/extensions/creator3/install-native.cjs +333 -0
- package/extensions/creator3/package.json +10 -0
- package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridge.java +532 -0
- package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridgeProvider.java +70 -0
- package/native/ios/FTCocosBridge.h +10 -0
- package/native/ios/FTCocosBridge.m +470 -0
- package/native/ios/FTCocosBridge.podspec +18 -0
- package/package.json +60 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/** A scalar value accepted by SDK attributes. */
|
|
2
|
+
export type FTPrimitive = string | number | boolean | null;
|
|
3
|
+
/** A JSON-compatible SDK attribute value. */
|
|
4
|
+
export type FTValue = FTPrimitive | FTValue[] | {
|
|
5
|
+
[key: string]: FTValue;
|
|
6
|
+
};
|
|
7
|
+
/** Custom attributes attached to RUM, Log, and Resource data. */
|
|
8
|
+
export type FTAttributes = Record<string, FTValue>;
|
|
9
|
+
/** Deployment environment reported with SDK data. */
|
|
10
|
+
export type FTEnvironment = 'prod' | 'gray' | 'pre' | 'common' | 'local' | string;
|
|
11
|
+
/** Base SDK connection and service settings. */
|
|
12
|
+
export interface FTSDKConfig {
|
|
13
|
+
/** Datakit address used for direct data reporting. */
|
|
14
|
+
datakitUrl?: string;
|
|
15
|
+
/** DataWay address used for public data reporting. Requires {@link clientToken}. */
|
|
16
|
+
datawayUrl?: string;
|
|
17
|
+
/** Client token used with {@link datawayUrl}. Keep this value outside source control. */
|
|
18
|
+
clientToken?: string;
|
|
19
|
+
/** Service name attached to collected data. */
|
|
20
|
+
serviceName?: string;
|
|
21
|
+
/** Deployment environment attached to collected data. */
|
|
22
|
+
env?: FTEnvironment;
|
|
23
|
+
/** Enables native SDK debug output. */
|
|
24
|
+
debug?: boolean;
|
|
25
|
+
/** String attributes included with all data produced by the native SDK. */
|
|
26
|
+
globalContext?: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
/** User identity bound to subsequent SDK data. */
|
|
29
|
+
export interface FTUserData {
|
|
30
|
+
/** Stable application-specific user identifier. */
|
|
31
|
+
userId: string;
|
|
32
|
+
/** Display name of the user. */
|
|
33
|
+
userName?: string;
|
|
34
|
+
/** Email address of the user. */
|
|
35
|
+
userEmail?: string;
|
|
36
|
+
/** Additional string attributes associated with the user. */
|
|
37
|
+
extra?: Record<string, string>;
|
|
38
|
+
}
|
|
39
|
+
/** Real User Monitoring configuration. */
|
|
40
|
+
export interface FTRUMConfig {
|
|
41
|
+
/** Android RUM application ID. */
|
|
42
|
+
androidAppId?: string;
|
|
43
|
+
/** iOS RUM application ID. */
|
|
44
|
+
iosAppId?: string;
|
|
45
|
+
/** Session sampling rate from `0` to `1`. */
|
|
46
|
+
sampleRate?: number;
|
|
47
|
+
/** Additional replay sampling rate from `0` to `1` for sessions that contain errors. */
|
|
48
|
+
sessionOnErrorSampleRate?: number;
|
|
49
|
+
/** Enables native user-action tracking. */
|
|
50
|
+
enableNativeUserAction?: boolean;
|
|
51
|
+
/** Enables native view tracking. */
|
|
52
|
+
enableNativeUserView?: boolean;
|
|
53
|
+
/** Enables native resource tracking. */
|
|
54
|
+
enableNativeUserResource?: boolean;
|
|
55
|
+
/** Enables native crash tracking. */
|
|
56
|
+
enableNativeCrash?: boolean;
|
|
57
|
+
/** Enables Android ANR tracking. Ignored on platforms that do not support it. */
|
|
58
|
+
enableNativeAnr?: boolean;
|
|
59
|
+
/** Enables native UI-block or freeze tracking. */
|
|
60
|
+
enableNativeUiBlock?: boolean;
|
|
61
|
+
/** Minimum native UI-block duration in milliseconds. */
|
|
62
|
+
nativeUiBlockDurationMs?: number;
|
|
63
|
+
/** Native SDK error-monitor bit mask. */
|
|
64
|
+
errorMonitorType?: number;
|
|
65
|
+
/** Native SDK device-metrics monitor bit mask. */
|
|
66
|
+
deviceMetricsMonitorType?: number;
|
|
67
|
+
/** Device-metrics collection frequency. */
|
|
68
|
+
detectFrequency?: 'normal' | 'frequent' | 'rare';
|
|
69
|
+
/** String attributes included with all RUM data. */
|
|
70
|
+
globalContext?: Record<string, string>;
|
|
71
|
+
}
|
|
72
|
+
/** Log level accepted by the SDK logger. */
|
|
73
|
+
export type FTLogLevel = 'info' | 'warning' | 'error' | 'critical' | 'ok' | string;
|
|
74
|
+
/** Logger configuration. */
|
|
75
|
+
export interface FTLoggerConfig {
|
|
76
|
+
/** Log sampling rate from `0` to `1`. */
|
|
77
|
+
sampleRate?: number;
|
|
78
|
+
/** Associates logs with the current RUM session. */
|
|
79
|
+
enableLinkRumData?: boolean;
|
|
80
|
+
/** Enables logs submitted through the Cocos SDK logger. */
|
|
81
|
+
enableCustomLog?: boolean;
|
|
82
|
+
/** Mirrors custom logs to the platform console. */
|
|
83
|
+
printCustomLogToConsole?: boolean;
|
|
84
|
+
/** Policy used when the native log cache reaches its limit. */
|
|
85
|
+
discardStrategy?: 'discard' | 'discardOldest';
|
|
86
|
+
/** Log levels accepted by the native logger. */
|
|
87
|
+
logLevelFilters?: FTLogLevel[];
|
|
88
|
+
/** Maximum number of cached log entries. */
|
|
89
|
+
logCacheLimitCount?: number;
|
|
90
|
+
/** String attributes included with every log. */
|
|
91
|
+
globalContext?: Record<string, string>;
|
|
92
|
+
}
|
|
93
|
+
/** Distributed-tracing propagation format. */
|
|
94
|
+
export type FTTraceType = 'ddTrace' | 'zipkinMultiHeader' | 'zipkinSingleHeader' | 'traceparent' | 'skywalking' | 'jaeger';
|
|
95
|
+
/** Distributed-tracing configuration. */
|
|
96
|
+
export interface FTTraceConfig {
|
|
97
|
+
/** Trace sampling rate from `0` to `1`. */
|
|
98
|
+
sampleRate?: number;
|
|
99
|
+
/** Header propagation format. */
|
|
100
|
+
traceType?: FTTraceType;
|
|
101
|
+
/** Associates trace data with the current RUM session. */
|
|
102
|
+
enableLinkRumData?: boolean;
|
|
103
|
+
/** Enables native automatic network tracing. */
|
|
104
|
+
enableNativeAutoTrace?: boolean;
|
|
105
|
+
}
|
|
106
|
+
/** Visual treatment applied to a Session Replay node. */
|
|
107
|
+
export type FTReplayPrivacyMode = 'mask' | 'hide' | 'unmask';
|
|
108
|
+
/** Whether Session Replay records touch positions. */
|
|
109
|
+
export type FTReplayTouchPrivacy = 'show' | 'hide';
|
|
110
|
+
/** Image quality preset used by Cocos Session Replay. */
|
|
111
|
+
export type FTReplayQuality = 'low' | 'medium' | 'high';
|
|
112
|
+
/** Image traffic controls for Cocos Session Replay. */
|
|
113
|
+
export interface FTReplayImagePolicy {
|
|
114
|
+
/** Compression, size, and traffic preset. @defaultValue `'medium'` */
|
|
115
|
+
quality?: FTReplayQuality;
|
|
116
|
+
/** Maximum encoded bytes for a normal image resource. */
|
|
117
|
+
maxFrameBytes?: number;
|
|
118
|
+
/** Maximum encoded image bytes retained in a rolling 60-second window. */
|
|
119
|
+
maxBytesPerMinute?: number;
|
|
120
|
+
/** Adapts effective capture rate, image quality, and size as the budget fills. @defaultValue `true` */
|
|
121
|
+
adaptiveCapture?: boolean;
|
|
122
|
+
}
|
|
123
|
+
/** Session Replay configuration for standalone Cocos applications. */
|
|
124
|
+
export interface FTSessionReplayConfig {
|
|
125
|
+
/** Replay sampling rate from `0` to `1`. */
|
|
126
|
+
sampleRate?: number;
|
|
127
|
+
/** Additional replay sampling rate from `0` to `1` for sessions that contain errors. */
|
|
128
|
+
sessionOnErrorSampleRate?: number;
|
|
129
|
+
/** Canvas capture rate in frames per second. Accepts integers from `1` to `5`. @defaultValue `1` */
|
|
130
|
+
captureFps?: number;
|
|
131
|
+
/** Maximum width or height of a captured frame. Accepts `1` to `2048`. @defaultValue `720` */
|
|
132
|
+
maxImageDimension?: number;
|
|
133
|
+
/** Image compression and rolling traffic-budget controls. */
|
|
134
|
+
imagePolicy?: FTReplayImagePolicy;
|
|
135
|
+
/** Whether captured replays include touch positions. @defaultValue `'hide'` */
|
|
136
|
+
touchPrivacy?: FTReplayTouchPrivacy;
|
|
137
|
+
}
|
|
138
|
+
/** Cocos-side Session Replay settings when the native host owns SDK initialization. */
|
|
139
|
+
export interface FTHybridSessionReplayConfig {
|
|
140
|
+
/** Canvas capture rate in frames per second. Accepts integers from `1` to `5`. @defaultValue `1` */
|
|
141
|
+
captureFps?: number;
|
|
142
|
+
/** Maximum width or height of a captured frame. Accepts `1` to `2048`. @defaultValue `720` */
|
|
143
|
+
maxImageDimension?: number;
|
|
144
|
+
/** Image compression and rolling traffic-budget controls. */
|
|
145
|
+
imagePolicy?: FTReplayImagePolicy;
|
|
146
|
+
/** Whether captured replays include touch positions. @defaultValue `'hide'` */
|
|
147
|
+
touchPrivacy?: FTReplayTouchPrivacy;
|
|
148
|
+
}
|
|
149
|
+
/** Request and response details recorded for a manually tracked resource. */
|
|
150
|
+
export interface FTResourceContent {
|
|
151
|
+
/** Absolute resource URL. */
|
|
152
|
+
url: string;
|
|
153
|
+
/** HTTP method, such as `GET` or `POST`. */
|
|
154
|
+
httpMethod: string;
|
|
155
|
+
/** Request headers safe to include in observability data. */
|
|
156
|
+
requestHeaders?: Record<string, string>;
|
|
157
|
+
/** Response headers safe to include in observability data. */
|
|
158
|
+
responseHeaders?: Record<string, string>;
|
|
159
|
+
/** Optional response body safe to include in observability data. */
|
|
160
|
+
responseBody?: string;
|
|
161
|
+
/** HTTP response status code. */
|
|
162
|
+
statusCode?: number;
|
|
163
|
+
/** Response content type. */
|
|
164
|
+
responseContentType?: string;
|
|
165
|
+
/** Response content encoding. */
|
|
166
|
+
responseContentEncoding?: string;
|
|
167
|
+
}
|
|
168
|
+
/** Optional timing metrics for a manually tracked resource. Values are nanosecond timestamps. */
|
|
169
|
+
export interface FTResourceMetrics {
|
|
170
|
+
/** Time at which the fetch operation started. */
|
|
171
|
+
fetchStartTime?: number;
|
|
172
|
+
/** Time at which the TCP connection started. */
|
|
173
|
+
tcpStartTime?: number;
|
|
174
|
+
/** Time at which the TCP connection completed. */
|
|
175
|
+
tcpEndTime?: number;
|
|
176
|
+
/** Time at which DNS resolution started. */
|
|
177
|
+
dnsStartTime?: number;
|
|
178
|
+
/** Time at which DNS resolution completed. */
|
|
179
|
+
dnsEndTime?: number;
|
|
180
|
+
/** Time at which the first response data arrived. */
|
|
181
|
+
responseStartTime?: number;
|
|
182
|
+
/** Time at which the response completed. */
|
|
183
|
+
responseEndTime?: number;
|
|
184
|
+
/** Time at which the TLS handshake started. */
|
|
185
|
+
sslStartTime?: number;
|
|
186
|
+
/** Time at which the TLS handshake completed. */
|
|
187
|
+
sslEndTime?: number;
|
|
188
|
+
}
|
|
189
|
+
/** Cocos events that the SDK can track automatically. */
|
|
190
|
+
export interface FTAutoTrackingConfig {
|
|
191
|
+
/** Tracks Cocos scene changes as RUM views. */
|
|
192
|
+
scenes?: boolean;
|
|
193
|
+
/** Tracks supported pointer interactions as RUM actions. */
|
|
194
|
+
actions?: boolean;
|
|
195
|
+
/** Tracks supported Cocos errors as RUM errors. */
|
|
196
|
+
errors?: boolean;
|
|
197
|
+
/** Sends supported console output to the SDK logger. */
|
|
198
|
+
console?: boolean;
|
|
199
|
+
/** Tracks supported network requests as RUM resources and traces. */
|
|
200
|
+
network?: boolean;
|
|
201
|
+
}
|
|
202
|
+
/** Complete configuration for a standalone Cocos application. */
|
|
203
|
+
export interface FTCocosConfig {
|
|
204
|
+
/** Required base SDK configuration. */
|
|
205
|
+
sdk: FTSDKConfig;
|
|
206
|
+
/** Enables and configures RUM. */
|
|
207
|
+
rum?: FTRUMConfig;
|
|
208
|
+
/** Enables and configures logging. */
|
|
209
|
+
logger?: FTLoggerConfig;
|
|
210
|
+
/** Enables and configures distributed tracing. */
|
|
211
|
+
trace?: FTTraceConfig;
|
|
212
|
+
/** Enables and configures Session Replay. */
|
|
213
|
+
replay?: FTSessionReplayConfig;
|
|
214
|
+
/** Enables selected Cocos automatic-tracking integrations. */
|
|
215
|
+
autoTrack?: FTAutoTrackingConfig;
|
|
216
|
+
}
|
|
217
|
+
/** Cocos-side configuration for applications initialized by a native host. */
|
|
218
|
+
export interface FTCocosHybridConfig {
|
|
219
|
+
/** Enables Cocos canvas capture while the application is inside Cocos. */
|
|
220
|
+
replay?: FTHybridSessionReplayConfig;
|
|
221
|
+
/** Enables selected Cocos automatic-tracking integrations. */
|
|
222
|
+
autoTrack?: FTAutoTrackingConfig;
|
|
223
|
+
}
|
|
224
|
+
/** Options applied when entering a Cocos runtime from a native host. */
|
|
225
|
+
export interface FTCocosEnterOptions {
|
|
226
|
+
/** RUM view name used when automatic scene tracking is disabled. */
|
|
227
|
+
viewName?: string;
|
|
228
|
+
}
|
|
229
|
+
/** Internal native RUM context used by Session Replay encoding. */
|
|
230
|
+
export interface FTRUMContext {
|
|
231
|
+
applicationId: string;
|
|
232
|
+
sessionId: string;
|
|
233
|
+
viewId: string;
|
|
234
|
+
globalContext?: FTAttributes;
|
|
235
|
+
}
|
|
236
|
+
/** Internal privacy rectangle projected into a captured frame. */
|
|
237
|
+
export interface FTPrivacyRegion {
|
|
238
|
+
x: number;
|
|
239
|
+
y: number;
|
|
240
|
+
width: number;
|
|
241
|
+
height: number;
|
|
242
|
+
mode: Exclude<FTReplayPrivacyMode, 'unmask'>;
|
|
243
|
+
}
|
|
244
|
+
/** Internal in-memory representation of a captured Cocos frame. */
|
|
245
|
+
export interface FTCapturedFrame {
|
|
246
|
+
rgba: Uint8Array;
|
|
247
|
+
width: number;
|
|
248
|
+
height: number;
|
|
249
|
+
timestamp: number;
|
|
250
|
+
privacyRegions?: FTPrivacyRegion[];
|
|
251
|
+
}
|
|
252
|
+
/** Internal persisted representation of a captured Cocos frame. */
|
|
253
|
+
export interface FTStoredFrame {
|
|
254
|
+
path: string;
|
|
255
|
+
width: number;
|
|
256
|
+
height: number;
|
|
257
|
+
timestamp: number;
|
|
258
|
+
fingerprint: string;
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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nB;AAED,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B;AAED,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;CAC9C;AAED,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC;CACpC;AAED,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/core/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FTHybridSessionReplayConfig, FTReplayQuality } from './types.js';
|
|
2
|
+
export declare function samplingRate(value: number | undefined, name: string): number | undefined;
|
|
3
|
+
export declare function captureFps(value: number | undefined): number;
|
|
4
|
+
export interface FTResolvedReplayImagePolicy {
|
|
5
|
+
quality: FTReplayQuality;
|
|
6
|
+
compressionQuality: number;
|
|
7
|
+
maxImageDimension: number;
|
|
8
|
+
maxFrameBytes: number;
|
|
9
|
+
maxBytesPerMinute: number;
|
|
10
|
+
adaptiveCapture: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function replayImagePolicy(config: FTHybridSessionReplayConfig): FTResolvedReplayImagePolicy;
|
|
13
|
+
export declare function requireText(value: string, name: string): string;
|
|
14
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/core/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMxF;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAM5D;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,eAAe,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAuBD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,2BAA2B,GAAG,2BAA2B,CA2BlG;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export function samplingRate(value, name) {
|
|
2
|
+
if (value === undefined)
|
|
3
|
+
return undefined;
|
|
4
|
+
if (!Number.isFinite(value) || value < 0 || value > 1) {
|
|
5
|
+
throw new RangeError(`${name} must be between 0 and 1`);
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
export function captureFps(value) {
|
|
10
|
+
const fps = value === undefined ? 1 : value;
|
|
11
|
+
if (!Number.isInteger(fps) || fps < 1 || fps > 5) {
|
|
12
|
+
throw new RangeError('captureFps must be an integer between 1 and 5');
|
|
13
|
+
}
|
|
14
|
+
return fps;
|
|
15
|
+
}
|
|
16
|
+
const REPLAY_IMAGE_PRESETS = {
|
|
17
|
+
low: {
|
|
18
|
+
compressionQuality: 0.35,
|
|
19
|
+
maxImageDimension: 480,
|
|
20
|
+
maxFrameBytes: 20 * 1024,
|
|
21
|
+
maxBytesPerMinute: Math.round(0.6 * 1024 * 1024),
|
|
22
|
+
},
|
|
23
|
+
medium: {
|
|
24
|
+
compressionQuality: 0.45,
|
|
25
|
+
maxImageDimension: 720,
|
|
26
|
+
maxFrameBytes: 40 * 1024,
|
|
27
|
+
maxBytesPerMinute: Math.round(1.5 * 1024 * 1024),
|
|
28
|
+
},
|
|
29
|
+
high: {
|
|
30
|
+
compressionQuality: 0.6,
|
|
31
|
+
maxImageDimension: 960,
|
|
32
|
+
maxFrameBytes: 80 * 1024,
|
|
33
|
+
maxBytesPerMinute: 4 * 1024 * 1024,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export function replayImagePolicy(config) {
|
|
37
|
+
var _a, _b, _c, _d, _e;
|
|
38
|
+
const policy = config.imagePolicy || {};
|
|
39
|
+
const quality = (_a = policy.quality) !== null && _a !== void 0 ? _a : 'medium';
|
|
40
|
+
if (!(quality in REPLAY_IMAGE_PRESETS)) {
|
|
41
|
+
throw new TypeError("imagePolicy.quality must be 'low', 'medium', or 'high'");
|
|
42
|
+
}
|
|
43
|
+
if (policy.adaptiveCapture !== undefined && typeof policy.adaptiveCapture !== 'boolean') {
|
|
44
|
+
throw new TypeError('imagePolicy.adaptiveCapture must be a boolean');
|
|
45
|
+
}
|
|
46
|
+
const preset = REPLAY_IMAGE_PRESETS[quality];
|
|
47
|
+
const maxImageDimension = (_b = config.maxImageDimension) !== null && _b !== void 0 ? _b : preset.maxImageDimension;
|
|
48
|
+
integerInRange(maxImageDimension, 1, 2048, 'maxImageDimension');
|
|
49
|
+
const maxFrameBytes = (_c = policy.maxFrameBytes) !== null && _c !== void 0 ? _c : preset.maxFrameBytes;
|
|
50
|
+
integerInRange(maxFrameBytes, 1024, 1024 * 1024, 'imagePolicy.maxFrameBytes');
|
|
51
|
+
const maxBytesPerMinute = (_d = policy.maxBytesPerMinute) !== null && _d !== void 0 ? _d : preset.maxBytesPerMinute;
|
|
52
|
+
integerInRange(maxBytesPerMinute, 16 * 1024, 64 * 1024 * 1024, 'imagePolicy.maxBytesPerMinute');
|
|
53
|
+
if (maxFrameBytes > maxBytesPerMinute) {
|
|
54
|
+
throw new RangeError('imagePolicy.maxFrameBytes must not exceed maxBytesPerMinute');
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
quality,
|
|
58
|
+
compressionQuality: preset.compressionQuality,
|
|
59
|
+
maxImageDimension,
|
|
60
|
+
maxFrameBytes,
|
|
61
|
+
maxBytesPerMinute,
|
|
62
|
+
adaptiveCapture: (_e = policy.adaptiveCapture) !== null && _e !== void 0 ? _e : true,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function integerInRange(value, minimum, maximum, name) {
|
|
66
|
+
if (!Number.isInteger(value) || value < minimum || value > maximum) {
|
|
67
|
+
throw new RangeError(`${name} must be an integer between ${minimum} and ${maximum}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function requireText(value, name) {
|
|
71
|
+
if (!value.trim())
|
|
72
|
+
throw new TypeError(`${name} must not be empty`);
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../src/core/validation.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,YAAY,CAAC,KAAyB,EAAE,IAAY;IAClE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ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Ac,CAAC,KAAa,EAAE,OAAe,EAAE,OAAe,EAAE,IAAY;IACnF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,OAAO,IAAI,KAAK,GAAG,OAAO,EAAE,CAAC;QACnE,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,+BAA+B,OAAO,QAAQ,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,IAAY;IACrD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;IACpE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Version of the installed Cocos SDK package. */
|
|
2
|
+
export declare const FT_COCOS_SDK_VERSION = "0.1.0-alpha.3";
|
|
3
|
+
/** Global-context key used to report the Cocos SDK package version. */
|
|
4
|
+
export declare const FT_COCOS_SDK_VERSION_KEY = "sdk_package_cocos";
|
|
5
|
+
/** Event attribute used to identify data emitted through a framework bridge. */
|
|
6
|
+
export declare const FT_COCOS_SDK_BRIDGE_INFO_KEY = "sdk_bridge_info";
|
|
7
|
+
/** Serialized bridge metadata expected by the native SDK data model. */
|
|
8
|
+
export declare const FT_COCOS_SDK_BRIDGE_INFO: string;
|
|
9
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../../../src/core/version.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AAEpD,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D,gFAAgF;AAChF,eAAO,MAAM,4BAA4B,oBAAoB,CAAC;AAE9D,wEAAwE;AACxE,eAAO,MAAM,wBAAwB,QAEnC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Version of the installed Cocos SDK package. */
|
|
2
|
+
export const FT_COCOS_SDK_VERSION = '0.1.0-alpha.3';
|
|
3
|
+
/** Global-context key used to report the Cocos SDK package version. */
|
|
4
|
+
export const FT_COCOS_SDK_VERSION_KEY = 'sdk_package_cocos';
|
|
5
|
+
/** Event attribute used to identify data emitted through a framework bridge. */
|
|
6
|
+
export const FT_COCOS_SDK_BRIDGE_INFO_KEY = 'sdk_bridge_info';
|
|
7
|
+
/** Serialized bridge metadata expected by the native SDK data model. */
|
|
8
|
+
export const FT_COCOS_SDK_BRIDGE_INFO = JSON.stringify({
|
|
9
|
+
cocos: FT_COCOS_SDK_VERSION,
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../../src/core/version.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEpD,uEAAuE;AACvE,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE5D,gFAAgF;AAChF,MAAM,CAAC,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;AAE9D,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,SAAS,CAAC;IACrD,KAAK,EAAE,oBAAoB;CAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FTEngineTrackingHooks } from '../core/auto-tracking.js';
|
|
2
|
+
import type { FTReplayPointerEvent, FTReplayPointerSource } from '../core/replay.js';
|
|
3
|
+
import type { FTAttributes } from '../core/types.js';
|
|
4
|
+
export declare class FTCreator3TrackingHooks implements FTEngineTrackingHooks, FTReplayPointerSource {
|
|
5
|
+
onSceneChanged(callback: (name: string) => void, includeCurrent?: boolean): () => void;
|
|
6
|
+
onAction(callback: (name: string, attributes?: FTAttributes) => void): () => void;
|
|
7
|
+
onReplayPointer(callback: (event: FTReplayPointerEvent) => void): () => void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=auto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto.d.ts","sourceRoot":"","sources":["../../../../../src/creator3/auto.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,qBAAa,uBAAwB,YAAW,qBAAqB,EAAE,qBAAqB;IAC1F,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,cAAc,UAAO,GAAG,MAAM,IAAI;IAOnF,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI;IAQjF,eAAe,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,GAAG,MAAM,IAAI;CAU7E"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Director, Input, director, input, view } from 'cc';
|
|
2
|
+
export class FTCreator3TrackingHooks {
|
|
3
|
+
onSceneChanged(callback, includeCurrent = true) {
|
|
4
|
+
const handler = () => { var _a; return callback(((_a = director.getScene()) === null || _a === void 0 ? void 0 : _a.name) || 'UnknownScene'); };
|
|
5
|
+
director.on(Director.EVENT_AFTER_SCENE_LAUNCH, handler);
|
|
6
|
+
if (includeCurrent && director.getScene())
|
|
7
|
+
handler();
|
|
8
|
+
return () => director.off(Director.EVENT_AFTER_SCENE_LAUNCH, handler);
|
|
9
|
+
}
|
|
10
|
+
onAction(callback) {
|
|
11
|
+
const handler = (event) => {
|
|
12
|
+
var _a, _b, _c;
|
|
13
|
+
const location = ((_a = event.getUILocation) === null || _a === void 0 ? void 0 : _a.call(event)) || ((_b = event.getLocation) === null || _b === void 0 ? void 0 : _b.call(event));
|
|
14
|
+
callback(((_c = event.target) === null || _c === void 0 ? void 0 : _c.name) || 'CocosTouch', location ? { x: location.x, y: location.y } : undefined);
|
|
15
|
+
};
|
|
16
|
+
return onTouch(Input.EventType.TOUCH_END, handler);
|
|
17
|
+
}
|
|
18
|
+
onReplayPointer(callback) {
|
|
19
|
+
const onStart = (event) => callback(replayPointer(event, 'down'));
|
|
20
|
+
const onEnd = (event) => callback(replayPointer(event, 'up'));
|
|
21
|
+
const stops = [
|
|
22
|
+
onTouch(Input.EventType.TOUCH_START, onStart),
|
|
23
|
+
onTouch(Input.EventType.TOUCH_END, onEnd),
|
|
24
|
+
onTouch(Input.EventType.TOUCH_CANCEL, onEnd),
|
|
25
|
+
];
|
|
26
|
+
return () => stops.reverse().forEach((stop) => stop());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function onTouch(type, callback) {
|
|
30
|
+
// UI nodes consume touches before the global input dispatcher in Creator 3.
|
|
31
|
+
// Capture those at the scene root, retaining global input for non-UI touches.
|
|
32
|
+
// One EventTouch can contain several fingers and pass through multiple nodes.
|
|
33
|
+
const seen = new WeakMap();
|
|
34
|
+
const handler = (event) => {
|
|
35
|
+
var _a, _b, _c, _d, _e;
|
|
36
|
+
const id = (_e = (_b = (_a = event.getID) === null || _a === void 0 ? void 0 : _a.call(event)) !== null && _b !== void 0 ? _b : (_d = (_c = event.touch) === null || _c === void 0 ? void 0 : _c.getID) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : 0;
|
|
37
|
+
let pointers = seen.get(event);
|
|
38
|
+
if (pointers === null || pointers === void 0 ? void 0 : pointers.has(id))
|
|
39
|
+
return;
|
|
40
|
+
if (!pointers)
|
|
41
|
+
seen.set(event, pointers = new Set());
|
|
42
|
+
pointers.add(id);
|
|
43
|
+
callback(event);
|
|
44
|
+
};
|
|
45
|
+
let scene;
|
|
46
|
+
const bind = () => {
|
|
47
|
+
scene === null || scene === void 0 ? void 0 : scene.off(type, handler, undefined, true);
|
|
48
|
+
scene = director.getScene();
|
|
49
|
+
scene === null || scene === void 0 ? void 0 : scene.on(type, handler, undefined, true);
|
|
50
|
+
};
|
|
51
|
+
director.on(Director.EVENT_AFTER_SCENE_LAUNCH, bind);
|
|
52
|
+
input.on(type, handler);
|
|
53
|
+
bind();
|
|
54
|
+
return () => {
|
|
55
|
+
director.off(Director.EVENT_AFTER_SCENE_LAUNCH, bind);
|
|
56
|
+
scene === null || scene === void 0 ? void 0 : scene.off(type, handler, undefined, true);
|
|
57
|
+
input.off(type, handler);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function replayPointer(event, eventType) {
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
62
|
+
const location = ((_a = event.getUILocation) === null || _a === void 0 ? void 0 : _a.call(event)) || ((_b = event.getLocation) === null || _b === void 0 ? void 0 : _b.call(event)) || { x: 0, y: 0 };
|
|
63
|
+
const size = ((_c = view.getVisibleSize) === null || _c === void 0 ? void 0 : _c.call(view)) || { width: 1, height: 1 };
|
|
64
|
+
const origin = ((_d = view.getVisibleOrigin) === null || _d === void 0 ? void 0 : _d.call(view)) || { x: 0, y: 0 };
|
|
65
|
+
return {
|
|
66
|
+
eventType,
|
|
67
|
+
pointerId: (_j = (_f = (_e = event.getID) === null || _e === void 0 ? void 0 : _e.call(event)) !== null && _f !== void 0 ? _f : (_h = (_g = event.touch) === null || _g === void 0 ? void 0 : _g.getID) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : 0,
|
|
68
|
+
normalizedX: size.width > 0 ? (location.x - origin.x) / size.width : 0,
|
|
69
|
+
normalizedY: size.height > 0 ? 1 - ((location.y - origin.y) / size.height) : 0,
|
|
70
|
+
timestam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AAI,CAAC,cAAc,oDAAI,KAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAChE,MAAM,MAAM,GAAG,CAAA,MAAA,IAAI,CAAC,gBAAgB,oDAAI,KAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAC3D,OAAO;QACL,SAAS;QACT,SAAS,EAAE,MAAA,MAAA,MAAA,KAAK,CAAC,KAAK,qDAAI,mCAAI,MAAA,MAAA,KAAK,CAAC,KAAK,0CAAE,KAAK,kDAAI,mCAAI,CAAC;QACzD,WAAW,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtE,WAAW,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9E,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FTCanvasCapture } from '../core/replay.js';
|
|
2
|
+
import type { FTCapturedFrame, FTReplayPrivacyMode, FTStoredFrame } from '../core/types.js';
|
|
3
|
+
export declare class FTCreator3CanvasCapture implements FTCanvasCapture {
|
|
4
|
+
private camera;
|
|
5
|
+
private privacy;
|
|
6
|
+
setCamera(camera: unknown): void;
|
|
7
|
+
setPrivacy(node: unknown, mode: FTReplayPrivacyMode): void;
|
|
8
|
+
getViewportSize(): {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
} | undefined;
|
|
12
|
+
capture(maxImageDimension: number): Promise<FTCapturedFrame | undefined>;
|
|
13
|
+
persist(frame: FTCapturedFrame, fingerprint?: string): Promise<FTStoredFrame>;
|
|
14
|
+
disposeStoredFrame(frame: FTStoredFrame): void;
|
|
15
|
+
private collectPrivacyRegions;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../../../src/creator3/capture.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAmB,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAK7G,qBAAa,uBAAwB,YAAW,eAAe;IAC7D,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,OAAO,CAA2C;IAE1D,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAIhC,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,GAAG,IAAI;IAK1D,eAAe,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAK1D,OAAO,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAqCxE,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,WAAW,SAA+B,GAAG,OAAO,CAAC,aAAa,CAAC;IAQzG,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAI9C,OAAO,CAAC,qBAAqB;CA2B9B"}
|