DOM
Types
abortController
A controller object that allows you to abort one or more WebApiDOM requests as and when desired. See AbortController on MDN
type abortController = private {signal: abortSignal}Record fields
abortSignal
A signal object that allows you to communicate with a WebApiDOM request (such as a WebApiFetch) and abort it if required via an AbortController object. See AbortSignal on MDN
type abortSignal = private {aborted: bool, reason: JSON.t}Record fields
aborted
Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. Read more on MDN
alphaOption
type alphaOption = @as("discard") Discard | @as("keep") KeepanimationPlayState
type animationPlayState = | @as("finished") Finished | @as("idle") Idle | @as("paused") Paused | @as("running") RunninganimationReplaceState
type animationReplaceState = | @as("active") Active | @as("persisted") Persisted | @as("removed") RemovedassignedNodesOptions
type assignedNodesOptions = {mutable flatten?: bool}Record fields
flatten
autoFillBase
type autoFillBase = @as("off") Off | @as("on") Onblob
A file-like object of immutable, raw data. See Blob on MDN
type blob = private {size: int, type_: string}Record fields
size
type_
canvasContext2DAttributes
type canvasContext2DAttributes = { alpha: bool, colorspace?: predefinedColorSpace, desynchronized: bool, willReadFrequently: bool,}Record fields
alpha
colorspace
desynchronized
willReadFrequently
canvasRenderingContext2D
The CanvasRenderingContext2D interface, part of the WebApiCanvas API, provides the 2D rendering context for the drawing surface of a <canvas> element. It is used for drawing shapes, text, images, and other objects. See CanvasRenderingContext2D on MDN
type canvasRenderingContext2DcheckVisibilityOptions
type checkVisibilityOptions = { mutable checkOpacity?: bool, mutable checkVisibilityCSS?: bool, mutable contentVisibilityAuto?: bool, mutable opacityProperty?: bool, mutable visibilityProperty?: bool,}Record fields
checkOpacity
checkVisibilityCSS
contentVisibilityAuto
opacityProperty
visibilityProperty
colorSpaceConversion
type colorSpaceConversion = | @as("default") Default | @as("none") NonecustomElementConstructor
type customElementConstructordocument
Any web page loaded in the browser that serves as an entry point into the page's DOM tree. See Document on MDN
type document = private {}documentReadyState
type documentReadyState = | @as("complete") Complete | @as("interactive") Interactive | @as("loading") LoadingdocumentTimeline
type documentTimeline = private {currentTime: Null.t<float>}Record fields
documentTimelineOptions
type documentTimelineOptions = {mutable originTime?: float}Record fields
originTime
documentVisibilityState
type documentVisibilityState = | @as("hidden") Hidden | @as("visible") VisibledomException
An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. See DOMException on MDN
type domException = {name: string, message: string}Record fields
domMatrix
type domMatrix = private { a: float, b: float, c: float, d: float, e: float, f: float, m11: float, m12: float, m13: float, m14: float, m21: float, m22: float, m23: float, m24: float, m31: float, m32: float, m33: float, m34: float, m41: float, m42: float, m43: float, m44: float,}Record fields
domMatrix2DInit
type domMatrix2DInit = { mutable a?: float, mutable b?: float, mutable c?: float, mutable d?: float, mutable e?: float, mutable f?: float, mutable m11?: float, mutable m12?: float, mutable m21?: float, mutable m22?: float, mutable m41?: float, mutable m42?: float,}Record fields
a
b
c
d
e
f
m11
m12
m21
m22
m41
m42
domMatrixInit
type domMatrixInit = { mutable a?: float, mutable b?: float, mutable c?: float, mutable d?: float, mutable e?: float, mutable f?: float, mutable m11?: float, mutable m12?: float, mutable m21?: float, mutable m22?: float, mutable m41?: float, mutable m42?: float, mutable m13?: float, mutable m14?: float, mutable m23?: float, mutable m24?: float, mutable m31?: float, mutable m32?: float, mutable m33?: float, mutable m34?: float, mutable m43?: float, mutable m44?: float, mutable is2D?: bool,}Record fields
a
b
c
d
e
f
m11
m12
m21
m22
m41
m42
m13
m14
m23
m24
m31
m32
m33
m34
m43
m44
is2D
domMatrixReadOnly
type domMatrixReadOnly = private { a: float, b: float, c: float, d: float, e: float, f: float, m11: float, m12: float, m13: float, m14: float, m21: float, m22: float, m23: float, m24: float, m31: float, m32: float, m33: float, m34: float, m41: float, m42: float, m43: float, m44: float,}Record fields
domPoint
type domPoint = private { x: float, y: float, z: float, w: float,}Record fields
domPointInit
type domPointInit = { mutable x?: float, mutable y?: float, mutable z?: float, mutable w?: float,}Record fields
x
y
z
w
domPointReadOnly
type domPointReadOnly = private { x: float, y: float, z: float, w: float,}Record fields
domRect
type domRect = private { x: float, y: float, width: float, height: float, top: float, right: float, bottom: float, left: float,}Record fields
domRectInit
type domRectInit = { mutable x?: float, mutable y?: float, mutable width?: float, mutable height?: float,}Record fields
x
y
width
height
domRectList
type domRectList = private {}domRectReadOnly
type domRectReadOnly = private { x: float, y: float, width: float, height: float, top: float, right: float, bottom: float, left: float,}Record fields
domStringList
A type returned by some APIs which contains a list of DOMString (strings). See DOMStringList on MDN
type domStringList = {length: int}Record fields
domTokenList
type domTokenList = {length: int, mutable value: string}Record fields
value
Returns the associated set as string.
Can be set, to change the associated attribute. Read more on MDN
elementDefinitionOptions
type elementDefinitionOptions = {mutable extends?: string}Record fields
extends
event
An event which takes place in the DOM. See WebApiEvent on MDN
type event = private { type_: WebAPI.EventType.t, target: Null.t<eventTarget>, currentTarget: Null.t<eventTarget>, eventPhase: int, bubbles: bool, cancelable: bool, defaultPrevented: bool, composed: bool, isTrusted: bool, timeStamp: float,}Record fields
type_
Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN
target
Returns the object to which event is dispatched (its target). Read more on MDN
currentTarget
Returns the object whose event listener's callback is currently being invoked. Read more on MDN
eventPhase
Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN
bubbles
Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN
cancelable
Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN
defaultPrevented
Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN
composed
Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN
isTrusted
Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN
timeStamp
Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN
eventInit
type eventInit = { mutable bubbles?: bool, mutable cancelable?: bool, mutable composed?: bool,}Record fields
bubbles
cancelable
composed
eventTarget
EventTarget is a WebApiDOM interface implemented by objects that can receive events and may have listeners for them. See EventTarget on MDN
type eventTarget = private {}extendableEvent
The ExtendableEvent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. See ExtendableEvent on MDN
type extendableEvent = private { type_: WebAPI.EventType.t, target: Null.t<eventTarget>, currentTarget: Null.t<eventTarget>, eventPhase: int, bubbles: bool, cancelable: bool, defaultPrevented: bool, composed: bool, isTrusted: bool, timeStamp: float,}Record fields
type_
Returns the type of event, e.g. "click", "hashchange", or "submit". Read more on MDN
target
Returns the object to which event is dispatched (its target). Read more on MDN
currentTarget
Returns the object whose event listener's callback is currently being invoked. Read more on MDN
eventPhase
Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. Read more on MDN
bubbles
Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. Read more on MDN
cancelable
Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. Read more on MDN
defaultPrevented
Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. Read more on MDN
composed
Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. Read more on MDN
isTrusted
Returns true if event was dispatched by the user agent, and false otherwise. Read more on MDN
timeStamp
Returns the event's timestamp as the number of milliseconds measured relative to the time origin. Read more on MDN
file
Provides information about a file selected by or available to the user. See File on MDN
type file = private { size: int, type_: string, name: string, lastModified: int, webkitRelativePath: string,}Record fields
size
type_
name
lastModified
webkitRelativePath
fileList
An object of this type is returned by the files property of the HTML <input> element; this lets you access the list of files selected with the <input type="file"> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. See FileList on MDN
type fileList = private {length: int}Record fields
fillMode
type fillMode = | @as("auto") Auto | @as("backwards") Backwards | @as("both") Both | @as("forwards") Forwards | @as("none") NonefocusOptions
type focusOptions = {mutable preventScroll?: bool}Record fields
preventScroll
fullscreenNavigationUI
type fullscreenNavigationUI = | @as("auto") Auto | @as("hide") Hide | @as("show") ShowfullscreenOptions
type fullscreenOptions = { mutable navigationUI?: fullscreenNavigationUI,}Record fields
navigationUI
idleDeadline
type idleDeadline = private {didTimeout: bool}Record fields
idleRequestOptions
type idleRequestOptions = {mutable timeout?: int}Record fields
timeout
imageBitmapOptions
type imageBitmapOptions = { mutable imageOrientation?: imageOrientation, mutable premultiplyAlpha?: premultiplyAlpha, mutable colorSpaceConversion?: colorSpaceConversion, mutable resizeWidth?: int, mutable resizeHeight?: int, mutable resizeQuality?: resizeQuality,}Record fields
imageOrientation
premultiplyAlpha
colorSpaceConversion
resizeWidth
resizeHeight
resizeQuality
imageBitmapSource
type imageBitmapSourceimageData
The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). See ImageData on MDN
type imageData = private { width: int, height: int, data: Uint8ClampedArray.t, colorSpace: predefinedColorSpace,}Record fields
width
Returns the actual dimensions of the data in the ImageData object, in pixels. Read more on MDN
height
Returns the actual dimensions of the data in the ImageData object, in pixels. Read more on MDN
data
Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. Read more on MDN
imageDataSettings
type imageDataSettings = { mutable colorSpace?: predefinedColorSpace,}Record fields
colorSpace
imageOrientation
type imageOrientation = | @as("flipY") FlipY | @as("from-image") FromImage | @as("none") NoneinsertPosition
type insertPosition = | @as("afterbegin") Afterbegin | @as("afterend") Afterend | @as("beforebegin") Beforebegin | @as("beforeend") BeforeendnamedNodeMap
A collection of Attr objects. Objects inside a NamedNodeMap are not in any particular order, unlike NodeList, although they may be accessed by an index as in an array. See NamedNodeMap on MDN
type namedNodeMap = private {length: int}Record fields
navigator
The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. See Navigator on MDN
type navigatornodeList
NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll(). See NodeList on MDN
type nodeList<'tNode> = private {length: int}Record fields
offscreenRenderingContext
type offscreenRenderingContext = unknownorientationType
type orientationType = | @as("landscape-primary") LandscapePrimary | @as("landscape-secondary") LandscapeSecondary | @as("portrait-primary") PortraitPrimary | @as("portrait-secondary") PortraitSecondaryplaneLayout
type planeLayout = { mutable offset: int, mutable stride: int,}Record fields
offset
stride
playbackDirection
type playbackDirection = | @as("alternate") Alternate | @as("alternate-reverse") AlternateReverse | @as("normal") Normal | @as("reverse") ReversepointerLockOptions
type pointerLockOptions = { mutable unadjustedMovement?: bool,}Record fields
unadjustedMovement
predefinedColorSpace
type predefinedColorSpace = | @as("display-p3") DisplayP3 | @as("srgb") SrgbpremultiplyAlpha
type premultiplyAlpha = | @as("default") Default | @as("none") None | @as("premultiply") PremultiplyreferrerPolicy
type referrerPolicy = | @as("no-referrer") NoReferrer | @as("no-referrer-when-downgrade") NoReferrerWhenDowngrade | @as("origin") Origin | @as("origin-when-cross-origin") OriginWhenCrossOrigin | @as("same-origin") SameOrigin | @as("strict-origin") StrictOrigin | @as("strict-origin-when-cross-origin") StrictOriginWhenCrossOrigin | @as("unsafe-url") UnsafeUrlremotePlaybackState
type remotePlaybackState = | @as("connected") Connected | @as("connecting") Connecting | @as("disconnected") DisconnectedrenderingContext
type renderingContext = unknownresizeQuality
type resizeQuality = | @as("high") High | @as("low") Low | @as("medium") Medium | @as("pixelated") Pixelatedscreen
A screen, usually the one on which the current window is being rendered, and is obtained using window.screen. See Screen on MDN
type screen = { availWidth: int, availHeight: int, width: int, height: int, colorDepth: int, pixelDepth: int, orientation: screenOrientation,}Record fields
screenOrientation
type screenOrientation = private { type_: orientationType, angle: int,}Record fields
scrollBehavior
type scrollBehavior = | @as("auto") Auto | @as("instant") Instant | @as("smooth") SmoothscrollIntoViewOptions
type scrollIntoViewOptions = { mutable behavior?: scrollBehavior, mutable block?: scrollLogicalPosition, mutable inline?: scrollLogicalPosition,}Record fields
behavior
block
inline
scrollLogicalPosition
type scrollLogicalPosition = | @as("center") Center | @as("end") End | @as("nearest") Nearest | @as("start") StartscrollOptions
type scrollOptions = {mutable behavior?: scrollBehavior}Record fields
behavior
scrollToOptions
type scrollToOptions = { mutable behavior?: scrollBehavior, mutable left?: float, mutable top?: float,}Record fields
behavior
left
top
selectionMode
type selectionMode = | @as("end") End | @as("preserve") Preserve | @as("select") Select | @as("start") StartshareData
type shareData = { mutable files?: array<file>, mutable title?: string, mutable text?: string, mutable url?: string,}Record fields
files
title
text
url
slotAssignmentMode
type slotAssignmentMode = | @as("manual") Manual | @as("named") NamedstructuredSerializeOptions
type structuredSerializeOptions = { mutable transfer?: array<Dict.t<string>>,}Record fields
transfer
timeoutId
type timeoutIduserActivation
type userActivation = {hasBeenActive: bool, isActive: bool}Record fields
validityState
The validity states that an element can be in, with respect to constraint validation. Together, they help explain why an element's value fails to validate, if it's not valid. See ValidityState on MDN
type validityState = { valueMissing: bool, typeMismatch: bool, patternMismatch: bool, tooLong: bool, tooShort: bool, rangeUnderflow: bool, rangeOverflow: bool, stepMismatch: bool, badInput: bool, customError: bool, valid: bool,}Record fields
validityStateFlags
type validityStateFlags = { mutable valueMissing?: bool, mutable typeMismatch?: bool, mutable patternMismatch?: bool, mutable tooLong?: bool, mutable tooShort?: bool, mutable rangeUnderflow?: bool, mutable rangeOverflow?: bool, mutable stepMismatch?: bool, mutable badInput?: bool, mutable customError?: bool,}Record fields
valueMissing
typeMismatch
patternMismatch
tooLong
tooShort
rangeUnderflow
rangeOverflow
stepMismatch
badInput
customError
vibratePattern
@unboxedtype vibratePattern = Int(int) | IntArray(array<int>)videoColorPrimaries
type videoColorPrimaries = | @as("bt470bg") Bt470bg | @as("bt709") Bt709 | @as("smpte170m") Smpte170mvideoColorSpace
type videoColorSpace = private { primaries: Null.t<videoColorPrimaries>, transfer: Null.t<videoTransferCharacteristics>, matrix: Null.t<videoMatrixCoefficients>, fullRange: Null.t<bool>,}Record fields
videoColorSpaceInit
type videoColorSpaceInit = { mutable primaries?: Nullable.t<videoColorPrimaries>, mutable transfer?: Nullable.t< videoTransferCharacteristics, >, mutable matrix?: Nullable.t<videoMatrixCoefficients>, mutable fullRange?: Nullable.t<bool>,}Record fields
primaries
transfer
matrix
fullRange
videoFrame
type videoFrame = private { format: Null.t<videoPixelFormat>, codedWidth: int, codedHeight: int, codedRect: Null.t<domRectReadOnly>, visibleRect: Null.t<domRectReadOnly>, displayWidth: int, displayHeight: int, duration: Null.t<int>, timestamp: int, colorSpace: videoColorSpace,}Record fields
videoFrameBufferInit
type videoFrameBufferInit = { mutable format: videoPixelFormat, mutable codedWidth: int, mutable codedHeight: int, mutable timestamp: int, mutable duration?: int, mutable layout?: array<planeLayout>, mutable visibleRect?: domRectInit, mutable displayWidth?: int, mutable displayHeight?: int, mutable colorSpace?: videoColorSpaceInit,}Record fields
format
codedWidth
codedHeight
timestamp
duration
layout
visibleRect
displayWidth
displayHeight
colorSpace
videoFrameCopyToOptions
type videoFrameCopyToOptions = { mutable rect?: domRectInit, mutable layout?: array<planeLayout>, mutable format?: videoPixelFormat, mutable colorSpace?: predefinedColorSpace,}Record fields
rect
layout
format
colorSpace
videoFrameInit
type videoFrameInit = { mutable duration?: int, mutable timestamp?: int, mutable alpha?: alphaOption, mutable visibleRect?: domRectInit, mutable displayWidth?: int, mutable displayHeight?: int,}Record fields
duration
timestamp
alpha
visibleRect
displayWidth
displayHeight
videoMatrixCoefficients
type videoMatrixCoefficients = | @as("bt470bg") Bt470bg | @as("bt709") Bt709 | @as("rgb") Rgb | @as("smpte170m") Smpte170mvideoPixelFormat
type videoPixelFormat = | BGRA | BGRX | I420 | I420A | I422 | I444 | NV12 | RGBA | RGBXvideoTransferCharacteristics
type videoTransferCharacteristics = | @as("bt709") Bt709 | @as("iec61966-2-1") Iec6196621 | @as("smpte170m") Smpte170mwindow
type window = private {}windowPostMessageOptions
type windowPostMessageOptions = { mutable transfer?: array<Dict.t<string>>, mutable targetOrigin?: string,}Record fields
transfer
targetOrigin
xPathNSResolver
type xPathNSResolverValues
window
let window: window