Files
tubestation/testing/web-platform/tests/interfaces/web-nfc.idl
kaixinjxq 40bae22a1a Bug 1452482 [wpt PR 10360] - Adapt web-nfc IDL tests to latest spec, a=testonly
Automatic update from web-platform-testsAdapt web-nfc IDL tests to latest spec (#10360)

wpt-commits: f16180450896438c055fe41c16a5d26593d15b6d
wpt-pr: 10360
wpt-commits: f16180450896438c055fe41c16a5d26593d15b6d
wpt-pr: 10360
2018-04-15 09:38:18 +01:00

64 lines
1.3 KiB
Plaintext

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<void> cancelPush(optional NFCPushTarget target = "any");
Promise<long> watch(MessageCallback callback,
optional NFCWatchOptions options);
Promise<void> cancelWatch(optional long id);
};
callback MessageCallback = void (NFCMessage message);
dictionary NFCPushOptions {
NFCPushTarget target = "any";
unrestricted double timeout = Infinity;
boolean ignoreRead = true;
};
enum NFCPushTarget {
"tag",
"peer",
"any"
};
dictionary NFCWatchOptions {
USVString url = "";
NFCRecordType? recordType;
USVString mediaType = "";
NFCWatchMode mode = "web-nfc-only";
};
enum NFCWatchMode {
"web-nfc-only",
"any"
};