-
Notifications
You must be signed in to change notification settings - Fork 73
/
web-nfc.idl
65 lines (53 loc) · 1.35 KB
/
web-nfc.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// 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"
};
partial interface Navigator {
[SecureContext, SameObject] readonly attribute NFC nfc;
};
typedef (DOMString or ArrayBuffer or NFCMessage) NFCPushMessage;
[SecureContext]
interface NFC {
Promise<void> push(NFCPushMessage message, optional NFCPushOptions options);
Promise<long> watch(MessageCallback callback, optional NFCWatchOptions options);
};
callback MessageCallback = void (NFCMessage message);
dictionary NFCPushOptions {
NFCPushTarget target = "any";
unrestricted double timeout = Infinity;
boolean ignoreRead = true;
AbortSignal? signal;
};
enum NFCPushTarget {
"tag",
"peer",
"any"
};
dictionary NFCWatchOptions {
USVString url = "";
NFCRecordType recordType;
USVString mediaType = "";
NFCWatchMode mode = "web-nfc-only";
AbortSignal? signal;
};
enum NFCWatchMode {
"web-nfc-only",
"any"
};