From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- testing/web-platform/tests/interfaces/webhid.idl | 127 +++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 testing/web-platform/tests/interfaces/webhid.idl (limited to 'testing/web-platform/tests/interfaces/webhid.idl') diff --git a/testing/web-platform/tests/interfaces/webhid.idl b/testing/web-platform/tests/interfaces/webhid.idl new file mode 100644 index 0000000000..a1a02d3e43 --- /dev/null +++ b/testing/web-platform/tests/interfaces/webhid.idl @@ -0,0 +1,127 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content was automatically extracted by Reffy into webref +// (https://github.com/w3c/webref) +// Source: WebHID API (https://wicg.github.io/webhid/) + +[SecureContext] partial interface Navigator { + [SameObject] readonly attribute HID hid; +}; + +[Exposed=ServiceWorker, SecureContext] +partial interface WorkerNavigator { + [SameObject] readonly attribute HID hid; +}; + +[Exposed=(Window,ServiceWorker), SecureContext] +interface HID : EventTarget { + attribute EventHandler onconnect; + attribute EventHandler ondisconnect; + Promise> getDevices(); + Promise> requestDevice( + HIDDeviceRequestOptions options); +}; + +dictionary HIDDeviceRequestOptions { + required sequence filters; + sequence exclusionFilters; +}; + +dictionary HIDDeviceFilter { + unsigned long vendorId; + unsigned short productId; + unsigned short usagePage; + unsigned short usage; +}; + +[Exposed=Window, SecureContext] +interface HIDDevice : EventTarget { + attribute EventHandler oninputreport; + readonly attribute boolean opened; + readonly attribute unsigned short vendorId; + readonly attribute unsigned short productId; + readonly attribute DOMString productName; + readonly attribute FrozenArray collections; + Promise open(); + Promise close(); + Promise forget(); + Promise sendReport([EnforceRange] octet reportId, BufferSource data); + Promise sendFeatureReport( + [EnforceRange] octet reportId, + BufferSource data); + Promise receiveFeatureReport([EnforceRange] octet reportId); +}; + +[Exposed=Window, SecureContext] +interface HIDConnectionEvent : Event { + constructor(DOMString type, HIDConnectionEventInit eventInitDict); + [SameObject] readonly attribute HIDDevice device; +}; + +dictionary HIDConnectionEventInit : EventInit { + required HIDDevice device; +}; + +[Exposed=Window, SecureContext] +interface HIDInputReportEvent : Event { + constructor(DOMString type, HIDInputReportEventInit eventInitDict); + [SameObject] readonly attribute HIDDevice device; + readonly attribute octet reportId; + readonly attribute DataView data; +}; + +dictionary HIDInputReportEventInit : EventInit { + required HIDDevice device; + required octet reportId; + required DataView data; +}; + +dictionary HIDCollectionInfo { + unsigned short usagePage; + unsigned short usage; + octet type; + sequence children; + sequence inputReports; + sequence outputReports; + sequence featureReports; +}; + +dictionary HIDReportInfo { + octet reportId; + sequence items; +}; + +dictionary HIDReportItem { + boolean isAbsolute; + boolean isArray; + boolean isBufferedBytes; + boolean isConstant; + boolean isLinear; + boolean isRange; + boolean isVolatile; + boolean hasNull; + boolean hasPreferredState; + boolean wrap; + sequence usages; + unsigned long usageMinimum; + unsigned long usageMaximum; + unsigned short reportSize; + unsigned short reportCount; + byte unitExponent; + HIDUnitSystem unitSystem; + byte unitFactorLengthExponent; + byte unitFactorMassExponent; + byte unitFactorTimeExponent; + byte unitFactorTemperatureExponent; + byte unitFactorCurrentExponent; + byte unitFactorLuminousIntensityExponent; + long logicalMinimum; + long logicalMaximum; + long physicalMinimum; + long physicalMaximum; + sequence strings; +}; + +enum HIDUnitSystem { + "none", "si-linear", "si-rotation", "english-linear", + "english-rotation", "vendor-defined", "reserved" +}; -- cgit v1.2.3