testing/web-platform/tests/interfaces/web-nfc.idl
author autofoolip <auto@foolip.org>
Tue, 05 Mar 2019 12:16:06 +0000
changeset 464557 0e5dc0de225b5195128ff27fbb0a3de56b49fb39
parent 464361 66b1aba3fb4372ec47986e728b1da9b32dd3d368
child 464640 c5bd3dc78b58810100682dad5ccd46b2aed68641
permissions -rw-r--r--
Bug 1528732 [wpt PR 15408] - Update interfaces/web-nfc.idl, a=testonly Automatic update from web-platform-tests Update interfaces/web-nfc.idl (#15408) Source: https://github.com/tidoust/reffy-reports/blob/42ed719/whatwg/idl/web-nfc.idl Build: https://travis-ci.org/tidoust/reffy-reports/builds/493621065 -- wpt-commits: ab1f5d66d8c0ab41af4a16b2571fe42a2cf00f4f wpt-pr: 15408

// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: Web NFC API (https://w3c.github.io/web-nfc/)

dictionary NFCMessage {
  sequence<NFCRecord> records;
  USVString url;
};

typedef (DOMString or unrestricted double or ArrayBuffer or Dictionary) NFCRecordData;

dictionary NFCRecord {
  NFCRecordType recordType;
  USVString mediaType;
  NFCRecordData data;
};

enum NFCRecordType {
  "empty",
  "text",
  "url",
  "json",
  "opaque"
};

typedef (DOMString or ArrayBuffer or NFCMessage) NFCMessageSource;

[Constructor(), SecureContext, Exposed=Window]
interface NFCWriter {
  Promise<void> push(NFCMessageSource message, optional NFCPushOptions options);
};

[Constructor(optional NFCReaderOptions options), SecureContext, Exposed=Window]
interface NFCReader : EventTarget {
  attribute EventHandler onreading;
  attribute EventHandler onerror;

  void start();
  void stop();
};

[Constructor(DOMString type, NFCReadingEventInit readingEventInitDict), SecureContext, Exposed=Window]
interface NFCReadingEvent : Event {
  readonly attribute NFCMessage message;
};

dictionary NFCReadingEventInit : EventInit {
  required NFCMessage message;
};

[Constructor(DOMString type, NFCErrorEventInit errorEventInitDict), SecureContext, Exposed=Window]
interface NFCErrorEvent : Event {
  readonly attribute DOMException error;
};

dictionary NFCErrorEventInit : EventInit {
  required DOMException error;
};

dictionary NFCPushOptions {
  NFCPushTarget target = "any";
  unrestricted double timeout = Infinity;
  boolean ignoreRead = true;
  AbortSignal? signal;
};

enum NFCPushTarget {
  "tag",
  "peer",
  "any"
};

dictionary NFCReaderOptions {
  USVString url = "";
  NFCRecordType recordType;
  USVString mediaType = "";
};