| 18 | >; |
| 19 | |
| 20 | export class UHidOutputStream |
| 21 | extends PushReadableStream<UHidOutputDeviceMessage> |
| 22 | implements ScrcpyDeviceMessageParser |
| 23 | { |
| 24 | #controller: PushReadableStreamController<UHidOutputDeviceMessage>; |
| 25 | |
| 26 | readonly id = 2; |
| 27 | |
| 28 | constructor() { |
| 29 | let controller!: PushReadableStreamController<UHidOutputDeviceMessage>; |
| 30 | super((controller_) => { |
| 31 | controller = controller_; |
| 32 | }); |
| 33 | this.#controller = controller; |
| 34 | } |
| 35 | |
| 36 | async parse(_id: number, stream: AsyncExactReadable): Promise<undefined> { |
| 37 | const message = await UHidOutputDeviceMessage.deserialize(stream); |
| 38 | await this.#controller.enqueue(message); |
| 39 | } |
| 40 | |
| 41 | close() { |
| 42 | this.#controller.close(); |
| 43 | } |
| 44 | |
| 45 | error(e?: unknown) { |
| 46 | this.#controller.error(e); |
| 47 | } |
| 48 | } |
nothing calls this directly
no outgoing calls
no test coverage detected