blob: 7d7a898445bdc48d5a5dd62fd4996f870616294a [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://wicg.github.io/serial/#serial-interface
[
Exposed(Window Serial, DedicatedWorker Serial),
SecureContext
] interface Serial : EventTarget {
attribute EventHandler onconnect;
attribute EventHandler ondisconnect;
[CallWith=ScriptState, RaisesException, MeasureAs=SerialGetPorts]
Promise<sequence<SerialPort>> getPorts();
[CallWith=ScriptState, RaisesException, MeasureAs=SerialRequestPort, Exposed=Window]
Promise<SerialPort> requestPort(optional SerialPortRequestOptions options = {});
};