diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..7877b3a --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "msu2-usb-monitor-controller", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@types/w3c-web-serial": { + "version": "1.0.8", + "resolved": "http://mirrors.tencentyun.com/npm/@types/w3c-web-serial/-/w3c-web-serial-1.0.8.tgz", + "integrity": "sha512-QQOT+bxQJhRGXoZDZGLs3ksLud1dMNnMiSQtBA0w8KXvLpXX4oM4TZb6J0GgJ8UbCaHo5s9/4VQT8uXy9JER2A==" + } + } +} diff --git a/node_modules/@types/w3c-web-serial/LICENSE b/node_modules/@types/w3c-web-serial/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/w3c-web-serial/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/w3c-web-serial/README.md b/node_modules/@types/w3c-web-serial/README.md new file mode 100644 index 0000000..fd38852 --- /dev/null +++ b/node_modules/@types/w3c-web-serial/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/w3c-web-serial` + +# Summary +This package contains type definitions for w3c-web-serial (https://wicg.github.io/serial). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/w3c-web-serial. + +### Additional Details + * Last updated: Sat, 01 Mar 2025 01:29:33 GMT + * Dependencies: none + +# Credits +These definitions were written by [Reilly Grant](https://github.com/reillyeon). diff --git a/node_modules/@types/w3c-web-serial/index.d.ts b/node_modules/@types/w3c-web-serial/index.d.ts new file mode 100644 index 0000000..a271107 --- /dev/null +++ b/node_modules/@types/w3c-web-serial/index.d.ts @@ -0,0 +1,134 @@ +/*~ https://wicg.github.io/serial/#dom-paritytype */ +type ParityType = "none" | "even" | "odd"; + +/*~ https://wicg.github.io/serial/#dom-flowcontroltype */ +type FlowControlType = "none" | "hardware"; + +/*~ https://wicg.github.io/serial/#dom-serialoptions */ +interface SerialOptions { + baudRate: number; + dataBits?: 7 | 8 | undefined; + stopBits?: 1 | 2 | undefined; + parity?: ParityType | undefined; + bufferSize?: number | undefined; + flowControl?: FlowControlType | undefined; +} + +/*~ https://wicg.github.io/serial/#dom-serialoutputsignals */ +interface SerialOutputSignals { + dataTerminalReady?: boolean | undefined; + requestToSend?: boolean | undefined; + break?: boolean | undefined; +} + +/*~ https://wicg.github.io/serial/#dom-serialinputsignals */ +interface SerialInputSignals { + dataCarrierDetect: boolean; + clearToSend: boolean; + ringIndicator: boolean; + dataSetReady: boolean; +} + +/*~ https://wicg.github.io/serial/#serialportinfo-dictionary */ +interface SerialPortInfo { + usbVendorId?: number | undefined; + usbProductId?: number | undefined; + /** If the port is a service on a Bluetooth device this member will be a BluetoothServiceUUID + * containing the service class UUID. Otherwise it will be undefined. */ + bluetoothServiceClassId?: number | string | undefined; +} + +/*~ https://wicg.github.io/serial/#dom-serialport */ +declare class SerialPort extends EventTarget { + onconnect: ((this: this, ev: Event) => void) | null; + ondisconnect: ((this: this, ev: Event) => void) | null; + /** A flag indicating the logical connection state of serial port */ + readonly connected: boolean; + readonly readable: ReadableStream | null; + readonly writable: WritableStream | null; + + open(options: SerialOptions): Promise; + setSignals(signals: SerialOutputSignals): Promise; + getSignals(): Promise; + getInfo(): SerialPortInfo; + close(): Promise; + forget(): Promise; + + addEventListener( + type: "connect" | "disconnect", + listener: (this: this, ev: Event) => void, + useCapture?: boolean, + ): void; + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject | null, + options?: boolean | AddEventListenerOptions, + ): void; + removeEventListener( + type: "connect" | "disconnect", + callback: (this: this, ev: Event) => void, + useCapture?: boolean, + ): void; + removeEventListener( + type: string, + callback: EventListenerOrEventListenerObject | null, + options?: EventListenerOptions | boolean, + ): void; +} + +/*~ https://wicg.github.io/serial/#dom-serialportfilter */ +interface SerialPortFilter { + usbVendorId?: number | undefined; + usbProductId?: number | undefined; + bluetoothServiceClassId?: number | string | undefined; +} + +/*~ https://wicg.github.io/serial/#dom-serialportrequestoptions */ +interface SerialPortRequestOptions { + filters?: SerialPortFilter[] | undefined; + /** A list of BluetoothServiceUUID values representing Bluetooth service class IDs. + * Bluetooth ports with custom service class IDs are excluded from the list of ports + * presented to the user unless the service class ID is included in this list. + * + * {@link https://wicg.github.io/serial/#serialportrequestoptions-dictionary} */ + allowedBluetoothServiceClassIds?: Array | undefined; +} + +/*~ https://wicg.github.io/serial/#dom-serial */ +declare class Serial extends EventTarget { + onconnect: ((this: this, ev: Event) => void) | null; + ondisconnect: ((this: this, ev: Event) => void) | null; + + getPorts(): Promise; + requestPort(options?: SerialPortRequestOptions): Promise; + addEventListener( + type: "connect" | "disconnect", + listener: (this: this, ev: Event) => void, + useCapture?: boolean, + ): void; + addEventListener( + type: string, + listener: EventListenerOrEventListenerObject | null, + options?: boolean | AddEventListenerOptions, + ): void; + removeEventListener( + type: "connect" | "disconnect", + callback: (this: this, ev: Event) => void, + useCapture?: boolean, + ): void; + removeEventListener( + type: string, + callback: EventListenerOrEventListenerObject | null, + options?: EventListenerOptions | boolean, + ): void; +} + +/*~ https://wicg.github.io/serial/#extensions-to-the-navigator-interface */ +interface Navigator { + readonly serial: Serial; +} + +/*~ https://wicg.github.io/serial/#extensions-to-workernavigator-interface */ +interface WorkerNavigator { + readonly serial: Serial; +} diff --git a/node_modules/@types/w3c-web-serial/package.json b/node_modules/@types/w3c-web-serial/package.json new file mode 100644 index 0000000..ed748a4 --- /dev/null +++ b/node_modules/@types/w3c-web-serial/package.json @@ -0,0 +1,27 @@ +{ + "name": "@types/w3c-web-serial", + "version": "1.0.8", + "description": "TypeScript definitions for w3c-web-serial", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/w3c-web-serial", + "license": "MIT", + "contributors": [ + { + "name": "Reilly Grant", + "githubUsername": "reillyeon", + "url": "https://github.com/reillyeon" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/w3c-web-serial" + }, + "scripts": {}, + "dependencies": {}, + "peerDependencies": {}, + "typesPublisherContentHash": "65266e1703600c207e33ead89e5dced16e5c16067f0144a0e074ad4d3829d1d0", + "typeScriptVersion": "5.0", + "nonNpm": true +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ae0c4da --- /dev/null +++ b/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "msu2-usb-monitor-controller", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "msu2-usb-monitor-controller", + "version": "1.0.0", + "license": "GPL-3.0-only", + "dependencies": { + "@types/w3c-web-serial": "^1.0.8" + } + }, + "node_modules/@types/w3c-web-serial": { + "version": "1.0.8", + "resolved": "http://mirrors.tencentyun.com/npm/@types/w3c-web-serial/-/w3c-web-serial-1.0.8.tgz", + "integrity": "sha512-QQOT+bxQJhRGXoZDZGLs3ksLud1dMNnMiSQtBA0w8KXvLpXX4oM4TZb6J0GgJ8UbCaHo5s9/4VQT8uXy9JER2A==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5a66bfc --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "msu2-usb-monitor-controller", + "version": "1.0.0", + "description": "MSU2 USB 小屏幕控制网页 Demo,使用 TRAE 辅助编写,参考了原 Python 程序的代码。", + "author": "Frost-ZX", + "keywords": ["demo", "web"], + "license": "GPL-3.0-only", + "scripts": {}, + "dependencies": { + "@types/w3c-web-serial": "^1.0.8" + } +}