chore(scrcpy): add more docs

This commit is contained in:
Simon Chan 2023-07-20 19:53:00 +08:00
parent 347beb308e
commit 04f15595e3
No known key found for this signature in database
GPG key ID: A8B69F750B9BCEDD
4 changed files with 33 additions and 2 deletions

View file

@ -260,21 +260,54 @@ export class AdbScrcpyClient {
}
#videoStream: Promise<AdbScrcpyVideoStream> | undefined;
/**
* Gets a `Promise` that resolves to the parsed video stream.
*
* On server version 2.1 and above, it will be `undefined` if
* video is disabled by `options.video: false`.
*
* Note: if it's not `undefined`, it must be consumed to prevent
* the connection from being blocked.
*/
get videoStream() {
return this.#videoStream;
}
#audioStream: Promise<AdbScrcpyAudioStreamMetadata> | undefined;
/**
* Gets a `Promise` that resolves to the parsed audio stream.
*
* On server versions before 2.0, it will always be `undefined`.
* On server version 2.0 and above, it will be `undefined` if
* audio is disabled by `options.audio: false`.
*
* Note: if it's not `undefined`, it must be consumed to prevent
* the connection from being blocked.
*/
get audioStream() {
return this.#audioStream;
}
#controlMessageWriter: ScrcpyControlMessageWriter | undefined;
/**
* Gets the control message writer.
*
* On server version 1.22 and above, it will be `undefined` if
* control is disabled by `options.control: false`.
*/
get controlMessageWriter() {
return this.#controlMessageWriter;
}
#deviceMessageStream: ReadableStream<ScrcpyDeviceMessage> | undefined;
/**
* Gets the device message stream.
*
* On server version 1.22 and above, it will be `undefined` if
* control is disabled by `options.control: false`.
*
* Note: it must be consumed to prevent the connection from being blocked.
*/
get deviceMessageStream() {
return this.#deviceMessageStream;
}

View file

@ -10,5 +10,3 @@ export type ScrcpyVideoOrientation = ScrcpyVideoOrientation1_18;
export type ScrcpyOptionsInitLatest = ScrcpyOptionsInit2_1;
export class ScrcpyOptionsLatest extends ScrcpyOptions2_1 {}
export const ScrcpyLatestVersion = "2.1";