@rescript/webapi 0.1.0-alpha-b1d58f9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +35 -0
- package/package.json +61 -0
- package/rescript.json +557 -0
- package/src/animation/Animation.res +149 -0
- package/src/animation/AnimationEffect.res +71 -0
- package/src/animation/DocumentTimeline.res +8 -0
- package/src/canvas/Canvas.res +179 -0
- package/src/canvas/CanvasGradient.res +11 -0
- package/src/canvas/CanvasPattern.res +11 -0
- package/src/canvas/CanvasRenderingContext2D.res +868 -0
- package/src/canvas/CanvasTypes.res +452 -0
- package/src/canvas/FillStyle.res +25 -0
- package/src/canvas/HTMLCanvasElement.res +101 -0
- package/src/canvas/ImageBitmap.res +6 -0
- package/src/canvas/ImageBitmapRenderingContext.res +9 -0
- package/src/canvas/ImageData.res +17 -0
- package/src/canvas/OffscreenCanvas.res +87 -0
- package/src/canvas/Path2D.res +186 -0
- package/src/canvas/VideoColorSpace.res +11 -0
- package/src/canvas/VideoFrame.res +217 -0
- package/src/core/ArrayBufferTypedArrayOrDataView.res +4 -0
- package/src/core/DOM.res +1026 -0
- package/src/core/EventType.res +108 -0
- package/src/crypto/Crypto.res +11 -0
- package/src/crypto/SubtleCrypto.res +173 -0
- package/src/crypto/WebCryptoTypes.res +71 -0
- package/src/css-font-loading/BaseCSSFontLoading.res +24 -0
- package/src/css-font-loading/CssFontLoadingTypes.res +92 -0
- package/src/css-font-loading/FontFace.res +62 -0
- package/src/css-font-loading/FontFaceSet.res +38 -0
- package/src/cssom/CSSRuleList.res +5 -0
- package/src/cssom/CSSStyleDeclaration.res +1734 -0
- package/src/cssom/CSSStyleValue.res +17 -0
- package/src/cssom/MediaList.res +29 -0
- package/src/cssom/MediaQueryList.res +18 -0
- package/src/cssom/StylePropertyMap.res +56 -0
- package/src/cssom/StylePropertyMapReadOnly.res +22 -0
- package/src/cssom/StyleSheet.res +152 -0
- package/src/cssom/StyleSheetList.res +17 -0
- package/src/device/GamepadHapticActuator.res +16 -0
- package/src/device/GamepadTypes.res +86 -0
- package/src/device/Geolocation.res +31 -0
- package/src/device/GeolocationCoordinates.res +5 -0
- package/src/device/GeolocationPosition.res +5 -0
- package/src/device/GeolocationTypes.res +81 -0
- package/src/device/LockManager.res +26 -0
- package/src/device/ScreenOrientation.res +7 -0
- package/src/device/ScreenWakeLockTypes.res +26 -0
- package/src/device/WakeLock.res +8 -0
- package/src/device/WakeLockSentinel.res +7 -0
- package/src/device/WebLocksTypes.res +45 -0
- package/src/device/WebMIDI.res +7 -0
- package/src/device/WebMidiTypes.res +36 -0
- package/src/dom-nodes/AbstractRange.res +30 -0
- package/src/dom-nodes/Attr.res +101 -0
- package/src/dom-nodes/CDATASection.res +7 -0
- package/src/dom-nodes/CaretPosition.res +2 -0
- package/src/dom-nodes/CharacterData.res +199 -0
- package/src/dom-nodes/Comment.res +15 -0
- package/src/dom-nodes/DOMImplementation.res +131 -0
- package/src/dom-nodes/DOMTree.res +1653 -0
- package/src/dom-nodes/DocumentFragment.res +96 -0
- package/src/dom-nodes/Element.res +509 -0
- package/src/dom-nodes/ElementInternals.res +39 -0
- package/src/dom-nodes/HTML.res +11 -0
- package/src/dom-nodes/HTMLCollection.res +25 -0
- package/src/dom-nodes/NamedNodeMap.res +46 -0
- package/src/dom-nodes/Node.res +114 -0
- package/src/dom-nodes/NodeFilter.res +4 -0
- package/src/dom-nodes/NodeIterator.res +38 -0
- package/src/dom-nodes/NodeList.res +6 -0
- package/src/dom-nodes/ProcessingInstruction.res +15 -0
- package/src/dom-nodes/Range.res +156 -0
- package/src/dom-nodes/Selection.res +137 -0
- package/src/dom-nodes/ShadowRoot.res +23 -0
- package/src/dom-nodes/StaticRange.res +6 -0
- package/src/dom-nodes/Text.res +31 -0
- package/src/dom-nodes/TreeWalker.res +65 -0
- package/src/dom-platform/DOMException.res +7 -0
- package/src/dom-platform/DOMStringList.res +15 -0
- package/src/dom-platform/DOMStringMap.res +5 -0
- package/src/dom-platform/DOMTokenList.res +70 -0
- package/src/event/AbortController.res +9 -0
- package/src/event/AbortSignal.res +25 -0
- package/src/event/Event.res +76 -0
- package/src/event/EventTarget.res +91 -0
- package/src/event/ExtendableEvent.res +14 -0
- package/src/fetch/BodyInit.res +46 -0
- package/src/fetch/Fetch.res +12 -0
- package/src/fetch/FetchTypes.res +282 -0
- package/src/fetch/FormData.res +71 -0
- package/src/fetch/FormDataEntryValue.res +2 -0
- package/src/fetch/Headers.res +59 -0
- package/src/fetch/HeadersInit.res +16 -0
- package/src/fetch/Request.res +61 -0
- package/src/fetch/Response.res +127 -0
- package/src/file/BaseFileAndDirectoryEntries.res +72 -0
- package/src/file/Blob.res +48 -0
- package/src/file/File.res +15 -0
- package/src/file/FileAndDirectoryEntriesTypes.res +35 -0
- package/src/file/FileList.res +16 -0
- package/src/file/FileSystemDirectoryEntry.res +42 -0
- package/src/file/FileSystemDirectoryHandle.res +49 -0
- package/src/file/FileSystemDirectoryReader.res +9 -0
- package/src/file/FileSystemEntry.res +9 -0
- package/src/file/FileSystemFileHandle.res +25 -0
- package/src/file/FileSystemHandle.res +6 -0
- package/src/file/FileSystemWritableFileStream.res +65 -0
- package/src/file/FileTypes.res +225 -0
- package/src/file/ReadableStream.res +79 -0
- package/src/file/WritableStream.res +27 -0
- package/src/file/WritableStreamDefaultController.res +5 -0
- package/src/geometry/DOMMatrix.res +206 -0
- package/src/geometry/DOMMatrixReadOnly.res +140 -0
- package/src/geometry/DOMPoint.res +28 -0
- package/src/geometry/DOMPointReadOnly.res +22 -0
- package/src/geometry/DOMRect.res +22 -0
- package/src/geometry/DOMRectList.res +2 -0
- package/src/geometry/DOMRectReadOnly.res +19 -0
- package/src/html/HTMLAnchorElement.res +373 -0
- package/src/html/HTMLAreaElement.res +353 -0
- package/src/html/HTMLBRElement.res +9 -0
- package/src/html/HTMLBaseElement.res +20 -0
- package/src/html/HTMLBodyElement.res +9 -0
- package/src/html/HTMLButtonElement.res +98 -0
- package/src/html/HTMLDListElement.res +9 -0
- package/src/html/HTMLDataElement.res +14 -0
- package/src/html/HTMLDataListElement.res +14 -0
- package/src/html/HTMLDialogElement.res +40 -0
- package/src/html/HTMLDivElement.res +9 -0
- package/src/html/HTMLElement.res +108 -0
- package/src/html/HTMLEmbedElement.res +275 -0
- package/src/html/HTMLFieldSetElement.res +70 -0
- package/src/html/HTMLFormControlsCollection.res +21 -0
- package/src/html/HTMLFormElement.res +39 -0
- package/src/html/HTMLFrameSetElement.res +9 -0
- package/src/html/HTMLHRElement.res +9 -0
- package/src/html/HTMLHeadElement.res +256 -0
- package/src/html/HTMLHeadingElement.res +9 -0
- package/src/html/HTMLHtmlElement.res +9 -0
- package/src/html/HTMLIFrameElement.res +69 -0
- package/src/html/HTMLImageElement.res +349 -0
- package/src/html/HTMLInputElement.res +310 -0
- package/src/html/HTMLLIElement.res +9 -0
- package/src/html/HTMLLabelElement.res +25 -0
- package/src/html/HTMLLegendElement.res +14 -0
- package/src/html/HTMLLinkElement.res +69 -0
- package/src/html/HTMLMapElement.res +20 -0
- package/src/html/HTMLMenuElement.res +8 -0
- package/src/html/HTMLMetaElement.res +29 -0
- package/src/html/HTMLMeterElement.res +38 -0
- package/src/html/HTMLModElement.res +9 -0
- package/src/html/HTMLOListElement.res +24 -0
- package/src/html/HTMLObjectElement.res +89 -0
- package/src/html/HTMLOptGroupElement.res +19 -0
- package/src/html/HTMLOptionElement.res +49 -0
- package/src/html/HTMLOptionsCollection.res +35 -0
- package/src/html/HTMLOutputElement.res +73 -0
- package/src/html/HTMLParagraphElement.res +9 -0
- package/src/html/HTMLPictureElement.res +9 -0
- package/src/html/HTMLPreElement.res +9 -0
- package/src/html/HTMLProgressElement.res +29 -0
- package/src/html/HTMLQuoteElement.res +9 -0
- package/src/html/HTMLScriptElement.res +310 -0
- package/src/html/HTMLSelectElement.res +157 -0
- package/src/html/HTMLSlotElement.res +34 -0
- package/src/html/HTMLSourceElement.res +18 -0
- package/src/html/HTMLSpanElement.res +9 -0
- package/src/html/HTMLStyleElement.res +24 -0
- package/src/html/HTMLTableCaptionElement.res +9 -0
- package/src/html/HTMLTableCellElement.res +40 -0
- package/src/html/HTMLTableElement.res +100 -0
- package/src/html/HTMLTableRowElement.res +40 -0
- package/src/html/HTMLTableSectionElement.res +30 -0
- package/src/html/HTMLTemplateElement.res +31 -0
- package/src/html/HTMLTextAreaElement.res +177 -0
- package/src/html/HTMLTimeElement.res +14 -0
- package/src/html/HTMLTitleElement.res +15 -0
- package/src/html/HTMLUListElement.res +9 -0
- package/src/html/HTMLUnknownElement.res +9 -0
- package/src/media/BaseEncryptedMediaExtensions.res +97 -0
- package/src/media/DomHTMLMediaElement.res +206 -0
- package/src/media/EncryptedMediaExtensionsHTMLMediaElement.res +15 -0
- package/src/media/EncryptedMediaExtensionsTypes.res +43 -0
- package/src/media/HTMLAudioElement.res +9 -0
- package/src/media/HTMLTrackElement.res +14 -0
- package/src/media/HTMLVideoElement.res +78 -0
- package/src/media/MediaCapabilities.res +19 -0
- package/src/media/MediaCapabilitiesTypes.res +83 -0
- package/src/media/MediaCaptureAndStreamsTypes.res +197 -0
- package/src/media/MediaDeviceInfo.res +9 -0
- package/src/media/MediaDevices.res +40 -0
- package/src/media/MediaError.res +14 -0
- package/src/media/MediaKeySession.res +53 -0
- package/src/media/MediaKeyStatusMap.res +11 -0
- package/src/media/MediaKeySystemAccess.res +14 -0
- package/src/media/MediaKeys.res +35 -0
- package/src/media/MediaMetadata.res +10 -0
- package/src/media/MediaSession.res +25 -0
- package/src/media/MediaSessionTypes.res +85 -0
- package/src/media/MediaStream.res +89 -0
- package/src/media/MediaStreamTrack.res +51 -0
- package/src/media/PictureInPicture.res +7 -0
- package/src/media/PictureInPictureTypes.res +17 -0
- package/src/media/RemotePlayback.res +25 -0
- package/src/media/RemotePlaybackTypes.res +20 -0
- package/src/media/SpeechSynthesis.res +33 -0
- package/src/media/SpeechSynthesisUtterance.res +8 -0
- package/src/media/TextTrack.res +15 -0
- package/src/media/TextTrackCueList.res +9 -0
- package/src/media/TextTrackList.res +17 -0
- package/src/media/TimeRanges.res +29 -0
- package/src/media/VideoPlaybackQuality.res +18 -0
- package/src/media/WebSpeechTypes.res +83 -0
- package/src/media/WebVttTypes.res +123 -0
- package/src/messaging/ApplicationServerKey.res +2 -0
- package/src/messaging/ChannelMessagingTypes.res +12 -0
- package/src/messaging/CloseEvent.res +10 -0
- package/src/messaging/MessageEvent.res +43 -0
- package/src/messaging/MessagePort.res +38 -0
- package/src/messaging/Notification.res +46 -0
- package/src/messaging/NotificationTypes.res +107 -0
- package/src/messaging/PushEvent.res +3 -0
- package/src/messaging/PushManager.res +24 -0
- package/src/messaging/PushMessageData.res +15 -0
- package/src/messaging/PushSubscription.res +20 -0
- package/src/messaging/PushTypes.res +88 -0
- package/src/messaging/WebSocket.res +74 -0
- package/src/messaging/WebSocketsTypes.res +124 -0
- package/src/navigator/Clipboard.res +29 -0
- package/src/navigator/ClipboardItem.res +20 -0
- package/src/navigator/ClipboardTypes.res +31 -0
- package/src/navigator/CredentialManagementTypes.res +138 -0
- package/src/navigator/CredentialsContainer.res +33 -0
- package/src/navigator/Navigator.res +166 -0
- package/src/navigator/Permissions.res +10 -0
- package/src/navigator/PermissionsTypes.res +38 -0
- package/src/observers/IntersectionObserver.res +36 -0
- package/src/observers/IntersectionObserverRoot.res +23 -0
- package/src/observers/IntersectionObserverTypes.res +67 -0
- package/src/observers/MutationObserver.res +94 -0
- package/src/observers/ResizeObserver.res +30 -0
- package/src/observers/ResizeObserverTypes.res +56 -0
- package/src/performance/Performance.res +101 -0
- package/src/performance/PerformanceEntry.res +5 -0
- package/src/performance/PerformanceMark.res +16 -0
- package/src/performance/PerformanceTypes.res +86 -0
- package/src/storage/Cache.res +117 -0
- package/src/storage/CacheStorage.res +43 -0
- package/src/storage/CacheTypes.res +24 -0
- package/src/storage/IDBDatabase.res +54 -0
- package/src/storage/IDBFactory.res +34 -0
- package/src/storage/IDBIndex.res +83 -0
- package/src/storage/IDBObjectStore.res +183 -0
- package/src/storage/IDBTransaction.res +22 -0
- package/src/storage/IndexedDbTypes.res +213 -0
- package/src/storage/Storage.res +42 -0
- package/src/storage/StorageEvent.res +10 -0
- package/src/storage/StorageManager.res +24 -0
- package/src/storage/StorageTypes.res +11 -0
- package/src/storage/WebStorageTypes.res +57 -0
- package/src/svg/SVGElement.res +115 -0
- package/src/svg/SVGGraphicsElement.res +16 -0
- package/src/svg/SVGLength.res +9 -0
- package/src/ui-events/CompositionEvent.res +10 -0
- package/src/ui-events/DataTransfer.res +38 -0
- package/src/ui-events/DataTransferItem.res +21 -0
- package/src/ui-events/DataTransferItemList.res +34 -0
- package/src/ui-events/FocusEvent.res +10 -0
- package/src/ui-events/InputEvent.res +16 -0
- package/src/ui-events/KeyboardEvent.res +16 -0
- package/src/ui-events/MouseEvent.res +26 -0
- package/src/ui-events/PointerEvent.res +24 -0
- package/src/ui-events/Touch.res +5 -0
- package/src/ui-events/TouchEvent.res +10 -0
- package/src/ui-events/TouchList.res +5 -0
- package/src/ui-events/UIEvent.res +20 -0
- package/src/ui-events/UiEventsTypes.res +590 -0
- package/src/ui-events/WheelEvent.res +10 -0
- package/src/url/URL.res +38 -0
- package/src/url/URLSearchParams.res +104 -0
- package/src/url/UrlTypes.res +69 -0
- package/src/view-transitions/ViewTransition.res +5 -0
- package/src/view-transitions/ViewTransitionsTypes.res +22 -0
- package/src/web-audio/AnalyserNode.res +38 -0
- package/src/web-audio/AudioBuffer.res +33 -0
- package/src/web-audio/AudioBufferSourceNode.res +21 -0
- package/src/web-audio/AudioContext.res +59 -0
- package/src/web-audio/AudioDestinationNode.res +1 -0
- package/src/web-audio/AudioNode.res +76 -0
- package/src/web-audio/AudioParam.res +65 -0
- package/src/web-audio/AudioProcessingEvent.res +10 -0
- package/src/web-audio/AudioScheduledSourceNode.res +23 -0
- package/src/web-audio/AudioWorkletNode.res +11 -0
- package/src/web-audio/BaseAudioContext.res +141 -0
- package/src/web-audio/BiquadFilterNode.res +21 -0
- package/src/web-audio/ChannelMergerNode.res +10 -0
- package/src/web-audio/ChannelSplitterNode.res +10 -0
- package/src/web-audio/ConstantSourceNode.res +10 -0
- package/src/web-audio/ConvolverNode.res +10 -0
- package/src/web-audio/DelayNode.res +10 -0
- package/src/web-audio/DynamicsCompressorNode.res +10 -0
- package/src/web-audio/GainNode.res +10 -0
- package/src/web-audio/IIRFilterNode.res +21 -0
- package/src/web-audio/MediaElementAudioSourceNode.res +10 -0
- package/src/web-audio/MediaStreamAudioDestinationNode.res +10 -0
- package/src/web-audio/MediaStreamAudioSourceNode.res +10 -0
- package/src/web-audio/OfflineAudioCompletionEvent.res +10 -0
- package/src/web-audio/OfflineAudioContext.res +58 -0
- package/src/web-audio/OscillatorNode.res +17 -0
- package/src/web-audio/PannerNode.res +10 -0
- package/src/web-audio/PeriodicWave.res +8 -0
- package/src/web-audio/StereoPannerNode.res +10 -0
- package/src/web-audio/WaveShaperNode.res +10 -0
- package/src/web-audio/WebAudioTypes.res +1309 -0
- package/src/web-audio/Worklet.res +14 -0
- package/src/window/CustomElementRegistry.res +30 -0
- package/src/window/Document.res +470 -0
- package/src/window/DomGlobal.res +459 -0
- package/src/window/History.res +37 -0
- package/src/window/HistoryTypes.res +26 -0
- package/src/window/IdleDeadline.res +5 -0
- package/src/window/Location.res +108 -0
- package/src/window/VisualViewport.res +5 -0
- package/src/window/VisualViewportTypes.res +37 -0
- package/src/window/Window.res +556 -0
- package/src/window/XPathExpression.res +16 -0
- package/src/window/XPathResult.res +46 -0
- package/src/workers/Clients.res +39 -0
- package/src/workers/NavigationPreloadManager.res +26 -0
- package/src/workers/ServiceWorker.res +38 -0
- package/src/workers/ServiceWorkerContainer.res +34 -0
- package/src/workers/ServiceWorkerRegistration.res +32 -0
- package/src/workers/ServiceWorkerScope.res +12 -0
- package/src/workers/ServiceWorkerTypes.res +153 -0
- package/src/workers/SharedWorker.res +68 -0
- package/src/workers/SharedWorkerScope.res +29 -0
- package/src/workers/WebWorkersTypes.res +46 -0
- package/src/workers/Worker.res +48 -0
- package/src/workers/WorkerLocation.res +18 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
[See CSSStyleValue on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue)
|
|
3
|
+
*/
|
|
4
|
+
@editor.completeFrom(CSSStyleValue)
|
|
5
|
+
type t = private {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parse_static)
|
|
9
|
+
*/
|
|
10
|
+
@throws(JsExn) @scope("CSSStyleValue")
|
|
11
|
+
external parse: (~property: string, ~cssText: string) => t = "parse"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleValue/parseAll_static)
|
|
15
|
+
*/
|
|
16
|
+
@throws(JsExn) @scope("CSSStyleValue")
|
|
17
|
+
external parseAll: (~property: string, ~cssText: string) => array<t> = "parseAll"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@editor.completeFrom(MediaList)
|
|
2
|
+
type t = {
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/mediaText)
|
|
5
|
+
*/
|
|
6
|
+
mutable mediaText: string,
|
|
7
|
+
/**
|
|
8
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/length)
|
|
9
|
+
*/
|
|
10
|
+
length: int,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/item)
|
|
15
|
+
*/
|
|
16
|
+
@send
|
|
17
|
+
external item: (t, int) => Null.t<string> = "item"
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/appendMedium)
|
|
21
|
+
*/
|
|
22
|
+
@send
|
|
23
|
+
external appendMedium: (t, string) => unit = "appendMedium"
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaList/deleteMedium)
|
|
27
|
+
*/
|
|
28
|
+
@throws(JsExn) @send
|
|
29
|
+
external deleteMedium: (t, string) => unit = "deleteMedium"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Stores information on a media query applied to a document, and handles sending notifications to listeners when the media query state change (i.e. when the media query test starts or stops evaluating to true).
|
|
3
|
+
[See MediaQueryList on MDN](https://developer.mozilla.org/docs/Web/API/MediaQueryList)
|
|
4
|
+
*/
|
|
5
|
+
@editor.completeFrom(MediaQueryList)
|
|
6
|
+
type t = private {
|
|
7
|
+
...DOM.eventTarget,
|
|
8
|
+
/**
|
|
9
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaQueryList/media)
|
|
10
|
+
*/
|
|
11
|
+
media: string,
|
|
12
|
+
/**
|
|
13
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaQueryList/matches)
|
|
14
|
+
*/
|
|
15
|
+
matches: bool,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
include EventTarget.Impl({type t = t})
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
[See StylePropertyMap on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap)
|
|
3
|
+
*/
|
|
4
|
+
@editor.completeFrom(StylePropertyMap)
|
|
5
|
+
type t = private {
|
|
6
|
+
...StylePropertyMapReadOnly.t,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
external asStylePropertyMapReadOnly: t => StylePropertyMapReadOnly.t = "%identity"
|
|
10
|
+
/**
|
|
11
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll)
|
|
12
|
+
*/
|
|
13
|
+
@throws(JsExn) @send
|
|
14
|
+
external getAll: (t, string) => array<CSSStyleValue.t> = "getAll"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has)
|
|
18
|
+
*/
|
|
19
|
+
@throws(JsExn) @send
|
|
20
|
+
external has: (t, string) => bool = "has"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/set)
|
|
24
|
+
*/
|
|
25
|
+
@throws(JsExn) @send
|
|
26
|
+
external set: (t, ~property: string, ~values: CSSStyleValue.t) => unit = "set"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/set)
|
|
30
|
+
*/
|
|
31
|
+
@throws(JsExn) @send
|
|
32
|
+
external set2: (t, ~property: string, ~values: string) => unit = "set"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/append)
|
|
36
|
+
*/
|
|
37
|
+
@throws(JsExn) @send
|
|
38
|
+
external append: (t, ~property: string, ~values: CSSStyleValue.t) => unit = "append"
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/append)
|
|
42
|
+
*/
|
|
43
|
+
@throws(JsExn) @send
|
|
44
|
+
external append2: (t, ~property: string, ~values: string) => unit = "append"
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/delete)
|
|
48
|
+
*/
|
|
49
|
+
@throws(JsExn) @send
|
|
50
|
+
external delete: (t, string) => unit = "delete"
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMap/clear)
|
|
54
|
+
*/
|
|
55
|
+
@send
|
|
56
|
+
external clear: t => unit = "clear"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
[See StylePropertyMapReadOnly on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly)
|
|
3
|
+
*/
|
|
4
|
+
@editor.completeFrom(StylePropertyMapReadOnly)
|
|
5
|
+
type t = private {
|
|
6
|
+
/**
|
|
7
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/size)
|
|
8
|
+
*/
|
|
9
|
+
size: int,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll)
|
|
14
|
+
*/
|
|
15
|
+
@throws(JsExn) @send
|
|
16
|
+
external getAll: (t, string) => array<CSSStyleValue.t> = "getAll"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has)
|
|
20
|
+
*/
|
|
21
|
+
@throws(JsExn) @send
|
|
22
|
+
external has: (t, string) => bool = "has"
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
A single style sheet. CSS style sheets will further implement the more specialized CSSStyleSheet interface.
|
|
5
|
+
[See StyleSheet on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet)
|
|
6
|
+
*/
|
|
7
|
+
type rec t = {
|
|
8
|
+
/**
|
|
9
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/type)
|
|
10
|
+
*/
|
|
11
|
+
@as("type")
|
|
12
|
+
type_: string,
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/href)
|
|
15
|
+
*/
|
|
16
|
+
href: Null.t<string>,
|
|
17
|
+
/**
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/ownerNode)
|
|
19
|
+
*/
|
|
20
|
+
ownerNode: Null.t<unknown>,
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/parentStyleSheet)
|
|
23
|
+
*/
|
|
24
|
+
parentStyleSheet: Null.t<cssStyleSheet>,
|
|
25
|
+
/**
|
|
26
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/title)
|
|
27
|
+
*/
|
|
28
|
+
title: Null.t<string>,
|
|
29
|
+
/**
|
|
30
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/media)
|
|
31
|
+
*/
|
|
32
|
+
media: MediaList.t,
|
|
33
|
+
/**
|
|
34
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/disabled)
|
|
35
|
+
*/
|
|
36
|
+
mutable disabled: bool,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet.
|
|
41
|
+
[See CSSStyleSheet on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet)
|
|
42
|
+
TODO: mark as private once mutating fields of private records is allowed
|
|
43
|
+
*/
|
|
44
|
+
@editor.completeFrom(CSSStyleSheet) and cssStyleSheet = {
|
|
45
|
+
// Base properties from StyleSheet
|
|
46
|
+
/**
|
|
47
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/type)
|
|
48
|
+
*/
|
|
49
|
+
@as("type")
|
|
50
|
+
type_: string,
|
|
51
|
+
/**
|
|
52
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/href)
|
|
53
|
+
*/
|
|
54
|
+
href: Null.t<string>,
|
|
55
|
+
/**
|
|
56
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/ownerNode)
|
|
57
|
+
*/
|
|
58
|
+
ownerNode: Null.t<unknown>,
|
|
59
|
+
/**
|
|
60
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/parentStyleSheet)
|
|
61
|
+
*/
|
|
62
|
+
parentStyleSheet: Null.t<cssStyleSheet>,
|
|
63
|
+
/**
|
|
64
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/title)
|
|
65
|
+
*/
|
|
66
|
+
title: Null.t<string>,
|
|
67
|
+
/**
|
|
68
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/media)
|
|
69
|
+
*/
|
|
70
|
+
media: MediaList.t,
|
|
71
|
+
/**
|
|
72
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheet/disabled)
|
|
73
|
+
*/
|
|
74
|
+
mutable disabled: bool,
|
|
75
|
+
// End base properties from StyleSheet
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/ownerRule)
|
|
79
|
+
*/
|
|
80
|
+
ownerRule: Null.t<cssRule>,
|
|
81
|
+
/**
|
|
82
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/cssRules)
|
|
83
|
+
*/
|
|
84
|
+
cssRules: cssRuleList,
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
A single CSS rule. There are several types of rules, listed in the Type constants section below.
|
|
89
|
+
[See CSSRule on MDN](https://developer.mozilla.org/docs/Web/API/CSSRule)
|
|
90
|
+
*/
|
|
91
|
+
and cssRule = {
|
|
92
|
+
/**
|
|
93
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSRule/cssText)
|
|
94
|
+
*/
|
|
95
|
+
mutable cssText: string,
|
|
96
|
+
/**
|
|
97
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSRule/parentRule)
|
|
98
|
+
*/
|
|
99
|
+
parentRule: Null.t<cssRule>,
|
|
100
|
+
/**
|
|
101
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSRule/parentStyleSheet)
|
|
102
|
+
*/
|
|
103
|
+
parentStyleSheet: Null.t<cssStyleSheet>,
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects.
|
|
108
|
+
[See CSSRuleList on MDN](https://developer.mozilla.org/docs/Web/API/CSSRuleList)
|
|
109
|
+
*/
|
|
110
|
+
@editor.completeFrom(CSSRuleList) and cssRuleList = private {
|
|
111
|
+
/**
|
|
112
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSRuleList/length)
|
|
113
|
+
*/
|
|
114
|
+
length: int,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
type init = {
|
|
118
|
+
mutable baseURL?: string,
|
|
119
|
+
mutable media?: unknown,
|
|
120
|
+
mutable disabled?: bool,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet)
|
|
125
|
+
*/
|
|
126
|
+
@new
|
|
127
|
+
external make: (~options: init=?) => cssStyleSheet = "CSSStyleSheet"
|
|
128
|
+
|
|
129
|
+
external asStyleSheet: cssStyleSheet => t = "%identity"
|
|
130
|
+
/**
|
|
131
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/insertRule)
|
|
132
|
+
*/
|
|
133
|
+
@throws(JsExn) @send
|
|
134
|
+
external insertRule: (cssStyleSheet, ~rule: string, ~index: int=?) => int = "insertRule"
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/deleteRule)
|
|
138
|
+
*/
|
|
139
|
+
@send
|
|
140
|
+
external deleteRule: (cssStyleSheet, int) => unit = "deleteRule"
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replace)
|
|
144
|
+
*/
|
|
145
|
+
@send
|
|
146
|
+
external replace: (cssStyleSheet, string) => promise<cssStyleSheet> = "replace"
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CSSStyleSheet/replaceSync)
|
|
150
|
+
*/
|
|
151
|
+
@throws(JsExn) @send
|
|
152
|
+
external replaceSync: (cssStyleSheet, string) => unit = "replaceSync"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
A list of StyleSheet.
|
|
3
|
+
[See StyleSheetList on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheetList)
|
|
4
|
+
*/
|
|
5
|
+
@editor.completeFrom(StyleSheetList)
|
|
6
|
+
type t = private {
|
|
7
|
+
/**
|
|
8
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheetList/length)
|
|
9
|
+
*/
|
|
10
|
+
length: int,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/StyleSheetList/item)
|
|
15
|
+
*/
|
|
16
|
+
@send
|
|
17
|
+
external item: (t, int) => Null.t<StyleSheet.cssStyleSheet> = "item"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator/playEffect)
|
|
3
|
+
*/
|
|
4
|
+
@send
|
|
5
|
+
external playEffect: (
|
|
6
|
+
GamepadTypes.gamepadHapticActuator,
|
|
7
|
+
~type_: GamepadTypes.gamepadHapticEffectType,
|
|
8
|
+
~params: GamepadTypes.gamepadEffectParameters=?,
|
|
9
|
+
) => promise<GamepadTypes.gamepadHapticsResult> = "playEffect"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator/reset)
|
|
13
|
+
*/
|
|
14
|
+
@send
|
|
15
|
+
external reset: GamepadTypes.gamepadHapticActuator => promise<GamepadTypes.gamepadHapticsResult> =
|
|
16
|
+
"reset"
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
type gamepadMappingType =
|
|
3
|
+
| @as("standard") Standard
|
|
4
|
+
| @as("xr-standard") XrStandard
|
|
5
|
+
|
|
6
|
+
type gamepadHapticEffectType =
|
|
7
|
+
| @as("dual-rumble") DualRumble
|
|
8
|
+
| @as("trigger-rumble") TriggerRumble
|
|
9
|
+
|
|
10
|
+
type gamepadHapticsResult =
|
|
11
|
+
| @as("complete") Complete
|
|
12
|
+
| @as("preempted") Preempted
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device.
|
|
16
|
+
[See GamepadButton on MDN](https://developer.mozilla.org/docs/Web/API/GamepadButton)
|
|
17
|
+
*/
|
|
18
|
+
type gamepadButton = {
|
|
19
|
+
/**
|
|
20
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GamepadButton/pressed)
|
|
21
|
+
*/
|
|
22
|
+
pressed: bool,
|
|
23
|
+
/**
|
|
24
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GamepadButton/touched)
|
|
25
|
+
*/
|
|
26
|
+
touched: bool,
|
|
27
|
+
/**
|
|
28
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GamepadButton/value)
|
|
29
|
+
*/
|
|
30
|
+
value: float,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
This WebApiGamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware.
|
|
35
|
+
[See GamepadHapticActuator on MDN](https://developer.mozilla.org/docs/Web/API/GamepadHapticActuator)
|
|
36
|
+
*/
|
|
37
|
+
@editor.completeFrom(GamepadHapticActuator)
|
|
38
|
+
type gamepadHapticActuator = private {}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
This WebApiGamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.
|
|
42
|
+
[See WebApiGamepad on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad)
|
|
43
|
+
*/
|
|
44
|
+
type gamepad = {
|
|
45
|
+
/**
|
|
46
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/id)
|
|
47
|
+
*/
|
|
48
|
+
id: string,
|
|
49
|
+
/**
|
|
50
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/index)
|
|
51
|
+
*/
|
|
52
|
+
index: int,
|
|
53
|
+
/**
|
|
54
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/connected)
|
|
55
|
+
*/
|
|
56
|
+
connected: bool,
|
|
57
|
+
/**
|
|
58
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/timestamp)
|
|
59
|
+
*/
|
|
60
|
+
timestamp: float,
|
|
61
|
+
/**
|
|
62
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/mapping)
|
|
63
|
+
*/
|
|
64
|
+
mapping: gamepadMappingType,
|
|
65
|
+
/**
|
|
66
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/axes)
|
|
67
|
+
*/
|
|
68
|
+
axes: array<float>,
|
|
69
|
+
/**
|
|
70
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/buttons)
|
|
71
|
+
*/
|
|
72
|
+
buttons: array<gamepadButton>,
|
|
73
|
+
/**
|
|
74
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/vibrationActuator)
|
|
75
|
+
*/
|
|
76
|
+
vibrationActuator: gamepadHapticActuator,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type gamepadEffectParameters = {
|
|
80
|
+
mutable duration?: int,
|
|
81
|
+
mutable startDelay?: int,
|
|
82
|
+
mutable strongMagnitude?: float,
|
|
83
|
+
mutable weakMagnitude?: float,
|
|
84
|
+
mutable leftTrigger?: float,
|
|
85
|
+
mutable rightTrigger?: float,
|
|
86
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation/getCurrentPosition)
|
|
3
|
+
*/
|
|
4
|
+
@send
|
|
5
|
+
external getCurrentPosition: (
|
|
6
|
+
GeolocationTypes.geolocation,
|
|
7
|
+
~successCallback: GeolocationTypes.positionCallback,
|
|
8
|
+
~errorCallback: GeolocationTypes.positionErrorCallback=?,
|
|
9
|
+
~options: GeolocationTypes.positionOptions=?,
|
|
10
|
+
) => unit = "getCurrentPosition"
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation/watchPosition)
|
|
14
|
+
*/
|
|
15
|
+
@send
|
|
16
|
+
external watchPosition: (
|
|
17
|
+
GeolocationTypes.geolocation,
|
|
18
|
+
~successCallback: GeolocationTypes.positionCallback,
|
|
19
|
+
~errorCallback: GeolocationTypes.positionErrorCallback=?,
|
|
20
|
+
~options: GeolocationTypes.positionOptions=?,
|
|
21
|
+
) => int = "watchPosition"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation/clearWatch)
|
|
25
|
+
*/
|
|
26
|
+
@send
|
|
27
|
+
external clearWatch: (GeolocationTypes.geolocation, int) => unit = "clearWatch"
|
|
28
|
+
|
|
29
|
+
module GeolocationCoordinates = GeolocationCoordinates
|
|
30
|
+
module GeolocationPosition = GeolocationPosition
|
|
31
|
+
module Types = GeolocationTypes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
/**
|
|
3
|
+
An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location.
|
|
4
|
+
[See WebApiGeolocation on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation)
|
|
5
|
+
*/
|
|
6
|
+
@editor.completeFrom(WebApiGeolocation)
|
|
7
|
+
type geolocation = private {}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
[See GeolocationCoordinates on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates)
|
|
11
|
+
*/
|
|
12
|
+
@editor.completeFrom(GeolocationCoordinates)
|
|
13
|
+
type geolocationCoordinates = private {
|
|
14
|
+
/**
|
|
15
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/accuracy)
|
|
16
|
+
*/
|
|
17
|
+
accuracy: float,
|
|
18
|
+
/**
|
|
19
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/latitude)
|
|
20
|
+
*/
|
|
21
|
+
latitude: float,
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/longitude)
|
|
24
|
+
*/
|
|
25
|
+
longitude: float,
|
|
26
|
+
/**
|
|
27
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitude)
|
|
28
|
+
*/
|
|
29
|
+
altitude: Null.t<float>,
|
|
30
|
+
/**
|
|
31
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/altitudeAccuracy)
|
|
32
|
+
*/
|
|
33
|
+
altitudeAccuracy: Null.t<float>,
|
|
34
|
+
/**
|
|
35
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/heading)
|
|
36
|
+
*/
|
|
37
|
+
heading: Null.t<float>,
|
|
38
|
+
/**
|
|
39
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationCoordinates/speed)
|
|
40
|
+
*/
|
|
41
|
+
speed: Null.t<float>,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
[See GeolocationPosition on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPosition)
|
|
46
|
+
*/
|
|
47
|
+
@editor.completeFrom(GeolocationPosition)
|
|
48
|
+
type geolocationPosition = private {
|
|
49
|
+
/**
|
|
50
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/coords)
|
|
51
|
+
*/
|
|
52
|
+
coords: geolocationCoordinates,
|
|
53
|
+
/**
|
|
54
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPosition/timestamp)
|
|
55
|
+
*/
|
|
56
|
+
timestamp: int,
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
[See GeolocationPositionError on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError)
|
|
61
|
+
*/
|
|
62
|
+
type geolocationPositionError = {
|
|
63
|
+
/**
|
|
64
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/code)
|
|
65
|
+
*/
|
|
66
|
+
code: int,
|
|
67
|
+
/**
|
|
68
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/GeolocationPositionError/message)
|
|
69
|
+
*/
|
|
70
|
+
message: string,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type positionOptions = {
|
|
74
|
+
mutable enableHighAccuracy?: bool,
|
|
75
|
+
mutable timeout?: int,
|
|
76
|
+
mutable maximumAge?: int,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type positionCallback = geolocationPosition => unit
|
|
80
|
+
|
|
81
|
+
type positionErrorCallback = geolocationPositionError => unit
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
|
|
3
|
+
*/
|
|
4
|
+
@send
|
|
5
|
+
external request: (
|
|
6
|
+
WebLocksTypes.lockManager,
|
|
7
|
+
~name: string,
|
|
8
|
+
~callback: WebLocksTypes.lockGrantedCallback,
|
|
9
|
+
) => promise<JSON.t> = "request"
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
|
|
13
|
+
*/
|
|
14
|
+
@send
|
|
15
|
+
external request2: (
|
|
16
|
+
WebLocksTypes.lockManager,
|
|
17
|
+
~name: string,
|
|
18
|
+
~options: WebLocksTypes.lockOptions,
|
|
19
|
+
~callback: WebLocksTypes.lockGrantedCallback,
|
|
20
|
+
) => promise<JSON.t> = "request"
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/query)
|
|
24
|
+
*/
|
|
25
|
+
@send
|
|
26
|
+
external query: WebLocksTypes.lockManager => promise<WebLocksTypes.lockManagerSnapshot> = "query"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
type wakeLockType = | @as("screen") Screen
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
[See WakeLock on MDN](https://developer.mozilla.org/docs/Web/API/WakeLock)
|
|
7
|
+
*/
|
|
8
|
+
@editor.completeFrom(WakeLock)
|
|
9
|
+
type wakeLock = private {}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
[See WakeLockSentinel on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel)
|
|
13
|
+
*/
|
|
14
|
+
@editor.completeFrom(WakeLockSentinel)
|
|
15
|
+
type wakeLockSentinel = private {
|
|
16
|
+
...DOM.eventTarget,
|
|
17
|
+
/**
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/released)
|
|
19
|
+
*/
|
|
20
|
+
released: bool,
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/type)
|
|
23
|
+
*/
|
|
24
|
+
@as("type")
|
|
25
|
+
type_: wakeLockType,
|
|
26
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
include EventTarget.Impl({type t = ScreenWakeLockTypes.wakeLockSentinel})
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WakeLockSentinel/release)
|
|
5
|
+
*/
|
|
6
|
+
@send
|
|
7
|
+
external release: ScreenWakeLockTypes.wakeLockSentinel => promise<unit> = "release"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@@warning("-30")
|
|
2
|
+
|
|
3
|
+
type lockMode =
|
|
4
|
+
| @as("exclusive") Exclusive
|
|
5
|
+
| @as("shared") Shared
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
[See LockManager on MDN](https://developer.mozilla.org/docs/Web/API/LockManager)
|
|
9
|
+
*/
|
|
10
|
+
@editor.completeFrom(LockManager)
|
|
11
|
+
type lockManager = private {}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
[See Lock on MDN](https://developer.mozilla.org/docs/Web/API/Lock)
|
|
15
|
+
*/
|
|
16
|
+
type lock = {
|
|
17
|
+
/**
|
|
18
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Lock/name)
|
|
19
|
+
*/
|
|
20
|
+
name: string,
|
|
21
|
+
/**
|
|
22
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Lock/mode)
|
|
23
|
+
*/
|
|
24
|
+
mode: lockMode,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type lockInfo = {
|
|
28
|
+
mutable name?: string,
|
|
29
|
+
mutable mode?: lockMode,
|
|
30
|
+
mutable clientId?: string,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type lockManagerSnapshot = {
|
|
34
|
+
mutable held?: array<lockInfo>,
|
|
35
|
+
mutable pending?: array<lockInfo>,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type lockOptions = {
|
|
39
|
+
mutable mode?: lockMode,
|
|
40
|
+
mutable ifAvailable?: bool,
|
|
41
|
+
mutable steal?: bool,
|
|
42
|
+
mutable signal?: DOM.abortSignal,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type lockGrantedCallback = lock => promise<JSON.t>
|