summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/serial/serial.idl
blob: ff9f6568f637cf8a22898215d8c7e76e436569f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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

[
    Exposed(Window Serial,DedicatedWorker Serial),
    SecureContext
] interface Serial : EventTarget {
    attribute EventHandler onconnect;
    attribute EventHandler ondisconnect;

    [CallWith=ScriptState, MeasureAs=SerialGetPorts]
    Promise<sequence<SerialPort>> getPorts();

    [CallWith=ScriptState, MeasureAs=SerialRequestPort, Exposed=Window]
    Promise<SerialPort> requestPort(optional SerialPortRequestOptions options);
};