@arenahito/droid-webscr 0.0.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.
@@ -0,0 +1,43 @@
1
+ import { AdbProvider } from '@droid-webscr/adb';
2
+ import { AgentConfig } from '@droid-webscr/config';
3
+ import { FastifyInstance } from 'fastify';
4
+
5
+ interface StartedDeviceSession {
6
+ readonly frames: AsyncIterable<Uint8Array>;
7
+ readonly serial: string;
8
+ stop(): Promise<void>;
9
+ write(frame: Uint8Array): Promise<void>;
10
+ }
11
+
12
+ interface SessionVideoSettings {
13
+ readonly bitrateMbps: number;
14
+ readonly fps: number;
15
+ }
16
+
17
+ interface DeviceServer {
18
+ start(serial: string, video: SessionVideoSettings, signal?: AbortSignal | undefined): Promise<StartedDeviceSession>;
19
+ }
20
+
21
+ interface AgentAppContext {
22
+ readonly adbProvider: AdbProvider;
23
+ readonly config: AgentConfig;
24
+ readonly deviceServer?: DeviceServer | undefined;
25
+ readonly getRuntimeConfig?: (() => AgentConfig) | undefined;
26
+ readonly logger?: boolean | undefined;
27
+ readonly rebindRuntime?: ((bindHost: string, port: number) => Promise<void>) | undefined;
28
+ readonly updateRuntimeConfig?: ((config: AgentConfig) => void) | undefined;
29
+ }
30
+ interface AgentFastifyApp extends FastifyInstance {
31
+ closeActiveDeviceSessions(options?: {
32
+ readonly waitForStartup?: boolean;
33
+ }): Promise<void>;
34
+ }
35
+ declare function createLoggerOptions(enabled: boolean | undefined): false | {
36
+ level: string;
37
+ redact: string[];
38
+ };
39
+ declare function createFastifyApp(context: AgentAppContext): Promise<AgentFastifyApp>;
40
+ declare function selectBinaryWebSocketProtocol(protocols: Set<string>): string | false;
41
+ declare function hasBinaryWebSocketProtocol(header: string | string[] | undefined): boolean;
42
+
43
+ export { type AgentAppContext, type AgentFastifyApp, createFastifyApp, createLoggerOptions, hasBinaryWebSocketProtocol, selectBinaryWebSocketProtocol };