Skip to content

Commit 997e36f

Browse files
committed
EndingType enum for endings
1 parent a9451fd commit 997e36f

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
lines changed

api-reports/2_12.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Blob[JC] def stream(): ReadableStream[Uint8Array]
373373
Blob[JC] def text(): js.Promise[String]
374374
Blob[JC] def `type`: String
375375
Blob[JO]
376-
BlobPropertyBag[JT] var endings: js.UndefOr[String]
376+
BlobPropertyBag[JT] var endings: js.UndefOr[EndingType]
377377
BlobPropertyBag[JT] var `type`: js.UndefOr[String]
378378
BlobPropertyBag[SO] def apply(`type`: js.UndefOr[String]?): BlobPropertyBag (@deprecated in 2.0.0)
379379
Body[JT] def arrayBuffer(): js.Promise[ArrayBuffer]
@@ -1801,6 +1801,9 @@ ElementDefinitionOptions[JT] var `extends`: js.UndefOr[String]
18011801
EndOfStreamError[JT]
18021802
EndOfStreamError[SO] val decode: EndOfStreamError
18031803
EndOfStreamError[SO] val network: EndOfStreamError
1804+
EndingType[JT]
1805+
EndingType[SO] val native: EndingType
1806+
EndingType[SO] val transparent: EndingType
18041807
ErrorEvent[JT] def bubbles: Boolean
18051808
ErrorEvent[JT] def cancelBubble: Boolean
18061809
ErrorEvent[JT] def cancelable: Boolean
@@ -1957,7 +1960,7 @@ File[JC] def webkitRelativePath: String
19571960
FileList[JC] @JSBracketAccess def apply(index: Int): T
19581961
FileList[JC] def item(index: Int): File
19591962
FileList[JC] def length: Int
1960-
FilePropertyBag[JT] var endings: js.UndefOr[String]
1963+
FilePropertyBag[JT] var endings: js.UndefOr[EndingType]
19611964
FilePropertyBag[JT] var lastModified: js.UndefOr[Double]
19621965
FilePropertyBag[JT] var `type`: js.UndefOr[String]
19631966
FileReader[JC] def abort(): Unit

api-reports/2_13.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ Blob[JC] def stream(): ReadableStream[Uint8Array]
373373
Blob[JC] def text(): js.Promise[String]
374374
Blob[JC] def `type`: String
375375
Blob[JO]
376-
BlobPropertyBag[JT] var endings: js.UndefOr[String]
376+
BlobPropertyBag[JT] var endings: js.UndefOr[EndingType]
377377
BlobPropertyBag[JT] var `type`: js.UndefOr[String]
378378
BlobPropertyBag[SO] def apply(`type`: js.UndefOr[String]?): BlobPropertyBag (@deprecated in 2.0.0)
379379
Body[JT] def arrayBuffer(): js.Promise[ArrayBuffer]
@@ -1801,6 +1801,9 @@ ElementDefinitionOptions[JT] var `extends`: js.UndefOr[String]
18011801
EndOfStreamError[JT]
18021802
EndOfStreamError[SO] val decode: EndOfStreamError
18031803
EndOfStreamError[SO] val network: EndOfStreamError
1804+
EndingType[JT]
1805+
EndingType[SO] val native: EndingType
1806+
EndingType[SO] val transparent: EndingType
18041807
ErrorEvent[JT] def bubbles: Boolean
18051808
ErrorEvent[JT] def cancelBubble: Boolean
18061809
ErrorEvent[JT] def cancelable: Boolean
@@ -1957,7 +1960,7 @@ File[JC] def webkitRelativePath: String
19571960
FileList[JC] @JSBracketAccess def apply(index: Int): T
19581961
FileList[JC] def item(index: Int): File
19591962
FileList[JC] def length: Int
1960-
FilePropertyBag[JT] var endings: js.UndefOr[String]
1963+
FilePropertyBag[JT] var endings: js.UndefOr[EndingType]
19611964
FilePropertyBag[JT] var lastModified: js.UndefOr[Double]
19621965
FilePropertyBag[JT] var `type`: js.UndefOr[String]
19631966
FileReader[JC] def abort(): Unit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* Endings enum for [[https://w3c.github.io/FileAPI/#enumdef-endingtype]]
7+
* If set to "native", line endings will be converted to native in any USVString elements in blobParts
8+
*/
9+
@js.native
10+
sealed trait EndingType extends js.Any
11+
12+
object EndingType {
13+
val transparent: EndingType = "transparent".asInstanceOf[EndingType]
14+
val native: EndingType = "native".asInstanceOf[EndingType]
15+
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
5+
/**
6+
* Endings enum for [[https://w3c.github.io/FileAPI/#enumdef-endingtype]]
7+
* If set to "native", line endings will be converted to native in any USVString elements in blobParts
8+
*/
9+
opaque type EndingType <: String = String
10+
11+
object EndingType {
12+
val transparent: EndingType = "transparent"
13+
val native: EndingType = "native"
14+
}

dom/src/main/scala/org/scalajs/dom/BlobPropertyBag.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.scalajs.js
1111
trait BlobPropertyBag extends js.Object {
1212
var `type`: js.UndefOr[String] = js.undefined
1313

14-
var endings: js.UndefOr[String] = js.undefined
14+
var endings: js.UndefOr[EndingType] = js.undefined
1515
}
1616

1717
@deprecated("all members of BlobPropertyBag are deprecated", "2.0.0")

0 commit comments

Comments
 (0)