@g9tm/app-diagnostic-lynx 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Native-Validation-Pending.md +1 -1
- package/README.md +63 -42
- package/android/build.gradle.kts +45 -45
- package/android/src/main/java/com/g9tm/appdiagnostic/G9AppDiagnosticHost.kt +19 -19
- package/android/src/main/java/com/g9tm/appdiagnostic/G9AppDiagnosticModule.kt +2 -2
- package/android/src/main/java/com/g9tm/appdiagnostic/LynxBridge.kt +41 -0
- package/android/src/main/java/com/g9tm/appdiagnostic/TouchWatcher.kt +129 -129
- package/android/src/main/java/com/g9tm/appdiagnostic/core/TouchCore.kt +270 -270
- package/ios/g9tm-app-diagnostic-lynx.podspec +23 -0
- package/ios/src/G9AppDiagnosticHost.h +32 -0
- package/ios/src/G9AppDiagnosticHost.m +72 -0
- package/ios/src/G9AppDiagnosticModule.h +23 -0
- package/ios/src/G9AppDiagnosticModule.m +238 -0
- package/ios/src/G9DiagnosticRecorders.h +36 -0
- package/ios/src/G9DiagnosticRecorders.m +514 -0
- package/package.json +17 -4
- package/src/index.ts +178 -175
- package/src/ui/TesterPanel.tsx +224 -0
- package/types/g9-app-diagnostic-module.d.ts +60 -60
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
// The native module of @g9tm/app-diagnostic-lynx. The Android/iOS specs and the JS accessor (generated/) follow this
|
|
2
|
-
// declaration. Every reply is an envelope `{ ok: true, value } | { ok: false, error: { code, message } }` so the error
|
|
3
|
-
// fields survive the bridge.
|
|
4
|
-
//
|
|
5
|
-
// Error codes (public API — add, never rename or repurpose):
|
|
6
|
-
// busy a recorder of that kind is already running
|
|
7
|
-
// permission the microphone permission was refused
|
|
8
|
-
// unavailable no encoder / microphone / laid-out window
|
|
9
|
-
// invalid a folder or file outside the folders the host allows, or a malformed request
|
|
10
|
-
// not-found the file to send does not exist
|
|
11
|
-
// network the range request failed in transport (any HTTP status is a value, not an error)
|
|
12
|
-
// timeout the range request ran past its time limit
|
|
13
|
-
// io the platform refused (a capture that failed, no space)
|
|
14
|
-
//
|
|
15
|
-
// Events (global, JSON text): `g9:diagnostic-touch` — {type: 'tap', fingers, x, y, excluded} for a completed multi-finger
|
|
16
|
-
// tap, {type: 'down', fingers: 1, x, y, excluded: false} for a first finger down (only while `touches` is on). x, y are
|
|
17
|
-
// fractions of the window; `excluded` = the first finger landed on a surface the host excludes (a map). A tap also
|
|
18
|
-
// carries `cx`, `cy`: the fingers' midpoint at the most fingers. While `touches` is on, every touch that could have been a
|
|
19
|
-
// tap ends with {type: 'seq', fingers, x, y, cx, cy, excluded, info: {ms, secondMs, firstUpMs, movePx, slopPx, held,
|
|
20
|
-
// oldRuleMoved, why}} — why: tap | moved | too-long | one-finger | cancelled | not-watching.
|
|
21
|
-
|
|
22
|
-
/** @lynxmodule */
|
|
23
|
-
export declare class G9AppDiagnosticModule {
|
|
24
|
-
/** `{ version, platform: 'android' | 'ios', screen, voice, consume }`: what this device can record, whether a gesture can be consumed. */
|
|
25
|
-
capabilities(callback: (reply: Record<string, unknown>) => void): void;
|
|
26
|
-
/** `{ screen, voice }`: which recorder runs now (a recorder outlives a reload of the app's script). */
|
|
27
|
-
state(callback: (reply: Record<string, unknown>) => void): void;
|
|
28
|
-
/**
|
|
29
|
-
* Records the app's OWN window into `<dir>/screen-<ms>.mp4` (H.264, long edge ≤ 960 px, no system consent) at an adaptive
|
|
30
|
-
* rate starting at `maxFps` (4-20). Stops itself at 10 minutes and keeps the file for `stopScreen`. Value: null.
|
|
31
|
-
*/
|
|
32
|
-
startScreen(dir: string, maxFps: number, callback: (reply: Record<string, unknown>) => void): void;
|
|
33
|
-
/** `{ path, bytes, durationMs, width, height, capped }`, or null when nothing usable was recorded. */
|
|
34
|
-
stopScreen(callback: (reply: Record<string, unknown>) => void): void;
|
|
35
|
-
/** Records the microphone into `<dir>/voice-<ms>.m4a` (AAC, mono, 44.1 kHz); asks the permission first. Value: null. */
|
|
36
|
-
startVoice(dir: string, callback: (reply: Record<string, unknown>) => void): void;
|
|
37
|
-
/** `{ path, bytes, durationMs }`, or null. */
|
|
38
|
-
stopVoice(callback: (reply: Record<string, unknown>) => void): void;
|
|
39
|
-
/**
|
|
40
|
-
* The tester gesture's watcher: `taps` reports completed multi-finger taps, `touches` every first finger down, `consume`
|
|
41
|
-
* holds a two-finger touch away from the views (cancelled, replayed when it turns out to be a pinch or pan) so the
|
|
42
|
-
* gesture never also presses what is under it; `excludeSurfaces` keeps the excluded surfaces native (never held). All
|
|
43
|
-
* false = nothing is watched. Value: null.
|
|
44
|
-
*/
|
|
45
|
-
watchTouches(taps: boolean, touches: boolean, consume: boolean, excludeSurfaces: boolean, callback: (reply: Record<string, unknown>) => void): void;
|
|
46
|
-
/** The window as the user sees it (the map included), JPEG at `quality` (10-100), long edge ≤ `maxEdge`, into `dir`: `{ path, width, height, bytes }`. */
|
|
47
|
-
screenshot(dir: string, maxEdge: number, quality: number, callback: (reply: Record<string, unknown>) => void): void;
|
|
48
|
-
/**
|
|
49
|
-
* One HTTP request whose body is a byte range of a file, read natively: `{url, method, path, offset, length, contentType,
|
|
50
|
-
* headers, timeoutMs}` as JSON. Every HTTP status resolves `{ status, body, headers }`; only a transport failure rejects.
|
|
51
|
-
*/
|
|
52
|
-
sendRange(requestJson: string, callback: (reply: Record<string, unknown>) => void): void;
|
|
53
|
-
/**
|
|
54
|
-
* A REAL touch for the operator's remote control (the live channel's remote input, E-13; the caller checks the user's
|
|
55
|
-
* consent first): `kind` 'tap' | 'longPress' | 'drag', points in dp from the window's top-left, dispatched into the
|
|
56
|
-
* window's decor view with real time between DOWN, MOVEs and UP — whatever is on top gets it as it gets a finger.
|
|
57
|
-
* `{ handled }`.
|
|
58
|
-
*/
|
|
59
|
-
touch(kind: string, x: number, y: number, toX: number, toY: number, durationMs: number, callback: (reply: Record<string, unknown>) => void): void;
|
|
60
|
-
}
|
|
1
|
+
// The native module of @g9tm/app-diagnostic-lynx. The Android/iOS specs and the JS accessor (generated/) follow this
|
|
2
|
+
// declaration. Every reply is an envelope `{ ok: true, value } | { ok: false, error: { code, message } }` so the error
|
|
3
|
+
// fields survive the bridge.
|
|
4
|
+
//
|
|
5
|
+
// Error codes (public API — add, never rename or repurpose):
|
|
6
|
+
// busy a recorder of that kind is already running
|
|
7
|
+
// permission the microphone permission was refused
|
|
8
|
+
// unavailable no encoder / microphone / laid-out window
|
|
9
|
+
// invalid a folder or file outside the folders the host allows, or a malformed request
|
|
10
|
+
// not-found the file to send does not exist
|
|
11
|
+
// network the range request failed in transport (any HTTP status is a value, not an error)
|
|
12
|
+
// timeout the range request ran past its time limit
|
|
13
|
+
// io the platform refused (a capture that failed, no space)
|
|
14
|
+
//
|
|
15
|
+
// Events (global, JSON text): `g9:diagnostic-touch` — {type: 'tap', fingers, x, y, excluded} for a completed multi-finger
|
|
16
|
+
// tap, {type: 'down', fingers: 1, x, y, excluded: false} for a first finger down (only while `touches` is on). x, y are
|
|
17
|
+
// fractions of the window; `excluded` = the first finger landed on a surface the host excludes (a map). A tap also
|
|
18
|
+
// carries `cx`, `cy`: the fingers' midpoint at the most fingers. While `touches` is on, every touch that could have been a
|
|
19
|
+
// tap ends with {type: 'seq', fingers, x, y, cx, cy, excluded, info: {ms, secondMs, firstUpMs, movePx, slopPx, held,
|
|
20
|
+
// oldRuleMoved, why}} — why: tap | moved | too-long | one-finger | cancelled | not-watching.
|
|
21
|
+
|
|
22
|
+
/** @lynxmodule */
|
|
23
|
+
export declare class G9AppDiagnosticModule {
|
|
24
|
+
/** `{ version, platform: 'android' | 'ios', screen, voice, consume }`: what this device can record, whether a gesture can be consumed. */
|
|
25
|
+
capabilities(callback: (reply: Record<string, unknown>) => void): void;
|
|
26
|
+
/** `{ screen, voice }`: which recorder runs now (a recorder outlives a reload of the app's script). */
|
|
27
|
+
state(callback: (reply: Record<string, unknown>) => void): void;
|
|
28
|
+
/**
|
|
29
|
+
* Records the app's OWN window into `<dir>/screen-<ms>.mp4` (H.264, long edge ≤ 960 px, no system consent) at an adaptive
|
|
30
|
+
* rate starting at `maxFps` (4-20). Stops itself at 10 minutes and keeps the file for `stopScreen`. Value: null.
|
|
31
|
+
*/
|
|
32
|
+
startScreen(dir: string, maxFps: number, callback: (reply: Record<string, unknown>) => void): void;
|
|
33
|
+
/** `{ path, bytes, durationMs, width, height, capped }`, or null when nothing usable was recorded. */
|
|
34
|
+
stopScreen(callback: (reply: Record<string, unknown>) => void): void;
|
|
35
|
+
/** Records the microphone into `<dir>/voice-<ms>.m4a` (AAC, mono, 44.1 kHz); asks the permission first. Value: null. */
|
|
36
|
+
startVoice(dir: string, callback: (reply: Record<string, unknown>) => void): void;
|
|
37
|
+
/** `{ path, bytes, durationMs }`, or null. */
|
|
38
|
+
stopVoice(callback: (reply: Record<string, unknown>) => void): void;
|
|
39
|
+
/**
|
|
40
|
+
* The tester gesture's watcher: `taps` reports completed multi-finger taps, `touches` every first finger down, `consume`
|
|
41
|
+
* holds a two-finger touch away from the views (cancelled, replayed when it turns out to be a pinch or pan) so the
|
|
42
|
+
* gesture never also presses what is under it; `excludeSurfaces` keeps the excluded surfaces native (never held). All
|
|
43
|
+
* false = nothing is watched. Value: null.
|
|
44
|
+
*/
|
|
45
|
+
watchTouches(taps: boolean, touches: boolean, consume: boolean, excludeSurfaces: boolean, callback: (reply: Record<string, unknown>) => void): void;
|
|
46
|
+
/** The window as the user sees it (the map included), JPEG at `quality` (10-100), long edge ≤ `maxEdge`, into `dir`: `{ path, width, height, bytes }`. */
|
|
47
|
+
screenshot(dir: string, maxEdge: number, quality: number, callback: (reply: Record<string, unknown>) => void): void;
|
|
48
|
+
/**
|
|
49
|
+
* One HTTP request whose body is a byte range of a file, read natively: `{url, method, path, offset, length, contentType,
|
|
50
|
+
* headers, timeoutMs}` as JSON. Every HTTP status resolves `{ status, body, headers }`; only a transport failure rejects.
|
|
51
|
+
*/
|
|
52
|
+
sendRange(requestJson: string, callback: (reply: Record<string, unknown>) => void): void;
|
|
53
|
+
/**
|
|
54
|
+
* A REAL touch for the operator's remote control (the live channel's remote input, E-13; the caller checks the user's
|
|
55
|
+
* consent first): `kind` 'tap' | 'longPress' | 'drag', points in dp from the window's top-left, dispatched into the
|
|
56
|
+
* window's decor view with real time between DOWN, MOVEs and UP — whatever is on top gets it as it gets a finger.
|
|
57
|
+
* `{ handled }`.
|
|
58
|
+
*/
|
|
59
|
+
touch(kind: string, x: number, y: number, toX: number, toY: number, durationMs: number, callback: (reply: Record<string, unknown>) => void): void;
|
|
60
|
+
}
|