ladybird/Libraries/LibWeb/Serial/Serial.idl
2025-08-08 10:23:17 +02:00

26 lines
932 B
Text

#import <DOM/EventHandler.idl>
#import <Serial/SerialPort.idl>
// https://wicg.github.io/serial/#serial-interface
[Exposed=(DedicatedWorker, Window), SecureContext]
interface Serial : EventTarget {
attribute EventHandler onconnect;
attribute EventHandler ondisconnect;
Promise<sequence<SerialPort>> getPorts();
[Exposed=Window] Promise<SerialPort> requestPort(optional SerialPortRequestOptions options = {});
};
// https://wicg.github.io/serial/#serialportfilter-dictionary
dictionary SerialPortFilter {
unsigned short usbVendorId;
unsigned short usbProductId;
// FIXME: Should be a BluetoothServiceUUID
DOMString bluetoothServiceClassId;
};
// https://wicg.github.io/serial/#serialportrequestoptions-dictionary
dictionary SerialPortRequestOptions {
sequence<SerialPortFilter> filters;
// FIXME: Should be a BluetoothServiceUUID
sequence<DOMString> allowedBluetoothServiceClassIds;
};