react-native-frame-capture 1.0.1
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/FrameCapture.podspec +21 -0
- package/LICENSE +20 -0
- package/README.md +158 -0
- package/android/build.gradle +77 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +20 -0
- package/android/src/main/java/com/framecapture/CaptureManager.kt +831 -0
- package/android/src/main/java/com/framecapture/Constants.kt +196 -0
- package/android/src/main/java/com/framecapture/ErrorHandler.kt +165 -0
- package/android/src/main/java/com/framecapture/FrameCaptureModule.kt +653 -0
- package/android/src/main/java/com/framecapture/FrameCapturePackage.kt +32 -0
- package/android/src/main/java/com/framecapture/OverlayRenderer.kt +423 -0
- package/android/src/main/java/com/framecapture/PermissionHandler.kt +150 -0
- package/android/src/main/java/com/framecapture/ScreenCaptureService.kt +366 -0
- package/android/src/main/java/com/framecapture/StorageManager.kt +221 -0
- package/android/src/main/java/com/framecapture/capture/BitmapProcessor.kt +157 -0
- package/android/src/main/java/com/framecapture/capture/CaptureEventEmitter.kt +120 -0
- package/android/src/main/java/com/framecapture/models/CaptureModels.kt +302 -0
- package/android/src/main/java/com/framecapture/models/EnumsAndExtensions.kt +60 -0
- package/android/src/main/java/com/framecapture/models/OverlayModels.kt +154 -0
- package/android/src/main/java/com/framecapture/service/CaptureNotificationManager.kt +286 -0
- package/android/src/main/java/com/framecapture/storage/StorageStrategies.kt +317 -0
- package/android/src/main/java/com/framecapture/utils/ValidationUtils.kt +379 -0
- package/app.plugin.js +1 -0
- package/ios/FrameCapture.h +5 -0
- package/ios/FrameCapture.mm +21 -0
- package/lib/module/NativeFrameCapture.js +24 -0
- package/lib/module/NativeFrameCapture.js.map +1 -0
- package/lib/module/api.js +146 -0
- package/lib/module/api.js.map +1 -0
- package/lib/module/constants.js +67 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/errors.js +19 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/events.js +58 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/index.js +24 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/normalize.js +51 -0
- package/lib/module/normalize.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +165 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/validation.js +190 -0
- package/lib/module/validation.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/plugin/src/index.d.ts +4 -0
- package/lib/typescript/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/src/NativeFrameCapture.d.ts +75 -0
- package/lib/typescript/src/NativeFrameCapture.d.ts.map +1 -0
- package/lib/typescript/src/api.d.ts +66 -0
- package/lib/typescript/src/api.d.ts.map +1 -0
- package/lib/typescript/src/constants.d.ts +41 -0
- package/lib/typescript/src/constants.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts +14 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +30 -0
- package/lib/typescript/src/events.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +12 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/normalize.d.ts +43 -0
- package/lib/typescript/src/normalize.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +247 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/lib/typescript/src/validation.d.ts +15 -0
- package/lib/typescript/src/validation.d.ts.map +1 -0
- package/package.json +196 -0
- package/plugin/build/index.js +48 -0
- package/src/NativeFrameCapture.ts +86 -0
- package/src/api.ts +189 -0
- package/src/constants.ts +69 -0
- package/src/errors.ts +21 -0
- package/src/events.ts +61 -0
- package/src/index.tsx +31 -0
- package/src/normalize.ts +81 -0
- package/src/types.ts +327 -0
- package/src/validation.ts +321 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Input validation utilities
|
|
5
|
+
* @module validation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { CaptureErrorCode } from "./types.js";
|
|
9
|
+
import { CaptureError } from "./errors.js";
|
|
10
|
+
import { MIN_INTERVAL, MAX_INTERVAL, MIN_QUALITY, MAX_QUALITY } from "./constants.js";
|
|
11
|
+
/**
|
|
12
|
+
* Validates capture options
|
|
13
|
+
* @throws {CaptureError} if validation fails
|
|
14
|
+
*/
|
|
15
|
+
export function validateOptions(options) {
|
|
16
|
+
// Validate capture config
|
|
17
|
+
if (options.capture) {
|
|
18
|
+
const {
|
|
19
|
+
interval
|
|
20
|
+
} = options.capture;
|
|
21
|
+
if (interval !== undefined) {
|
|
22
|
+
if (typeof interval !== 'number' || interval < MIN_INTERVAL || interval > MAX_INTERVAL) {
|
|
23
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `capture.interval must be a number between ${MIN_INTERVAL} and ${MAX_INTERVAL} milliseconds`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Validate image config
|
|
29
|
+
if (options.image) {
|
|
30
|
+
const {
|
|
31
|
+
quality,
|
|
32
|
+
format,
|
|
33
|
+
scaleResolution,
|
|
34
|
+
region,
|
|
35
|
+
excludeStatusBar
|
|
36
|
+
} = options.image;
|
|
37
|
+
if (quality !== undefined) {
|
|
38
|
+
if (typeof quality !== 'number' || quality < MIN_QUALITY || quality > MAX_QUALITY) {
|
|
39
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.quality must be a number between ${MIN_QUALITY} and ${MAX_QUALITY}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (format !== undefined) {
|
|
43
|
+
if (format !== 'png' && format !== 'jpeg') {
|
|
44
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.format must be either 'png' or 'jpeg'`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (scaleResolution !== undefined) {
|
|
48
|
+
if (typeof scaleResolution !== 'number' || scaleResolution < 0.1 || scaleResolution > 1.0) {
|
|
49
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.scaleResolution must be a number between 0.1 and 1.0`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (region !== undefined) {
|
|
53
|
+
validateCaptureRegion(region);
|
|
54
|
+
}
|
|
55
|
+
if (excludeStatusBar !== undefined && typeof excludeStatusBar !== 'boolean') {
|
|
56
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.excludeStatusBar must be a boolean`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Validate storage config
|
|
61
|
+
if (options.storage) {
|
|
62
|
+
const {
|
|
63
|
+
saveFrames,
|
|
64
|
+
location,
|
|
65
|
+
outputDirectory,
|
|
66
|
+
warningThreshold,
|
|
67
|
+
fileNaming
|
|
68
|
+
} = options.storage;
|
|
69
|
+
if (saveFrames !== undefined && typeof saveFrames !== 'boolean') {
|
|
70
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.saveFrames must be a boolean`);
|
|
71
|
+
}
|
|
72
|
+
if (location !== undefined) {
|
|
73
|
+
if (location !== 'private' && location !== 'public') {
|
|
74
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.location must be either 'private' or 'public'`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (outputDirectory !== undefined) {
|
|
78
|
+
if (typeof outputDirectory !== 'string' || outputDirectory.trim() === '') {
|
|
79
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.outputDirectory must be a non-empty string`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (warningThreshold !== undefined) {
|
|
83
|
+
if (typeof warningThreshold !== 'number' || warningThreshold < 0) {
|
|
84
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.warningThreshold must be a non-negative number (bytes)`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (fileNaming) {
|
|
88
|
+
validateFileNaming(fileNaming);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Validate performance config
|
|
93
|
+
if (options.performance) {
|
|
94
|
+
validatePerformance(options.performance);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Validates file naming configuration
|
|
100
|
+
*/
|
|
101
|
+
function validateFileNaming(fn) {
|
|
102
|
+
if (fn.prefix !== undefined) {
|
|
103
|
+
if (typeof fn.prefix !== 'string' || fn.prefix.trim() === '') {
|
|
104
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.fileNaming.prefix must be a non-empty string`);
|
|
105
|
+
}
|
|
106
|
+
if (/[<>:"/\\|?*]/.test(fn.prefix)) {
|
|
107
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.fileNaming.prefix contains invalid filename characters`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (fn.dateFormat !== undefined) {
|
|
111
|
+
if (typeof fn.dateFormat !== 'string' || fn.dateFormat.trim() === '') {
|
|
112
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.fileNaming.dateFormat must be a non-empty string`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (fn.framePadding !== undefined) {
|
|
116
|
+
if (typeof fn.framePadding !== 'number' || fn.framePadding < 1 || fn.framePadding > 10) {
|
|
117
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `storage.fileNaming.framePadding must be between 1 and 10`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Validates performance configuration
|
|
124
|
+
*/
|
|
125
|
+
function validatePerformance(perf) {
|
|
126
|
+
if (perf.overlayCacheSize !== undefined) {
|
|
127
|
+
if (typeof perf.overlayCacheSize !== 'number' || perf.overlayCacheSize < 0) {
|
|
128
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `performance.overlayCacheSize must be a non-negative number (bytes)`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (perf.imageReaderBuffers !== undefined) {
|
|
132
|
+
if (typeof perf.imageReaderBuffers !== 'number' || perf.imageReaderBuffers < 1 || perf.imageReaderBuffers > 10) {
|
|
133
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `performance.imageReaderBuffers must be between 1 and 10`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (perf.executorShutdownTimeout !== undefined) {
|
|
137
|
+
if (typeof perf.executorShutdownTimeout !== 'number' || perf.executorShutdownTimeout < 100 || perf.executorShutdownTimeout > 30000) {
|
|
138
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `performance.executorShutdownTimeout must be between 100 and 30000ms`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (perf.executorForcedShutdownTimeout !== undefined) {
|
|
142
|
+
if (typeof perf.executorForcedShutdownTimeout !== 'number' || perf.executorForcedShutdownTimeout < 100 || perf.executorForcedShutdownTimeout > 10000) {
|
|
143
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `performance.executorForcedShutdownTimeout must be between 100 and 10000ms`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Validates capture region configuration
|
|
150
|
+
*/
|
|
151
|
+
function validateCaptureRegion(region) {
|
|
152
|
+
const unit = region.unit || 'percentage';
|
|
153
|
+
if (typeof region.x !== 'number' || typeof region.y !== 'number' || typeof region.width !== 'number' || typeof region.height !== 'number') {
|
|
154
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.region coordinates must be numbers`);
|
|
155
|
+
}
|
|
156
|
+
if (unit === 'percentage') {
|
|
157
|
+
if (region.x < 0 || region.x > 1 || region.y < 0 || region.y > 1 || region.width < 0 || region.width > 1 || region.height < 0 || region.height > 1) {
|
|
158
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.region percentage values must be between 0 and 1`);
|
|
159
|
+
}
|
|
160
|
+
if (region.x + region.width > 1 || region.y + region.height > 1) {
|
|
161
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.region extends beyond screen bounds (x + width or y + height > 1)`);
|
|
162
|
+
}
|
|
163
|
+
} else if (unit === 'pixels') {
|
|
164
|
+
if (region.width <= 0 || region.height <= 0) {
|
|
165
|
+
throw new CaptureError(CaptureErrorCode.INVALID_OPTIONS, `image.region width and height must be positive`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Merges user options with defaults
|
|
172
|
+
*/
|
|
173
|
+
export function mergeOptions(options) {
|
|
174
|
+
return {
|
|
175
|
+
capture: {
|
|
176
|
+
interval: 1000,
|
|
177
|
+
...options?.capture
|
|
178
|
+
},
|
|
179
|
+
image: {
|
|
180
|
+
quality: 80,
|
|
181
|
+
format: 'jpeg',
|
|
182
|
+
...options?.image
|
|
183
|
+
},
|
|
184
|
+
storage: options?.storage,
|
|
185
|
+
performance: options?.performance,
|
|
186
|
+
notification: options?.notification,
|
|
187
|
+
overlays: options?.overlays
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CaptureErrorCode","CaptureError","MIN_INTERVAL","MAX_INTERVAL","MIN_QUALITY","MAX_QUALITY","validateOptions","options","capture","interval","undefined","INVALID_OPTIONS","image","quality","format","scaleResolution","region","excludeStatusBar","validateCaptureRegion","storage","saveFrames","location","outputDirectory","warningThreshold","fileNaming","trim","validateFileNaming","performance","validatePerformance","fn","prefix","test","dateFormat","framePadding","perf","overlayCacheSize","imageReaderBuffers","executorShutdownTimeout","executorForcedShutdownTimeout","unit","x","y","width","height","mergeOptions","notification","overlays"],"sourceRoot":"..\\..\\src","sources":["validation.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,gBAAgB,QAAQ,YAAS;AAC1C,SAASC,YAAY,QAAQ,aAAU;AACvC,SACEC,YAAY,EACZC,YAAY,EACZC,WAAW,EACXC,WAAW,QACN,gBAAa;AAGpB;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,OAAgC,EAAQ;EACtE;EACA,IAAIA,OAAO,CAACC,OAAO,EAAE;IACnB,MAAM;MAAEC;IAAS,CAAC,GAAGF,OAAO,CAACC,OAAO;IAEpC,IAAIC,QAAQ,KAAKC,SAAS,EAAE;MAC1B,IACE,OAAOD,QAAQ,KAAK,QAAQ,IAC5BA,QAAQ,GAAGP,YAAY,IACvBO,QAAQ,GAAGN,YAAY,EACvB;QACA,MAAM,IAAIF,YAAY,CACpBD,gBAAgB,CAACW,eAAe,EAChC,6CAA6CT,YAAY,QAAQC,YAAY,eAC/E,CAAC;MACH;IACF;EACF;;EAEA;EACA,IAAII,OAAO,CAACK,KAAK,EAAE;IACjB,MAAM;MAAEC,OAAO;MAAEC,MAAM;MAAEC,eAAe;MAAEC,MAAM;MAAEC;IAAiB,CAAC,GAClEV,OAAO,CAACK,KAAK;IAEf,IAAIC,OAAO,KAAKH,SAAS,EAAE;MACzB,IACE,OAAOG,OAAO,KAAK,QAAQ,IAC3BA,OAAO,GAAGT,WAAW,IACrBS,OAAO,GAAGR,WAAW,EACrB;QACA,MAAM,IAAIJ,YAAY,CACpBD,gBAAgB,CAACW,eAAe,EAChC,0CAA0CP,WAAW,QAAQC,WAAW,EAC1E,CAAC;MACH;IACF;IAEA,IAAIS,MAAM,KAAKJ,SAAS,EAAE;MACxB,IAAII,MAAM,KAAK,KAAK,IAAIA,MAAM,KAAK,MAAM,EAAE;QACzC,MAAM,IAAIb,YAAY,CACpBD,gBAAgB,CAACW,eAAe,EAChC,6CACF,CAA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ACF;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASiC,YAAYA,CAC1BrC,OAAiC,EACjB;EAChB,OAAO;IACLC,OAAO,EAAE;MACPC,QAAQ,EAAE,IAAI;MACd,GAAGF,OAAO,EAAEC;IACd,CAAC;IACDI,KAAK,EAAE;MACLC,OAAO,EAAE,EAAE;MACXC,MAAM,EAAE,MAAM;MACd,GAAGP,OAAO,EAAEK;IACd,CAAC;IACDO,OAAO,EAAEZ,OAAO,EAAEY,OAAO;IACzBQ,WAAW,EAAEpB,OAAO,EAAEoB,WAAW;IACjCkB,YAAY,EAAEtC,OAAO,EAAEsC,YAAY;IACnCC,QAAQ,EAAEvC,OAAO,EAAEuC;EACrB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../plugin/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;;AA0CzD,wBAA4E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native TurboModule bridge for React Native Frame Capture
|
|
3
|
+
* @module NativeFrameCapture
|
|
4
|
+
*/
|
|
5
|
+
import { type TurboModule } from 'react-native';
|
|
6
|
+
/**
|
|
7
|
+
* EventEmitter type for TurboModule events
|
|
8
|
+
*/
|
|
9
|
+
type EventEmitter<T> = (callback: (event: T) => void) => {
|
|
10
|
+
remove: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Event payload types (defined inline for codegen compatibility)
|
|
14
|
+
*/
|
|
15
|
+
export type FrameCapturedEvent = {
|
|
16
|
+
filePath: string;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
frameNumber: number;
|
|
19
|
+
fileSize: number;
|
|
20
|
+
};
|
|
21
|
+
export type CaptureErrorEvent = {
|
|
22
|
+
code: string;
|
|
23
|
+
message: string;
|
|
24
|
+
details?: Object;
|
|
25
|
+
};
|
|
26
|
+
export type CaptureStopEvent = {
|
|
27
|
+
sessionId: string;
|
|
28
|
+
totalFrames: number;
|
|
29
|
+
duration: number;
|
|
30
|
+
};
|
|
31
|
+
export type CaptureStartEvent = {
|
|
32
|
+
sessionId: string;
|
|
33
|
+
options: Object;
|
|
34
|
+
};
|
|
35
|
+
export type StorageWarningEvent = {
|
|
36
|
+
availableSpace: number;
|
|
37
|
+
threshold: number;
|
|
38
|
+
};
|
|
39
|
+
export type CapturePauseEvent = {
|
|
40
|
+
sessionId: string;
|
|
41
|
+
};
|
|
42
|
+
export type CaptureResumeEvent = {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
};
|
|
45
|
+
export type OverlayErrorEvent = {
|
|
46
|
+
overlayIndex: number;
|
|
47
|
+
overlayType: string;
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* TurboModule specification for FrameCapture
|
|
52
|
+
* Defines the native methods implemented in Kotlin
|
|
53
|
+
*/
|
|
54
|
+
export interface Spec extends TurboModule {
|
|
55
|
+
readonly onFrameCaptured: EventEmitter<FrameCapturedEvent>;
|
|
56
|
+
readonly onCaptureError: EventEmitter<CaptureErrorEvent>;
|
|
57
|
+
readonly onCaptureStop: EventEmitter<CaptureStopEvent>;
|
|
58
|
+
readonly onCaptureStart: EventEmitter<CaptureStartEvent>;
|
|
59
|
+
readonly onStorageWarning: EventEmitter<StorageWarningEvent>;
|
|
60
|
+
readonly onCapturePause: EventEmitter<CapturePauseEvent>;
|
|
61
|
+
readonly onCaptureResume: EventEmitter<CaptureResumeEvent>;
|
|
62
|
+
readonly onOverlayError: EventEmitter<OverlayErrorEvent>;
|
|
63
|
+
requestPermission(): Promise<string>;
|
|
64
|
+
checkPermission(): Promise<string>;
|
|
65
|
+
startCapture(options: Object): Promise<Object>;
|
|
66
|
+
stopCapture(): Promise<void>;
|
|
67
|
+
pauseCapture(): Promise<void>;
|
|
68
|
+
resumeCapture(): Promise<void>;
|
|
69
|
+
getCaptureStatus(): Promise<Object>;
|
|
70
|
+
checkNotificationPermission(): Promise<string>;
|
|
71
|
+
cleanupTempFrames(): Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
declare const _default: Spec;
|
|
74
|
+
export default _default;
|
|
75
|
+
//# sourceMappingURL=NativeFrameCapture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeFrameCapture.d.ts","sourceRoot":"","sources":["../../../src/NativeFrameCapture.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE;;GAEG;AACH,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAAK;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,S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OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;;AAED,wBAAsE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core API functions for React Native Frame Capture
|
|
3
|
+
* @module api
|
|
4
|
+
*/
|
|
5
|
+
import { PermissionStatus, type CaptureOptions, type CaptureSession, type CaptureStatus } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Requests MediaProjection permission from the user
|
|
8
|
+
*
|
|
9
|
+
* @returns Promise resolving to permission status
|
|
10
|
+
* @throws {CaptureError} if permission request fails
|
|
11
|
+
*/
|
|
12
|
+
export declare function requestPermission(): Promise<PermissionStatus>;
|
|
13
|
+
/**
|
|
14
|
+
* Checks current permission status without requesting
|
|
15
|
+
*
|
|
16
|
+
* @returns Promise resolving to current permission status
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkPermission(): Promise<PermissionStatus>;
|
|
19
|
+
/**
|
|
20
|
+
* Starts screen capture with the given options
|
|
21
|
+
*
|
|
22
|
+
* @param options - Capture configuration options (optional, uses defaults if not provided)
|
|
23
|
+
* @returns Promise resolving to capture session information
|
|
24
|
+
* @throws {CaptureError} if capture cannot be started
|
|
25
|
+
*/
|
|
26
|
+
export declare function startCapture(options?: Partial<CaptureOptions>): Promise<CaptureSession>;
|
|
27
|
+
/**
|
|
28
|
+
* Stops the active capture session
|
|
29
|
+
*
|
|
30
|
+
* @returns Promise that resolves when capture is stopped
|
|
31
|
+
* @throws {CaptureError} if stop operation fails
|
|
32
|
+
*/
|
|
33
|
+
export declare function stopCapture(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Pauses the active capture session
|
|
36
|
+
*
|
|
37
|
+
* @returns Promise that resolves when capture is paused
|
|
38
|
+
* @throws {CaptureError} if pause operation fails
|
|
39
|
+
*/
|
|
40
|
+
export declare function pauseCapture(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Resumes a paused capture session
|
|
43
|
+
*
|
|
44
|
+
* @returns Promise that resolves when capture is resumed
|
|
45
|
+
* @throws {CaptureError} if resume operation fails
|
|
46
|
+
*/
|
|
47
|
+
export declare function resumeCapture(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the current capture status
|
|
50
|
+
*
|
|
51
|
+
* @returns Promise resolving to current capture status
|
|
52
|
+
*/
|
|
53
|
+
export declare function getCaptureStatus(): Promise<CaptureStatus>;
|
|
54
|
+
/**
|
|
55
|
+
* Checks if notification permission is granted (Android 13+)
|
|
56
|
+
*
|
|
57
|
+
* @returns Promise resolving to permission status
|
|
58
|
+
*/
|
|
59
|
+
export declare function checkNotificationPermission(): Promise<PermissionStatus>;
|
|
60
|
+
/**
|
|
61
|
+
* Manually cleans up all temporary frame files
|
|
62
|
+
*
|
|
63
|
+
* @returns Promise that resolves when cleanup is complete
|
|
64
|
+
*/
|
|
65
|
+
export declare function cleanupTempFrames(): Promise<void>;
|
|
66
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAEL,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAWnE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAWjE;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAChC,OAAO,CAAC,cAAc,CAAC,CAkBzB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAUjD;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAUlD;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAUnD;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC,CAW/D;AAED;;;;GAIG;AACH,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAW7E;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAUvD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for React Native Frame Capture
|
|
3
|
+
* @module constants
|
|
4
|
+
*/
|
|
5
|
+
import type { CaptureOptions, FileNamingConfig, PerformanceOptions } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Default configuration options
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_OPTIONS: CaptureOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Default advanced configuration (for validation fallbacks)
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEFAULT_ADVANCED_CONFIG: {
|
|
14
|
+
storage: {
|
|
15
|
+
warningThreshold: number;
|
|
16
|
+
};
|
|
17
|
+
fileNaming: Required<FileNamingConfig>;
|
|
18
|
+
performance: Required<PerformanceOptions>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Minimum interval between captures (milliseconds)
|
|
22
|
+
*/
|
|
23
|
+
export declare const MIN_INTERVAL = 100;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum interval between captures (milliseconds)
|
|
26
|
+
*/
|
|
27
|
+
export declare const MAX_INTERVAL = 60000;
|
|
28
|
+
/**
|
|
29
|
+
* Minimum image quality value
|
|
30
|
+
*/
|
|
31
|
+
export declare const MIN_QUALITY = 0;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum image quality value
|
|
34
|
+
*/
|
|
35
|
+
export declare const MAX_QUALITY = 100;
|
|
36
|
+
/**
|
|
37
|
+
* Storage warning threshold (bytes)
|
|
38
|
+
* @deprecated Use advanced.storage.warningThreshold in CaptureOptions instead
|
|
39
|
+
*/
|
|
40
|
+
export declare const STORAGE_WARNING_THRESHOLD: number;
|
|
41
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,cAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;gBAQ7B,QAAQ,CAAC,gBAAgB,CAAC;iBAM1B,QAAQ,CAAC,kBAAkB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B;;GAEG;AACH,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAoB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error handling for React Native Frame Capture
|
|
3
|
+
* @module errors
|
|
4
|
+
*/
|
|
5
|
+
import { CaptureErrorCode } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Custom error class for capture operations
|
|
8
|
+
*/
|
|
9
|
+
export declare class CaptureError extends Error {
|
|
10
|
+
code: CaptureErrorCode;
|
|
11
|
+
details?: any;
|
|
12
|
+
constructor(code: CaptureErrorCode, message: string, details?: any);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,CAAC,EAAE,GAAG,CAAC;gBAEF,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAMnE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event handling for React Native Frame Capture
|
|
3
|
+
* @module events
|
|
4
|
+
*/
|
|
5
|
+
import type { EventSubscription } from 'react-native';
|
|
6
|
+
import { CaptureEventType, type CaptureEventCallback } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Adds an event listener for capture events
|
|
9
|
+
*
|
|
10
|
+
* @param event - Event type to listen for
|
|
11
|
+
* @param callback - Function to call when event is emitted
|
|
12
|
+
* @returns Subscription object that can be used to remove the listener
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const subscription = addListener(
|
|
17
|
+
* CaptureEventType.FRAME_CAPTURED,
|
|
18
|
+
* (event) => console.log('Frame captured:', event.filePath)
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* // Later, remove the listener
|
|
22
|
+
* subscription.remove();
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function addListener(event: CaptureEventType, callback: CaptureEventCallback): EventSubscription;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use subscription.remove() instead
|
|
28
|
+
*/
|
|
29
|
+
export declare function removeAllListeners(_event: CaptureEventType): void;
|
|
30
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEtE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,oBAAoB,GAC7B,iBAAiB,CAqBnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAIjE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native Frame Capture
|
|
3
|
+
* Production-grade screen capture library for React Native Android
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './constants';
|
|
9
|
+
export { CaptureError } from './errors';
|
|
10
|
+
export { requestPermission, checkPermission, startCapture, stopCapture, pauseCapture, resumeCapture, getCaptureStatus, checkNotificationPermission, cleanupTempFrames, } from './api';
|
|
11
|
+
export { addListener, removeAllListeners } from './events';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalization utilities for converting organized CaptureOptions
|
|
3
|
+
* to the flat structure expected by native code
|
|
4
|
+
* @module normalize
|
|
5
|
+
*/
|
|
6
|
+
import type { CaptureOptions } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Flat options structure expected by native code
|
|
9
|
+
*/
|
|
10
|
+
export interface NativeCaptureOptions {
|
|
11
|
+
interval: number;
|
|
12
|
+
quality: number;
|
|
13
|
+
format: 'png' | 'jpeg';
|
|
14
|
+
saveFrames?: boolean;
|
|
15
|
+
storageLocation?: 'private' | 'public';
|
|
16
|
+
outputDirectory?: string;
|
|
17
|
+
scaleResolution?: number;
|
|
18
|
+
captureRegion?: any;
|
|
19
|
+
excludeStatusBar?: boolean;
|
|
20
|
+
notification?: any;
|
|
21
|
+
overlays?: any[];
|
|
22
|
+
advanced?: {
|
|
23
|
+
storage?: {
|
|
24
|
+
warningThreshold?: number;
|
|
25
|
+
};
|
|
26
|
+
fileNaming?: {
|
|
27
|
+
prefix?: string;
|
|
28
|
+
dateFormat?: string;
|
|
29
|
+
framePadding?: number;
|
|
30
|
+
};
|
|
31
|
+
performance?: {
|
|
32
|
+
overlayCacheSize?: number;
|
|
33
|
+
imageReaderBuffers?: number;
|
|
34
|
+
executorShutdownTimeout?: number;
|
|
35
|
+
executorForcedShutdownTimeout?: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalizes organized CaptureOptions to flat structure for native code
|
|
41
|
+
*/
|
|
42
|
+
export declare function normalizeOptions(options: CaptureOptions): NativeCaptureOptions;
|
|
43
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/normalize.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE;YACR,gBAAgB,CAAC,EAAE,MAAM,CAAC;SAC3B,CAAC;QACF,UAAU,CAAC,EAAE;YACX,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,YAAY,CAAC,EAAE,MAAM,CAAC;SACvB,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;YAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;YACjC,6BAA6B,CAAC,EAAE,MAAM,CAAC;SACxC,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,cAAc,GACtB,oBAAoB,CAkCtB"}
|