-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reflect changes in scala-js/scala-js-dom#806
- Loading branch information
1 parent
e6586e2
commit b3f5fc8
Showing
8 changed files
with
122 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
webapp/src/main/scala/org/scalajs/dom/NDEFReadingEvent.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
package org.scalajs.dom | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.JSGlobal | ||
|
||
/** The NDEFReadingEvent interface of the Web NFC API represents events dispatched on new NFC readings obtained by | ||
* NDEFReader. | ||
* | ||
* @see | ||
* https://developer.mozilla.org/en-US/docs/Web/API/NDEFReadingEvent | ||
* @see | ||
* https://w3c.github.io/web-nfc/#the-ndefreader-object | ||
*/ | ||
@js.native | ||
trait NDEFReadingEvent extends Event { | ||
@JSGlobal | ||
class NDEFReadingEvent(typeArg: String, init: NDEFReadingEventInit) extends Event(typeArg, init) { | ||
|
||
/** Returns an NDEFMessage object containing the received message. */ | ||
var message: NDEFMessage = js.native | ||
def message: NDEFMessage = js.native | ||
|
||
/** Returns the serial number of the device, which is used for anti-collision and identification, or an empty string | ||
* if no serial number is available. | ||
*/ | ||
var serialNumber: String = js.native | ||
|
||
def serialNumber: String = js.native | ||
} |
24 changes: 24 additions & 0 deletions
24
webapp/src/main/scala/org/scalajs/dom/NDEFReadingEventInit.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.scalajs.dom | ||
|
||
import scala.scalajs.js | ||
|
||
/** NDEFReadingEventInit is used to initialize a new event with a serial number and the NDEFMessageInit data via the | ||
* message member. If serialNumber is not present or is null, empty string will be used to init the event. | ||
* | ||
* @see | ||
* https://developer.mozilla.org/en-US/docs/Web/API/NDEFReadingEvent/NDEFReadingEvent#parameters | ||
* @see | ||
* https://w3c.github.io/web-nfc/#the-ndefreader-object | ||
*/ | ||
trait NDEFReadingEventInit extends EventInit { | ||
|
||
/** A string with the name of the event. It is case-sensitive and browsers always set it to reading. Default is "" an | ||
* empty string | ||
*/ | ||
var serialNumber: js.UndefOr[AbortSignal] = js.undefined | ||
|
||
/** An object that, in addition of the properties defined in Event(), can have the following properties: serialNumber; | ||
* message | ||
*/ | ||
var message: NDEFRecordInit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
webapp/src/main/scala/org/scalajs/dom/NDEFRecordInit.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.scalajs.dom | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.| | ||
|
||
/** The NDEFRecordInit dictionary is used to initialize an NDEF record with its record type recordType, and optional | ||
* record identifier id and payload data data. | ||
* @see | ||
* https://developer.mozilla.org/en-US/docs/Web/API/NDEFMessage/NDEFMessage | ||
* @see | ||
* https://developer.mozilla.org/en-US/docs/Web/API/NDEFRecord/NDEFRecord | ||
* @see | ||
* https://w3c.github.io/web-nfc/#the-ndefrecord-interface | ||
*/ | ||
trait NDEFRecordInit extends js.Object { | ||
|
||
/** Contains the data to be transmitted. It can be a string object or literal, an ArrayBuffer, a TypedArray, a | ||
* DataView, or an array of nested records. | ||
*/ | ||
var data: js.UndefOr[ | ||
String | | ||
js.typedarray.DataView | | ||
js.typedarray.ArrayBuffer | | ||
js.typedarray.TypedArray[_, _] | | ||
js.typedarray.DataView | | ||
js.Array[NDEFRecord] | ||
] = js.undefined | ||
|
||
/** A string specifying the record's encoding. */ | ||
var encoding: js.UndefOr[String] = js.undefined | ||
|
||
/** A developer-defined identifier for the record. */ | ||
var id: js.UndefOr[String] = js.undefined | ||
|
||
/** A valid language tag according to [RFC 5646: Tags for Identifying Languages (also known as BCP | ||
* 47)](https://datatracker.ietf.org/doc/html/rfc5646). | ||
*/ | ||
var lang: js.UndefOr[String] = js.undefined | ||
|
||
/** A valid MIME type. */ | ||
var mediaType: js.UndefOr[String] = js.undefined | ||
|
||
/** A string indicating the type of data stored in data. | ||
* | ||
* It must be one of the following values: | ||
* - "absolute-url" - An absolute URL to the data. | ||
* - "empty" - An empty NDEFRecord. | ||
* - "mime" - A valid MIME type. | ||
* - "smart-poster" - A smart poster as defined by the NDEF-SMARTPOSTER specification. | ||
* - "text" - Text as defined by the NDEF-TEXT specification. | ||
* - "unknown" - The record type is not known. | ||
* - "URL" - A URL as defined by the NDEF-URI specification. | ||
*/ | ||
var recordType: String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters