UNPKG

@yume-chan/scrcpy

Version:
23 lines 656 B
/** * Scrcpy control message types have different values between versions. * * This class provides a way to get the actual value for a given type. */ export class ScrcpyControlMessageTypeMap { #types; constructor(options) { this.#types = options.controlMessageTypes; } get(type) { const value = this.#types.indexOf(type); if (value === -1) { throw new TypeError("Invalid or unsupported control message type"); } return value; } fillMessageType(message, type) { message.type = this.get(type); return message; } } //# sourceMappingURL=message-type-map.js.map