Skip to content

Commit 9d316ec

Browse files
committed
Add webcrypto
Closes #597 I orginally thought the type would be js.UndefOr[Crypto] but according to MDN, `crypto` is always available but not all of the methods are.
1 parent b613096 commit 9d316ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,12 @@ package object dom {
104104
*/
105105
type HashAlgorithmIdentifier = HashAlgorithm | String
106106

107+
/** This is the same as `crypto` in JS.
108+
*
109+
* To maintain backwards-source-compatibility with scala-js-dom v1, `crypto` in scala-js-dom is retained as a package object.
110+
*
111+
*/
112+
@js.native
113+
@JSGlobal("crypto")
114+
val webcrypto: Crypto = js.native
107115
}

0 commit comments

Comments
 (0)