From 12dbdbac396dafb6046acb21b5726259be92ea6c Mon Sep 17 00:00:00 2001 From: David Barri Date: Sat, 4 Sep 2021 14:10:21 +1000 Subject: [PATCH] Change auto-formatting settings --- .scalafmt.conf | 26 +- .../org/scalajs/dom/AbortController.scala | 65 +- src/main/scala/org/scalajs/dom/Audio.scala | 1890 ++-- src/main/scala/org/scalajs/dom/CSSTypes.scala | 376 +- .../scalajs/dom/DeprecatedCSSAliases.scala | 18 +- src/main/scala/org/scalajs/dom/Fetch.scala | 340 +- .../scala/org/scalajs/dom/HTMLTypes.scala | 4960 ++++----- src/main/scala/org/scalajs/dom/IDBTypes.scala | 1158 +- .../scalajs/dom/KeyboardEventConstants.scala | 142 +- .../scala/org/scalajs/dom/Notification.scala | 474 +- .../org/scalajs/dom/OffscreenCanvas.scala | 58 +- src/main/scala/org/scalajs/dom/SVGTypes.scala | 3811 +++---- src/main/scala/org/scalajs/dom/Stream.scala | 526 +- src/main/scala/org/scalajs/dom/URL.scala | 172 +- .../scala/org/scalajs/dom/WebGLTypes.scala | 3329 +++--- .../org/scalajs/dom/WebWorkerTypes.scala | 474 +- .../dom/WindowOrWorkerGlobalScope.scala | 149 +- .../scala/org/scalajs/dom/crypto/Crypto.scala | 503 +- .../org/scalajs/dom/crypto/package.scala | 29 +- .../dom/experimental/FileReaderSync.scala | 54 +- .../scalajs/dom/experimental/Fullscreen.scala | 4 +- .../dom/experimental/PointerLock.scala | 121 +- .../scalajs/dom/experimental/Vibration.scala | 3 +- .../dom/experimental/beacon/package.scala | 69 +- .../cachestorage/CacheStorage.scala | 41 +- .../deviceorientation/DeviceOrientation.scala | 22 +- .../deviceorientation/package.scala | 10 +- .../experimental/domparser/DOMParser.scala | 29 +- .../dom/experimental/gamepad/Gamepad.scala | 41 +- .../dom/experimental/gamepad/package.scala | 10 +- .../scalajs/dom/experimental/intl/Intl.scala | 301 +- .../dom/experimental/intl/package.scala | 19 +- .../mediastream/MediaStream.scala | 624 +- .../scalajs/dom/experimental/package.scala | 5 +- .../experimental/permissions/package.scala | 15 +- .../dom/experimental/push/PushManager.scala | 334 +- .../dom/experimental/push/package.scala | 78 +- .../serviceworkers/ServiceWorkers.scala | 800 +- .../experimental/serviceworkers/package.scala | 30 +- .../sharedworkers/SharedWorker.scala | 55 +- .../SharedWorkerGlobalScope.scala | 51 +- .../dom/experimental/storage/package.scala | 6 +- .../experimental/webgl/WebGLExtensions.scala | 404 +- .../webgl/extensions/Extensions.scala | 295 +- .../dom/experimental/webgl/package.scala | 20 +- .../dom/experimental/webrtc/WebRTC.scala | 1242 +-- .../dom/experimental/webrtc/package.scala | 17 +- .../org/scalajs/dom/ext/Extensions.scala | 38 +- .../scala/org/scalajs/dom/ext/package.scala | 1 + src/main/scala/org/scalajs/dom/html.scala | 5 +- src/main/scala/org/scalajs/dom/idb.scala | 6 +- src/main/scala/org/scalajs/dom/lib.scala | 9719 +++++++---------- src/main/scala/org/scalajs/dom/package.scala | 67 +- src/main/scala/org/scalajs/dom/raw.scala | 301 +- src/main/scala/org/scalajs/dom/svg.scala | 9 +- src/main/scala/org/scalajs/dom/webgl.scala | 5 +- .../scala/org/scalajs/dom/webworkers.scala | 18 +- 57 files changed, 14877 insertions(+), 18492 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index b3f01dadf..1702ceb82 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,6 +1,26 @@ -version = 2.0.0-RC5 +version = 3.0.2 project.git = true style = Scala.js project.includeFilters = ["src/main/scala/org/scalajs/.*\\.scala"] -maxColumn = 79 -docstrings = JavaDoc +maxColumn = 120 + +danglingParentheses.callSite = false +danglingParentheses.ctrlSite = false +danglingParentheses.defnSite = false +docstrings.style = SpaceAsterisk +literals.hexDigits = Upper +literals.scientific = Upper +newlines.afterCurlyLambdaParams = never +newlines.alwaysBeforeElseAfterCurlyIf = false +newlines.beforeCurlyLambdaParams = never +newlines.topLevelStatements = [before] +optIn.forceBlankLineBeforeDocstring = true + +rewrite.sortModifiers.order = [ + "override", "final", "implicit", + "sealed", "abstract", + "private", "protected", + "open", "opaque", "infix", + "transparent", "inline", + "lazy" +] diff --git a/src/main/scala/org/scalajs/dom/AbortController.scala b/src/main/scala/org/scalajs/dom/AbortController.scala index 6aae4767c..462d9f715 100644 --- a/src/main/scala/org/scalajs/dom/AbortController.scala +++ b/src/main/scala/org/scalajs/dom/AbortController.scala @@ -3,56 +3,47 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -/** - * The AbortController interface represents a controller object that allows you - * to abort one or more DOM requests as and when desired. - * - * MDN - */ +/** The AbortController interface represents a controller object that allows you to abort one or more DOM requests as + * and when desired. + * + * MDN + */ @js.native @JSGlobal class AbortController() extends js.Object { - /** - * Returns a AbortSignal object instance, which can be used to communicate - * with/abort a DOM request - * - * MDN - */ + /** Returns a AbortSignal object instance, which can be used to communicate with/abort a DOM request + * + * MDN + */ val signal: AbortSignal = js.native - /** - * Aborts a DOM request before it has completed. This is able to abort fetch - * requests, consumption of any response Body, and streams. - * - * MDN - */ + /** Aborts a DOM request before it has completed. This is able to abort fetch requests, consumption of any response + * Body, and streams. + * + * MDN + */ def abort(): Unit = js.native } -/** - * The AbortSignal interface represents a signal object that allows you to - * communicate with a DOM request (such as a Fetch) and abort it if required - * via an AbortController object. - * - * MDN - */ +/** The AbortSignal interface represents a signal object that allows you to communicate with a DOM request (such as a + * Fetch) and abort it if required via an AbortController object. + * + * MDN + */ @js.native trait AbortSignal extends EventTarget { - /** - * A Boolean that indicates whether the request(s) the signal is - * communicating with is/are aborted (true) or not (false). - * - * MDN - */ + /** A Boolean that indicates whether the request(s) the signal is communicating with is/are aborted (true) or not + * (false). + * + * MDN + */ def aborted: Boolean = js.native - /** - * Invoked when an abort event fires, i.e. when the DOM request(s) the signal - * is communicating with is/are aborted. - * - * MDN - */ + /** Invoked when an abort event fires, i.e. when the DOM request(s) the signal is communicating with is/are aborted. + * + * MDN + */ var onabort: js.Function0[Any] = js.native } diff --git a/src/main/scala/org/scalajs/dom/Audio.scala b/src/main/scala/org/scalajs/dom/Audio.scala index 301589b8a..8f561ee2a 100644 --- a/src/main/scala/org/scalajs/dom/Audio.scala +++ b/src/main/scala/org/scalajs/dom/Audio.scala @@ -1,889 +1,761 @@ -/** - * Documentation is thanks to Mozilla Contributors - * at https://developer.mozilla.org/en-US/docs/Web/API and available - * under the Creative Commons Attribution-ShareAlike v2.5 or later. - * http://creativecommons.org/licenses/by-sa/2.5/ - * - * Everything else is under the MIT License - * http://opensource.org/licenses/MIT - */ +/** Documentation is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and available + * under the Creative Commons Attribution-ShareAlike v2.5 or later. http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ package org.scalajs.dom import org.scalajs.dom.experimental.mediastream.MediaStream import scala.scalajs.js import scala.scalajs.js.annotation._ -/** The AudioContext interface represents an audio-processing graph built - * from audio modules linked together, each represented by an AudioNode. - * An audio context controls both the creation of the nodes it contains and the - * execution of the audio processing, or decoding. You need to create an - * AudioContext before you do anything else, as everything happens inside a - * context. - * - * An AudioContext can be a target of events, therefore it implements the - * EventTarget interface. - */ +/** The AudioContext interface represents an audio-processing graph built from audio modules linked together, each + * represented by an AudioNode. An audio context controls both the creation of the nodes it contains and the execution + * of the audio processing, or decoding. You need to create an AudioContext before you do anything else, as everything + * happens inside a context. + * + * An AudioContext can be a target of events, therefore it implements the EventTarget interface. + */ @js.native @JSGlobal class AudioContext extends EventTarget { - /** Returns a double representing an ever-increasing hardware time in - * seconds used for scheduling. - * It starts at 0 and cannot be stopped, paused or reset. - */ + /** Returns a double representing an ever-increasing hardware time in seconds used for scheduling. It starts at 0 and + * cannot be stopped, paused or reset. + */ def currentTime: Double = js.native - /** Returns an AudioDestinationNode representing the final destination of - * all audio in the context. - * It can be thought of as the audio-rendering device. - */ + /** Returns an AudioDestinationNode representing the final destination of all audio in the context. It can be thought + * of as the audio-rendering device. + */ val destination: AudioDestinationNode = js.native /** Returns the AudioListener object, used for 3D spatialization. */ val listener: AudioListener = js.native - /** Returns a float representing the sample rate (in samples per second) - * used by all nodes in this context. - * The sample-rate of an AudioContext cannot be changed. - */ + /** Returns a float representing the sample rate (in samples per second) used by all nodes in this context. The + * sample-rate of an AudioContext cannot be changed. + */ val sampleRate: Double = js.native /** Returns the current state of the AudioContext. */ def state: String = js.native - /** Closes the audio context, releasing any system audio resources - * that it uses. - */ + /** Closes the audio context, releasing any system audio resources that it uses. + */ def close(): js.Promise[Unit] = js.native - /** Creates an AnalyserNode, which can be used to expose audio time and - * frequency data and for example to create data visualisations. - */ + /** Creates an AnalyserNode, which can be used to expose audio time and frequency data and for example to create data + * visualisations. + */ def createAnalyser(): AnalyserNode = js.native - /** Creates a BiquadFilterNode, which represents a second order filter - * configurable as several different common filter types: - * high-pass, low-pass, band-pass, etc. - */ + /** Creates a BiquadFilterNode, which represents a second order filter configurable as several different common filter + * types: high-pass, low-pass, band-pass, etc. + */ def createBiquadFilter(): BiquadFilterNode = js.native - /** Creates a new, empty AudioBuffer object, which can then be populated by - * data and played via an AudioBufferSourceNode. - * - * @param numOfChannels An integer representing the number of channels this - * buffer should have. Implementations must support a - * minimum 32 channels. - * @param length An integer representing the size of the buffer in - * sample-frames. - * @param sampleRate The sample-rate of the linear audio data in - * sample-frames per second. An implementation must - * support sample-rates in at least the range 22050 to - * 96000. - */ - def createBuffer(numOfChannels: Int, length: Int, - sampleRate: Int): AudioBuffer = js.native - - /** Creates an AudioBufferSourceNode, which can be used to play and - * manipulate audio data contained within an AudioBuffer object. - * AudioBuffers are created using AudioContext.createBuffer or returned by - * AudioContext.decodeAudioData when it successfully decodes an audio track. - */ + /** Creates a new, empty AudioBuffer object, which can then be populated by data and played via an + * AudioBufferSourceNode. + * + * @param numOfChannels + * An integer representing the number of channels this buffer should have. Implementations must support a minimum + * 32 channels. + * @param length + * An integer representing the size of the buffer in sample-frames. + * @param sampleRate + * The sample-rate of the linear audio data in sample-frames per second. An implementation must support + * sample-rates in at least the range 22050 to 96000. + */ + def createBuffer(numOfChannels: Int, length: Int, sampleRate: Int): AudioBuffer = js.native + + /** Creates an AudioBufferSourceNode, which can be used to play and manipulate audio data contained within an + * AudioBuffer object. AudioBuffers are created using AudioContext.createBuffer or returned by + * AudioContext.decodeAudioData when it successfully decodes an audio track. + */ def createBufferSource(): AudioBufferSourceNode = js.native - /** Creates a ChannelMergerNode, which is used to combine channels from - * multiple audio streams into a single audio stream. - * - * @param numberOfInputs The number of channels in the input audio streams, - * which the output stream will contain; the default is - * 6 is this parameter is not specified. - */ - def createChannelMerger( - numberOfInputs: Int = 6): ChannelMergerNode = js.native - - /** Creates a ChannelSplitterNode, which is used to access the individual - * channels of an audio stream and process them separately. - * - * @param numberOfOutputs The number of channels in the input audio stream - * that you want to output separately; the default is - * 6 is this parameter is not specified. - */ - def createChannelSplitter( - numberOfOutputs: Int = 6): ChannelSplitterNode = js.native - - /** Creates a ConvolverNode, which can be used to apply convolution effects - * to your audio graph, for example a reverberation effect. - */ + /** Creates a ChannelMergerNode, which is used to combine channels from multiple audio streams into a single audio + * stream. + * + * @param numberOfInputs + * The number of channels in the input audio streams, which the output stream will contain; the default is 6 is + * this parameter is not specified. + */ + def createChannelMerger(numberOfInputs: Int = 6): ChannelMergerNode = js.native + + /** Creates a ChannelSplitterNode, which is used to access the individual channels of an audio stream and process them + * separately. + * + * @param numberOfOutputs + * The number of channels in the input audio stream that you want to output separately; the default is 6 is this + * parameter is not specified. + */ + def createChannelSplitter(numberOfOutputs: Int = 6): ChannelSplitterNode = js.native + + /** Creates a ConvolverNode, which can be used to apply convolution effects to your audio graph, for example a + * reverberation effect. + */ def createConvolver(): ConvolverNode = js.native - /** Creates a DelayNode, which is used to delay the incoming audio signal - * by a certain amount. - * This node is also useful to create feedback loops in a Web Audio API - * graph. - * - * @param maxDelayTime The maximum amount of time, in seconds, that the audio - * signal can be delayed by. The default value is 0. - */ + /** Creates a DelayNode, which is used to delay the incoming audio signal by a certain amount. This node is also + * useful to create feedback loops in a Web Audio API graph. + * + * @param maxDelayTime + * The maximum amount of time, in seconds, that the audio signal can be delayed by. The default value is 0. + */ def createDelay(maxDelayTime: Int): DelayNode = js.native - /** Creates a DynamicsCompressorNode, which can be used to apply acoustic - * compression to an audio signal. */ + /** Creates a DynamicsCompressorNode, which can be used to apply acoustic compression to an audio signal. + */ def createDynamicsCompressor(): DynamicsCompressorNode = js.native - /** Creates a GainNode, which can be used to control the overall volume of - * the audio graph. */ + /** Creates a GainNode, which can be used to control the overall volume of the audio graph. + */ def createGain(): GainNode = js.native - /** Creates a MediaElementAudioSourceNode associated with an HTMLMediaElement. - * This can be used to play and manipulate audio from <video> or - * <audio> elements. - * - * @param myMediaElement An HTMLMediaElement object that you want to feed - * into an audio processing graph to manipulate. - */ - def createMediaElementSource( - myMediaElement: HTMLMediaElement): MediaElementAudioSourceNode = js.native - - /** Creates a MediaStreamAudioSourceNode associated with a MediaStream - * representing an audio stream which may come from the local computer - * microphone or other sources. - * - * @param stream A MediaStream object that you want to feed into an audio - * processing graph to manipulate. - */ - def createMediaStreamSource( - stream: MediaStream): MediaStreamAudioSourceNode = js.native - - /** Creates a MediaStreamAudioDestinationNode associated with a MediaStream - * representing an audio stream which may be stored in a local file or sent - * to another computer. - */ + /** Creates a MediaElementAudioSourceNode associated with an HTMLMediaElement. This can be used to play and manipulate + * audio from <video> or <audio> elements. + * + * @param myMediaElement + * An HTMLMediaElement object that you want to feed into an audio processing graph to manipulate. + */ + def createMediaElementSource(myMediaElement: HTMLMediaElement): MediaElementAudioSourceNode = js.native + + /** Creates a MediaStreamAudioSourceNode associated with a MediaStream representing an audio stream which may come + * from the local computer microphone or other sources. + * + * @param stream + * A MediaStream object that you want to feed into an audio processing graph to manipulate. + */ + def createMediaStreamSource(stream: MediaStream): MediaStreamAudioSourceNode = js.native + + /** Creates a MediaStreamAudioDestinationNode associated with a MediaStream representing an audio stream which may be + * stored in a local file or sent to another computer. + */ def createMediaStreamDestination(): MediaStreamAudioDestinationNode = js.native - /** Creates an OscillatorNode, a source representing a periodic waveform. - * It basically generates a tone. */ + /** Creates an OscillatorNode, a source representing a periodic waveform. It basically generates a tone. + */ def createOscillator(): OscillatorNode = js.native - /** Creates a PannerNode, which is used to spatialise an incoming audio - * stream in 3D space. */ + /** Creates a PannerNode, which is used to spatialise an incoming audio stream in 3D space. + */ def createPanner(): PannerNode = js.native - /** Creates a PeriodicWave, used to define a periodic waveform that can be - * used to determine the output of an OscillatorNode. - */ - def createPeriodicWave(real: js.typedarray.Float32Array, - imag: js.typedarray.Float32Array): PeriodicWave = js.native + /** Creates a PeriodicWave, used to define a periodic waveform that can be used to determine the output of an + * OscillatorNode. + */ + def createPeriodicWave(real: js.typedarray.Float32Array, imag: js.typedarray.Float32Array): PeriodicWave = js.native - /** Creates a StereoPannerNode, which can be used to apply stereo panning - * to an audio source. */ + /** Creates a StereoPannerNode, which can be used to apply stereo panning to an audio source. + */ def createStereoPanner(): StereoPannerNode = js.native - /** Creates a WaveShaperNode, which is used to implement non-linear - * distortion effects. */ + /** Creates a WaveShaperNode, which is used to implement non-linear distortion effects. + */ def createWaveShaper(): WaveShaperNode = js.native - /** Asynchronously decodes audio file data contained in an ArrayBuffer. In - * this case, the ArrayBuffer is usually loaded from an XMLHttpRequest's - * response attribute after setting the responseType to arraybuffer. - * This method only works on complete files, not fragments of audio files. - * - * @param audioData An ArrayBuffer containing the audio data to be - * decoded, usually grabbed from an XMLHttpRequest's - * response attribute after setting the responseType - * to arraybuffer. - * @param successCallback A callback function to be invoked when the - * decoding successfully finishes. The single - * argument to this callback is an AudioBuffer - * representing the decoded PCM audio data. Usually - * you'll want to put the decoded data into an - * AudioBufferSourceNode, from which it can be played - * and manipulated how you want. - * @param errorCallback An optional error callback, to be invoked if an - * error occurs when the audio data is being decoded. - */ + /** Asynchronously decodes audio file data contained in an ArrayBuffer. In this case, the ArrayBuffer is usually + * loaded from an XMLHttpRequest's response attribute after setting the responseType to arraybuffer. This method only + * works on complete files, not fragments of audio files. + * + * @param audioData + * An ArrayBuffer containing the audio data to be decoded, usually grabbed from an XMLHttpRequest's response + * attribute after setting the responseType to arraybuffer. + * @param successCallback + * A callback function to be invoked when the decoding successfully finishes. The single argument to this callback + * is an AudioBuffer representing the decoded PCM audio data. Usually you'll want to put the decoded data into an + * AudioBufferSourceNode, from which it can be played and manipulated how you want. + * @param errorCallback + * An optional error callback, to be invoked if an error occurs when the audio data is being decoded. + */ def decodeAudioData( - audioData: js.typedarray.ArrayBuffer, - successCallback: js.Function1[AudioBuffer, _] = js.native, + audioData: js.typedarray.ArrayBuffer, successCallback: js.Function1[AudioBuffer, _] = js.native, errorCallback: js.Function0[_] = js.native ): js.Promise[AudioBuffer] = js.native - /** Resumes the progression of time in an audio context that has previously - * been suspended. - */ + /** Resumes the progression of time in an audio context that has previously been suspended. + */ def resume(): js.Promise[Unit] = js.native - /** Suspends the progression of time in the audio context, - * temporarily halting audio hardware access and reducing CPU/battery - * usage in the process. - */ + /** Suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing + * CPU/battery usage in the process. + */ def suspend(): js.Promise[Unit] = js.native } -/** The OfflineAudioContext interface is an AudioContext interface - * representing an audio-processing graph built from linked together - * AudioNodes. In contrast with a standard AudioContext, an OfflineAudioContext - * doesn't render the audio to the device hardware; instead, it generates it, - * as fast as it can, and outputs the result to an AudioBuffer. - * - * It is important to note that, whereas you can create a new AudioContext - * using the new AudioContext() constructor with no arguments, the - * new OfflineAudioContext() constructor requires three arguments: - * - * @example {{{ - * new OfflineAudioContext(numOfChannels, length, sampleRate) - * }}} - * - * This works in exactly the same way as when you create a new AudioBuffer with - * the AudioContext.createBuffer method. For more detail, read Audio buffers: - * frames, samples and channels from our Basic concepts guide. - * - * @param numOfChannels An integer representing the number of channels this - * buffer should have. - * Implementations must support a minimum 32 channels. - * @param length An integer representing the size of the buffer in - * sample-frames. - * @param sampleRate The sample-rate of the linear audio data in - * sample-frames per second. - * An implementation must support sample-rates in at - * least the range 22050 to 96000, with 44100 being the - * most commonly used. - */ +/** The OfflineAudioContext interface is an AudioContext interface representing an audio-processing graph built from + * linked together AudioNodes. In contrast with a standard AudioContext, an OfflineAudioContext doesn't render the + * audio to the device hardware; instead, it generates it, as fast as it can, and outputs the result to an AudioBuffer. + * + * It is important to note that, whereas you can create a new AudioContext using the new AudioContext() constructor + * with no arguments, the new OfflineAudioContext() constructor requires three arguments: + * + * @example + * {{{new OfflineAudioContext(numOfChannels, length, sampleRate)}}} + * + * This works in exactly the same way as when you create a new AudioBuffer with the AudioContext.createBuffer method. + * For more detail, read Audio buffers: frames, samples and channels from our Basic concepts guide. + * + * @param numOfChannels + * An integer representing the number of channels this buffer should have. Implementations must support a minimum 32 + * channels. + * @param length + * An integer representing the size of the buffer in sample-frames. + * @param sampleRate + * The sample-rate of the linear audio data in sample-frames per second. An implementation must support sample-rates + * in at least the range 22050 to 96000, with 44100 being the most commonly used. + */ @js.native @JSGlobal -class OfflineAudioContext(numOfChannels: Int, length: Int, sampleRate: Int) - extends AudioContext { - - /** The promise-based startRendering() method of the OfflineAudioContext - * Interface starts rendering the audio graph, taking into account the - * current connections and the current scheduled changes. - * - * When the method is invoked, the rendering is started and a promise is - * raised. When the rendering is completed, the promise resolves with an - * AudioBuffer containing the rendered audio. - */ +class OfflineAudioContext(numOfChannels: Int, length: Int, sampleRate: Int) extends AudioContext { + + /** The promise-based startRendering() method of the OfflineAudioContext Interface starts rendering the audio graph, + * taking into account the current connections and the current scheduled changes. + * + * When the method is invoked, the rendering is started and a promise is raised. When the rendering is completed, the + * promise resolves with an AudioBuffer containing the rendered audio. + */ def startRendering(): js.Promise[AudioBuffer] = js.native } -/** The AudioNode interface is a generic interface for representing an audio - * processing module like an audio source (e.g. an HTML <audio> or - * <video> element, an OscillatorNode, etc.), the audio destination, - * intermediate processing module (e.g. a filter like BiquadFilterNode or - * ConvolverNode), or volume control (like GainNode). - * - * An AudioNode has inputs and outputs, each with a given amount of channels. - * An AudioNode with zero inputs and one or multiple outputs is called a source - * node. The exact processing done varies from one AudioNode to another but, in - * general, a node reads its inputs, does some audio-related processing, and - * generates new values for its outputs, or simply lets the audio pass through - * (for example in the AnalyserNode, where the result of the processing is - * accessed separately). - * - * Different nodes can be linked together to build a processing graph. Such - * a graph is contained in an AudioContext. - * Each AudioNode participates in exactly one such context. In general, - * processing nodes inherit the properties and methods of AudioNode, but also - * define their own functionality on top. See the individual node pages for - * more details, as listed on the Web Audio API homepage. - */ +/** The AudioNode interface is a generic interface for representing an audio processing module like an audio source + * (e.g. an HTML <audio> or <video> element, an OscillatorNode, etc.), the audio destination, intermediate + * processing module (e.g. a filter like BiquadFilterNode or ConvolverNode), or volume control (like GainNode). + * + * An AudioNode has inputs and outputs, each with a given amount of channels. An AudioNode with zero inputs and one or + * multiple outputs is called a source node. The exact processing done varies from one AudioNode to another but, in + * general, a node reads its inputs, does some audio-related processing, and generates new values for its outputs, or + * simply lets the audio pass through (for example in the AnalyserNode, where the result of the processing is accessed + * separately). + * + * Different nodes can be linked together to build a processing graph. Such a graph is contained in an AudioContext. + * Each AudioNode participates in exactly one such context. In general, processing nodes inherit the properties and + * methods of AudioNode, but also define their own functionality on top. See the individual node pages for more + * details, as listed on the Web Audio API homepage. + */ @js.native trait AudioNode extends EventTarget { - /** Returns the associated AudioContext, that is the object representing - * the processing graph the node is participating in. - */ + /** Returns the associated AudioContext, that is the object representing the processing graph the node is + * participating in. + */ val context: AudioContext = js.native - /** Returns the number of inputs feeding the node. Source nodes are defined - * as nodes having a numberOfInputs property with a value of 0. - */ + /** Returns the number of inputs feeding the node. Source nodes are defined as nodes having a numberOfInputs property + * with a value of 0. + */ val numberOfInputs: Int = js.native - /** Returns the number of outputs coming out of the node. Destination nodes - * — like AudioDestinationNode — have a value of 0 for this attribute. - */ + /** Returns the number of outputs coming out of the node. Destination nodes — like AudioDestinationNode — have a value + * of 0 for this attribute. + */ val numberOfOutputs: Int = js.native - /** Represents an integer used to determine how many channels are used when - * up-mixing and down-mixing connections to any inputs to the node. Its usage - * and precise definition depend on the value of AudioNode.channelCountMode. - */ + /** Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to + * any inputs to the node. Its usage and precise definition depend on the value of AudioNode.channelCountMode. + */ var channelCount: Int = js.native - /** Represents an enumerated value describing the way channels must be - * matched between the node's inputs and outputs. - */ + /** Represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. + */ var channelCountMode: Int = js.native - /** Represents an enumerated value describing the meaning of the channels. - * This interpretation will define how audio up-mixing and down-mixing will - * happen. - * - * The possible values are "speakers" or "discrete". - */ + /** Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio + * up-mixing and down-mixing will happen. + * + * The possible values are "speakers" or "discrete". + */ var channelInterpretation: String = js.native - /** Allows us to connect one output of this node to one input of another - * node. - */ + /** Allows us to connect one output of this node to one input of another node. + */ def connect(audioNode: AudioNode): Unit = js.native - /** Allows us to connect one output of this node to one input of an audio - * parameter. - */ + /** Allows us to connect one output of this node to one input of an audio parameter. + */ def connect(audioParam: AudioParam): Unit = js.native - /** Allows us to disconnect the current node from another one it is already - * connected to. - * - * @param output The index describing which output of the AudioNode is - * going to be disconnected. - */ + /** Allows us to disconnect the current node from another one it is already connected to. + * + * @param output + * The index describing which output of the AudioNode is going to be disconnected. + */ def disconnect(output: AudioNode = js.native): Unit = js.native } -/** The AnalyserNode interface represents a node able to provide real-time - * frequency and time-domain analysis information. - * It is an AudioNode that passes the audio stream unchanged from the input to - * the output, but allows you to take the generated data,process it, and create - * audio visualizations. - * - * An AnalyzerNode has exactly one input and one output. The node works even - * if the output is not connected. - * - * - Number of inputs: 1 - * - Number of outputs: 1 (but may be left unconnected) - * - Channel count mode: "explicit" - * - Channel count: 1 - * - Channel interpretation: "speakers" - */ +/** The AnalyserNode interface represents a node able to provide real-time frequency and time-domain analysis + * information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you + * to take the generated data,process it, and create audio visualizations. + * + * An AnalyzerNode has exactly one input and one output. The node works even if the output is not connected. + * + * - Number of inputs: 1 + * - Number of outputs: 1 (but may be left unconnected) + * - Channel count mode: "explicit" + * - Channel count: 1 + * - Channel interpretation: "speakers" + */ @js.native trait AnalyserNode extends AudioNode { - /** Is an unsigned long value representing the size of the FFT (Fast Fourier - * Transform) to be used to determine the frequency domain. - */ + /** Is an unsigned long value representing the size of the FFT (Fast Fourier Transform) to be used to determine the + * frequency domain. + */ var fftSize: Int = js.native - /** Is an unsigned long value half that of the FFT size. This generally - * equates to the number of data values you will have to play with for the - * visualization. - */ + /** Is an unsigned long value half that of the FFT size. This generally equates to the number of data values you will + * have to play with for the visualization. + */ val frequencyBinCount: Int = js.native - /** Is a double value representing the minimum power value in the scaling - * range for the FFT analysis data, for conversion to unsigned byte values — - * basically, this specifies the minimum value for the range of results when - * using getByteFrequencyData(). - */ + /** Is a double value representing the minimum power value in the scaling range for the FFT analysis data, for + * conversion to unsigned byte values — basically, this specifies the minimum value for the range of results when + * using getByteFrequencyData(). + */ var minDecibels: Double = js.native - /** Is a double value representing the maximum power value in the scaling - * range for the FFT analysis data, for conversion to unsigned byte values — - * basically, this specifies the maximum value for the range of results when - * using getByteFrequencyData(). - */ + /** Is a double value representing the maximum power value in the scaling range for the FFT analysis data, for + * conversion to unsigned byte values — basically, this specifies the maximum value for the range of results when + * using getByteFrequencyData(). + */ var maxDecibels: Double = js.native - /** Is a double value representing the averaging constant with the last - * analysis frame — basically, it makes the transition between values over - * time smoother. - */ + /** Is a double value representing the averaging constant with the last analysis frame — basically, it makes the + * transition between values over time smoother. + */ var smoothingTimeConstant: Double = js.native - /** Copies the current frequency data into a Float32Array array passed into - * it. - * - * If the array has fewer elements than the AnalyserNode.frequencyBinCount, - * excess elements are dropped. - * If it has more elements than needed, excess elements are ignored. - * - * @param array The Float32Array that the frequency domain data will be - * copied to. - */ - def getFloatFrequencyData( - array: js.typedarray.Float32Array): Unit = js.native - - /** Copies the current frequency data into a Uint8Array (unsigned byte - * array) passed into it. - * - * If the array has fewer elements than the AnalyserNode.frequencyBinCount, - * excess elements are dropped. - * If it has more elements than needed, excess elements are ignored. - * - * @param array The Uint8Array that the frequency domain data will be - * copied to. - */ + /** Copies the current frequency data into a Float32Array array passed into it. + * + * If the array has fewer elements than the AnalyserNode.frequencyBinCount, excess elements are dropped. If it has + * more elements than needed, excess elements are ignored. + * + * @param array + * The Float32Array that the frequency domain data will be copied to. + */ + def getFloatFrequencyData(array: js.typedarray.Float32Array): Unit = js.native + + /** Copies the current frequency data into a Uint8Array (unsigned byte array) passed into it. + * + * If the array has fewer elements than the AnalyserNode.frequencyBinCount, excess elements are dropped. If it has + * more elements than needed, excess elements are ignored. + * + * @param array + * The Uint8Array that the frequency domain data will be copied to. + */ def getByteFrequencyData(array: js.typedarray.Uint8Array): Unit = js.native - /** Copies the current waveform, or time-domain, data into a Float32Array - * array passed into it. - * - * If the array has fewer elements than the AnalyserNode.fftSize, excess - * elements are dropped. - * If it has more elements than needed, excess elements are ignored. - * - * @param array The Float32Array that the time domain data will be copied to. - */ - def getFloatTimeDomainData( - array: js.typedarray.Float32Array): Unit = js.native - - /** Copies the current waveform, or time-domain, data into a Uint8Array - * (unsigned byte array) passed into it. - * - * If the array has fewer elements than the AnalyserNode.fftSize, excess - * elements are dropped. - * If it has more elements than needed, excess elements are ignored. - * - * @param array The Uint8Array that the time domain data will be copied to. - */ + /** Copies the current waveform, or time-domain, data into a Float32Array array passed into it. + * + * If the array has fewer elements than the AnalyserNode.fftSize, excess elements are dropped. If it has more + * elements than needed, excess elements are ignored. + * + * @param array + * The Float32Array that the time domain data will be copied to. + */ + def getFloatTimeDomainData(array: js.typedarray.Float32Array): Unit = js.native + + /** Copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it. + * + * If the array has fewer elements than the AnalyserNode.fftSize, excess elements are dropped. If it has more + * elements than needed, excess elements are ignored. + * + * @param array + * The Uint8Array that the time domain data will be copied to. + */ def getByteTimeDomainData(array: js.typedarray.Uint8Array): Unit = js.native } -/** AudioBufferSourceNode has no input and exactly one output. The number of - * channels in the output corresponds to the number of channels of the - * AudioBuffer that is set to the AudioBufferSourceNode.buffer property. - * If there is no buffer set—that is, if the attribute's value is NULL—the - * output contains one channel consisting of silence. - * An AudioBufferSourceNode can only be played once; that is, only one call to - * AudioBufferSourceNode.start() is allowed. - * If the sound needs to be played again, another AudioBufferSourceNode has - * to be created. Those nodes are cheap to create, and AudioBuffers can be - * reused across plays. It is often said that AudioBufferSourceNodes have to be - * used in a "fire and forget" fashion: once it has been started, all - * references to the node can be dropped, and it will be garbage-collected - * automatically. - * - * Multiple calls to AudioBufferSourceNode.stop() are allowed. The most - * recent call replaces the previous one, granted the AudioBufferSourceNode - * has not already reached the end of the buffer. - * - * - Number of inputs: 0 - * - Number of outputs: 1 - * - Channel count: defined by the associated AudioBuffer - */ +/** AudioBufferSourceNode has no input and exactly one output. The number of channels in the output corresponds to the + * number of channels of the AudioBuffer that is set to the AudioBufferSourceNode.buffer property. If there is no + * buffer set—that is, if the attribute's value is NULL—the output contains one channel consisting of silence. An + * AudioBufferSourceNode can only be played once; that is, only one call to AudioBufferSourceNode.start() is allowed. + * If the sound needs to be played again, another AudioBufferSourceNode has to be created. Those nodes are cheap to + * create, and AudioBuffers can be reused across plays. It is often said that AudioBufferSourceNodes have to be used in + * a "fire and forget" fashion: once it has been started, all references to the node can be dropped, and it will be + * garbage-collected automatically. + * + * Multiple calls to AudioBufferSourceNode.stop() are allowed. The most recent call replaces the previous one, granted + * the AudioBufferSourceNode has not already reached the end of the buffer. + * + * - Number of inputs: 0 + * - Number of outputs: 1 + * - Channel count: defined by the associated AudioBuffer + */ @js.native trait AudioBufferSourceNode extends AudioNode { - /** Is an AudioBuffer that defines the audio asset to be played, or when - * set to the value null, defines a single channel of silence. - */ + /** Is an AudioBuffer that defines the audio asset to be played, or when set to the value null, defines a single + * channel of silence. + */ var buffer: AudioBuffer = js.native - /** Is an a-rate AudioParam that defines the speed factor at which the - * audio asset will be played. - * Since no pitch correction is applied on the output, this can be used to - * change the pitch of the sample. - */ + /** Is an a-rate AudioParam that defines the speed factor at which the audio asset will be played. Since no pitch + * correction is applied on the output, this can be used to change the pitch of the sample. + */ val playbackRate: AudioParam = js.native - /** Is a Boolean attribute indicating if the audio asset must be replayed - * when the end of the AudioBuffer is reached. - * Its default value is false. - */ + /** Is a Boolean attribute indicating if the audio asset must be replayed when the end of the AudioBuffer is reached. + * Its default value is false. + */ var loop: Boolean = js.native - /** Is a double value indicating, in seconds, where in the AudioBuffer the - * restart of the play must happen. - * Its default value is 0. - */ + /** Is a double value indicating, in seconds, where in the AudioBuffer the restart of the play must happen. Its + * default value is 0. + */ var loopStart: Double = js.native - /** Is a double value indicating, in seconds, where in the AudioBuffer the - * replay of the play must stop (and eventually loop again). - * Its default value is 0. - */ + /** Is a double value indicating, in seconds, where in the AudioBuffer the replay of the play must stop (and + * eventually loop again). Its default value is 0. + */ var loopEnd: Double = js.native /** Schedules the start of the playback of the audio asset. - * - * @param when The when parameter defines when the play will start. If - * when represents a time in the past, the play will start - * immediately. If the method is called more than one time, - * or after a call to AudioBufferSourceNode.stop(), an - * exception is raised. - * @param offset The offset parameter, which defaults to 0, defines - * where the playback will start. - * @param duration The duration parameter, which defaults to the length of - * the asset minus the value of offset, defines the length of - * the portion of the asset to be played. - */ - def start(when: Double = 0.0, offset: Double = 0.0, - duration: Double = js.native): Unit = js.native + * + * @param when + * The when parameter defines when the play will start. If when represents a time in the past, the play will start + * immediately. If the method is called more than one time, or after a call to AudioBufferSourceNode.stop(), an + * exception is raised. + * @param offset + * The offset parameter, which defaults to 0, defines where the playback will start. + * @param duration + * The duration parameter, which defaults to the length of the asset minus the value of offset, defines the length + * of the portion of the asset to be played. + */ + def start(when: Double = 0.0, offset: Double = 0.0, duration: Double = js.native): Unit = js.native /** Schedules the end of the playback of an audio asset. - * - * @param when The when parameter defines when the playback will stop. If - * it represents a time in the past, the playback will end - * immediately. If this method is called twice or more, an - * exception is raised. - */ + * + * @param when + * The when parameter defines when the playback will stop. If it represents a time in the past, the playback will + * end immediately. If this method is called twice or more, an exception is raised. + */ def stop(when: Double = 0.0): Unit = js.native - /** Is an EventHandler containing the callback associated with the ended - * event. - */ + /** Is an EventHandler containing the callback associated with the ended event. + */ var onended: js.Function1[Event, _] = js.native } -/** The AudioDestinationNode interface represents the end destination of an - * audio graph in a given context — usually the speakers of your device. - * It can also be the node that will "record" the audio data when used with an - * OfflineAudioContext. - * - * AudioDestinationNode has no output (as it is the output, no more AudioNode - * can be linked after it in the audio graph) and one input. - * The amount of channels in the input must be between 0 and the - * maxChannelCount value or an exception is raised. - * - * The AudioDestinationNode of a given AudioContext can be retrieved using - * the AudioContext.destination property. - * - * - Number of inputs: 1 - * - Number of outputs: 0 - * - Channel count mode: "explicit" - * - Channel count: 2 - * - Channel interpretation: "speakers" - */ +/** The AudioDestinationNode interface represents the end destination of an audio graph in a given context — usually the + * speakers of your device. It can also be the node that will "record" the audio data when used with an + * OfflineAudioContext. + * + * AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio + * graph) and one input. The amount of channels in the input must be between 0 and the maxChannelCount value or an + * exception is raised. + * + * The AudioDestinationNode of a given AudioContext can be retrieved using the AudioContext.destination property. + * + * - Number of inputs: 1 + * - Number of outputs: 0 + * - Channel count mode: "explicit" + * - Channel count: 2 + * - Channel interpretation: "speakers" + */ @js.native trait AudioDestinationNode extends AudioNode { - /** Is an unsigned long defining the maximum amount of channels that the - * physical device can handle. - */ + /** Is an unsigned long defining the maximum amount of channels that the physical device can handle. + */ var maxChannelCount: Int = js.native } -/** The AudioListener interface represents the position and orientation of - * the unique person listening to the audio scene, and is used in audio - * spatialisation. All PannerNodes spatialise in relation to the AudioListener - * stored in the AudioContext.listener attribute. - * - * It is important to note that there is only one listener per context and - * that it isn't an AudioNode. - */ +/** The AudioListener interface represents the position and orientation of the unique person listening to the audio + * scene, and is used in audio spatialisation. All PannerNodes spatialise in relation to the AudioListener stored in + * the AudioContext.listener attribute. + * + * It is important to note that there is only one listener per context and that it isn't an AudioNode. + */ @js.native trait AudioListener extends AudioNode { - /** Is a double value representing the amount of pitch shift to use when - * rendering a doppler effect. - */ + /** Is a double value representing the amount of pitch shift to use when rendering a doppler effect. + */ var dopplerFactor: Double = js.native /** Is a double value representing the speed of sound, in meters per second. - */ + */ var speedOfSound: Double = js.native /** Defines the position of the listener. - * - * The three parameters x, y and z are unitless and describe the listener's - * position in 3D space according to the right-hand Cartesian coordinate - * system. PannerNode objects use this position relative to individual audio - * sources for spatialisation. - * - * The default value of the position vector is (0, 0, 0). - * - * @param x The x position of the listener in 3D space. - * @param y The y position of the listener in 3D space. - * @param z The z position of the listener in 3D space. - */ - def setPosition(x: Double = 0.0, y: Double = 0.0, - z: Double = 0.0): Unit = js.native + * + * The three parameters x, y and z are unitless and describe the listener's position in 3D space according to the + * right-hand Cartesian coordinate system. PannerNode objects use this position relative to individual audio sources + * for spatialisation. + * + * The default value of the position vector is (0, 0, 0). + * + * @param x + * The x position of the listener in 3D space. + * @param y + * The y position of the listener in 3D space. + * @param z + * The z position of the listener in 3D space. + */ + def setPosition(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): Unit = js.native /** Defines the orientation of the listener. - * - * It consists of two direction vectors: - * - * - The front vector, defined by the three unitless parameters x, y and z, - * describes the direction of the face of the listener, that is the - * direction the nose of the person is pointing towards. - * The front vector's default value is (0, 0, -1). - * - The up vector, defined by three unitless parameters xUp, yUp and zUp, - * describes the direction of the top of the listener's head. - * The up vector's default value is (0, 1, 0). - * - * Both vectors must be separated by an angle of 90° — in linear analysis - * terms, they must be linearly independent. - * - * @param x The x value of the front vector of the listener. - * @param y The y value of the front vector of the listener. - * @param z The z value of the front vector of the listener. - * @param xUp The x value of the up vector of the listener. - * @param yUp The y value of the up vector of the listener. - * @param zUp The z value of the up vector of the listener. - */ - def setOrientation(x: Double = 0.0, y: Double = 0.0, z: Double = -1.0, - xUp: Double = 0.0, yUp: Double = 1.0, + * + * It consists of two direction vectors: + * + * - The front vector, defined by the three unitless parameters x, y and z, describes the direction of the face of + * the listener, that is the direction the nose of the person is pointing towards. The front vector's default + * value is (0, 0, -1). + * - The up vector, defined by three unitless parameters xUp, yUp and zUp, describes the direction of the top of + * the listener's head. The up vector's default value is (0, 1, 0). + * + * Both vectors must be separated by an angle of 90° — in linear analysis terms, they must be linearly independent. + * + * @param x + * The x value of the front vector of the listener. + * @param y + * The y value of the front vector of the listener. + * @param z + * The z value of the front vector of the listener. + * @param xUp + * The x value of the up vector of the listener. + * @param yUp + * The y value of the up vector of the listener. + * @param zUp + * The z value of the up vector of the listener. + */ + def setOrientation(x: Double = 0.0, y: Double = 0.0, z: Double = -1.0, xUp: Double = 0.0, yUp: Double = 1.0, zUp: Double = 0.0): Unit = js.native } -/** The AudioParam interface represents an audio-related parameter, usually a - * parameter of an AudioNode (such as GainNode.gain). An AudioParam can be set - * to a specific value or a change in value, and can be scheduled to happen at - * a specific time and following a specific pattern. - * - * There are two kinds of AudioParam, a-rate and k-rate parameters: - * - * - An a-rate AudioParam takes the current audio parameter value for each - * sample frame of the audio signal. - * - A k-rate AudioParam uses the same initial audio parameter value for the - * whole block processed, that is 128 sample frames. - * - * Each AudioNode defines which of its parameters are a-rate or k-rate in - * the spec. - * - * Each AudioParam has a list of events, initially empty, that define when - * and how values change. When this list is not empty, changes using the - * AudioParam.value attributes are ignored. This list of events allows us to - * schedule changes that have to happen at very precise times, using arbitrary - * timelime-based automation curves. - * The time used is the one defined in AudioContext.currentTime. - */ +/** The AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as + * GainNode.gain). An AudioParam can be set to a specific value or a change in value, and can be scheduled to happen at + * a specific time and following a specific pattern. + * + * There are two kinds of AudioParam, a-rate and k-rate parameters: + * + * - An a-rate AudioParam takes the current audio parameter value for each sample frame of the audio signal. + * - A k-rate AudioParam uses the same initial audio parameter value for the whole block processed, that is 128 + * sample frames. + * + * Each AudioNode defines which of its parameters are a-rate or k-rate in the spec. + * + * Each AudioParam has a list of events, initially empty, that define when and how values change. When this list is not + * empty, changes using the AudioParam.value attributes are ignored. This list of events allows us to schedule changes + * that have to happen at very precise times, using arbitrary timelime-based automation curves. The time used is the + * one defined in AudioContext.currentTime. + */ @js.native trait AudioParam extends AudioNode { - /** Represents the parameter's current floating point value; initially set - * to the value of AudioParam.defaultValue. - * Though it can be set, any modifications happening while there are - * automation events scheduled — that is events scheduled using the methods - * of the AudioParam — are ignored, without raising any exception. - */ + /** Represents the parameter's current floating point value; initially set to the value of AudioParam.defaultValue. + * Though it can be set, any modifications happening while there are automation events scheduled — that is events + * scheduled using the methods of the AudioParam — are ignored, without raising any exception. + */ var value: Double = js.native - /** Represents the initial value of the attributes as defined by the - * specific AudioNode creating the AudioParam. - */ + /** Represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam. + */ val defaultValue: Double = js.native - /** Schedules an instant change to the value of the AudioParam at a precise - * time, as measured against AudioContext.currentTime. - * The new value is given in the value parameter. - * - * @param value A floating point number representing the value the - * AudioParam will change to at the given time. - * @param startTime A double representing the exact time (in seconds) after - * the AudioContext was first created that the change in - * value will happen. - */ + /** Schedules an instant change to the value of the AudioParam at a precise time, as measured against + * AudioContext.currentTime. The new value is given in the value parameter. + * + * @param value + * A floating point number representing the value the AudioParam will change to at the given time. + * @param startTime + * A double representing the exact time (in seconds) after the AudioContext was first created that the change in + * value will happen. + */ def setValueAtTime(value: Double, startTime: Double): Unit = js.native - /** Schedules a gradual linear change in the value of the AudioParam. The - * change starts at the time specified for the previous event, follows a - * linear ramp to the new value given in the value parameter, and reaches the - * new value at the time given in the endTime parameter. - * - * @param value A floating point number representing the value the - * AudioParam will ramp up to by the given time. - * @param endTime A double representing the exact time (in seconds) after - * the ramping starts that the changing of the value will - * stop. - */ + /** Schedules a gradual linear change in the value of the AudioParam. The change starts at the time specified for the + * previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at + * the time given in the endTime parameter. + * + * @param value + * A floating point number representing the value the AudioParam will ramp up to by the given time. + * @param endTime + * A double representing the exact time (in seconds) after the ramping starts that the changing of the value will + * stop. + */ def linearRampToValueAtTime(value: Double, endTime: Double): Unit = js.native - /** Schedules a gradual exponential change in the value of the AudioParam. - * The change starts at the time specified for - * the previous event, follows an exponential ramp to the new value given - * in the value parameter, and reaches the new - * value at the time given in the endTime parameter. - * - * @param value A floating point number representing the value the - * AudioParam will ramp up to by the given time. - * @param endTime A double representing the exact time (in seconds) - * after the ramping starts that the changing of - * the value will stop. - */ - def exponentialRampToValueAtTime(value: Double, - endTime: Double): Unit = js.native - - /** Schedules the start of a change to the value of the AudioParam. The - * change starts at the time specified in startTime and exponentially moves - * towards the value given by the target parameter. The exponential decay - * rate is defined by the timeConstant parameter, which is a time measured in - * seconds. - * - * @param target The value the parameter will start to transition - * towards at the given start time. - * @param startTime The time that the exponential transition will begin, - * which will be relative to AudioContext.currentTime. - * @param timeConstant The time-constant value of first-order filter - * (exponential) approach to the target value. The larger - * this value is, the slower the transition will be. - */ - def setTargetAtTime(target: Double, startTime: Double, - timeConstant: Double): Unit = js.native - - /** Schedules the values of the AudioParam to follow a set of values, - * defined by the values Float32Array scaled to fit into the given interval, - * starting at startTime, and having a specific duration. - * - * @param values A Float32Array representing the value curve the - * AudioParam will change through along the duration. - * @param startTime A double representing the exact time (in seconds) after - * the AudioContext was first created that the change in - * value will happen. - * @param duration A double representing the exact time (in seconds) - * during which the values will be changed between. - * The values are spaced equally along this duration. - */ - def setValueCurveAtTime(values: js.typedarray.Float32Array, - startTime: Double, duration: Double): Unit = js.native + /** Schedules a gradual exponential change in the value of the AudioParam. The change starts at the time specified for + * the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new + * value at the time given in the endTime parameter. + * + * @param value + * A floating point number representing the value the AudioParam will ramp up to by the given time. + * @param endTime + * A double representing the exact time (in seconds) after the ramping starts that the changing of the value will + * stop. + */ + def exponentialRampToValueAtTime(value: Double, endTime: Double): Unit = js.native + + /** Schedules the start of a change to the value of the AudioParam. The change starts at the time specified in + * startTime and exponentially moves towards the value given by the target parameter. The exponential decay rate is + * defined by the timeConstant parameter, which is a time measured in seconds. + * + * @param target + * The value the parameter will start to transition towards at the given start time. + * @param startTime + * The time that the exponential transition will begin, which will be relative to AudioContext.currentTime. + * @param timeConstant + * The time-constant value of first-order filter (exponential) approach to the target value. The larger this value + * is, the slower the transition will be. + */ + def setTargetAtTime(target: Double, startTime: Double, timeConstant: Double): Unit = js.native + + /** Schedules the values of the AudioParam to follow a set of values, defined by the values Float32Array scaled to fit + * into the given interval, starting at startTime, and having a specific duration. + * + * @param values + * A Float32Array representing the value curve the AudioParam will change through along the duration. + * @param startTime + * A double representing the exact time (in seconds) after the AudioContext was first created that the change in + * value will happen. + * @param duration + * A double representing the exact time (in seconds) during which the values will be changed between. The values + * are spaced equally along this duration. + */ + def setValueCurveAtTime(values: js.typedarray.Float32Array, startTime: Double, duration: Double): Unit = js.native /** Cancels all scheduled future changes to the AudioParam. - * - * @param startTime A double representing the exact time (in seconds) - * after the AudioContext was first created after - * which all scheduled changes will be cancelled. - */ + * + * @param startTime + * A double representing the exact time (in seconds) after the AudioContext was first created after which all + * scheduled changes will be cancelled. + */ def cancelScheduledValues(startTime: Double): Unit = js.native } -/** The BiquadFilterNode interface represents a simple low-order filter, and - * is created using the AudioContext.createBiquadFilter() method. - * It is an AudioNode that can represent different kinds of filters, tone - * control devices, and graphic equalizers. - * A BiquadFilterNode always has exactly one input and one output. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "max" - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: "speakers" - */ +/** The BiquadFilterNode interface represents a simple low-order filter, and is created using the + * AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone + * control devices, and graphic equalizers. A BiquadFilterNode always has exactly one input and one output. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "max" + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: "speakers" + */ @js.native trait BiquadFilterNode extends AudioNode { - /** Is a k-rate AudioParam, a double representing a frequency in the - * current filtering algorithm measured in hertz (Hz). - */ + /** Is a k-rate AudioParam, a double representing a frequency in the current filtering algorithm measured in hertz + * (Hz). + */ val frequency: AudioParam = js.native /** Is an a-rate AudioParam representing detuning of the frequency in cents. - */ + */ val detune: AudioParam = js.native - /** Is a k-rate AudioParam, a double representing a Q factor, or quality - * factor. - */ + /** Is a k-rate AudioParam, a double representing a Q factor, or quality factor. + */ val Q: AudioParam = js.native - /** Is a k-rate AudioParam, a double representing the gain used in the - * current filtering algorithm. - */ + /** Is a k-rate AudioParam, a double representing the gain used in the current filtering algorithm. + */ val gain: AudioParam = js.native - /** Is a string value defining the kind of filtering algorithm the node is - * implementing. - */ + /** Is a string value defining the kind of filtering algorithm the node is implementing. + */ var `type`: String = js.native - /** From the current filter parameter settings this method calculates the - * frequency response for frequencies specified in the provided array of - * frequencies. - * - * @param frequencyHz A Float32Array containing hertz values that you - * want the frequency response for. - * @param magResponse A Float32Array that will contain the outputted - * magnitude of the frequency response for each - * inputted frequency (hertz) value. The magnitude - * values are unitless. - * @param phaseResponse A Float32Array that will contain the outputted - * phase of the frequency response for each inputted - * frequency (hertz) value, measured in radians. - */ - def getFrequencyResponse(frequencyHz: js.typedarray.Float32Array, - magResponse: js.typedarray.Float32Array, + /** From the current filter parameter settings this method calculates the frequency response for frequencies specified + * in the provided array of frequencies. + * + * @param frequencyHz + * A Float32Array containing hertz values that you want the frequency response for. + * @param magResponse + * A Float32Array that will contain the outputted magnitude of the frequency response for each inputted frequency + * (hertz) value. The magnitude values are unitless. + * @param phaseResponse + * A Float32Array that will contain the outputted phase of the frequency response for each inputted frequency + * (hertz) value, measured in radians. + */ + def getFrequencyResponse(frequencyHz: js.typedarray.Float32Array, magResponse: js.typedarray.Float32Array, phaseResponse: js.typedarray.Float32Array): Unit = js.native } -/** The ChannelMergerNode interface, often used in conjunction with its - * opposite, ChannelSplitterNode, reunites different mono inputs into a single - * output. Each input is used to fill a channel of the output. This is useful - * for accessing each channels separately, e.g. for performing channel mixing - * where gain must be separately controlled on each channel. - * - * If ChannelMergerNode has one single output, but as many inputs as there - * are channels to merge; the amount of inputs is defined as a parameter of its - * constructor and the call to AudioContext.createChannelMerger. - * In the case that no value is given, it will default to 6. - * - * Using a ChannelMergerNode, it is possible to create outputs with more - * channels than the rendering hardware is able to process. In that case, when - * the signal is sent to the AudioContext.listener object, supernumerary - * channels will be ignored. - * - * - Number of inputs: variable; default to 6. - * - Number of outputs: 1 - * - Channel count mode: "max" - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: "speakers" - */ +/** The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites + * different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for + * accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on + * each channel. + * + * If ChannelMergerNode has one single output, but as many inputs as there are channels to merge; the amount of inputs + * is defined as a parameter of its constructor and the call to AudioContext.createChannelMerger. In the case that no + * value is given, it will default to 6. + * + * Using a ChannelMergerNode, it is possible to create outputs with more channels than the rendering hardware is able + * to process. In that case, when the signal is sent to the AudioContext.listener object, supernumerary channels will + * be ignored. + * + * - Number of inputs: variable; default to 6. + * - Number of outputs: 1 + * - Channel count mode: "max" + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: "speakers" + */ @js.native trait ChannelMergerNode extends AudioNode -/** The ChannelSplitterNode interface, often used in conjunction with its - * opposite, ChannelMergerNode, separates the different channels of an audio - * source into a set of mono outputs. This is useful for accessing each channel - * separately, e.g. for performing channel mixing where gain must be separately - * controlled on each channel. - * - * If your ChannelSplitterNode always has one single input, the amount of - * outputs is defined by a parameter on its constructor and the call to - * AudioContext.createChannelSplitter(). In the case that no value is given, - * it will default to 6. If there are less channels in the input than there are - * outputs, supernumerary outputs are silent. - * - * - Number of inputs: 1 - * - Number of outputs: variable; default to 6. - * - Channel count mode: "max" - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: "speakers" - */ +/** The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the + * different channels of an audio source into a set of mono outputs. This is useful for accessing each channel + * separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. + * + * If your ChannelSplitterNode always has one single input, the amount of outputs is defined by a parameter on its + * constructor and the call to AudioContext.createChannelSplitter(). In the case that no value is given, it will + * default to 6. If there are less channels in the input than there are outputs, supernumerary outputs are silent. + * + * - Number of inputs: 1 + * - Number of outputs: variable; default to 6. + * - Channel count mode: "max" + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: "speakers" + */ @js.native trait ChannelSplitterNode extends AudioNode -/** The ConvolverNode interface is an AudioNode that performs a Linear - * Convolution on a given AudioBuffer, often used to achieve a reverb effect. - * A ConvolverNode always has exactly one input and one output. - * - * Note: For more information on the theory behind Linear Convolution, see - * the W3C Web Audio API spec section, Linear Effects Using Convolution, or - * read the The Wikipedia Linear Convolution Article. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "clamped-max" - * - Channel count: 2 - * - Channel interpretation: "speakers" - */ +/** The ConvolverNode interface is an AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to + * achieve a reverb effect. A ConvolverNode always has exactly one input and one output. + * + * Note: For more information on the theory behind Linear Convolution, see the W3C Web Audio API spec section, Linear + * Effects Using Convolution, or read the The Wikipedia Linear Convolution Article. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "clamped-max" + * - Channel count: 2 + * - Channel interpretation: "speakers" + */ @js.native trait ConvolverNode extends AudioNode { - /** A mono, stereo, or 4-channel AudioBuffer containing the (possibly - * multichannel) impulse response used by the ConvolverNode to create the - * reverb effect. - */ + /** A mono, stereo, or 4-channel AudioBuffer containing the (possibly multichannel) impulse response used by the + * ConvolverNode to create the reverb effect. + */ var buffer: AudioBuffer = js.native - /** A boolean that controls whether the impulse response from the buffer will - * be scaled by an equal-power normalization when the buffer attribute is - * set, or not. - */ + /** A boolean that controls whether the impulse response from the buffer will be scaled by an equal-power + * normalization when the buffer attribute is set, or not. + */ var normalize: Boolean = js.native } -/** The DelayNode interface represents a delay-line; an AudioNode - * audio-processing module that causes a delay between the arrival of an input - * data and its propagation to the output. - * A DelayNode always has exactly one input and one output, both with the same - * amount of channels. - * - * When creating a graph that has a cycle, it is mandatory to have at least one - * DelayNode in the cycle, or the nodes taking part in the cycle will be muted. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "max" - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: "speakers" - */ +/** The DelayNode interface represents a delay-line; an AudioNode audio-processing module that causes a delay between + * the arrival of an input data and its propagation to the output. A DelayNode always has exactly one input and one + * output, both with the same amount of channels. + * + * When creating a graph that has a cycle, it is mandatory to have at least one DelayNode in the cycle, or the nodes + * taking part in the cycle will be muted. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "max" + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: "speakers" + */ @js.native trait DelayNode extends AudioNode { @@ -891,74 +763,65 @@ trait DelayNode extends AudioNode { val delayTime: AudioParam = js.native } -/** The DynamicsCompressorNode interface provides a compression effect, which - * lowers the volume of the loudest parts of the signal in order to help - * prevent clipping and distortion that can occur when multiple sounds are - * played and multiplexed together at once. This is often used in musical - * production and game audio. DynamicsCompressorNode is an AudioNode that has - * exactly one input and one output; it is created using the - * AudioContext.createDynamicsCompressor method. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "explicit" - * - Channel count: 2 - * - Channel interpretation: "speakers" - */ +/** The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of + * the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and + * multiplexed together at once. This is often used in musical production and game audio. DynamicsCompressorNode is an + * AudioNode that has exactly one input and one output; it is created using the AudioContext.createDynamicsCompressor + * method. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "explicit" + * - Channel count: 2 + * - Channel interpretation: "speakers" + */ @js.native trait DynamicsCompressorNode extends AudioNode { - /** Is a k-rate AudioParam representing the decibel value above which the - * compression will start taking effect. - */ + /** Is a k-rate AudioParam representing the decibel value above which the compression will start taking effect. + */ val threshold: AudioParam = js.native - /** Is a k-rate AudioParam containing a decibel value representing the - * range above the threshold where the curve smoothly transitions to the - * compressed portion. - */ + /** Is a k-rate AudioParam containing a decibel value representing the range above the threshold where the curve + * smoothly transitions to the compressed portion. + */ val knee: AudioParam = js.native - /** Is a k-rate AudioParam representing the amount of change, in dB, needed - * in the input for a 1 dB change in the output. - */ + /** Is a k-rate AudioParam representing the amount of change, in dB, needed in the input for a 1 dB change in the + * output. + */ val ratio: AudioParam = js.native - /** Is a k-rate AudioParam representing the amount of gain reduction - * currently applied by the compressor to the signal. - */ + /** Is a k-rate AudioParam representing the amount of gain reduction currently applied by the compressor to the + * signal. + */ val reduction: AudioParam = js.native - /** Is a k-rate AudioParam representing the amount of time, in seconds, - * required to reduce the gain by 10 dB. - */ + /** Is a k-rate AudioParam representing the amount of time, in seconds, required to reduce the gain by 10 dB. + */ val attack: AudioParam = js.native - /** Is a k-rate AudioParam representing the amount of time, in seconds, - * required to increase the gain by 10 dB. - */ + /** Is a k-rate AudioParam representing the amount of time, in seconds, required to increase the gain by 10 dB. + */ val release: AudioParam = js.native } -/** The GainNode interface represents a change in volume. It is an AudioNode - * audio-processing module that causes a given gain to be applied to the input - * data before its propagation to the output. - * A GainNode always has exactly one input and one output, both with the same - * number of channels. - * - * The gain is a unitless value, changing with time, that is multiplied to - * each corresponding sample of all input channels. If modified, the new gain - * is applied using a de-zippering algorithm in order to prevent unaesthetic - * 'clicks' from appearing in the resulting audio. - * - * The GainNode is increasing the gain of the output. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "max" - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: "speakers" - */ +/** The GainNode interface represents a change in volume. It is an AudioNode audio-processing module that causes a given + * gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input + * and one output, both with the same number of channels. + * + * The gain is a unitless value, changing with time, that is multiplied to each corresponding sample of all input + * channels. If modified, the new gain is applied using a de-zippering algorithm in order to prevent unaesthetic + * 'clicks' from appearing in the resulting audio. + * + * The GainNode is increasing the gain of the output. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "max" + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: "speakers" + */ @js.native trait GainNode extends AudioNode { @@ -966,100 +829,88 @@ trait GainNode extends AudioNode { val gain: AudioParam = js.native } -/** The MediaElementAudioSourceNode interface represents an audio source - * consisting of an HTML5 <audio> or <video> element. - * It is an AudioNode that acts as an audio source. - * - * A MediaElementSourceNode has no inputs and exactly one output, and is - * created using the AudioContext.createMediaElementSource method. - * The amount of channels in the output equals the number of channels of the - * audio referenced by the HTMLMediaElement used in the creation of the node, - * or is 1 if the HTMLMediaElement has no audio. - * - * - Number of inputs: 0 - * - Number of outputs: 1 - * - Channel count: defined by the media in the HTMLMediaElement passed - * to the AudioContext.createMediaElementSource method - * that created it. - */ +/** The MediaElementAudioSourceNode interface represents an audio source consisting of an HTML5 <audio> or + * <video> element. It is an AudioNode that acts as an audio source. + * + * A MediaElementSourceNode has no inputs and exactly one output, and is created using the + * AudioContext.createMediaElementSource method. The amount of channels in the output equals the number of channels of + * the audio referenced by the HTMLMediaElement used in the creation of the node, or is 1 if the HTMLMediaElement has + * no audio. + * + * - Number of inputs: 0 + * - Number of outputs: 1 + * - Channel count: defined by the media in the HTMLMediaElement passed to the AudioContext.createMediaElementSource + * method that created it. + */ @js.native trait MediaElementAudioSourceNode extends AudioNode -/** The MediaElementAudioSourceNode interface represents an audio destination - * consisting of a WebRTC MediaStream with a single AudioMediaStreamTrack, - * which can be used in a similar way to a MediaStream obtained from - * Navigator.getUserMedia. - * - * It is an AudioNode that acts as an audio destination, created using the - * AudioContext.createMediaStreamDestination method. - * - * - Number of inputs: 1 - * - Number of outputs: 0 - * - Channel count: 2 - * - Channel count mode: "explicit" - * - Channel count interpretation: "speakers" - */ +/** The MediaElementAudioSourceNode interface represents an audio destination consisting of a WebRTC MediaStream with a + * single AudioMediaStreamTrack, which can be used in a similar way to a MediaStream obtained from + * Navigator.getUserMedia. + * + * It is an AudioNode that acts as an audio destination, created using the AudioContext.createMediaStreamDestination + * method. + * + * - Number of inputs: 1 + * - Number of outputs: 0 + * - Channel count: 2 + * - Channel count mode: "explicit" + * - Channel count interpretation: "speakers" + */ @js.native trait MediaStreamAudioDestinationNode extends AudioNode { - /** Is a MediaStream containing a single AudioMediaStreamTrack with the - * same number of channels as the node itself. - * You can use this property to get a stream out of the audio graph and - * feed it into another construct, such as a Media Recorder. - */ + /** Is a MediaStream containing a single AudioMediaStreamTrack with the same number of channels as the node itself. + * You can use this property to get a stream out of the audio graph and feed it into another construct, such as a + * Media Recorder. + */ var stream: MediaStream = js.native } -/** The MediaStreamAudioSourceNode interface represents an audio source - * consisting of a WebRTC MediaStream (such as a webcam or microphone). - * It is an AudioNode that acts as an audio source. - * - * A MediaElementSourceNode has no inputs and exactly one output, and is - * created using the AudioContext.createMediaStreamSource method. - * The amount of channels in the output equals the number of channels in - * AudioMediaStreamTrack. If there is no valid media stream, then the number - * of output channels will be one silent channel. - * - * - Number of inputs: 0 - * - Number of outputs: 1 - * - Channel count: defined by the AudioMediaStreamTrack passed to the - * AudioContext.createMediaStreamSource method that - * created it. - */ +/** The MediaStreamAudioSourceNode interface represents an audio source consisting of a WebRTC MediaStream (such as a + * webcam or microphone). It is an AudioNode that acts as an audio source. + * + * A MediaElementSourceNode has no inputs and exactly one output, and is created using the + * AudioContext.createMediaStreamSource method. The amount of channels in the output equals the number of channels in + * AudioMediaStreamTrack. If there is no valid media stream, then the number of output channels will be one silent + * channel. + * + * - Number of inputs: 0 + * - Number of outputs: 1 + * - Channel count: defined by the AudioMediaStreamTrack passed to the AudioContext.createMediaStreamSource method + * that created it. + */ @js.native trait MediaStreamAudioSourceNode extends AudioNode -/** The OscillatorNode interface represents a periodic waveform, like a sine - * wave. It is an AudioNode audio-processing module that causes a given - * frequency of sine wave to be created — in effect, a constant tone. - * - * An OscillatorNode is created using the AudioContext.createOscillator - * method. It always has exactly one output and no inputs, both with the same - * amount of channels. Its basic property defaults (see AudioNode for - * definitions) are: - * - * - Number of inputs: 0 - * - Number of outputs: 1 - * - Channel count mode: max - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: speakers - */ +/** The OscillatorNode interface represents a periodic waveform, like a sine wave. It is an AudioNode audio-processing + * module that causes a given frequency of sine wave to be created — in effect, a constant tone. + * + * An OscillatorNode is created using the AudioContext.createOscillator method. It always has exactly one output and no + * inputs, both with the same amount of channels. Its basic property defaults (see AudioNode for definitions) are: + * + * - Number of inputs: 0 + * - Number of outputs: 1 + * - Channel count mode: max + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: speakers + */ @js.native trait OscillatorNode extends AudioNode { - /** An a-rate AudioParam representing the frequency of oscillation in hertz - * (though the AudioParam returned is read-only, the value it represents is - * not.) - */ + /** An a-rate AudioParam representing the frequency of oscillation in hertz (though the AudioParam returned is + * read-only, the value it represents is not.) + */ var frequency: AudioParam = js.native - /** An a-rate AudioParam representing detuning of oscillation in cents (though - * the AudioParam returned is read-only, the value it represents is not.) - */ + /** An a-rate AudioParam representing detuning of oscillation in cents (though the AudioParam returned is read-only, + * the value it represents is not.) + */ var detune: AudioParam = js.native - /** Represents the shape of the oscillator wave generated. Different waves - * will produce different tones. */ + /** Represents the shape of the oscillator wave generated. Different waves will produce different tones. + */ var `type`: String = js.native // Not sure if this is correct ... /** This method specifies the exact time to start playing the tone. */ @@ -1068,146 +919,139 @@ trait OscillatorNode extends AudioNode { /** This method specifies the exact time to stop playing the tone. */ def stop(when: Double = 0.0): Unit = js.native - /** Used to point to a PeriodicWave defining a periodic waveform that can - * be used to shape the oscillator's output, when type = "custom" is used. - * - * This replaces the now-obsolete OscillatorNode.setWaveTable. - */ + /** Used to point to a PeriodicWave defining a periodic waveform that can be used to shape the oscillator's output, + * when type = "custom" is used. + * + * This replaces the now-obsolete OscillatorNode.setWaveTable. + */ def setPeriodicWave(wave: PeriodicWave): Unit = js.native - /** Used to set the event handler for the ended event, which fires when the - * tone has stopped playing. - */ + /** Used to set the event handler for the ended event, which fires when the tone has stopped playing. + */ var onended: js.Function1[Event, _] = js.native } -/** The PannerNode interface represents the position and behavior of an audio - * source signal in space. It is an AudioNode audio-processing module - * describing its position with right-hand Cartesian coordinates, its movement - * using a velocity vector and its directionality using a directionality cone. - * - * A PannerNode always has exactly one input and one output: the input can - * be mono or stereo but the output is always stereo (2 channels) — you need - * stereo sound for panning effects! - * - * The PannerNode brings a spatial position and velocity and a directionality - * for a given signal. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "clamped-max" - * - Channel count: 2 - * - Channel interpretation: "speakers" - */ +/** The PannerNode interface represents the position and behavior of an audio source signal in space. It is an AudioNode + * audio-processing module describing its position with right-hand Cartesian coordinates, its movement using a velocity + * vector and its directionality using a directionality cone. + * + * A PannerNode always has exactly one input and one output: the input can be mono or stereo but the output is always + * stereo (2 channels) — you need stereo sound for panning effects! + * + * The PannerNode brings a spatial position and velocity and a directionality for a given signal. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "clamped-max" + * - Channel count: 2 + * - Channel interpretation: "speakers" + */ @js.native trait PannerNode extends AudioNode { - /** Is an enumerated value determining which spatialisation algorithm to - * use to position the audio in 3D space. */ + /** Is an enumerated value determining which spatialisation algorithm to use to position the audio in 3D space. + */ var panningModel: String = js.native - /** Is an enumerated value determining which algorithm to use to reduce the - * volume of the audio source as it moves away from the listener. - */ + /** Is an enumerated value determining which algorithm to use to reduce the volume of the audio source as it moves + * away from the listener. + */ var distanceModel: String = js.native - /** Is a double value representing the reference distance for reducing - * volume as the audio source moves further from the listener. - */ + /** Is a double value representing the reference distance for reducing volume as the audio source moves further from + * the listener. + */ var refDistance: Double = js.native - /** Is a double value representing the maximum distance between the audio - * source and the listener, after which the volume is not reduced any further. - */ + /** Is a double value representing the maximum distance between the audio source and the listener, after which the + * volume is not reduced any further. + */ var maxDistance: Double = js.native - /** Is a double value describing how quickly the volume is reduced as the - * source moves away from the listener. - * This value is used by all distance models. - */ + /** Is a double value describing how quickly the volume is reduced as the source moves away from the listener. This + * value is used by all distance models. + */ var rolloffFactor: Double = js.native - /** Is a double value describing the angle, in degrees, of a cone inside of - * which there will be no volume reduction. - */ + /** Is a double value describing the angle, in degrees, of a cone inside of which there will be no volume reduction. + */ var coneInnerAngle: Double = js.native - /** Is a double value describing the angle, in degrees, of a cone outside - * of which the volume will be reduced by a constant value, defined by the - * coneOuterGain attribute. - */ + /** Is a double value describing the angle, in degrees, of a cone outside of which the volume will be reduced by a + * constant value, defined by the coneOuterGain attribute. + */ var coneOuterAngle: Double = js.native - /** Is a double value describing the amount of volume reduction outside the - * cone defined by the coneOuterAngle attribute. - * - * Its default value is 0, meaning that no sound can be heard. - */ + /** Is a double value describing the amount of volume reduction outside the cone defined by the coneOuterAngle + * attribute. + * + * Its default value is 0, meaning that no sound can be heard. + */ var coneOuterGain: Double = js.native - /** Defines the position of the audio source relative to the listener - * (represented by an AudioListener object stored in the - * AudioContext.listener attribute.) The three parameters x, y and z are - * unitless and describe the source's position in 3D space using the - * right-hand Cartesian coordinate system. - * - * The setPosition() method's default value of the position is (0, 0, 0). - * - * @param x The x position of the panner in 3D space. - * @param y The y position of the panner in 3D space. - * @param z The z position of the panner in 3D space. - */ - def setPosition(x: Double = 0.0, y: Double = 0.0, - z: Double = 0.0): Unit = js.native - - /** Defines the direction the audio source is playing in. - * This can have a big effect if the sound is very directional — - * controlled by the three cone-related attributes PannerNode.coneInnerAngle, - * PannerNode.coneOuterAngle, and PannerNode.coneOuterGain. In such a case, - * a sound pointing away from the listener can be very quiet or even silent. - * - * The three parameters x, y and z are unitless and describe a direction - * vector in 3D space using the right-hand Cartesian coordinate system. - * - * The default value of the direction vector is (1, 0, 0). - * - * @param x The x value of the panner's direction vector in 3D space. - * @param y The y value of the panner's direction vector in 3D space. - * @param z The z value of the panner's direction vector in 3D space. - */ - def setOrientation(x: Double = 1.0, y: Double = 0.0, - z: Double = 0.0): Unit = js.native - - /** Defines the velocity vector of the audio source — how fast it is moving - * and in what direction. - * - * The velocity relative to the listener is used to control the pitch change - * needed to conform with the Doppler effect due to the relative speed. - * - * As the vector controls both the direction of travel and its velocity, - * the three parameters x, y and z are expressed in meters per second. - * - * The default value of the velocity vector is (0, 0, 0). - * - * @param x The x value of the panner's velocity vector. - * @param y The y value of the panner's velocity vector. - * @param z The z value of the panner's velocity vector. - */ - def setVelocity(x: Double = 0.0, y: Double = 0.0, - z: Double = 0.0): Unit = js.native + /** Defines the position of the audio source relative to the listener (represented by an AudioListener object stored + * in the AudioContext.listener attribute.) The three parameters x, y and z are unitless and describe the source's + * position in 3D space using the right-hand Cartesian coordinate system. + * + * The setPosition() method's default value of the position is (0, 0, 0). + * + * @param x + * The x position of the panner in 3D space. + * @param y + * The y position of the panner in 3D space. + * @param z + * The z position of the panner in 3D space. + */ + def setPosition(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): Unit = js.native + + /** Defines the direction the audio source is playing in. This can have a big effect if the sound is very directional + * — controlled by the three cone-related attributes PannerNode.coneInnerAngle, PannerNode.coneOuterAngle, and + * PannerNode.coneOuterGain. In such a case, a sound pointing away from the listener can be very quiet or even + * silent. + * + * The three parameters x, y and z are unitless and describe a direction vector in 3D space using the right-hand + * Cartesian coordinate system. + * + * The default value of the direction vector is (1, 0, 0). + * + * @param x + * The x value of the panner's direction vector in 3D space. + * @param y + * The y value of the panner's direction vector in 3D space. + * @param z + * The z value of the panner's direction vector in 3D space. + */ + def setOrientation(x: Double = 1.0, y: Double = 0.0, z: Double = 0.0): Unit = js.native + + /** Defines the velocity vector of the audio source — how fast it is moving and in what direction. + * + * The velocity relative to the listener is used to control the pitch change needed to conform with the Doppler + * effect due to the relative speed. + * + * As the vector controls both the direction of travel and its velocity, the three parameters x, y and z are + * expressed in meters per second. + * + * The default value of the velocity vector is (0, 0, 0). + * + * @param x + * The x value of the panner's velocity vector. + * @param y + * The y value of the panner's velocity vector. + * @param z + * The z value of the panner's velocity vector. + */ + def setVelocity(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): Unit = js.native } -/** The StereoPannerNode interface of the Web Audio API represents a simple - * stereo panner node that can be used to pan an audio stream left or right. - * It is an AudioNode audio-processing module that positions an incoming audio - * stream in a stereo image using a low-cost equal-power panning algorithm. - * - * The pan property takes a unitless value between -1 (full left pan) and 1 - * (full right pan). - * - * This interface was introduced as a much simpler way to apply a simple - * panning effect than having to use a full PannerNode. - */ +/** The StereoPannerNode interface of the Web Audio API represents a simple stereo panner node that can be used to pan + * an audio stream left or right. It is an AudioNode audio-processing module that positions an incoming audio stream in + * a stereo image using a low-cost equal-power panning algorithm. + * + * The pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). + * + * This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full + * PannerNode. + */ @js.native trait StereoPannerNode extends AudioNode { @@ -1215,132 +1059,114 @@ trait StereoPannerNode extends AudioNode { val pan: AudioParam = js.native } -/** The WaveShaperNode interface represents a non-linear distorter. It is an - * AudioNode that uses a curve to apply a wave shaping distortion to the - * signal. Beside obvious distortion effects, it is often used to add a warm - * feeling to the signal. - * - * A WaveShaperNode always has exactly one input and one output. - * - * - Number of inputs: 1 - * - Number of outputs: 1 - * - Channel count mode: "max" - * - Channel count: 2 (not used in the default count mode) - * - Channel interpretation: "speakers" - */ +/** The WaveShaperNode interface represents a non-linear distorter. It is an AudioNode that uses a curve to apply a wave + * shaping distortion to the signal. Beside obvious distortion effects, it is often used to add a warm feeling to the + * signal. + * + * A WaveShaperNode always has exactly one input and one output. + * + * - Number of inputs: 1 + * - Number of outputs: 1 + * - Channel count mode: "max" + * - Channel count: 2 (not used in the default count mode) + * - Channel interpretation: "speakers" + */ @js.native trait WaveShaperNode extends AudioNode { /** Is a Float32Array of numbers describing the distortion to apply. */ var curve: js.typedarray.Float32Array = js.native - /** Is an enumerated value indicating if oversampling must be used. - * Oversampling is a technique for creating more samples (up-sampling) before - * applying the distortion effect to the audio signal. */ + /** Is an enumerated value indicating if oversampling must be used. Oversampling is a technique for creating more + * samples (up-sampling) before applying the distortion effect to the audio signal. + */ var oversample: String = js.native } -/** The AudioBuffer interface represents a short audio asset residing in - * memory, created from an audio file using the AudioContext.decodeAudioData() - * method, or from raw data using AudioContext.createBuffer(). Once put into an - * AudioBuffer, the audio can then be played by being passed into an - * AudioBufferSourceNode. - * - * Objects of these types are designed to hold small audio snippets, - * typically less than 45 s. For longer sounds, objects implementing the - * MediaElementAudioSourceNode are more suitable. - * - * The buffer contains data in the following format: non-interleaved IEEE754 - * 32-bit linear PCM with a nominal range between -1 and +1, that is, 32bits - * floating point buffer, with each samples between -1.0 and 1.0. If the - * AudioBuffer has multiple channels, they are stored in separate buffer. - */ +/** The AudioBuffer interface represents a short audio asset residing in memory, created from an audio file using the + * AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an + * AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. + * + * Objects of these types are designed to hold small audio snippets, typically less than 45 s. For longer sounds, + * objects implementing the MediaElementAudioSourceNode are more suitable. + * + * The buffer contains data in the following format: non-interleaved IEEE754 32-bit linear PCM with a nominal range + * between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. If the AudioBuffer + * has multiple channels, they are stored in separate buffer. + */ @js.native trait AudioBuffer extends js.Object { - /** Returns a float representing the sample rate, in samples per second, of - * the PCM data stored in the buffer. - */ + /** Returns a float representing the sample rate, in samples per second, of the PCM data stored in the buffer. + */ val sampleRate: Double = js.native - /** Returns an integer representing the length, in sample-frames, of the - * PCM data stored in the buffer. - */ + /** Returns an integer representing the length, in sample-frames, of the PCM data stored in the buffer. + */ val length: Int = js.native - /** Returns a double representing the duration, in seconds, of the PCM data - * stored in the buffer. - */ + /** Returns a double representing the duration, in seconds, of the PCM data stored in the buffer. + */ val duration: Double = js.native - /** Returns an integer representing the number of discrete audio channels - * described by the PCM data stored in the buffer. - */ + /** Returns an integer representing the number of discrete audio channels described by the PCM data stored in the + * buffer. + */ val numberOfChannels: Int = js.native - /** Returns a Float32Array containing the PCM data associated with the - * channel, defined by the channel parameter (with 0 representing the first - * channel). - * - * @param channel The channel property is an index representing the - * particular channel to get data for. An index value of 0 - * represents the first channel. If the channel index value is - * greater than of equal to AudioBuffer.numberOfChannels, an - * INDEX_SIZE_ERR exception will be thrown. - */ + /** Returns a Float32Array containing the PCM data associated with the channel, defined by the channel parameter (with + * 0 representing the first channel). + * + * @param channel + * The channel property is an index representing the particular channel to get data for. An index value of 0 + * represents the first channel. If the channel index value is greater than of equal to + * AudioBuffer.numberOfChannels, an INDEX_SIZE_ERR exception will be thrown. + */ def getChannelData(channel: Int): js.typedarray.Float32Array = js.native - /** Copies the samples from the specified channel of the AudioBuffer to the - * destination array. - * - * @param destination A Float32Array to copy the channel data to. - * @param channelNumber The channel number of the current AudioBuffer to - * copy the channel data from. If channelNumber is - * greater than or equal to AudioBuffer.numberOfChannels, - * an INDEX_SIZE_ERR will be thrown. - * @param startInChannel An optional offset to copy the data from. If - * startInChannel is greater than AudioBuffer.length, - * an INDEX_SIZE_ERR will be thrown. - */ - def copyFromChannel(destination: js.typedarray.Float32Array, - channelNumber: Int, startInChannel: Int): Unit = js.native - - /** Copies the samples to the specified channel of the AudioBuffer, from - * the source array. - * - * @param source A Float32Array that the channel data will be - * copied from. - * @param channelNumber The channel number of the current AudioBuffer to - * copy the channel data to. If channelNumber is - * greater than or equal to AudioBuffer.numberOfChannels, - * an INDEX_SIZE_ERR will be thrown. - * @param startInChannel An optional offset to copy the data to. If - * startInChannel is greater than AudioBuffer.length, - * an INDEX_SIZE_ERR will be thrown. - */ - def copyToChannel(source: js.typedarray.Float32Array, channelNumber: Int, + /** Copies the samples from the specified channel of the AudioBuffer to the destination array. + * + * @param destination + * A Float32Array to copy the channel data to. + * @param channelNumber + * The channel number of the current AudioBuffer to copy the channel data from. If channelNumber is greater than or + * equal to AudioBuffer.numberOfChannels, an INDEX_SIZE_ERR will be thrown. + * @param startInChannel + * An optional offset to copy the data from. If startInChannel is greater than AudioBuffer.length, an + * INDEX_SIZE_ERR will be thrown. + */ + def copyFromChannel(destination: js.typedarray.Float32Array, channelNumber: Int, startInChannel: Int): Unit = js.native + + /** Copies the samples to the specified channel of the AudioBuffer, from the source array. + * + * @param source + * A Float32Array that the channel data will be copied from. + * @param channelNumber + * The channel number of the current AudioBuffer to copy the channel data to. If channelNumber is greater than or + * equal to AudioBuffer.numberOfChannels, an INDEX_SIZE_ERR will be thrown. + * @param startInChannel + * An optional offset to copy the data to. If startInChannel is greater than AudioBuffer.length, an INDEX_SIZE_ERR + * will be thrown. + */ + def copyToChannel(source: js.typedarray.Float32Array, channelNumber: Int, startInChannel: Int): Unit = js.native } -/** The Web Audio API OfflineAudioCompletionEvent interface represents events - * that occur when the processing of an OfflineAudioContext is terminated. - * The complete event implements this interface. - */ +/** The Web Audio API OfflineAudioCompletionEvent interface represents events that occur when the processing of an + * OfflineAudioContext is terminated. The complete event implements this interface. + */ @js.native trait OfflineAudioCompletionEvent extends Event { - /** The buffer containing the result of the processing of an - * OfflineAudioContext. - */ + /** The buffer containing the result of the processing of an OfflineAudioContext. + */ val renderedBuffer: AudioBuffer = js.native } -/** The PeriodicWave interface defines a periodic waveform that can be used - * to shape the output of an OscillatorNode. - * - * PeriodicWave has no inputs or outputs; it is used to create custom - * oscillators via OscillatorNode.setPeriodicWave. The PeriodicWave itself is - * created/returned by AudioContext.createPeriodicWave. - */ +/** The PeriodicWave interface defines a periodic waveform that can be used to shape the output of an OscillatorNode. + * + * PeriodicWave has no inputs or outputs; it is used to create custom oscillators via OscillatorNode.setPeriodicWave. + * The PeriodicWave itself is created/returned by AudioContext.createPeriodicWave. + */ @js.native trait PeriodicWave extends js.Object diff --git a/src/main/scala/org/scalajs/dom/CSSTypes.scala b/src/main/scala/org/scalajs/dom/CSSTypes.scala index fe18e22d8..324be346f 100644 --- a/src/main/scala/org/scalajs/dom/CSSTypes.scala +++ b/src/main/scala/org/scalajs/dom/CSSTypes.scala @@ -1,12 +1,9 @@ -/** - * Documentation marked "MDN" is thanks to Mozilla Contributors - * at https://developer.mozilla.org/en-US/docs/Web/API and available - * under the Creative Commons Attribution-ShareAlike v2.5 or later. - * http://creativecommons.org/licenses/by-sa/2.5/ - * - * Everything else is under the MIT License - * http://opensource.org/licenses/MIT - */ +/** Documentation marked "MDN" is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and + * available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ package org.scalajs.dom import scala.scalajs.js @@ -16,30 +13,27 @@ import scala.scalajs.js.annotation._ @JSGlobal object CSS extends js.Object { - /** - * The CSS.supports() method returns a boolean value indicating if the browser supports a given CSS feature, or not. - * Allows to test the support of a pair property-value. - * - * MDN - */ + /** The CSS.supports() method returns a boolean value indicating if the browser supports a given CSS feature, or not. + * Allows to test the support of a pair property-value. + * + * MDN + */ def supports(propertyName: String, value: String): Boolean = js.native - /** - * The CSS.supports() method returns a boolean value indicating if the browser supports a given CSS feature, or not. - * Takes one parameter matching the condition of @supports. - * - * MDN - */ + /** The CSS.supports() method returns a boolean value indicating if the browser supports a given CSS feature, or not. + * Takes one parameter matching the condition of @supports. + * + * MDN + */ def supports(supportCondition: String): Boolean = js.native } -/** - * A CSSStyleDeclaration is an interface to the declaration block returned by the - * style property of a cssRule in a stylesheet, when the rule is a CSSStyleRule. - * - * MDN - */ +/** A CSSStyleDeclaration is an interface to the declaration block returned by the style property of a cssRule in a + * stylesheet, when the rule is a CSSStyleRule. + * + * MDN + */ @js.native @JSGlobal class CSSStyleDeclaration extends js.Object { @@ -208,8 +202,7 @@ class CSSStyleDeclaration extends js.Object { @scala.scalajs.js.annotation.JSBracketAccess def update(index: Int, v: String): Unit = js.native - def setProperty(propertyName: String, value: String, - priority: String = js.native): Unit = js.native + def setProperty(propertyName: String, value: String, priority: String = js.native): Unit = js.native var animationFillMode: String = js.native var floodColor: String = js.native @@ -253,12 +246,10 @@ class CSSStyleDeclaration extends js.Object { var transformStyle: String = js.native } -/** - * An object implementing the CSSStyleSheet interface represents a single CSS style - * sheet. - * - * MDN - */ +/** An object implementing the CSSStyleSheet interface represents a single CSS style sheet. + * + * MDN + */ @js.native @JSGlobal class CSSStyleSheet extends StyleSheet { @@ -269,93 +260,79 @@ class CSSStyleSheet extends StyleSheet { var readOnly: Boolean = js.native var cssText: String = js.native - /** - * If this style sheet is imported into the document using an `@import` rule, the - * ownerRule property will return that CSSImportRule, otherwise it returns null. - * - * MDN - */ + /** If this style sheet is imported into the document using an `@import` rule, the ownerRule property will return that + * CSSImportRule, otherwise it returns null. + * + * MDN + */ var ownerRule: CSSRule = js.native - /** - * Returns a CSSRuleList of the CSS rules in the style sheet. - * - * MDN - */ + /** Returns a CSSRuleList of the CSS rules in the style sheet. + * + * MDN + */ var cssRules: CSSRuleList = js.native var id: String = js.native def addImport(bstrURL: String, lIndex: Int = js.native): Int = js.native - def addPageRule(bstrSelector: String, bstrStyle: String, - lIndex: Int = js.native): Int = js.native + def addPageRule(bstrSelector: String, bstrStyle: String, lIndex: Int = js.native): Int = js.native - /** - * The CSSStyleSheet.insertRule() method inserts a new style rule into the current - * style sheet. - * - * MDN - */ + /** The CSSStyleSheet.insertRule() method inserts a new style rule into the current style sheet. + * + * MDN + */ def insertRule(rule: String, index: Int = js.native): Int = js.native def removeRule(lIndex: Int): Unit = js.native - /** - * Deletes a rule from the style sheet. - * - * MDN - */ + /** Deletes a rule from the style sheet. + * + * MDN + */ def deleteRule(index: Int = js.native): Unit = js.native - def addRule(bstrSelector: String, bstrStyle: String = js.native, - lIndex: Int = js.native): Int = js.native + def addRule(bstrSelector: String, bstrStyle: String = js.native, lIndex: Int = js.native): Int = js.native def removeImport(lIndex: Int): Unit = js.native } -/** - * CSSStyleRule represents a single CSS style rule. It implements the CSSRule - * interface with a type value of 1 (CSSRule.STYLE_RULE). - * - * MDN - */ +/** CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 + * (CSSRule.STYLE_RULE). + * + * MDN + */ @js.native @JSGlobal class CSSStyleRule extends CSSRule { - /** - * Gets/sets the textual representation of the selector for this rule, e.g. "h1,h2". - * - * MDN - */ + /** Gets/sets the textual representation of the selector for this rule, e.g. "h1,h2". + * + * MDN + */ var selectorText: String = js.native var readOnly: Boolean = js.native - /** - * Returns the CSSStyleDeclaration object for the rule. - * - * MDN - */ + /** Returns the CSSStyleDeclaration object for the rule. + * + * MDN + */ val style: CSSStyleDeclaration = js.native } -/** - * CSSMediaRule is an object representing a single CSS `@media` rule. It implements the - * CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule - * interface with a type value of 4 (CSSRule.MEDIA_RULE). - * - * MDN - */ +/** CSSMediaRule is an object representing a single CSS `@media` rule. It implements the CSSConditionRule interface, and + * therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). + * + * MDN + */ @js.native @JSGlobal class CSSMediaRule extends CSSRule { - /** - * Specifies a MediaList representing the intended destination medium for style - * information. - * - * MDN - */ + /** Specifies a MediaList representing the intended destination medium for style information. + * + * MDN + */ var media: MediaList = js.native var cssRules: CSSRuleList = js.native @@ -364,30 +341,26 @@ class CSSMediaRule extends CSSRule { def deleteRule(index: Int = js.native): Unit = js.native } -/** - * The CSSNamespaceRule interface describes an object representing a single CSS - * `@@namespace` at-rule. It implements the CSSRule interface, with a type value of 10 - * (CSSRule.NAMESPACE_RULE). - * - * MDN - */ +/** The CSSNamespaceRule interface describes an object representing a single CSS `@@namespace` at-rule. It implements + * the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). + * + * MDN + */ @js.native @JSGlobal class CSSNamespaceRule extends CSSRule { - /** - * Returns a DOMString containing the text of the URI of the given namespace. - * - * MDN - */ + /** Returns a DOMString containing the text of the URI of the given namespace. + * + * MDN + */ var namespaceURI: String = js.native - /** - * Returns a DOMString with the name of the prefix associated to this namespace. If - * there is no such prefix, returns  null. - * - * MDN - */ + /** Returns a DOMString with the name of the prefix associated to this namespace. If there is no such prefix, returns  + * null. + * + * MDN + */ var prefix: String = js.native } @@ -399,39 +372,33 @@ class CSSImportRule extends CSSRule { var media: MediaList = js.native } -/** - * An object implementing the CSSRule DOM interface represents a single CSS at-rule. - * References to a CSSRule-implementing object may be obtained by looking at a CSS - * style sheet's cssRules list. - * - * MDN - */ +/** An object implementing the CSSRule DOM interface represents a single CSS at-rule. References to a + * CSSRule-implementing object may be obtained by looking at a CSS style sheet's cssRules list. + * + * MDN + */ @js.native @JSGlobal class CSSRule extends js.Object { - /** - * cssText returns the actual text of the style rule. To be able to set a stylesheet rule - * dynamically, see Using dynamic styling information. - * - * MDN - */ + /** cssText returns the actual text of the style rule. To be able to set a stylesheet rule dynamically, see Using + * dynamic styling information. + * + * MDN + */ var cssText: String = js.native - /** - * parentStyleSheet returns the stylesheet object in which the current rule is - * defined. - * - * MDN - */ + /** parentStyleSheet returns the stylesheet object in which the current rule is defined. + * + * MDN + */ var parentStyleSheet: CSSStyleSheet = js.native - /** - * Returns the containing rule, otherwise null. E.g. if this rule is a style rule - * inside an `@media` block, the parent rule would be that CSSMediaRule. - * - * MDN - */ + /** Returns the containing rule, otherwise null. E.g. if this rule is a style rule inside an `@media` block, the + * parent rule would be that CSSMediaRule. + * + * MDN + */ var parentRule: CSSRule = js.native var `type`: Int = js.native var IMPORT_RULE: Int = js.native @@ -466,124 +433,105 @@ class CSSFontFaceRule extends CSSRule { var style: CSSStyleDeclaration = js.native } -/** - * CSSPageRule is an object representing a single CSS `@page` rule. It implements the - * CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). - * - * MDN - */ +/** CSSPageRule is an object representing a single CSS `@page` rule. It implements the CSSRule interface with a type + * value of 6 (CSSRule.PAGE_RULE). + * + * MDN + */ @js.native @JSGlobal class CSSPageRule extends CSSRule { var pseudoClass: String = js.native - /** - * Represents the text of the page selector associated with the at-rule. - * - * MDN - */ + /** Represents the text of the page selector associated with the at-rule. + * + * MDN + */ var selectorText: String = js.native var selector: String = js.native - /** - * Returns the declaration block associated with the at-rule. - * - * MDN - */ + /** Returns the declaration block associated with the at-rule. + * + * MDN + */ var style: CSSStyleDeclaration = js.native } -/** - * A CSSRuleList is an array-like object containing an ordered collection of CSSRule - * objects. - * - * MDN - */ +/** A CSSRuleList is an array-like object containing an ordered collection of CSSRule objects. + * + * MDN + */ @js.native @JSGlobal class CSSRuleList private[this] () extends DOMList[CSSRule] { def item(index: Int): CSSRule = js.native } -/** - * The CSSKeyframesRule interface describes an object representing a complete set - * of keyframes for a CSS animation. It corresponds to the contains of a whole - * `@@keyframes` at-rule. It implements the CSSRule interface with a type value of 7 - * (CSSRule.KEYFRAMES_RULE). - * - * MDN - */ +/** The CSSKeyframesRule interface describes an object representing a complete set of keyframes for a CSS animation. It + * corresponds to the contains of a whole `@@keyframes` at-rule. It implements the CSSRule interface with a type value + * of 7 (CSSRule.KEYFRAMES_RULE). + * + * MDN + */ @js.native @JSGlobal class CSSKeyframesRule extends CSSRule { - /** - * Represents the name of the animation, used by the animation-name property. - * - * MDN - */ + /** Represents the name of the animation, used by the animation-name property. + * + * MDN + */ var name: String = js.native - /** - * Returns a CSSRuleList of the CSS rules in the media rule. - * - * MDN - */ + /** Returns a CSSRuleList of the CSS rules in the media rule. + * + * MDN + */ var cssRules: CSSRuleList = js.native - /** - * Returns a keyframe rule corresponding to the given key. The key is a DOMString - * containing an index of the keyframe o be returned, resolving to a number between 0 - * and 1. If no such keyframe exists, findRule returns null. - * - * MDN - */ + /** Returns a keyframe rule corresponding to the given key. The key is a DOMString containing an index of the keyframe + * o be returned, resolving to a number between 0 and 1. If no such keyframe exists, findRule returns null. + * + * MDN + */ def findRule(rule: String): CSSKeyframeRule = js.native - /** - * Deletes a keyframe rule from the current CSSKeyframesRule. The parameter is the - * index of the keyframe to be deleted, expressed as a DOMString resolving as a number - * between 0 and 1. - * - * MDN - */ + /** Deletes a keyframe rule from the current CSSKeyframesRule. The parameter is the index of the keyframe to be + * deleted, expressed as a DOMString resolving as a number between 0 and 1. + * + * MDN + */ def deleteRule(rule: String): Unit = js.native - /** - * Inserts a new keyframe rule into the current CSSKeyframesRule. The parameter is a - * DOMString containing a keyframe in the same format as an entry of a `@keyframes` - * at-rule. If it contains more than one keyframe rule, a DOMException with a - * SYNTAX_ERR is thrown. - * - * MDN - */ + /** Inserts a new keyframe rule into the current CSSKeyframesRule. The parameter is a DOMString containing a keyframe + * in the same format as an entry of a `@keyframes` at-rule. If it contains more than one keyframe rule, a + * DOMException with a SYNTAX_ERR is thrown. + * + * MDN + */ def appendRule(rule: String): Unit = js.native } -/** - * The CSSKeyframeRule interface describes an object representing a set of style for - * a given keyframe. It corresponds to the contains of a single keyframe of a - * `@@keyframes` at-rule. It implements the CSSRule interface with a type value of 8 - * (CSSRule.KEYFRAME_RULE). - * - * MDN - */ +/** The CSSKeyframeRule interface describes an object representing a set of style for a given keyframe. It corresponds + * to the contains of a single keyframe of a `@@keyframes` at-rule. It implements the CSSRule interface with a type + * value of 8 (CSSRule.KEYFRAME_RULE). + * + * MDN + */ @js.native @JSGlobal class CSSKeyframeRule extends CSSRule { - /** - * Represents the key of the keyframe, like '10%', '75%'. The from keyword maps to '0%' - * and the to keyword maps to '100%'. - * - * MDN - */ + /** Represents the key of the keyframe, like '10%', '75%'. The from keyword maps to '0%' and the to keyword maps to + * '100%'. + * + * MDN + */ var keyText: String = js.native - /** - * Returns a CSSStyleDeclaration of the CSS style associated with the keyfrom. - * - * MDN - */ + /** Returns a CSSStyleDeclaration of the CSS style associated with the keyfrom. + * + * MDN + */ var style: CSSStyleDeclaration = js.native } diff --git a/src/main/scala/org/scalajs/dom/DeprecatedCSSAliases.scala b/src/main/scala/org/scalajs/dom/DeprecatedCSSAliases.scala index 4ce48c8f1..b6bb9c43d 100644 --- a/src/main/scala/org/scalajs/dom/DeprecatedCSSAliases.scala +++ b/src/main/scala/org/scalajs/dom/DeprecatedCSSAliases.scala @@ -2,35 +2,47 @@ package org.scalajs.dom import org.scalajs.dom -/** - * Short aliases of all the dom.CSSThing classes - */ +/** Short aliases of all the dom.CSSThing classes + */ @deprecated("directly use the dom.CSS* types and values instead", "2.0.0") object DeprecatedCSSAliases { + @deprecated("use dom.CSS instead", "2.0.0") @inline def CSS = dom.CSS + @deprecated("use dom.FontFaceRule instead", "2.0.0") type FontFaceRule = CSSFontFaceRule + @deprecated("use dom.ImportRule instead", "2.0.0") type ImportRule = CSSImportRule + @deprecated("use dom.KeyframeRule instead", "2.0.0") type KeyframeRule = CSSKeyframeRule + @deprecated("use dom.MediaRule instead", "2.0.0") type MediaRule = CSSMediaRule + @deprecated("use dom.NamespaceRule instead", "2.0.0") type NamespaceRule = CSSNamespaceRule + @deprecated("use dom.PageRule instead", "2.0.0") type PageRule = CSSPageRule + @deprecated("use dom.Rule instead", "2.0.0") type Rule = CSSRule + @deprecated("use dom.Rule instead", "2.0.0") @inline def Rule = CSSRule + @deprecated("use dom.RuleList instead", "2.0.0") type RuleList = CSSRuleList + @deprecated("use dom.StyleDeclaration instead", "2.0.0") type StyleDeclaration = CSSStyleDeclaration + @deprecated("use dom.StyleSheet instead", "2.0.0") type StyleSheet = CSSStyleSheet + @deprecated("use dom.StyleRule instead", "2.0.0") type StyleRule = CSSStyleRule } diff --git a/src/main/scala/org/scalajs/dom/Fetch.scala b/src/main/scala/org/scalajs/dom/Fetch.scala index 39adecfab..3417f7e48 100644 --- a/src/main/scala/org/scalajs/dom/Fetch.scala +++ b/src/main/scala/org/scalajs/dom/Fetch.scala @@ -8,46 +8,41 @@ import scala.scalajs.js.typedarray.{ArrayBuffer, Uint8Array} @JSGlobalScope object Fetch extends js.Object { - /** - * [[https://fetch.spec.whatwg.org/#fetch-method ¶6.0 Fetch method]] defined in WhatWG spec - * - * @param info - * @param init - * @return - */ - def fetch(info: RequestInfo, - init: RequestInit = null): js.Promise[Response] = js.native + /** [[https://fetch.spec.whatwg.org/#fetch-method ¶6.0 Fetch method]] defined in WhatWG spec + * + * @param info + * @param init + * @return + */ + def fetch(info: RequestInfo, init: RequestInit = null): js.Promise[Response] = js.native } -/** - * The Request interface of the Fetch API represents a resource request. MDN - * - * see [[https://fetch.spec.whatwg.org/#request-class ¶6.3 Request Class]] - * in whatwg spec - * - * @param input the url of the requested resource or an unused Request object. - * @param init initialisation information - */ +/** The Request interface of the Fetch API represents a resource request. MDN + * + * see [[https://fetch.spec.whatwg.org/#request-class ¶6.3 Request Class]] in whatwg spec + * + * @param input + * the url of the requested resource or an unused Request object. + * @param init + * initialisation information + */ @js.native @JSGlobal class Request(input: RequestInfo, init: RequestInit = null) extends js.Object { - /** - * Contains the request's method (GET, POST, etc.) - */ + /** Contains the request's method (GET, POST, etc.) + */ def method: HttpMethod = js.native @JSName("type") def `mediaType`: RequestType = js.native - /** - * Contains the URL of the request. - */ + /** Contains the URL of the request. + */ def url: String = js.native //should be USVString - /** - * Contains the associated Headers object of the request. - */ + /** Contains the associated Headers object of the request. + */ def headers: Headers = js.native def destination: RequestDestination = js.native @@ -71,11 +66,9 @@ class Request(input: RequestInfo, init: RequestInit = null) extends js.Object { def signal: AbortSignal = js.native } -/** - * See [[https://fetch.spec.whatwg.org/#requestinit RequestInit]] in Fetch API - * The underlying object is a dictionary. This trait is here to help encode - * the types. - */ +/** See [[https://fetch.spec.whatwg.org/#requestinit RequestInit]] in Fetch API The underlying object is a dictionary. + * This trait is here to help encode the types. + */ trait RequestInit extends js.Object { var method: js.UndefOr[HttpMethod] = js.undefined @@ -101,26 +94,24 @@ trait RequestInit extends js.Object { var signal: js.UndefOr[AbortSignal] = js.undefined - /** - * The whatwg spec section on [[https://fetch.spec.whatwg.org/#requestinit RequestInit dictionary]] - * has a comment that states that this value "can only be set to null". - * In the detailed steps section for [[https://fetch.spec.whatwg.org/#dom-request the Request(input,init) constructor]] - * it says even more clearly: - * "If init's window member is present and it is not null, throw a TypeError." - */ + /** The whatwg spec section on [[https://fetch.spec.whatwg.org/#requestinit RequestInit dictionary]] has a comment + * that states that this value "can only be set to null". In the detailed steps section for + * [[https://fetch.spec.whatwg.org/#dom-request the Request(input,init) constructor]] it says even more clearly: "If + * init's window member is present and it is not null, throw a TypeError." + */ var window: js.UndefOr[Null] = js.undefined } -/** - * [[https://fetch.spec.whatwg.org/#response ¶6.4 Response class]] in whatwg spec - * - * @param content optional content - * @param init optional response initialisiton - */ +/** [[https://fetch.spec.whatwg.org/#response ¶6.4 Response class]] in whatwg spec + * + * @param content + * optional content + * @param init + * optional response initialisiton + */ @js.native @JSGlobal -class Response(content: BodyInit = null, init: ResponseInit = null) - extends Body { +class Response(content: BodyInit = null, init: ResponseInit = null) extends Body { /** Contains the type of the response */ def `type`: ResponseType = js.native @@ -128,10 +119,8 @@ class Response(content: BodyInit = null, init: ResponseInit = null) /** Contains the URL of the response. */ def url: String = js.native - /** - * Contains a boolean stating whether the response was successful (status in - * the range 200-299) or not. - **/ + /** Contains a boolean stating whether the response was successful (status in the range 200-299) or not. + */ def ok: Boolean = js.native /** Contains the status code of the response (e.g., 200 for a success). */ @@ -148,170 +137,142 @@ class Response(content: BodyInit = null, init: ResponseInit = null) override def clone(): Response = js.native } -/** - * static methods associated with a Response object in - * [[https://fetch.spec.whatwg.org/#response ¶6.4 Response class]] of - * whatwg Fetch spec. - */ +/** static methods associated with a Response object in [[https://fetch.spec.whatwg.org/#response ¶6.4 Response class]] + * of whatwg Fetch spec. + */ @js.native @JSGlobal object Response extends js.Object { - /** - * @return a new Response object associated with a network error. - */ + /** @return + * a new Response object associated with a network error. + */ def error(): Response = js.native - /** - * @param url - * @param status redirect status - * @return a new Response - */ + /** @param url + * @param status + * redirect status + * @return + * a new Response + */ def redirect(url: String, status: Int = 302): Response = js.native } -/** - * See [[https://fetch.spec.whatwg.org/#response-class ¶6.4 Response class]] - * definition in whatwg Fetch spec. - * - */ +/** See [[https://fetch.spec.whatwg.org/#response-class ¶6.4 Response class]] definition in whatwg Fetch spec. + */ trait ResponseInit extends js.Object { var status: Int var statusText: ByteString var headers: HeadersInit } -/** - * See [[https://fetch.spec.whatwg.org/#body body interface]] in whatwg Fetch spec. - * - * see also [[https://developer.mozilla.org/en-US/docs/Web/API/Body Body]] in MDN - */ +/** See [[https://fetch.spec.whatwg.org/#body body interface]] in whatwg Fetch spec. + * + * see also [[https://developer.mozilla.org/en-US/docs/Web/API/Body Body]] in MDN + */ @js.native trait Body extends js.Object { - /** - * MDN: Contains a Boolean that indicates whether the body has been read. - */ + /** MDN: Contains a Boolean that indicates whether the body has been read. + */ def bodyUsed: Boolean = js.native - /** - * MDN: Takes a Response stream and reads it to completion. It returns a - * promise that resolves with an ArrayBuffer. - */ + /** MDN: Takes a Response stream and reads it to completion. It returns a promise that resolves with an ArrayBuffer. + */ def arrayBuffer(): js.Promise[ArrayBuffer] = js.native - /** - * Takes a Response stream and reads it to completion. It returns a - * promise that resolves with a Blob. - */ + /** Takes a Response stream and reads it to completion. It returns a promise that resolves with a Blob. + */ def blob(): js.Promise[Blob] = js.native - /** - * Takes a Response stream and reads it to completion. It returns a - * promise that resolves with a FormData object. - */ + /** Takes a Response stream and reads it to completion. It returns a promise that resolves with a FormData object. + */ def formData(): js.Promise[FormData] = js.native - /** - * Takes a Response stream and reads it to completion. It returns a - * promise that resolves with a JSON object. - * //todo: define the JSON type, and return a Promise[JSON] as per spec - */ + /** Takes a Response stream and reads it to completion. It returns a promise that resolves with a JSON object. //todo: + * define the JSON type, and return a Promise[JSON] as per spec + */ def json(): js.Promise[js.Any] = js.native - /** - * Takes a Response stream and reads it to completion. It returns a - * promise that resolves with a USVString (text). - */ + /** Takes a Response stream and reads it to completion. It returns a promise that resolves with a USVString (text). + */ def text(): js.Promise[String] = js.native } -/** - * [[https://fetch.spec.whatwg.org/#headers-class ¶6.1 Headers Class]] of whatwg spec - * - * The Headers interface of the Fetch API allows you to perform various actions - * on HTTP request and response headers. These actions include retrieving, setting, - * adding to, and removing. A Headers object has an associated header - * list, which is initially empty and consists of zero or more name and value pairs. - * You can add to this using methods like append() (see Examples.) In all methods of - * this interface, header names are matched by case-insensitive byte sequence. - * - * For security reasons, some headers can only be controller by the user agent. - * These headers include the forbidden header names and forbidden response header - * names. - * - * A Headers object also has an associated guard, which takes a value of immutable, - * request, request-no-cors, response, or none. This affects whether the set(), - * delete(), and append() methods will mutate the header. For more information - * see Guard. - * - * You can retrieve a Headers object via the Request.headers and Response.headers - * properties, and create a new Headers object using the Headers.Headers() constructor. - * - * MDN - */ +/** [[https://fetch.spec.whatwg.org/#headers-class ¶6.1 Headers Class]] of whatwg spec + * + * The Headers interface of the Fetch API allows you to perform various actions on HTTP request and response headers. + * These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, + * which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like + * append() (see Examples.) In all methods of this interface, header names are matched by case-insensitive byte + * sequence. + * + * For security reasons, some headers can only be controller by the user agent. These headers include the forbidden + * header names and forbidden response header names. + * + * A Headers object also has an associated guard, which takes a value of immutable, request, request-no-cors, response, + * or none. This affects whether the set(), delete(), and append() methods will mutate the header. For more information + * see Guard. + * + * You can retrieve a Headers object via the Request.headers and Response.headers properties, and create a new Headers + * object using the Headers.Headers() constructor. + * + * MDN + */ @js.native @JSGlobal -class Headers(map: HeadersInit = js.Array[js.Array[String]]()) - extends js.Iterable[js.Array[ByteString]] { +class Headers(map: HeadersInit = js.Array[js.Array[String]]()) extends js.Iterable[js.Array[ByteString]] { @JSName(js.Symbol.iterator) def jsIterator(): js.Iterator[js.Array[ByteString]] = js.native - /** - * The append() method of the Headers interface appends a new value onto an - * existing header inside a Headers object, or adds the header if it does - * not already exist. - * - * The difference between Headers.set and append() is that if the specified - * header already exists and accepts multiple values, Headers.set will overwrite - * the existing value with the new one, whereas append() will append the new - * value onto the end of the set of values. - */ + /** The append() method of the Headers interface appends a new value onto an existing header inside a Headers object, + * or adds the header if it does not already exist. + * + * The difference between Headers.set and append() is that if the specified header already exists and accepts + * multiple values, Headers.set will overwrite the existing value with the new one, whereas append() will append the + * new value onto the end of the set of values. + */ def append(name: ByteString, value: ByteString): Unit = js.native - /** - * The set() method of the Headers interface sets a new value for an existing - * header inside a Headers object, or adds the header if it does not already exist. - * - * The difference between set() and Headers.append is that if the specified - * header already exists and accepts multiple values, set() overwrites the - * existing value with the new one, whereas Headers.append appends the new - * value to the end of the set of values. - * - * Not all headers can be set. See the list of forbidden header names in - * https://fetch.spec.whatwg.org/#terminology-headers - */ + /** The set() method of the Headers interface sets a new value for an existing header inside a Headers object, or adds + * the header if it does not already exist. + * + * The difference between set() and Headers.append is that if the specified header already exists and accepts + * multiple values, set() overwrites the existing value with the new one, whereas Headers.append appends the new + * value to the end of the set of values. + * + * Not all headers can be set. See the list of forbidden header names in + * https://fetch.spec.whatwg.org/#terminology-headers + */ def set(name: ByteString, value: ByteString): Unit = js.native - /** - * The delete() method of the Headers interface deletes a header from the current Headers object. - */ + /** The delete() method of the Headers interface deletes a header from the current Headers object. + */ def delete(name: ByteString): Unit = js.native - /** - * The get() method of the Headers interface returns the first value of a given header from within a Headers object - * . If the requested header doesn't exist in the Headers object, the call returns null. - * - * @param name a ByteString, ie. only ASCII chars - */ + /** The get() method of the Headers interface returns the first value of a given header from within a Headers object . + * If the requested header doesn't exist in the Headers object, the call returns null. + * + * @param name + * a ByteString, ie. only ASCII chars + */ def get(name: ByteString): ByteString = js.native - /** - * The getAll() method of the Headers interface returns an array of all the - * values of a header within a Headers object with a given name. If the - * requested header doesn't exist in the Headers object, it returns an empty array. - * - * @param name a ByteString, ie. only ASCII chars - */ + /** The getAll() method of the Headers interface returns an array of all the values of a header within a Headers + * object with a given name. If the requested header doesn't exist in the Headers object, it returns an empty array. + * + * @param name + * a ByteString, ie. only ASCII chars + */ def getAll(name: ByteString): Sequence[ByteString] = js.native - /** - * The has() method of the Headers interface returns a boolean stating whether - * a Headers object contains a certain header. - * - * @param name a ByteString, ie. only ASCII chars - */ + /** The has() method of the Headers interface returns a boolean stating whether a Headers object contains a certain + * header. + * + * @param name + * a ByteString, ie. only ASCII chars + */ def has(name: ByteString): Boolean = js.native } @@ -321,18 +282,18 @@ sealed trait ReferrerPolicy extends js.Any object ReferrerPolicy { val empty = "".asInstanceOf[ReferrerPolicy] val `no-referrer` = "no-referrer".asInstanceOf[ReferrerPolicy] + val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy] val `origin-only` = "origin-only".asInstanceOf[ReferrerPolicy] + val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy] val `unsafe-url` = "unsafe-url".asInstanceOf[ReferrerPolicy] } -/** - * This is not typed in the Fetch API but it is easy to create the most common - * defaults. - */ +/** This is not typed in the Fetch API but it is easy to create the most common defaults. + */ @js.native trait HttpMethod extends js.Any @@ -347,9 +308,8 @@ object HttpMethod { val OPTIONS = "OPTIONS".asInstanceOf[HttpMethod] } -/** - * Fetch APIs [[https://fetch.spec.whatwg.org/#requesttype RequestType enum]] - */ +/** Fetch APIs [[https://fetch.spec.whatwg.org/#requesttype RequestType enum]] + */ @js.native sealed trait RequestType extends js.Any @@ -364,9 +324,8 @@ object RequestType { val video = "video".asInstanceOf[RequestType] } -/** - * Fetch APIs [[https://fetch.spec.whatwg.org/#requestdestination RequestDestination enum]] - */ +/** Fetch APIs [[https://fetch.spec.whatwg.org/#requestdestination RequestDestination enum]] + */ @js.native sealed trait RequestDestination extends js.Any @@ -379,9 +338,8 @@ object RequestDestination { val worker = "worker".asInstanceOf[RequestDestination] } -/** - * Fetch API's [[https://fetch.spec.whatwg.org/#requestmode RequestMode enum]] - */ +/** Fetch API's [[https://fetch.spec.whatwg.org/#requestmode RequestMode enum]] + */ @js.native sealed trait RequestMode extends js.Any @@ -392,9 +350,8 @@ object RequestMode { val cors = "cors".asInstanceOf[RequestMode] } -/** - * Fetch APIs [[https://fetch.spec.whatwg.org/#requestcredentials RequestCredentials enum]] - */ +/** Fetch APIs [[https://fetch.spec.whatwg.org/#requestcredentials RequestCredentials enum]] + */ @js.native sealed trait RequestCredentials extends js.Any @@ -404,9 +361,8 @@ object RequestCredentials { val include = "include".asInstanceOf[RequestCredentials] } -/** - * Fetch APIs [[https://fetch.spec.whatwg.org/#requestcache RequestCache enum]] - */ +/** Fetch APIs [[https://fetch.spec.whatwg.org/#requestcache RequestCache enum]] + */ @js.native sealed trait RequestCache extends js.Any @@ -419,9 +375,8 @@ object RequestCache { val `only-if-cached` = "only-if-cached".asInstanceOf[RequestCache] } -/** - * Fetch API's [[https://fetch.spec.whatwg.org/#requestredirect RequestRedirect enum]] - */ +/** Fetch API's [[https://fetch.spec.whatwg.org/#requestredirect RequestRedirect enum]] + */ @js.native sealed trait RequestRedirect extends js.Any @@ -434,9 +389,8 @@ object RequestRedirect { @js.native sealed trait ResponseType extends js.Any -/** - * see [[https://fetch.spec.whatwg.org/#responsetype]] of whatwg Fetch spec - */ +/** see [[https://fetch.spec.whatwg.org/#responsetype]] of whatwg Fetch spec + */ object ResponseType { val basic = "basic".asInstanceOf[ResponseType] val cors = "cors".asInstanceOf[ResponseType] diff --git a/src/main/scala/org/scalajs/dom/HTMLTypes.scala b/src/main/scala/org/scalajs/dom/HTMLTypes.scala index ce3dcd1c7..b5014a740 100644 --- a/src/main/scala/org/scalajs/dom/HTMLTypes.scala +++ b/src/main/scala/org/scalajs/dom/HTMLTypes.scala @@ -1,12 +1,9 @@ -/** - * Documentation marked "MDN" is thanks to Mozilla Contributors - * at https://developer.mozilla.org/en-US/docs/Web/API and available - * under the Creative Commons Attribution-ShareAlike v2.5 or later. - * http://creativecommons.org/licenses/by-sa/2.5/ - * - * Everything else is under the MIT License - * http://opensource.org/licenses/MIT - */ +/** Documentation marked "MDN" is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and + * available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ package org.scalajs.dom import org.scalajs.dom.experimental.mediastream.{MediaSource, MediaStream} @@ -18,282 +15,231 @@ import scala.scalajs.js.| @JSGlobal abstract class HTMLDocument extends Document { - /** - * Returns the title of the current document. - * - * MDN - */ + /** Returns the title of the current document. + * + * MDN + */ var title: String = js.native - /** - * Gets/sets the domain portion of the origin of the current document, as used by the - * same origin policy. - * - * MDN - */ + /** Gets/sets the domain portion of the origin of the current document, as used by the same origin policy. + * + * MDN + */ var domain: String = js.native - /** - * The Document.location property returns a Location object, which - * contains information about the URL of the document and provides methods for - * changing that URL and load another URL. - * - * MDN - */ + /** The Document.location property returns a Location object, which contains information about the URL of the document + * and provides methods for changing that URL and load another URL. + * + * MDN + */ var location: Location = js.native - /** - * Returns a string containing the URL of the current document. - * - * MDN - */ + /** Returns a string containing the URL of the current document. + * + * MDN + */ def URL: String = js.native - /** - * Returns the URI of the page that linked to this page. - * - * MDN - */ + /** Returns the URI of the page that linked to this page. + * + * MDN + */ def referrer: String = js.native - /** - * Returns a semicolon-separated list of the cookies for that document or sets a - * single cookie. - * - * MDN - */ + /** Returns a semicolon-separated list of the cookies for that document or sets a single cookie. + * + * MDN + */ var cookie: String = js.native - /** - * The Document.dir property is a DOMString representing the directionality of the - * text of the document, whether left to right (default) or right to left. Possible - * values are 'rtl', right to left, and 'ltr', left to right. - * - * MDN - */ + /** The Document.dir property is a DOMString representing the directionality of the text of the document, whether left + * to right (default) or right to left. Possible values are 'rtl', right to left, and 'ltr', left to right. + * + * MDN + */ var dir: String = js.native - /** - * Can be used to make any document editable, for example in a <iframe />: - * - * MDN - */ + /** Can be used to make any document editable, for example in a <iframe />: + * + * MDN + */ var designMode: String = js.native - /** - * Indicates whether the document is rendered in Quirks mode or Strict mode. - * - * MDN - */ + /** Indicates whether the document is rendered in Quirks mode or Strict mode. + * + * MDN + */ def compatMode: String = js.native - /** - * Returns "loading" while the document is loading, "interactive" once it is - * finished parsing but still loading sub-resources, and "complete" once it has - * loaded. - * - * MDN - */ + /** Returns "loading" while the document is loading, "interactive" once it is finished parsing but still loading + * sub-resources, and "complete" once it has loaded. + * + * MDN + */ def readyState: String = js.native var uniqueID: String = js.native - /** - * In browsers returns the window object associated with the document or null if none - * available. - * - * MDN - */ + /** In browsers returns the window object associated with the document or null if none available. + * + * MDN + */ def defaultView: Window = js.native - /** - * Returns the <head> element of the current document. If there are more than one - * <head> elements, the first one is returned. - * - * MDN - */ + /** Returns the <head> element of the current document. If there are more than one <head> elements, the + * first one is returned. + * + * MDN + */ def head: HTMLHeadElement = js.native - /** - * Returns the <body> or <frameset> node of the current document, or null if no such - * element exists. - * - * MDN - */ + /** Returns the <body> or <frameset> node of the current document, or null if no such element exists. + * + * MDN + */ var body: HTMLElement = js.native - /** - * Returns the currently focused element, that is, the element that will get - * keystroke events if the user types any. This attribute is read only. - * - * MDN - */ + /** Returns the currently focused element, that is, the element that will get keystroke events if the user types any. + * This attribute is read only. + * + * MDN + */ def activeElement: Element = js.native - /** - * Returns a list of the embedded <embed> elements within the current document. - * - * MDN - */ + /** Returns a list of the embedded <embed> elements within the current document. + * + * MDN + */ def embeds: HTMLCollection = js.native - /** - * forms returns a collection (an HTMLCollection) of the form elements within the - * current document. - * - * MDN - */ + /** forms returns a collection (an HTMLCollection) of the form elements within the current document. + * + * MDN + */ def forms: HTMLCollection = js.native - /** - * The links property returns a collection of all AREA elements and anchor elements in - * a document with a value for the href attribute. - * - * MDN - */ + /** The links property returns a collection of all AREA elements and anchor elements in a document with a value for + * the href attribute. + * + * MDN + */ def links: HTMLCollection = js.native - /** - * anchors returns a list of all of the anchors in the document. - * - * MDN - */ + /** anchors returns a list of all of the anchors in the document. + * + * MDN + */ def anchors: HTMLCollection = js.native - /** - * Returns an HTMLCollection object containing one or more HTMLEmbedElements or - * null which represent the <embed> elements in the current document. - * - * MDN - */ + /** Returns an HTMLCollection object containing one or more HTMLEmbedElements or null which represent the + * <embed> elements in the current document. + * + * MDN + */ def plugins: HTMLCollection = js.native - /** - * document.images returns a collection of the images in the current HTML document. - * - * MDN - */ + /** document.images returns a collection of the images in the current HTML document. + * + * MDN + */ def images: HTMLCollection = js.native - /** - * Returns the current value of the current range for a formatting command. - * - * MDN - */ + /** Returns the current value of the current range for a formatting command. + * + * MDN + */ def queryCommandValue(commandId: String): String = js.native - /** - * Returns true if the formatting command is in an indeterminate state on the current - * range. - * - * MDN - */ + /** Returns true if the formatting command is in an indeterminate state on the current range. + * + * MDN + */ def queryCommandIndeterm(commandId: String): Boolean = js.native - /** - * This method never did anything but throw an exception, and was removed in Gecko 14.0 - * (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11). - * - * MDN - */ + /** This method never did anything but throw an exception, and was removed in Gecko 14.0 (Firefox 14.0 / Thunderbird + * 14.0 / SeaMonkey 2.11). + * + * MDN + */ def queryCommandText(commandId: String): String = js.native - /** - * Reports whether or not the specified editor query command is supported by the - * browser. - * - * MDN - */ + /** Reports whether or not the specified editor query command is supported by the browser. + * + * MDN + */ def queryCommandSupported(commandId: String): Boolean = js.native - /** - * Returns true if the formatting command can be executed on the current range. - * - * MDN - */ + /** Returns true if the formatting command can be executed on the current range. + * + * MDN + */ def queryCommandEnabled(commandId: String): Boolean = js.native - /** - * Returns true if the formatting command has been executed on the current range. - * - * MDN - */ + /** Returns true if the formatting command has been executed on the current range. + * + * MDN + */ def queryCommandState(commandId: String): Boolean = js.native - /** - * When an HTML document has been switched to designMode, the document object exposes - * the execCommand method which allows one to run commands to manipulate the - * contents of the editable region. Most commands affect the document's selection - * (bold, italics, etc), while others insert new elements (adding a link) or affect an - * entire line (indenting). When using contentEditable, - * calling execCommand will affect the currently active editable element. - * - * MDN - */ - def execCommand(commandId: String, showUI: Boolean = js.native, - value: js.Any = js.native): Boolean = js.native - - /** - * This method never did anything and always threw an exception, so it was removed in - * Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11). - * - * MDN - */ + /** When an HTML document has been switched to designMode, the document object exposes the execCommand method which + * allows one to run commands to manipulate the contents of the editable region. Most commands affect the document's + * selection (bold, italics, etc), while others insert new elements (adding a link) or affect an entire line + * (indenting). When using contentEditable, calling execCommand will affect the currently active editable element. + * + * MDN + */ + def execCommand(commandId: String, showUI: Boolean = js.native, value: js.Any = js.native): Boolean = js.native + + /** This method never did anything and always threw an exception, so it was removed in Gecko 14.0 (Firefox 14.0 / + * Thunderbird 14.0 / SeaMonkey 2.11). + * + * MDN + */ def execCommandShowHelp(commandId: String): Boolean = js.native - /** - * Writes a string of text to a document stream opened by document.open(). - * - * MDN - */ + /** Writes a string of text to a document stream opened by document.open(). + * + * MDN + */ def write(content: String*): Unit = js.native - /** - * Writes a string of text followed by a newline character to a document. - * - * MDN - */ + /** Writes a string of text followed by a newline character to a document. + * + * MDN + */ def writeln(content: String*): Unit = js.native - /** - * The document.open() method opens a document for writing. - * - * MDN - */ - def open(url: String = js.native, name: String = js.native, - features: String = js.native, + /** The document.open() method opens a document for writing. + * + * MDN + */ + def open(url: String = js.native, name: String = js.native, features: String = js.native, replace: Boolean = js.native): js.Dynamic = js.native - /** - * The document.close() method finishes writing to a document, opened with - * document.open(). - * - * MDN - */ + /** The document.close() method finishes writing to a document, opened with document.open(). + * + * MDN + */ def close(): Unit = js.native def updateSettings(): Unit = js.native - def fireEvent(eventName: String, - eventObj: js.Any = js.native): Boolean = js.native + def fireEvent(eventName: String, eventObj: js.Any = js.native): Boolean = js.native def focus(): Unit = js.native - /** - * Returns a Boolean value indicating whether the document or any element inside the - * document has focus. This method can be used to determine whether the active element - * in a document has focus. - * - * MDN - */ + /** Returns a Boolean value indicating whether the document or any element inside the document has focus. This method + * can be used to determine whether the active element in a document has focus. + * + * MDN + */ def hasFocus(): Boolean = js.native - /** - * The DOM getSelection() method is available on the Window and Document interfaces. - * See window.getSelection() for details. - * - * MDN - */ + /** The DOM getSelection() method is available on the Window and Document interfaces. See window.getSelection() for + * details. + * + * MDN + */ def getSelection(): Selection = js.native var onbeforeactivate: js.Function1[UIEvent, _] = js.native @@ -308,25 +254,22 @@ abstract class HTMLDocument extends Document { var onload: js.Function1[Event, _] = js.native - /** - * The onchange property sets and returns the event handler for the change event. - * - * MDN - */ + /** The onchange property sets and returns the event handler for the change event. + * + * MDN + */ var onchange: js.Function1[Event, _] = js.native - /** - * Returns the event handling code for the readystatechange event. - * - * MDN - */ + /** Returns the event handling code for the readystatechange event. + * + * MDN + */ var onreadystatechange: js.Function1[Event, _] = js.native - /** - * The submit event is raised when the user clicks a submit button in a form - * - * MDN - */ + /** The submit event is raised when the user clicks a submit button in a form + * + * MDN + */ var onsubmit: js.Function1[Event, _] = js.native var onfocus: js.Function1[FocusEvent, _] = js.native @@ -345,57 +288,49 @@ abstract class HTMLDocument extends Document { var oninput: js.Function1[Event, _] = js.native - /** - * The keydown event is raised when the user presses a keyboard key. - * - * MDN - */ + /** The keydown event is raised when the user presses a keyboard key. + * + * MDN + */ var onkeydown: js.Function1[KeyboardEvent, _] = js.native - /** - * The keyup event is raised when the user releases a key that's been pressed. - * - * MDN - */ + /** The keyup event is raised when the user releases a key that's been pressed. + * + * MDN + */ var onkeyup: js.Function1[KeyboardEvent, _] = js.native var onkeypress: js.Function1[KeyboardEvent, _] = js.native - /** - * The onclick property returns the onClick event handler code on the current element. - * - * MDN - */ + /** The onclick property returns the onClick event handler code on the current element. + * + * MDN + */ var onclick: js.Function1[MouseEvent, _] = js.native var ondblclick: js.Function1[MouseEvent, _] = js.native var onmouseup: js.Function1[MouseEvent, _] = js.native - /** - * The mouseover event is raised when the user moves the mouse over a - * particular element. - * - * MDN - */ + /** The mouseover event is raised when the user moves the mouse over a particular element. + * + * MDN + */ var onmouseover: js.Function1[MouseEvent, _] = js.native - /** - * The mousedown event is raised when the user presses the mouse button. - * - * MDN - */ + /** The mousedown event is raised when the user presses the mouse button. + * + * MDN + */ var onmousedown: js.Function1[MouseEvent, _] = js.native var onmousemove: js.Function1[MouseEvent, _] = js.native - /** - * The mouseout event is raised when the mouse leaves an element (e.g, when the - * mouse moves off of an image in the web page, the mouseout event is raised for - * that image element). - * - * MDN - */ + /** The mouseout event is raised when the mouse leaves an element (e.g, when the mouse moves off of an image in the + * web page, the mouseout event is raised for that image element). + * + * MDN + */ var onmouseout: js.Function1[MouseEvent, _] = js.native var onmousewheel: js.Function1[WheelEvent, _] = js.native @@ -404,48 +339,40 @@ abstract class HTMLDocument extends Document { var onscroll: js.Function1[UIEvent, _] = js.native - /** - * Called periodically throughout the drag and drop operation. - * - * MDN - */ + /** Called periodically throughout the drag and drop operation. + * + * MDN + */ var ondrag: js.Function1[DragEvent, _] = js.native - /** - * Called for an element when the mouse pointer first moves over the element - * while something is being dragged. This might be used to change the - * appearance of the element to indicate to the user that the object can be - * dropped on it. - * - * MDN - */ + /** Called for an element when the mouse pointer first moves over the element while something is being dragged. This + * might be used to change the appearance of the element to indicate to the user that the object can be dropped on + * it. + * + * MDN + */ var ondragenter: js.Function1[DragEvent, _] = js.native var ondragleave: js.Function1[DragEvent, _] = js.native - /** - * This event handler is called for an element when something is being dragged - * over top of it. If the object can be dropped on the element, the drag - * session should be notified. - * - * MDN - */ + /** This event handler is called for an element when something is being dragged over top of it. If the object can be + * dropped on the element, the drag session should be notified. + * + * MDN + */ var ondragover: js.Function1[DragEvent, _] = js.native - /** - * An alias for ondraggesture; this is the HTML 5 spec name for the event and - * may be used in HTML or XUL; however, for backward compatibility with older - * versions of Firefox, you may wish to continue using ondraggesture in XUL. - * - * MDN - */ + /** An alias for ondraggesture; this is the HTML 5 spec name for the event and may be used in HTML or XUL; however, + * for backward compatibility with older versions of Firefox, you may wish to continue using ondraggesture in XUL. + * + * MDN + */ var ondragstart: js.Function1[DragEvent, _] = js.native - /** - * Called when the drag operation is finished. - * - * MDN - */ + /** Called when the drag operation is finished. + * + * MDN + */ var ondragend: js.Function1[DragEvent, _] = js.native var ondrop: js.Function1[DragEvent, _] = js.native @@ -502,390 +429,319 @@ abstract class HTMLDocument extends Document { var onstoragecommit: js.Function1[StorageEvent, _] = js.native - /** - * fired when a pointing device is moved into an element's hit test boundaries. - * - * MDN - */ + /** fired when a pointing device is moved into an element's hit test boundaries. + * + * MDN + */ var onpointerover: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointing device is moved into the hit test boundaries of an element - * or one of its descendants, including as a result of a pointerdown event - * from a device that does not support hover (see pointerdown). - * - * MDN - */ + /** fired when a pointing device is moved into the hit test boundaries of an element or one of its descendants, + * including as a result of a pointerdown event from a device that does not support hover (see pointerdown). + * + * MDN + */ var onpointerenter: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer becomes active. - * - * MDN - */ + /** fired when a pointer becomes active. + * + * MDN + */ var onpointerdown: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer changes coordinates. - * - * MDN - */ + /** fired when a pointer changes coordinates. + * + * MDN + */ var onpointermove: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer is no longer active. - * - * MDN - */ + /** fired when a pointer is no longer active. + * + * MDN + */ var onpointerup: js.Function1[PointerEvent, _] = js.native - /** - * a browser fires this event if it concludes the pointer will no longer be able - * to generate events (for example the related device is deactived). - * - * MDN - */ + /** a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the + * related device is deactived). + * + * MDN + */ var onpointercancel: js.Function1[PointerEvent, _] = js.native - /** - * fired for several reasons including: pointing device is moved out of - * the hit test boundaries of an element; - * firing the pointerup event for a device that does not support hover (see pointerup); - * after firing the pointercancel event (see pointercancel); - * when a pen stylus leaves the hover range detectable by the digitizer. - * - * MDN - */ + /** fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing + * the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event + * (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. + * + * MDN + */ var onpointerout: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointing device is moved out of the hit test boundaries of an element. - * For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. - * - * MDN - */ + /** fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is + * fired when the stylus leaves the hover range detectable by the digitizer. + * + * MDN + */ var onpointerleave: js.Function1[PointerEvent, _] = js.native - /** - * fired when an element receives pointer capture. - * - * MDN - */ + /** fired when an element receives pointer capture. + * + * MDN + */ var gotpointercapture: js.Function1[PointerEvent, _] = js.native - /** - * Fired after pointer capture is released for a pointer. - * - * MDN - */ + /** Fired after pointer capture is released for a pointer. + * + * MDN + */ var lostpointercapture: js.Function1[PointerEvent, _] = js.native } -/** - * The HTMLTableElement interface provides special properties and methods (beyond - * the regular HTMLElement object interface it also has available to it by - * inheritance) for manipulating the layout and presentation of tables in an HTML - * document. - * - * MDN - */ +/** The HTMLTableElement interface provides special properties and methods (beyond the regular HTMLElement object + * interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an + * HTML document. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLTableElement extends HTMLElement { - /** - * Is an HTMLTableSectionElement representing the first <tfoot> that is a child of - * the element, or null if none is found. When set, if the object doesn't represent a - * <tfoot>, a DOMException with the HierarchyRequestError name is thrown. If a - * correct object is given, it is inserted in the tree immediately before the first - * element that is neither a <caption>, a <colgroup>, nor a <thead>, or as the last - * child if there is no such element, and the first <tfoot> that is a child of this - * element is removed from the tree, if any. - * - * MDN - */ + /** Is an HTMLTableSectionElement representing the first <tfoot> that is a child of the element, or null if none + * is found. When set, if the object doesn't represent a <tfoot>, a DOMException with the HierarchyRequestError + * name is thrown. If a correct object is given, it is inserted in the tree immediately before the first element that + * is neither a <caption>, a <colgroup>, nor a <thead>, or as the last child if there is no such + * element, and the first <tfoot> that is a child of this element is removed from the tree, if any. + * + * MDN + */ var tFoot: HTMLTableSectionElement = js.native - /** - * Returns a live HTMLCollection containing all the rows of the element, that is all - * <tr> that are a child of the element, or a child or one of its <thead>, <tbody> and - * <tfoot> children. The rows members of a <thead> appear first, in tree order, and - * those members of a <tbody> last, also in tree order. The HTMLCollection is live and - * is automatically updated when the HTMLTableElement changes. - * - * MDN - */ + /** Returns a live HTMLCollection containing all the rows of the element, that is all <tr> that are a child of + * the element, or a child or one of its <thead>, <tbody> and <tfoot> children. The rows members of + * a <thead> appear first, in tree order, and those members of a <tbody> last, also in tree order. The + * HTMLCollection is live and is automatically updated when the HTMLTableElement changes. + * + * MDN + */ def rows: HTMLCollection = js.native - /** - * Is an HTMLTableCaptionElement representing the first <caption> that is a child of - * the element, or null if none is found. When set, if the object doesn't represent a - * <caption>, a DOMException with the HierarchyRequestError name is thrown. If a - * correct object is given, it is inserted in the tree as the first child of this element - * and the first <caption> that is a child of this element is removed from the tree, if - * any. - * - * MDN - */ + /** Is an HTMLTableCaptionElement representing the first <caption> that is a child of the element, or null if + * none is found. When set, if the object doesn't represent a <caption>, a DOMException with the + * HierarchyRequestError name is thrown. If a correct object is given, it is inserted in the tree as the first child + * of this element and the first <caption> that is a child of this element is removed from the tree, if any. + * + * MDN + */ var caption: HTMLTableCaptionElement = js.native - /** - * Returns a live HTMLCollection containing all the <tbody> of the element. The - * HTMLCollection is live and is automatically updated when the HTMLTableElement - * changes. - * - * MDN - */ + /** Returns a live HTMLCollection containing all the <tbody> of the element. The HTMLCollection is live and is + * automatically updated when the HTMLTableElement changes. + * + * MDN + */ def tBodies: HTMLCollection = js.native - /** - * Is an HTMLTableSectionElement representing the first <thead> that is a child of - * the element, or null if none is found. When set, if the object doesn't represent a - * <thead>, a DOMException with the HierarchyRequestError name is thrown. If a - * correct object is given, it is inserted in the tree immediately before the first - * element that is neither a <caption>, nor a <colgroup>, or as the last child if there - * is no such element, and the first <thead> that is a child of this element is removed - * from the tree, if any. - * - * MDN - */ + /** Is an HTMLTableSectionElement representing the first <thead> that is a child of the element, or null if none + * is found. When set, if the object doesn't represent a <thead>, a DOMException with the HierarchyRequestError + * name is thrown. If a correct object is given, it is inserted in the tree immediately before the first element that + * is neither a <caption>, nor a <colgroup>, or as the last child if there is no such element, and the + * first <thead> that is a child of this element is removed from the tree, if any. + * + * MDN + */ var tHead: HTMLTableSectionElement = js.native - /** - * Removes the row corresponding to the index given in parameter. If the index value is - * -1 the last row is removed; if it smaller than -1 or greater than the amount of rows in - * the collection, a DOMException with the value IndexSizeError is raised. - * - * MDN - */ + /** Removes the row corresponding to the index given in parameter. If the index value is + * -1 the last row is removed; if it smaller than -1 or greater than the amount of rows in the collection, a + * DOMException with the value IndexSizeError is raised. + * + * MDN + */ def deleteRow(index: Int): Unit = js.native def createTBody(): HTMLElement = js.native - /** - * Removes the first <caption> that is a child of the element. - * - * MDN - */ + /** Removes the first <caption> that is a child of the element. + * + * MDN + */ def deleteCaption(): Unit = js.native - /** - * Returns an HTMLElement representing a new row of the table. It inserts it in the rows - * collection immediately before the <tr> element at the givent index position. If - * necessary a <tbody> is created. If the index is -1, the new row is appended to the - * collection. If the index is smaller than -1 or greater than the number of rows in the - * collection, a DOMException with the value IndexSizeError is raised. - * - * MDN - */ + /** Returns an HTMLElement representing a new row of the table. It inserts it in the rows collection immediately + * before the <tr> element at the givent index position. If necessary a <tbody> is created. If the index + * is -1, the new row is appended to the collection. If the index is smaller than -1 or greater than the number of + * rows in the collection, a DOMException with the value IndexSizeError is raised. + * + * MDN + */ def insertRow(index: Int = js.native): HTMLElement = js.native - /** - * Removes the first <tfoot> that is a child of the element. - * - * MDN - */ + /** Removes the first <tfoot> that is a child of the element. + * + * MDN + */ def deleteTFoot(): Unit = js.native - /** - * Returns an HTMLElement representing the first <thead> that is a child of the - * element. If none is found, a new one is created and inserted in the tree immediately - * before the first element that is neither a <caption>, nor a <colgroup>, or as the - * last child if there is no such element. - * - * MDN - */ + /** Returns an HTMLElement representing the first <thead> that is a child of the element. If none is found, a + * new one is created and inserted in the tree immediately before the first element that is neither a + * <caption>, nor a <colgroup>, or as the last child if there is no such element. + * + * MDN + */ def createTHead(): HTMLElement = js.native - /** - * Removes the first <thead> that is a child of the element. - * - * MDN - */ + /** Removes the first <thead> that is a child of the element. + * + * MDN + */ def deleteTHead(): Unit = js.native - /** - * Returns an HTMLElement representing the first <caption> that is a child of the - * element. If none is found, a new one is created and inserted in the tree as the first - * child of the <table> element. - * - * MDN - */ + /** Returns an HTMLElement representing the first <caption> that is a child of the element. If none is found, a + * new one is created and inserted in the tree as the first child of the <table> element. + * + * MDN + */ def createCaption(): HTMLElement = js.native - def moveRow(indexFrom: Int = js.native, - indexTo: Int = js.native): Object = js.native - - /** - * Returns an HTMLElement representing the first <tfoot> that is a child of the - * element. If none is found, a new one is created and inserted in the tree immediately - * before the first element that is neither a <caption>, a <colgroup>, nor a <thead>, - * or as the last child if there is no such element. - * - * MDN - */ + def moveRow(indexFrom: Int = js.native, indexTo: Int = js.native): Object = js.native + + /** Returns an HTMLElement representing the first <tfoot> that is a child of the element. If none is found, a + * new one is created and inserted in the tree immediately before the first element that is neither a + * <caption>, a <colgroup>, nor a <thead>, or as the last child if there is no such element. + * + * MDN + */ def createTFoot(): HTMLElement = js.native } -/** - * The HTMLBaseElement interface contains the base URI for a document. This object - * inherits all of the properties and methods as described in the HTMLElement - * interface. - * - * MDN - */ +/** The HTMLBaseElement interface contains the base URI for a document. This object inherits all of the properties and + * methods as described in the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLBaseElement extends HTMLElement { - /** - * Is a DOMString that reflects the target HTML attribute, containing a default - * target browsing context or frame for elements that do not have a target reference - * specified. - * - * MDN - */ + /** Is a DOMString that reflects the target HTML attribute, containing a default target browsing context or frame for + * elements that do not have a target reference specified. + * + * MDN + */ var target: String = js.native - /** - * Is a DOMString that reflects the href HTML attribute, containing a base URL for - * relative URLs in the document. - * - * MDN - */ + /** Is a DOMString that reflects the href HTML attribute, containing a base URL for relative URLs in the document. + * + * MDN + */ var href: String = js.native } -/** - * The HTMLParagraphElement interface provides special properties (beyond those - * of the regular HTMLElement object interface it inherits) for manipulating <p> - * elements. - * - * MDN - */ +/** The HTMLParagraphElement interface provides special properties (beyond those of the regular HTMLElement object + * interface it inherits) for manipulating <p> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLParagraphElement extends HTMLElement -/** - * The HTMLOListElement interface provides special properties (beyond those - * defined on the regular HTMLElement interface it also has available to it by - * inheritance) for manipulating ordered list elements. - * - * MDN - */ +/** The HTMLOListElement interface provides special properties (beyond those defined on the regular HTMLElement + * interface it also has available to it by inheritance) for manipulating ordered list elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLOListElement extends HTMLElement { - /** - * Is a long value reflecting the start and defining the value of the first number of the - * first element of the list. - * - * MDN - */ + /** Is a long value reflecting the start and defining the value of the first number of the first element of the list. + * + * MDN + */ var start: Int = js.native } -/** - * DOM select elements share all of the properties and methods of other HTML elements - * described in the element section. They also have the specialized interface - * HTMLSelectElement (or HTML 4 HTMLSelectElement). - * - * MDN - */ +/** DOM select elements share all of the properties and methods of other HTML elements described in the element section. + * They also have the specialized interface HTMLSelectElement (or HTML 4 HTMLSelectElement). + * + * MDN + */ @js.native @JSGlobal abstract class HTMLSelectElement extends HTMLElement { - /** - * The set of <option> elements contained by this element. Read only. - * - * MDN - */ + /** The set of <option> elements contained by this element. Read only. + * + * MDN + */ val options: js.Array[HTMLOptionElement] = js.native - /** - * The value of this form control, that is, of the first selected option. - * - * MDN - */ + /** The value of this form control, that is, of the first selected option. + * + * MDN + */ var value: String = js.native - /** - * The form that this element is associated with. If this element is a descendant of a - * form element, then this attribute is the ID of that form element. If the element is - * not a descendant of a form element, then: HTML5 The attribute can be the ID of any form - * element in the same document. HTML 4 The attribute is null. Read only. - * - * MDN - */ + /** The form that this element is associated with. If this element is a descendant of a form element, then this + * attribute is the ID of that form element. If the element is not a descendant of a form element, then: HTML5 The + * attribute can be the ID of any form element in the same document. HTML 4 The attribute is null. Read only. + * + * MDN + */ def form: HTMLFormElement = js.native - /** - * Reflects the name HTML attribute, containing the name of this control used by - * servers and DOM search functions. - * - * MDN - */ + /** Reflects the name HTML attribute, containing the name of this control used by servers and DOM search functions. + * + * MDN + */ var name: String = js.native - /** - * Reflects the size HTML attribute, which contains the number of visible items in the - * control. The default is 1, HTML5 unless multiple is true, in which case it is 4. - * - * MDN - */ + /** Reflects the size HTML attribute, which contains the number of visible items in the control. The default is 1, + * HTML5 unless multiple is true, in which case it is 4. + * + * MDN + */ var size: Int = js.native - /** - * The number of <option> elements in this select element. - * - * MDN - */ + /** The number of <option> elements in this select element. + * + * MDN + */ var length: Int = js.native - /** - * The index of the first selected <option> element. - * - * MDN - */ + /** The index of the first selected <option> element. + * + * MDN + */ var selectedIndex: Int = js.native - /** - * Reflects the multiple HTML attribute, whichindicates whether multiple items can - * be selected. - * - * MDN - */ + /** Reflects the multiple HTML attribute, whichindicates whether multiple items can be selected. + * + * MDN + */ var multiple: Boolean = js.native def `type`: String = js.native - /** - * Reflects the disabled HTML attribute, which indicates whether the control is - * disabled. If it is disabled, it does not accept clicks. - * - * MDN - */ + /** Reflects the disabled HTML attribute, which indicates whether the control is disabled. If it is disabled, it does + * not accept clicks. + * + * MDN + */ var disabled: Boolean = js.native - /** - * Removes the element at the specified index from the options collection for this - * select element. - * - * MDN - */ + /** Removes the element at the specified index from the options collection for this select element. + * + * MDN + */ def remove(index: Int = js.native): Unit = js.native - /** - * Adds an element to the collection of option elements for this select element. - * - * MDN - */ + /** Adds an element to the collection of option elements for this select element. + * + * MDN + */ def add(element: HTMLElement, before: js.Any = js.native): Unit = js.native - def item(name: js.Any = js.native, - index: js.Any = js.native): js.Dynamic = js.native + def item(name: js.Any = js.native, index: js.Any = js.native): js.Dynamic = js.native def namedItem(name: String): js.Dynamic = js.native @@ -895,47 +751,40 @@ abstract class HTMLSelectElement extends HTMLElement { @scala.scalajs.js.annotation.JSBracketAccess def update(name: String, v: js.Any): Unit = js.native - /** - * A localized message that describes the validation constraints that the control - * does not satisfy (if any). This attribute is the empty string if the control is not a - * candidate for constraint validation (willValidate is false), or it satisfies its - * constraints. Read only. HTML5 - * - * MDN - */ + /** A localized message that describes the validation constraints that the control does not satisfy (if any). This + * attribute is the empty string if the control is not a candidate for constraint validation (willValidate is false), + * or it satisfies its constraints. Read only. HTML5 + * + * MDN + */ def validationMessage: String = js.native - /** - * Reflects the autofocus HTML attribute, which indicates whether the control - * should have input focus when the page loads, unless the user overrides it, for - * example by typing in a different control. Only one form-associated element in a - * document can have this attribute specified. HTML5 - * - * MDN - */ + /** Reflects the autofocus HTML attribute, which indicates whether the control should have input focus when the page + * loads, unless the user overrides it, for example by typing in a different control. Only one form-associated + * element in a document can have this attribute specified. HTML5 + * + * MDN + */ var autofocus: Boolean = js.native - /** - * The validity states that this control is in. Read only. HTML5 - * - * MDN - */ + /** The validity states that this control is in. Read only. HTML5 + * + * MDN + */ def validity: ValidityState = js.native - /** - * Reflects the required HTML attribute, which indicates whether the user is - * required to select a value before submitting the form. HTML5 - * - * MDN - */ + /** Reflects the required HTML attribute, which indicates whether the user is required to select a value before + * submitting the form. HTML5 + * + * MDN + */ var required: Boolean = js.native - /** - * Indicates whether the button is a candidate for constraint validation. It is false - * if any conditions bar it from constraint validation. Read only. HTML5 - * - * MDN - */ + /** Indicates whether the button is a candidate for constraint validation. It is false if any conditions bar it from + * constraint validation. Read only. HTML5 + * + * MDN + */ def willValidate: Boolean = js.native def checkValidity(): Boolean = js.native @@ -943,207 +792,174 @@ abstract class HTMLSelectElement extends HTMLElement { def setCustomValidity(error: String): Unit = js.native } -/** - * The HTMLMetaElement interface contains descriptive metadata about a document. - * Itt inherits all of the properties and methods described in the HTMLElement - * interface. - * - * MDN - */ +/** The HTMLMetaElement interface contains descriptive metadata about a document. Itt inherits all of the properties and + * methods described in the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLMetaElement extends HTMLElement { - /** - * Gets or sets the name of an HTTP response header to define for a document. - * - * MDN - */ + /** Gets or sets the name of an HTTP response header to define for a document. + * + * MDN + */ var httpEquiv: String = js.native - /** - * Gets or sets the name of a meta-data property to define for a document. - * - * MDN - */ + /** Gets or sets the name of a meta-data property to define for a document. + * + * MDN + */ var name: String = js.native - /** - * Gets or sets the value of meta-data property. - * - * MDN - */ + /** Gets or sets the value of meta-data property. + * + * MDN + */ var content: String = js.native var url: String = js.native var charset: String = js.native } -/** - * The HTMLLinkElement interface represents reference information for external - * resources and the relationship of those resources to a document and vice-versa. - * This object inherits all of the properties and methods of the HTMLElement - * interface. - * - * MDN - */ +/** The HTMLLinkElement interface represents reference information for external resources and the relationship of those + * resources to a document and vice-versa. This object inherits all of the properties and methods of the HTMLElement + * interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLLinkElement extends HTMLElement with LinkStyle { - /** - * Gets or sets the forward relationship of the linked resource from the document to - * the resource. - * - * MDN - */ + /** Gets or sets the forward relationship of the linked resource from the document to the resource. + * + * MDN + */ var rel: String = js.native - /** - * Gets or sets the name of the target frame to which the resource applies. - * - * MDN - */ + /** Gets or sets the name of the target frame to which the resource applies. + * + * MDN + */ var target: String = js.native - /** - * Gets or sets the URI for the target resource. - * - * MDN - */ + /** Gets or sets the URI for the target resource. + * + * MDN + */ var href: String = js.native - /** - * Gets or sets a list of one or more media formats to which the resource applies. - * - * MDN - */ + /** Gets or sets a list of one or more media formats to which the resource applies. + * + * MDN + */ var media: String = js.native - /** - * Gets or sets the reverse relationship of the linked resource from the resource to - * the document. - * - * MDN - */ + /** Gets or sets the reverse relationship of the linked resource from the resource to the document. + * + * MDN + */ var rev: String = js.native var `type`: String = js.native - /** - * Gets or sets the language code for the linked resource. - * - * MDN - */ + /** Gets or sets the language code for the linked resource. + * + * MDN + */ var hreflang: String = js.native } -/** - * The HTMLTableCaptionElement interface special properties (beyond the regular - * HTMLElement interface it also has available to it by inheritance) for - * manipulating table caption elements. - * - * MDN - */ +/** The HTMLTableCaptionElement interface special properties (beyond the regular HTMLElement interface it also has + * available to it by inheritance) for manipulating table caption elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLTableCaptionElement extends HTMLElement -/** - * The HTMLOptionElement interface represents <option> elements and inherits all - * classes and methods of the HTMLElement interface. - * - * MDN - */ +/** The HTMLOptionElement interface represents <option> elements and inherits all classes and methods of the + * HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLOptionElement extends HTMLElement { - /** - * The position of the option within the list of options it belongs to, in tree-order. - * If the option is not part of a list of options, like when it is part of the <datalist> - * element, the value is 0. - * - * MDN - */ + /** The position of the option within the list of options it belongs to, in tree-order. If the option is not part of a + * list of options, like when it is part of the <datalist> element, the value is 0. + * + * MDN + */ def index: Int = js.native - /** - * Contains the initial value of the selected HTML attribute, indicating whether the - * option is selected by default or not. - * - * MDN - */ + /** Contains the initial value of the selected HTML attribute, indicating whether the option is selected by default or + * not. + * + * MDN + */ var defaultSelected: Boolean = js.native - /** - * Reflects the value of the value HTML attribute, if it exists; otherwise reflects - * value of the Node.textContent property. - * - * MDN - */ + /** Reflects the value of the value HTML attribute, if it exists; otherwise reflects value of the Node.textContent + * property. + * + * MDN + */ var value: String = js.native - /** - * Contains the text content of the element. - * - * MDN - */ + /** Contains the text content of the element. + * + * MDN + */ var text: String = js.native - /** - * If the option is a descendent of a <select> element, then this property has the same - * value as the form property of the corresponding HTMLSelectElement object; - * otherwise, it is null. - * - * MDN - */ + /** If the option is a descendent of a <select> element, then this property has the same value as the form + * property of the corresponding HTMLSelectElement object; otherwise, it is null. + * + * MDN + */ def form: HTMLFormElement = js.native - /** - * Reflects the value of the label HTML attribute, which provides a label for the - * option. If this attribute isn't specifically set, reading it returns the - * element's text content. - * - * MDN - */ + /** Reflects the value of the label HTML attribute, which provides a label for the option. If this attribute isn't + * specifically set, reading it returns the element's text content. + * + * MDN + */ var label: String = js.native - /** - * Indicates whether the option is currently selected. - * - * MDN - */ + /** Indicates whether the option is currently selected. + * + * MDN + */ var selected: Boolean = js.native - /** - * Reflects the value of the disabled HTML attribute, which indicates that the option - * is unavailable to be selected. An option can also be disabled if it is a child of - * an <optgroup> element that is disabled. - * - * MDN - */ + /** Reflects the value of the disabled HTML attribute, which indicates that the option is unavailable to be selected. + * An option can also be disabled if it is a child of an <optgroup> element that is disabled. + * + * MDN + */ var disabled: Boolean = js.native def create(): HTMLOptionElement = js.native } -/** - * The HTMLMapElement interface provides special properties and methods (beyond - * those of the regular object HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of map elements. - * - * MDN - */ +/** The HTMLMapElement interface provides special properties and methods (beyond those of the regular object HTMLElement + * interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLMapElement extends HTMLElement { - /** - * Is a DOMString representing the <map> element for referencing it other context. If - * the id attribute is set, this must have the same value; and it cannot be null or empty. - * - * MDN - */ + /** Is a DOMString representing the <map> element for referencing it other context. If the id attribute is set, + * this must have the same value; and it cannot be null or empty. + * + * MDN + */ var name: String = js.native } @@ -1153,330 +969,271 @@ abstract class HTMLMenuElement extends HTMLElement { var `type`: String = js.native } -/** - * HTMLCollection is an interface representing a generic collection of elements (in - * document order) and offers methods and properties for traversing the list. - * - * MDN - */ +/** HTMLCollection is an interface representing a generic collection of elements (in document order) and offers methods + * and properties for traversing the list. + * + * MDN + */ @js.native @JSGlobal class HTMLCollection private[this] () extends DOMList[Element] { def item(index: Int): Element = js.native - /** - * Returns the specific node whose ID or, as a fallback, name matches the string - * specified by name. Matching by name is only done as a last resort, only in HTML, and - * only if the referenced element supports the name attribute. Returns null if no node - * exists by the given name. - * - * MDN - */ + /** Returns the specific node whose ID or, as a fallback, name matches the string specified by name. Matching by name + * is only done as a last resort, only in HTML, and only if the referenced element supports the name attribute. + * Returns null if no node exists by the given name. + * + * MDN + */ def namedItem(name: String): Element = js.native } -/** - * The HTMLImageElement interface provides special properties and methods (beyond - * the regular HTMLElement interface it also has available to it by inheritance) for - * manipulating the layout and presentation of <img> elements. - * - * MDN - */ +/** The HTMLImageElement interface provides special properties and methods (beyond the regular HTMLElement interface it + * also has available to it by inheritance) for manipulating the layout and presentation of <img> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLImageElement extends HTMLElement { - /** - * Reflects the width HTML attribute, indicating the rendered width of the image in - * CSS pixels. - * - * MDN - */ + /** Reflects the width HTML attribute, indicating the rendered width of the image in CSS pixels. + * + * MDN + */ var width: Int = js.native - /** - * Intrinsic height of the image in CSS pixels, if it is available; otherwise, 0. - * - * MDN - */ + /** Intrinsic height of the image in CSS pixels, if it is available; otherwise, 0. + * + * MDN + */ var naturalHeight: Int = js.native - /** - * Reflects the alt HTML attribute, indicating fallback context for the image. - * - * MDN - */ + /** Reflects the alt HTML attribute, indicating fallback context for the image. + * + * MDN + */ var alt: String = js.native - /** - * Reflects the src HTML attribute, containing the URL of the image. - * - * MDN - */ + /** Reflects the src HTML attribute, containing the URL of the image. + * + * MDN + */ var src: String = js.native - /** - * Reflects the usemap HTML attribute, containing a partial URL of a map element. - * - * MDN - */ + /** Reflects the usemap HTML attribute, containing a partial URL of a map element. + * + * MDN + */ var useMap: String = js.native - /** - * Intrinsic width of the image in CSS pixels, if it is available; otherwise, 0. - * - * MDN - */ + /** Intrinsic width of the image in CSS pixels, if it is available; otherwise, 0. + * + * MDN + */ var naturalWidth: Int = js.native - /** - * Reflects the height HTML attribute, indicating the rendered height of the image in - * CSS pixels. - * - * MDN - */ + /** Reflects the height HTML attribute, indicating the rendered height of the image in CSS pixels. + * + * MDN + */ var height: Int = js.native var href: String = js.native - /** - * Reflects the ismap HTML attribute, indicating that the image is part of a - * server-side image map. - * - * MDN - */ + /** Reflects the ismap HTML attribute, indicating that the image is part of a server-side image map. + * + * MDN + */ var isMap: Boolean = js.native - /** - * True if the browser has fetched the image, and it is in a supported image type that was - * decoded without errors. - * - * MDN - */ + /** True if the browser has fetched the image, and it is in a supported image type that was decoded without errors. + * + * MDN + */ def complete: Boolean = js.native var onload: js.Function1[Event, _] = js.native } -/** - * The HTMLAreaElement interface provides special properties and methods (beyond - * those of the regular object HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of area elements. - * - * MDN - */ +/** The HTMLAreaElement interface provides special properties and methods (beyond those of the regular object + * HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of + * area elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLAreaElement extends HTMLElement { - /** - * Is a DOMString containing the protocol component (including trailing colon ':'), - * of the referenced URL. - * - * MDN - */ + /** Is a DOMString containing the protocol component (including trailing colon ':'), of the referenced URL. + * + * MDN + */ var protocol: String = js.native - /** - * Is a DOMString containing tThe search element (including leading question mark - * '?'), if any, of the referenced URL. - * - * MDN - */ + /** Is a DOMString containing tThe search element (including leading question mark '?'), if any, of the referenced + * URL. + * + * MDN + */ var search: String = js.native - /** - * Is a DOMString that reflects the alt HTML attribute, containing alternative text - * for the element. - * - * MDN - */ + /** Is a DOMString that reflects the alt HTML attribute, containing alternative text for the element. + * + * MDN + */ var alt: String = js.native - /** - * Is a DOMString that reflects the coords HTML attribute, containing coordinates to - * define the hot-spot region. - * - * MDN - */ + /** Is a DOMString that reflects the coords HTML attribute, containing coordinates to define the hot-spot region. + * + * MDN + */ var coords: String = js.native - /** - * Is a DOMString containing the hostname in the referenced URL. - * - * MDN - */ + /** Is a DOMString containing the hostname in the referenced URL. + * + * MDN + */ var hostname: String = js.native - /** - * Is a DOMString containing the port component, if any, of the referenced URL. - * - * MDN - */ + /** Is a DOMString containing the port component, if any, of the referenced URL. + * + * MDN + */ var port: String = js.native - /** - * Is a DOMString containing the path name component, if any, of the referenced URL. - * - * MDN - */ + /** Is a DOMString containing the path name component, if any, of the referenced URL. + * + * MDN + */ var pathname: String = js.native - /** - * Is a DOMString containing the hostname and port (if it's not the default port) in the - * referenced URL. - * - * MDN - */ + /** Is a DOMString containing the hostname and port (if it's not the default port) in the referenced URL. + * + * MDN + */ var host: String = js.native - /** - * Is a DOMString containing the fragment identifier (including the leading hash - * mark (#)), if any, in the referenced URL. - * - * MDN - */ + /** Is a DOMString containing the fragment identifier (including the leading hash mark (#)), if any, in the referenced + * URL. + * + * MDN + */ var hash: String = js.native - /** - * Is a DOMString that reflects the target HTML attribute, indicating the browsing - * context in which to open the linked resource. - * - * MDN - */ + /** Is a DOMString that reflects the target HTML attribute, indicating the browsing context in which to open the + * linked resource. + * + * MDN + */ var target: String = js.native - /** - * Is a DOMString containing that reflects the href HTML attribute, containing a - * valid URL of a linked resource. - * - * MDN - */ + /** Is a DOMString containing that reflects the href HTML attribute, containing a valid URL of a linked resource. + * + * MDN + */ var href: String = js.native - /** - * Is a DOMString teflects the shape HTML attribute, indicating the shape of the - * hot-spot, limited to known values. - * - * MDN - */ + /** Is a DOMString teflects the shape HTML attribute, indicating the shape of the hot-spot, limited to known values. + * + * MDN + */ var shape: String = js.native } -/** - * The HTMLButtonElement interface provides properties and methods (beyond the - * <button> object interface it also has available to them by inheritance) for - * manipulating the layout and presentation of button elements. - * - * MDN - */ +/** The HTMLButtonElement interface provides properties and methods (beyond the <button> object interface it also + * has available to them by inheritance) for manipulating the layout and presentation of button elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLButtonElement extends HTMLElement { - /** - * The current form control value of the button. - * - * MDN - */ + /** The current form control value of the button. + * + * MDN + */ var value: String = js.native var status: js.Any = js.native - /** - * The form that this button is associated with. If the button is a descendant of a form - * element, then this attribute is the ID of that form element. If the button is not a - * descendant of a form element, then the attribute can be the ID of any form element in - * the same document it is related to, or the null value if none matches. - * - * MDN - */ + /** The form that this button is associated with. If the button is a descendant of a form element, then this attribute + * is the ID of that form element. If the button is not a descendant of a form element, then the attribute can be the + * ID of any form element in the same document it is related to, or the null value if none matches. + * + * MDN + */ def form: HTMLFormElement = js.native - /** - * The name of the object when submitted with a form. HTML5 If specified, it must not be - * the empty string. - * - * MDN - */ + /** The name of the object when submitted with a form. HTML5 If specified, it must not be the empty string. + * + * MDN + */ var name: String = js.native var `type`: String = js.native - /** - * The control is disabled, meaning that it does not accept any clicks. - * - * MDN - */ + /** The control is disabled, meaning that it does not accept any clicks. + * + * MDN + */ var disabled: Boolean = js.native - /** - * A localized message that describes the validation constraints that the control - * does not satisfy (if any). This attribute is the empty string if the control is not a - * candidate for constraint validation (willValidate is false), or it satisfies its - * constraints. - * - * MDN - */ + /** A localized message that describes the validation constraints that the control does not satisfy (if any). This + * attribute is the empty string if the control is not a candidate for constraint validation (willValidate is false), + * or it satisfies its constraints. + * + * MDN + */ def validationMessage: String = js.native - /** - * A name or keyword indicating where to display the response that is received after - * submitting the form. If specified, this attribute overrides the target attribute - * of the <form> element that owns this element. - * - * MDN - */ + /** A name or keyword indicating where to display the response that is received after submitting the form. If + * specified, this attribute overrides the target attribute of the <form> element that owns this element. + * + * MDN + */ var formTarget: String = js.native - /** - * Indicates whether the button is a candidate for constraint validation. It is false - * if any conditions bar it from constraint validation. - * - * MDN - */ + /** Indicates whether the button is a candidate for constraint validation. It is false if any conditions bar it from + * constraint validation. + * + * MDN + */ def willValidate: Boolean = js.native - /** - * The URI of a resource that processes information submitted by the button. If - * specified, this attribute overrides the action attribute of the <form> element - * that owns this element. - * - * MDN - */ + /** The URI of a resource that processes information submitted by the button. If specified, this attribute overrides + * the action attribute of the <form> element that owns this element. + * + * MDN + */ var formAction: String = js.native - /** - * The control should have input focus when the page loads, unless the user overrides - * it, for example by typing in a different control. Only one form-associated element - * in a document can have this attribute specified. - * - * MDN - */ + /** The control should have input focus when the page loads, unless the user overrides it, for example by typing in a + * different control. Only one form-associated element in a document can have this attribute specified. + * + * MDN + */ var autofocus: Boolean = js.native - /** - * The validity states that this button is in. - * - * MDN - */ + /** The validity states that this button is in. + * + * MDN + */ def validity: ValidityState = js.native - /** - * Indicates that the form is not to be validated when it is submitted. If specified, - * this attribute overrides the enctype attribute of the <form> element that owns - * this element. - * - * MDN - */ + /** Indicates that the form is not to be validated when it is submitted. If specified, this attribute overrides the + * enctype attribute of the <form> element that owns this element. + * + * MDN + */ var formNoValidate: String = js.native var formEnctype: String = js.native - /** - * The HTTP method that the browser uses to submit the form. If specified, this - * attribute overrides the method attribute of the <form> element that owns this - * element. - * - * MDN - */ + /** The HTTP method that the browser uses to submit the form. If specified, this attribute overrides the method + * attribute of the <form> element that owns this element. + * + * MDN + */ var formMethod: String = js.native def checkValidity(): Boolean = js.native @@ -1484,235 +1241,196 @@ abstract class HTMLButtonElement extends HTMLElement { def setCustomValidity(error: String): Unit = js.native } -/** - * The HTMLSourceElement interface provides special properties (beyond the - * regular HTMLElement object interface it also has available to it by inheritance) - * for manipulating <source> elements. - * - * MDN - */ +/** The HTMLSourceElement interface provides special properties (beyond the regular HTMLElement object interface it also + * has available to it by inheritance) for manipulating <source> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLSourceElement extends HTMLElement { - /** - * Reflects the src HTML attribute, containing the URL for the media resource. - * - * MDN - */ + /** Reflects the src HTML attribute, containing the URL for the media resource. + * + * MDN + */ var src: String = js.native - /** - * Reflects the media HTML attribute, containing the intended type of the media - * resource. - * - * MDN - */ + /** Reflects the media HTML attribute, containing the intended type of the media resource. + * + * MDN + */ var media: String = js.native var `type`: String = js.native } -/** - * DOM Script objects expose the HTMLScriptElement (or HTML 4 HTMLScriptElement) - * interface, which provides special properties and methods (beyond the regular - * element object interface they also have available to them by inheritance) for - * manipulating the layout and presentation of <script> elements. - * - * MDN - */ +/** DOM Script objects expose the HTMLScriptElement (or HTML 4 HTMLScriptElement) interface, which provides special + * properties and methods (beyond the regular element object interface they also have available to them by inheritance) + * for manipulating the layout and presentation of <script> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLScriptElement extends HTMLElement { var defer: Boolean = js.native - /** - * The IDL attribute text must return a concatenation of the contents of all the Text - * nodes that are children of the <script> element (ignoring any other nodes such as - * comments or elements), in tree order. On setting, it must act the same way as the - * textContent IDL attribute. Note: When inserted using the document.write() - * method, <script> elements execute (typically synchronously), but when inserted - * using innerHTML and outerHTML attributes, they do not execute at all. - * - * MDN - */ + /** The IDL attribute text must return a concatenation of the contents of all the Text nodes that are children of the + * <script> element (ignoring any other nodes such as comments or elements), in tree order. On setting, it must + * act the same way as the textContent IDL attribute. Note: When inserted using the document.write() method, + * <script> elements execute (typically synchronously), but when inserted using innerHTML and outerHTML + * attributes, they do not execute at all. + * + * MDN + */ var text: String = js.native - /** - * Represents gives the address of the external script resource to use. It reflects - * the src attribute. - * - * MDN - */ + /** Represents gives the address of the external script resource to use. It reflects the src attribute. + * + * MDN + */ var src: String = js.native - /** - * Represents the character encoding of the external script resource. It reflects - * the charset attribute. - * - * MDN - */ + /** Represents the character encoding of the external script resource. It reflects the charset attribute. + * + * MDN + */ var charset: String = js.native var `type`: String = js.native var event: String = js.native - /** - * The async and defer attributes are boolean attributes that indicate how the script - * should be executed. The defer and async attributes must not be specified if the src - * attribute is not present. There are three possible modes that can be selected using - * these attributes. If the async attribute is present, then the script will be - * executed asynchronously, as soon as it is available. If the async attribute is not - * present but the defer attribute is present, then the script is executed when the - * page has finished parsing. If neither attribute is present, then the script is - * fetched and executed immediately, before the user agent continues parsing the - * page. Note: The exact processing details for these attributes are, for mostly - * historical reasons, somewhat non-trivial, involving a number of aspects of HTML. - * The implementation requirements are therefore by necessity scattered - * throughout the specification. These algorithms describe the core of this - * processing, but these algorithms reference and are referenced by the parsing - * rules for <script> start and end tags in HTML, in foreign content, and in XML, the - * rules for the document.write() method, the handling of scripting, etc. The defer - * attribute may be specified even if the async attribute is specified, to cause - * legacy Web browsers that only support defer (and not async) to fall back to the defer - * behavior instead of the synchronous blocking behavior that is the default. - * - * MDN - */ + /** The async and defer attributes are boolean attributes that indicate how the script should be executed. The defer + * and async attributes must not be specified if the src attribute is not present. There are three possible modes + * that can be selected using these attributes. If the async attribute is present, then the script will be executed + * asynchronously, as soon as it is available. If the async attribute is not present but the defer attribute is + * present, then the script is executed when the page has finished parsing. If neither attribute is present, then the + * script is fetched and executed immediately, before the user agent continues parsing the page. Note: The exact + * processing details for these attributes are, for mostly historical reasons, somewhat non-trivial, involving a + * number of aspects of HTML. The implementation requirements are therefore by necessity scattered throughout the + * specification. These algorithms describe the core of this processing, but these algorithms reference and are + * referenced by the parsing rules for <script> start and end tags in HTML, in foreign content, and in XML, the + * rules for the document.write() method, the handling of scripting, etc. The defer attribute may be specified even + * if the async attribute is specified, to cause legacy Web browsers that only support defer (and not async) to fall + * back to the defer behavior instead of the synchronous blocking behavior that is the default. + * + * MDN + */ var async: Boolean = js.native var onload: js.Function1[Event, _] = js.native } -/** - * The HTMLTableRowElement interface provides special properties and methods - * (beyond the HTMLElement interface it also has available to it by inheritance) for - * manipulating the layout and presentation of rows in an HTML table. - * - * MDN - */ +/** The HTMLTableRowElement interface provides special properties and methods (beyond the HTMLElement interface it also + * has available to it by inheritance) for manipulating the layout and presentation of rows in an HTML table. + * + * MDN + */ @js.native @JSGlobal -abstract class HTMLTableRowElement - extends HTMLElement with HTMLTableAlignment { - - /** - * Returns a long value which gives the logical position of the row within the entire - * table. If the row is not part of a table, returns -1. - * - * MDN - */ +abstract class HTMLTableRowElement extends HTMLElement with HTMLTableAlignment { + + /** Returns a long value which gives the logical position of the row within the entire table. If the row is not part + * of a table, returns -1. + * + * MDN + */ def rowIndex: Int = js.native - /** - * Returns a live HTMLCollection containing the cells in the row. The HTMLCollection - * is live and is automatically updated when cells are added or removed. - * - * MDN - */ + /** Returns a live HTMLCollection containing the cells in the row. The HTMLCollection is live and is automatically + * updated when cells are added or removed. + * + * MDN + */ def cells: HTMLCollection = js.native var borderColorLight: js.Any = js.native - /** - * Returns a long value which gives the logical position of the row within the table - * section it belongs to. If the row is not part of a section, returns -1. - * - * MDN - */ + /** Returns a long value which gives the logical position of the row within the table section it belongs to. If the + * row is not part of a section, returns -1. + * + * MDN + */ def sectionRowIndex: Int = js.native var borderColor: js.Any = js.native var height: js.Any = js.native var borderColorDark: js.Any = js.native - /** - * Removes the cell at the given position in the row. If the given position is greater - * (or equal as it starts at zero) than the amount of cells in the row, or is smaller than - * 0, it raises a DOMException with the IndexSizeError value. - * - * MDN - */ + /** Removes the cell at the given position in the row. If the given position is greater (or equal as it starts at + * zero) than the amount of cells in the row, or is smaller than 0, it raises a DOMException with the IndexSizeError + * value. + * + * MDN + */ def deleteCell(index: Int = js.native): Unit = js.native - /** - * Inserts a new cell just before the given position in the row. If the given position is - * not given or is -1, it appends the cell to the row. If the given position is greater (or - * equal as it starts at zero) than the amount of cells in the row, or is smaller than -1, - * it raises a DOMException with the IndexSizeError value. - * - * MDN - */ + /** Inserts a new cell just before the given position in the row. If the given position is not given or is -1, it + * appends the cell to the row. If the given position is greater (or equal as it starts at zero) than the amount of + * cells in the row, or is smaller than -1, it raises a DOMException with the IndexSizeError value. + * + * MDN + */ def insertCell(index: Int = js.native): HTMLElement = js.native } -/** - * The HTMLHtmlElement interface serves as the root node for a given HTML document.  - * This object inherits the properties and methods described in the HTMLElement - * interface. - * - * MDN - */ +/** The HTMLHtmlElement interface serves as the root node for a given HTML document. This object inherits the properties + * and methods described in the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLHtmlElement extends HTMLElement -/** - * The HTMLQuoteElement interface provides special properties and methods (beyond - * the regular HTMLElement interface it also has available to it by inheritance) for - * manipulating quoting elements, like <blockquote> and <q>, but not the <cite> - * element. - * - * MDN - */ +/** The HTMLQuoteElement interface provides special properties and methods (beyond the regular HTMLElement interface it + * also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, + * but not the <cite> element. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLQuoteElement extends HTMLElement { var dateTime: String = js.native - /** - * Reflects the cite HTML attribute, containing a URL for the source of the quotation. - * - * MDN - */ + /** Reflects the cite HTML attribute, containing a URL for the source of the quotation. + * + * MDN + */ var cite: String = js.native } -/** - * The HTMLDListElement interface provides special properties (beyond those of the - * regular HTMLElement interface it also has available to it by inheritance) for - * manipulating definition list elements. - * - * MDN - */ +/** The HTMLDListElement interface provides special properties (beyond those of the regular HTMLElement interface it + * also has available to it by inheritance) for manipulating definition list elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLDListElement extends HTMLElement -/** - * The HTMLLabelElement interface gives access to properties specific to <label> - * elements. It inherits from HTMLElement. - * - * MDN - */ +/** The HTMLLabelElement interface gives access to properties specific to <label> elements. It inherits from + * HTMLElement. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLLabelElement extends HTMLElement { - /** - * The ID of the labeled control. Reflects the for attribute. - * - * MDN - */ + /** The ID of the labeled control. Reflects the for attribute. + * + * MDN + */ var htmlFor: String = js.native def form: HTMLFormElement = js.native } -/** - * The HTMLLegendElement is an interface allowing to access properties of the - * <legend> elements. It inherits properties and methods from the HTMLElement - * interface. - * - * MDN - */ +/** The HTMLLegendElement is an interface allowing to access properties of the <legend> elements. It inherits + * properties and methods from the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLLegendElement extends HTMLElement { @@ -1721,1482 +1439,1210 @@ abstract class HTMLLegendElement extends HTMLElement { def form: HTMLFormElement = js.native } -/** - * The HTMLLIElement interface expose specific properties and methods (beyond - * those defined by regular HTMLElement interface it also has available to it by - * inheritance) for manipulating list elements. - * - * MDN - */ +/** The HTMLLIElement interface expose specific properties and methods (beyond those defined by regular HTMLElement + * interface it also has available to it by inheritance) for manipulating list elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLLIElement extends HTMLElement { - /** - * Indicates the ordinal position of the list element inside a given <ol>. It reflects - * the value attribute of the HTML <li> element, and can be smaller than 0. If the <li> - * element is not a child of an <ol> element, the property has no meaning. - * - * MDN - */ + /** Indicates the ordinal position of the list element inside a given <ol>. It reflects the value attribute of + * the HTML <li> element, and can be smaller than 0. If the <li> element is not a child of an <ol> + * element, the property has no meaning. + * + * MDN + */ var value: Int = js.native } -/** - * The HTMLIFrameElement interface provides special properties and methods - * (beyond those of the HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of inline frame - * elements. - * - * MDN - */ +/** The HTMLIFrameElement interface provides special properties and methods (beyond those of the HTMLElement interface + * it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLIFrameElement extends HTMLElement with GetSVGDocument { - /** - * Reflects the width HTML attribute, indicating the width of the frame. - * - * MDN - */ + /** Reflects the width HTML attribute, indicating the width of the frame. + * + * MDN + */ var width: String = js.native - /** - * The window proxy for the nested browsing context. - * - * MDN - */ + /** The window proxy for the nested browsing context. + * + * MDN + */ def contentWindow: Window = js.native - /** - * Reflects the src HTML attribute, containing the address of the content to be - * embedded. - * - * MDN - */ + /** Reflects the src HTML attribute, containing the address of the content to be embedded. + * + * MDN + */ var src: String = js.native - /** - * Reflects the name HTML attribute, containing a name by which to refer to the frame. - * - * MDN - */ + /** Reflects the name HTML attribute, containing a name by which to refer to the frame. + * + * MDN + */ var name: String = js.native - /** - * Reflects the height HTML attribute, indicating the height of the frame. - * - * MDN - */ + /** Reflects the height HTML attribute, indicating the height of the frame. + * + * MDN + */ var height: String = js.native var border: String = js.native - /** - * The active document in the inline frame's nested browsing context. - * - * MDN - */ + /** The active document in the inline frame's nested browsing context. + * + * MDN + */ def contentDocument: Document = js.native var security: js.Any = js.native var onload: js.Function1[Event, _] = js.native - /** - * Reflects the sandbox HTML attribute, indicating extra restrictions on the - * behavior of the nested content. - * - * MDN - */ + /** Reflects the sandbox HTML attribute, indicating extra restrictions on the behavior of the nested content. + * + * MDN + */ var sandbox: DOMSettableTokenList = js.native } -/** - * The HTMLBodyElement interface provides special properties (beyond those of the - * regular HTMLElement interface they also inherit) for manipulating body - * elements. - * - * MDN - */ +/** The HTMLBodyElement interface provides special properties (beyond those of the regular HTMLElement interface they + * also inherit) for manipulating body elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLBodyElement extends HTMLElement { var scroll: String = js.native - /** - * Reflects the ononline HTML attribute value for a function to call when network - * communication is restored. - * - * MDN - */ + /** Reflects the ononline HTML attribute value for a function to call when network communication is restored. + * + * MDN + */ var ononline: js.Function1[Event, _] = js.native - /** - * Reflects the onmessage HTML attribute value for a function to call when the - * document receives a message. - * - * MDN - */ + /** Reflects the onmessage HTML attribute value for a function to call when the document receives a message. + * + * MDN + */ var onmessage: js.Function1[MessageEvent, _] = js.native - /** - * Exposes the window.onerror event handler to call when the document fails to load - * properly. Note: This handler is triggered when the event reaches the window, not - * the body element. Use addEventListener() to attach an event listener to the body - * element. - * - * MDN - */ + /** Exposes the window.onerror event handler to call when the document fails to load properly. Note: This handler is + * triggered when the event reaches the window, not the body element. Use addEventListener() to attach an event + * listener to the body element. + * + * MDN + */ var onerror: js.Function1[Event, _] = js.native - /** - * Reflects the onresize HTML attribute value for a function to call when the - * document has been resized. - * - * MDN - */ + /** Reflects the onresize HTML attribute value for a function to call when the document has been resized. + * + * MDN + */ var onresize: js.Function1[UIEvent, _] = js.native - /** - * Reflects the onafterprint HTML attribute value for a function to call after the - * user has printed the document. - * - * MDN - */ + /** Reflects the onafterprint HTML attribute value for a function to call after the user has printed the document. + * + * MDN + */ var onafterprint: js.Function1[Event, _] = js.native - /** - * Reflects the onbeforeprint HTML attribute value for a function to call when the - * user has requested printing the document. - * - * MDN - */ + /** Reflects the onbeforeprint HTML attribute value for a function to call when the user has requested printing the + * document. + * + * MDN + */ var onbeforeprint: js.Function1[Event, _] = js.native - /** - * Reflects the onoffline HTML attribute value for a function to call when network - * communication fails. - * - * MDN - */ + /** Reflects the onoffline HTML attribute value for a function to call when network communication fails. + * + * MDN + */ var onoffline: js.Function1[Event, _] = js.native - /** - * Reflects the onunload HTML attribute value for a function to call when when the - * document is going away. - * - * MDN - */ + /** Reflects the onunload HTML attribute value for a function to call when when the document is going away. + * + * MDN + */ var onunload: js.Function1[Event, _] = js.native - /** - * Reflects the onhashchange HTML attribute value for a function to call when the - * fragment identifier in the address of the document changes. - * - * MDN - */ + /** Reflects the onhashchange HTML attribute value for a function to call when the fragment identifier in the address + * of the document changes. + * + * MDN + */ var onhashchange: js.Function1[Event, _] = js.native - /** - * Exposes the window.onload event handler to call when the window gains focus. Note: - * This handler is triggered when the event reaches the window, not the body element. - * Use addEventListener() to attach an event listener to the body element. - * - * MDN - */ + /** Exposes the window.onload event handler to call when the window gains focus. Note: This handler is triggered when + * the event reaches the window, not the body element. Use addEventListener() to attach an event listener to the body + * element. + * + * MDN + */ var onload: js.Function1[Event, _] = js.native - /** - * Reflects the onbeforeunload HTML attribute value for a function to call when the - * document is about to be unloaded. - * - * MDN - */ + /** Reflects the onbeforeunload HTML attribute value for a function to call when the document is about to be unloaded. + * + * MDN + */ var onbeforeunload: js.Function1[BeforeUnloadEvent, _] = js.native - /** - * Reflects the onpopstate HTML attribute value for a function to call when the - * storage area has changed. - * - * MDN - */ + /** Reflects the onpopstate HTML attribute value for a function to call when the storage area has changed. + * + * MDN + */ var onstorage: js.Function1[StorageEvent, _] = js.native - /** - * Reflects the onpopstate HTML attribute value for a function to call when the user - * has navigated session history. - * - * MDN - */ + /** Reflects the onpopstate HTML attribute value for a function to call when the user has navigated session history. + * + * MDN + */ var onpopstate: js.Function1[PopStateEvent, _] = js.native } -/** - * The HTMLTableSectionElement interface provides special properties and methods - * (beyond the HTMLElement interface it also has available to it by inheritance) for - * manipulating the layout and presentation of sections, that is headers, footers - * and bodies, in an HTML table. - * - * MDN - */ +/** The HTMLTableSectionElement interface provides special properties and methods (beyond the HTMLElement interface it + * also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, + * footers and bodies, in an HTML table. + * + * MDN + */ @js.native @JSGlobal -abstract class HTMLTableSectionElement - extends HTMLElement with HTMLTableAlignment { - - /** - * Returns a live HTMLCollection containing the rows in the section. The - * HTMLCollection is live and is automatically updated when rows are added or - * removed. - * - * MDN - */ +abstract class HTMLTableSectionElement extends HTMLElement with HTMLTableAlignment { + + /** Returns a live HTMLCollection containing the rows in the section. The HTMLCollection is live and is automatically + * updated when rows are added or removed. + * + * MDN + */ def rows: HTMLCollection = js.native - /** - * Removes the cell at the given position in the section. If the given position is - * greater (or equal as it starts at zero) than the amount of rows in the section, or is - * smaller than 0, it raises a DOMException with the IndexSizeError value. - * - * MDN - */ + /** Removes the cell at the given position in the section. If the given position is greater (or equal as it starts at + * zero) than the amount of rows in the section, or is smaller than 0, it raises a DOMException with the + * IndexSizeError value. + * + * MDN + */ def deleteRow(index: Int = js.native): Unit = js.native - def moveRow(indexFrom: Int = js.native, - indexTo: Int = js.native): Object = js.native + def moveRow(indexFrom: Int = js.native, indexTo: Int = js.native): Object = js.native def insertRow(index: Int = js.native): HTMLElement = js.native } -/** - * The HTMLInputElement interface provides special properties and methods (beyond - * the regular HTMLElement interface it also has available to it by inheritance) for - * manipulating the layout and presentation of input elements. - * - * MDN - */ +/** The HTMLInputElement interface provides special properties and methods (beyond the regular HTMLElement interface it + * also has available to it by inheritance) for manipulating the layout and presentation of input elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLInputElement extends HTMLElement { - /** - * Reflects the width HTML attribute, which defines the width of the image displayed - * for the button, if the value of type is image. - * - * MDN - */ + /** Reflects the width HTML attribute, which defines the width of the image displayed for the button, if the value of + * type is image. + * + * MDN + */ var width: String = js.native var status: Boolean = js.native - /** - * The containing form element, if this element is in a form. If this element is not - * contained in a form element: HTML5 this can be the id attribute of any <form> element - * in the same document. Even if the attribute is set on <input>, this property will be - * null, if it isn't the id of a <form> element. HTML 4 this must be null. - * - * MDN - */ + /** The containing form element, if this element is in a form. If this element is not contained in a form element: + * HTML5 this can be the id attribute of any <form> element in the same document. Even if the attribute is set + * on <input>, this property will be null, if it isn't the id of a <form> element. HTML 4 this must be + * null. + * + * MDN + */ def form: HTMLFormElement = js.native - /** - * The index of the beginning of selected text. - * - * MDN - */ + /** The index of the beginning of selected text. + * + * MDN + */ var selectionStart: Int = js.native - /** - * Indicates that a checkbox is neither on nor off. - * - * MDN - */ + /** Indicates that a checkbox is neither on nor off. + * + * MDN + */ var indeterminate: Boolean = js.native - /** - * Reflects the readonly HTML attribute, indicating that the user cannot modify the - * value of the control. HTML5This is ignored if the value of the type attribute is - * hidden, range, color, checkbox, radio, file, or a button type. - * - * MDN - */ + /** Reflects the readonly HTML attribute, indicating that the user cannot modify the value of the control. HTML5This + * is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type. + * + * MDN + */ var readOnly: Boolean = js.native - /** - * Reflects the size HTML attribute, containing size of the control. This value is in - * pixels unless the value of type is text or password, in which case, it is an integer - * number of characters. HTML5 Applies only when type is set to text, search, tel, url, - * email, or password; otherwise it is ignored. - * - * MDN - */ + /** Reflects the size HTML attribute, containing size of the control. This value is in pixels unless the value of type + * is text or password, in which case, it is an integer number of characters. HTML5 Applies only when type is set to + * text, search, tel, url, email, or password; otherwise it is ignored. + * + * MDN + */ var size: Int = js.native - /** - * The index of the end of selected text. - * - * MDN - */ + /** The index of the end of selected text. + * + * MDN + */ var selectionEnd: Int = js.native - /** - * Reflects the accept HTML attribute, containing comma-separated list of file - * types accepted by the server when type is file. - * - * MDN - */ + /** Reflects the accept HTML attribute, containing comma-separated list of file types accepted by the server when type + * is file. + * + * MDN + */ var accept: String = js.native - /** - * Reflects the alt HTML attribute, containing alternative text to use when type is - * image. - * - * MDN - */ + /** Reflects the alt HTML attribute, containing alternative text to use when type is image. + * + * MDN + */ var alt: String = js.native - /** - * The default state of a radio button or checkbox as originally specified in HTML that - * created this object. - * - * MDN - */ + /** The default state of a radio button or checkbox as originally specified in HTML that created this object. + * + * MDN + */ var defaultChecked: Boolean = js.native - /** - * Current value in the control. - * - * MDN - */ + /** Current value in the control. + * + * MDN + */ var value: String = js.native - /** - * Reflects the src HTML attribute, which specifies a URI for the location of an image - * to display on the graphical submit button, if the value of type is image; otherwise - * it is ignored. - * - * MDN - */ + /** Reflects the src HTML attribute, which specifies a URI for the location of an image to display on the graphical + * submit button, if the value of type is image; otherwise it is ignored. + * + * MDN + */ var src: String = js.native - /** - * Reflects the name HTML attribute, containing a name that identifies the element - * when submitting the form. - * - * MDN - */ + /** Reflects the name HTML attribute, containing a name that identifies the element when submitting the form. + * + * MDN + */ var name: String = js.native - /** - * Reflects the height HTML attribute, which defines the height of the image - * displayed for the button, if the value of type is image. - * - * MDN - */ + /** Reflects the height HTML attribute, which defines the height of the image displayed for the button, if the value + * of type is image. + * + * MDN + */ var height: String = js.native - /** - * The current state of the element when type is checkbox or radio. - * - * MDN - */ + /** The current state of the element when type is checkbox or radio. + * + * MDN + */ var checked: Boolean = js.native - /** - * Reflects the disabled HTML attribute, indicating that the control is not available - * for interaction. The input values will not be submitted with the form. - * - * MDN - */ + /** Reflects the disabled HTML attribute, indicating that the control is not available for interaction. The input + * values will not be submitted with the form. + * + * MDN + */ var disabled: Boolean = js.native - /** - * Reflects the maxlength HTML attribute, containing the maximum length of text (in - * Unicode code points) that the value can be changed to. The constraint is evaluated - * only when the value is changed Note: If you set maxLength to a negative value - * programmatically, an exception will be thrown. - * - * MDN - */ + /** Reflects the maxlength HTML attribute, containing the maximum length of text (in Unicode code points) that the + * value can be changed to. The constraint is evaluated only when the value is changed Note: If you set maxLength to + * a negative value programmatically, an exception will be thrown. + * + * MDN + */ var maxLength: Int = js.native - /** - * Reflects the type HTML attribute, indicating the type of control to display. - * See type attribute of <input> for possible values. - */ + /** Reflects the type HTML attribute, indicating the type of control to display. See type attribute of <input> + * for possible values. + */ var `type`: String = js.native - /** - * The default value as originally specified in HTML that created this object. - * - * MDN - */ + /** The default value as originally specified in HTML that created this object. + * + * MDN + */ var defaultValue: String = js.native - /** - * Selects a range of text in the element (but does not focus it). The optional - * selectionDirection parameter may be "forward" or "backward" to establish the - * direction in which selection was set, or "none" if the direction is unknown or not - * relevant. The default is "none". Specifying a selectionDirection parameter sets - * the value of the selectionDirection property. - * - * MDN - */ + /** Selects a range of text in the element (but does not focus it). The optional selectionDirection parameter may be + * "forward" or "backward" to establish the direction in which selection was set, or "none" if the direction is + * unknown or not relevant. The default is "none". Specifying a selectionDirection parameter sets the value of the + * selectionDirection property. + * + * MDN + */ def setSelectionRange(start: Int, end: Int): Unit = js.native - /** - * Selects the input text in the element, and focuses it so the user can subsequently - * replace the whole entry. - * - * MDN - */ + /** Selects the input text in the element, and focuses it so the user can subsequently replace the whole entry. + * + * MDN + */ def select(): Unit = js.native - /** - * A localized message that describes the validation constraints that the control - * does not satisfy (if any). This is the empty string if the control is not a candidate - * for constraint validation (willvalidate is false), or it satisfies its - * constraints. - * - * MDN - */ + /** A localized message that describes the validation constraints that the control does not satisfy (if any). This is + * the empty string if the control is not a candidate for constraint validation (willvalidate is false), or it + * satisfies its constraints. + * + * MDN + */ def validationMessage: String = js.native var files: FileList = js.native - /** - * Reflects the max HTML attribute, containing the maximum (numeric or date-time) - * value for this item, which must not be less than its minimum (min attribute) value. - * - * MDN - */ + /** Reflects the max HTML attribute, containing the maximum (numeric or date-time) value for this item, which must not + * be less than its minimum (min attribute) value. + * + * MDN + */ var max: String = js.native - /** - * Reflects the formtarget HTML attribute, containing a name or keyword indicating - * where to display the response that is received after submitting the form. If - * specified, this attribute overrides the target attribute of the <form> element - * that owns this element. - * - * MDN - */ + /** Reflects the formtarget HTML attribute, containing a name or keyword indicating where to display the response that + * is received after submitting the form. If specified, this attribute overrides the target attribute of the + * <form> element that owns this element. + * + * MDN + */ var formTarget: String = js.native - /** - * Indicates whether the element is a candidate for constraint validation. It is - * false if any conditions bar it from constraint validation. - * - * MDN - */ + /** Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from + * constraint validation. + * + * MDN + */ def willValidate: Boolean = js.native - /** - * Reflects the step HTML attribute, which works with min and max to limit the - * increments at which a numeric or date-time value can be set. It can be the string any - * or a positive floating point number. If this is not set to any, the control accepts - * only values at multiples of the step value greater than the minimum. - * - * MDN - */ + /** Reflects the step HTML attribute, which works with min and max to limit the increments at which a numeric or + * date-time value can be set. It can be the string any or a positive floating point number. If this is not set to + * any, the control accepts only values at multiples of the step value greater than the minimum. + * + * MDN + */ var step: String = js.native - /** - * Reflects the autofocus HTML attribute, which specifies that a form control - * should have input focus when the page loads, unless the user overrides it, for - * example by typing in a different control. Only one form element in a document can - * have the autofocus attribute. It cannot be applied if the type attribute is set to - * hidden (that is, you cannot automatically set focus to a hidden control). - * - * MDN - */ + /** Reflects the autofocus HTML attribute, which specifies that a form control should have input focus when the page + * loads, unless the user overrides it, for example by typing in a different control. Only one form element in a + * document can have the autofocus attribute. It cannot be applied if the type attribute is set to hidden (that is, + * you cannot automatically set focus to a hidden control). + * + * MDN + */ var autofocus: Boolean = js.native - /** - * Reflects the required HTML attribute, indicating that the user must fill in a - * value before submitting a form. - * - * MDN - */ + /** Reflects the required HTML attribute, indicating that the user must fill in a value before submitting a form. + * + * MDN + */ var required: Boolean = js.native - /** - * Reflects the formenctype HTML attribute, containing the type of content that - * is used to submit the form to the server. If specified, this attribute - * overrides the enctype attribute of the <form> element that owns this element. - * - * MDN - */ + /** Reflects the formenctype HTML attribute, containing the type of content that is used to submit the form to the + * server. If specified, this attribute overrides the enctype attribute of the <form> element that owns this + * element. + * + * MDN + */ var formEnctype: String = js.native - /** - * The value of the element, interpreted as one of the following in order: a time value a - * number null if conversion is not possible - * - * MDN - */ + /** The value of the element, interpreted as one of the following in order: a time value a number null if conversion + * is not possible + * + * MDN + */ var valueAsNumber: Double = js.native - /** - * Reflects the placeholder HTML attribute, containing a hint to the user of what can - * be entered in the control. The placeholder text must not contain carriage returns - * or line-feeds. This attribute applies when the value of the type attribute is text, - * search, tel, url or email; otherwise it is ignored. - * - * MDN - */ + /** Reflects the placeholder HTML attribute, containing a hint to the user of what can be entered in the control. The + * placeholder text must not contain carriage returns or line-feeds. This attribute applies when the value of the + * type attribute is text, search, tel, url or email; otherwise it is ignored. + * + * MDN + */ var placeholder: String = js.native - /** - * Reflects the formmethod HTML attribute, containing the HTTP method that the - * browser uses to submit the form. If specified, this attribute overrides the method - * attribute of the <form> element that owns this element. - * - * MDN - */ + /** Reflects the formmethod HTML attribute, containing the HTTP method that the browser uses to submit the form. If + * specified, this attribute overrides the method attribute of the <form> element that owns this element. + * + * MDN + */ var formMethod: String = js.native - /** - * Identifies a list of pre-defined options to suggest to the user. The value must be - * the id of a <datalist> element in the same document. The browser displays only - * options that are valid values for this input element. This attribute is ignored - * when the type attribute's value is hidden, checkbox, radio, file, or a button type. - * - * MDN - */ + /** Identifies a list of pre-defined options to suggest to the user. The value must be the id of a <datalist> + * element in the same document. The browser displays only options that are valid values for this input element. This + * attribute is ignored when the type attribute's value is hidden, checkbox, radio, file, or a button type. + * + * MDN + */ var list: HTMLElement = js.native - /** - * Reflects the autocomplete HTML attribute, indicating whether the value of the - * control can be automatically completed by the browser. Ignored if the value of the - * type attribute is hidden, checkbox, radio, file, or a button type (button, submit, - * reset, image). Possible values are: off: The user must explicitly enter a value - * into this field for every use, or the document provides its own auto-completion - * method; the browser does not automatically complete the entry. on: The browser can - * automatically complete the value based on values that the user has entered during - * previous uses. - * - * MDN - */ + /** Reflects the autocomplete HTML attribute, indicating whether the value of the control can be automatically + * completed by the browser. Ignored if the value of the type attribute is hidden, checkbox, radio, file, or a button + * type (button, submit, reset, image). Possible values are: off: The user must explicitly enter a value into this + * field for every use, or the document provides its own auto-completion method; the browser does not automatically + * complete the entry. on: The browser can automatically complete the value based on values that the user has entered + * during previous uses. + * + * MDN + */ var autocomplete: String = js.native - /** - * Reflects the min HTML attribute, containing the minimum (numeric or date-time) - * value for this item, which must not be greater than its maximum (max attribute) - * value. - * - * MDN - */ + /** Reflects the min HTML attribute, containing the minimum (numeric or date-time) value for this item, which must not + * be greater than its maximum (max attribute) value. + * + * MDN + */ var min: String = js.native - /** - * Reflects the formaction HTML attribute, containing the URI of a program that - * processes information submitted by the element. If specified, this attribute - * overrides the action attribute of the <form> element that owns this element. - * - * MDN - */ + /** Reflects the formaction HTML attribute, containing the URI of a program that processes information submitted by + * the element. If specified, this attribute overrides the action attribute of the <form> element that owns + * this element. + * + * MDN + */ var formAction: String = js.native - /** - * Reflects the pattern HTML attribute, containing a regular expression that the - * control's value is checked against. The pattern must match the entire value, not - * just some subset. Use the title attribute to describe the pattern to help the user. - * This attribute applies when the value of the type attribute is text, search, tel, - * url or email; otherwise it is ignored. - * - * MDN - */ + /** Reflects the pattern HTML attribute, containing a regular expression that the control's value is checked against. + * The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to + * help the user. This attribute applies when the value of the type attribute is text, search, tel, url or email; + * otherwise it is ignored. + * + * MDN + */ var pattern: String = js.native - /** - * The validity state that this element is in.  - * - * MDN - */ + /** The validity state that this element is in. + * + * MDN + */ def validity: ValidityState = js.native - /** - * Reflects the formnovalidate HTML attribute, indicating that the form is not to - * be validated when it is submitted. If specified, this attribute overrides the - * novalidate attribute of the <form> element that owns this element. - * - * MDN - */ + /** Reflects the formnovalidate HTML attribute, indicating that the form is not to be validated when it is submitted. + * If specified, this attribute overrides the novalidate attribute of the <form> element that owns this + * element. + * + * MDN + */ var formNoValidate: String = js.native - /** - * Reflects the multiple HTML attribute, indicating whether more than one value is - * possible (e.g., multiple files). - * - * MDN - */ + /** Reflects the multiple HTML attribute, indicating whether more than one value is possible (e.g., multiple files). + * + * MDN + */ var multiple: Boolean = js.native - /** - * Returns false if the element is a candidate for constraint validation, and it does - * not satisfy its constraints. In this case, it also fires an invalid event at the - * element. It returns true if the element is not a candidate for constraint - * validation, or if it satisfies its constraints. - * - * MDN - */ + /** Returns false if the element is a candidate for constraint validation, and it does not satisfy its constraints. In + * this case, it also fires an invalid event at the element. It returns true if the element is not a candidate for + * constraint validation, or if it satisfies its constraints. + * + * MDN + */ def checkValidity(): Boolean = js.native - /** - * Decrements the value by (step * n), where n defaults to 1 if not specified. Throws an - * INVALID_STATE_ERR exception: if the method is not applicable to for the current - * type value. if the element has no step value. if the value cannot be converted to a - * number. if the resulting value is above the max or below the min.  - * - * MDN - */ + /** Decrements the value by (step * n), where n defaults to 1 if not specified. Throws an INVALID_STATE_ERR exception: + * if the method is not applicable to for the current type value. if the element has no step value. if the value + * cannot be converted to a number. if the resulting value is above the max or below the min. + * + * MDN + */ def stepDown(n: Int = js.native): Unit = js.native - /** - * Increments the value by (step * n), where n defaults to 1 if not specified. Throws an - * INVALID_STATE_ERR exception: if the method is not applicable to for the current - * type value. if the element has no step value. if the value cannot be converted to a - * number. if the resulting value is above the max or below the min. - * - * MDN - */ + /** Increments the value by (step * n), where n defaults to 1 if not specified. Throws an INVALID_STATE_ERR exception: + * if the method is not applicable to for the current type value. if the element has no step value. if the value + * cannot be converted to a number. if the resulting value is above the max or below the min. + * + * MDN + */ def stepUp(n: Int = js.native): Unit = js.native - /** - * Sets a custom validity message for the element. If this message is not the empty - * string, then the element is suffering from a custom validity error, and does not - * validate. - * - * MDN - */ + /** Sets a custom validity message for the element. If this message is not the empty string, then the element is + * suffering from a custom validity error, and does not validate. + * + * MDN + */ def setCustomValidity(error: String): Unit = js.native } -/** - * The HTMLAnchorElement interface represents hyperlink elements and provides - * special properties and methods (beyond those of the regular HTMLElement object - * interface they also have available to them by inheritance) for manipulating the - * layout and presentation of such elements. - * - * MDN - */ +/** The HTMLAnchorElement interface represents hyperlink elements and provides special properties and methods (beyond + * those of the regular HTMLElement object interface they also have available to them by inheritance) for manipulating + * the layout and presentation of such elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLAnchorElement extends HTMLElement { - /** - * Is a DOMString that reflects the rel HTML attribute, specifying the relationship - * of the target object to the link object. - * - * MDN - */ + /** Is a DOMString that reflects the rel HTML attribute, specifying the relationship of the target object to the link + * object. + * + * MDN + */ var rel: String = js.native - /** - * Is a DOMString representing the protocol component, including trailing colon - * (':'), of the referenced URL. - * - * MDN - */ + /** Is a DOMString representing the protocol component, including trailing colon (':'), of the referenced URL. + * + * MDN + */ var protocol: String = js.native - /** - * Is a DOMString representing tThe search element, including leading question mark - * ('?'), if any, of the referenced URL. - * - * MDN - */ + /** Is a DOMString representing tThe search element, including leading question mark ('?'), if any, of the referenced + * URL. + * + * MDN + */ var search: String = js.native - /** - * Is a DOMString representing the hostname in the referenced URL. - * - * MDN - */ + /** Is a DOMString representing the hostname in the referenced URL. + * + * MDN + */ var hostname: String = js.native - /** - * Is a DOMString representing the path name component, if any, of the referenced URL. - * - * MDN - */ + /** Is a DOMString representing the path name component, if any, of the referenced URL. + * + * MDN + */ var pathname: String = js.native - /** - * Is a DOMString that reflects the target HTML attribute, indicating where to - * display the linked resource. - * - * MDN - */ + /** Is a DOMString that reflects the target HTML attribute, indicating where to display the linked resource. + * + * MDN + */ var target: String = js.native - /** - * Is a DOMString that reflects the href HTML attribute, containing a valid URL of a - * linked resource. - * - * MDN - */ + /** Is a DOMString that reflects the href HTML attribute, containing a valid URL of a linked resource. + * + * MDN + */ var href: String = js.native - /** - * Is a DOMString representing the character encoding of the linked resource. - * - * MDN - */ + /** Is a DOMString representing the character encoding of the linked resource. + * + * MDN + */ var charset: String = js.native - /** - * Is a DOMString that reflects the hreflang HTML attribute, indicating the language - * of the linked resource. - * - * MDN - */ + /** Is a DOMString that reflects the hreflang HTML attribute, indicating the language of the linked resource. + * + * MDN + */ var hreflang: String = js.native - /** - * Is a DOMString representing the port component, if any, of the referenced URL. - * - * MDN - */ + /** Is a DOMString representing the port component, if any, of the referenced URL. + * + * MDN + */ var port: String = js.native - /** - * Is a DOMString representing the hostname and port (if it's not the default port) in - * the referenced URL. - * - * MDN - */ + /** Is a DOMString representing the hostname and port (if it's not the default port) in the referenced URL. + * + * MDN + */ var host: String = js.native - /** - * Is a DOMString representing the fragment identifier, including the leading hash - * mark ('#'), if any, in the referenced URL. - * - * MDN - */ + /** Is a DOMString representing the fragment identifier, including the leading hash mark ('#'), if any, in the + * referenced URL. + * + * MDN + */ var hash: String = js.native var `type`: String = js.native var mimeType: String = js.native - /** - * Is a DOMString being a synonym for the Node.textContent property. - * - * MDN - */ + /** Is a DOMString being a synonym for the Node.textContent property. + * + * MDN + */ var text: String = js.native } -/** - * The HTMLParamElement interface provides special properties (beyond those of the - * regular HTMLElement object interface it inherits) for manipulating <param> - * elements, representing a pair of a key and a value that acts as a parameter for an - * <object> element. - * - * MDN - */ +/** The HTMLParamElement interface provides special properties (beyond those of the regular HTMLElement object interface + * it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a + * parameter for an <object> element. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLParamElement extends HTMLElement { - /** - * Is a DOMString representing the value associated to the parameter. It reflects the - * value attribute. - * - * MDN - */ + /** Is a DOMString representing the value associated to the parameter. It reflects the value attribute. + * + * MDN + */ var value: String = js.native - /** - * Is a DOMString representing the name of the parameter. It reflects the name - * attribute. - * - * MDN - */ + /** Is a DOMString representing the name of the parameter. It reflects the name attribute. + * + * MDN + */ var name: String = js.native } -/** - * The HTMLPreElement interface expose specific properties and methods (beyond - * those defined by regular HTMLElement interface it also has available to it by - * inheritance) for manipulating block of preformatted text. - * - * MDN - */ +/** The HTMLPreElement interface expose specific properties and methods (beyond those defined by regular HTMLElement + * interface it also has available to it by inheritance) for manipulating block of preformatted text. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLPreElement extends HTMLElement -/** - * The HTMLCanvasElement interface provides properties and methods for - * manipulating the layout and presentation of canvas elements. The - * HTMLCanvasElement interface also inherits the properties and methods of the - * HTMLElement interface. - * - * MDN - */ +/** The HTMLCanvasElement interface provides properties and methods for manipulating the layout and presentation of + * canvas elements. The HTMLCanvasElement interface also inherits the properties and methods of the HTMLElement + * interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLCanvasElement extends HTMLElement { - /** - * Reflects the width HTML attribute, specifying the width of the coordinate space in - * CSS pixels. - * - * MDN - */ + /** Reflects the width HTML attribute, specifying the width of the coordinate space in CSS pixels. + * + * MDN + */ var width: Int = js.native - /** - * Reflects the height HTML attribute, specifying the height of the coordinate space - * in CSS pixels. - * - * MDN - */ + /** Reflects the height HTML attribute, specifying the height of the coordinate space in CSS pixels. + * + * MDN + */ var height: Int = js.native - /** - * Returns a data: URL containing a representation of the image in the format - * specified by type (defaults to PNG). The returned image is 96dpi. If the height or - * width of the canvas is 0, "data:," representing the empty string, is returned. If - * the type requested is not image/png, and the returned value starts with - * data:image/png, then the requested type is not supported. Chrome supports the - * image/webp type. If the requested type is image/jpeg or image/webp, then the - * second argument, if it is between 0.0 and 1.0, is treated as indicating image - * quality; if the second argument is anything else, the default value for image - * quality is used. Other arguments are ignored. - * - * MDN - */ + /** Returns a data: URL containing a representation of the image in the format specified by type (defaults to PNG). + * The returned image is 96dpi. If the height or width of the canvas is 0, "data:," representing the empty string, is + * returned. If the type requested is not image/png, and the returned value starts with data:image/png, then the + * requested type is not supported. Chrome supports the image/webp type. If the requested type is image/jpeg or + * image/webp, then the second argument, if it is between 0.0 and 1.0, is treated as indicating image quality; if the + * second argument is anything else, the default value for image quality is used. Other arguments are ignored. + * + * MDN + */ def toDataURL(`type`: String, args: js.Any*): String = js.native - /** - * Returns a drawing context on the canvas, or null if the context ID is not supported. A - * drawing context lets you draw on the canvas. Calling getContext with "2d" returns a - * CanvasRenderingContext2D object, whereas calling it with - * "experimental-webgl" (or "webgl") returns a WebGLRenderingContext object. - * This context is only available on browsers that implement WebGL. - * - * MDN - */ + /** Returns a drawing context on the canvas, or null if the context ID is not supported. A drawing context lets you + * draw on the canvas. Calling getContext with "2d" returns a CanvasRenderingContext2D object, whereas calling it + * with "experimental-webgl" (or "webgl") returns a WebGLRenderingContext object. This context is only available on + * browsers that implement WebGL. + * + * MDN + */ def getContext(contextId: String, args: js.Any*): js.Dynamic = js.native } -/** - * The HTMLTitleElement interface contains the title for a document. This element - * inherits all of the properties and methods of the HTMLElement interface. - * - * MDN - */ +/** The HTMLTitleElement interface contains the title for a document. This element inherits all of the properties and + * methods of the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLTitleElement extends HTMLElement { - /** - * DOMString representing the text of the document's title. - * - * MDN - */ + /** DOMString representing the text of the document's title. + * + * MDN + */ var text: String = js.native } -/** - * The HTMLStyleElement interface represents a <style> element. It inherits - * properties and methods from its parent, HTMLElement, and from LinkStyle. - * - * MDN - */ +/** The HTMLStyleElement interface represents a <style> element. It inherits properties and methods from its + * parent, HTMLElement, and from LinkStyle. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLStyleElement extends HTMLElement with LinkStyle { - /** - * Is a DOMString representing the intended destination medium for style - * information. - * - * MDN - */ + /** Is a DOMString representing the intended destination medium for style information. + * + * MDN + */ var media: String = js.native - /** - * Returns the type of the current style. - * - * MDN - */ + /** Returns the type of the current style. + * + * MDN + */ var `type`: String = js.native } -/** - * The HTMLUnknownElement interface represents an invalid HTML element and derives - * from the HTMLElement interface, but without implementing any additional - * properties or methods. - * - * MDN - */ +/** The HTMLUnknownElement interface represents an invalid HTML element and derives from the HTMLElement interface, but + * without implementing any additional properties or methods. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLUnknownElement extends HTMLElement -/** - * The HTMLAudioElement interface provides access to the properties of <audio> - * elements, as well as methods to manipulate them. It derives from the - * HTMLMediaElement interface. - * - * MDN - */ +/** The HTMLAudioElement interface provides access to the properties of <audio> elements, as well as methods to + * manipulate them. It derives from the HTMLMediaElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLAudioElement extends HTMLMediaElement -/** - * The HTMLTableCellElement interface provides special properties and methods - * (beyond the regular HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of table cells, either - * header or data cells, in an HTML document. - * - * MDN - */ +/** The HTMLTableCellElement interface provides special properties and methods (beyond the regular HTMLElement interface + * it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either + * header or data cells, in an HTML document. + * + * MDN + */ @js.native @JSGlobal -abstract class HTMLTableCellElement - extends HTMLElement with HTMLTableAlignment { - - /** - * Is a DOMSettableTokenList describing a list of id of <th> elements that represents - * headers associated with the cell. It reflects the headers attribute. - * - * MDN - */ +abstract class HTMLTableCellElement extends HTMLElement with HTMLTableAlignment { + + /** Is a DOMSettableTokenList describing a list of id of <th> elements that represents headers associated with + * the cell. It reflects the headers attribute. + * + * MDN + */ def headers: String = js.native - /** - * Is a long representing the cell position in the cells collection of the <tr> it - * belongs to. If the cell doesn't belong to a <tr>, it returns -1. - * - * MDN - */ + /** Is a long representing the cell position in the cells collection of the <tr> it belongs to. If the cell + * doesn't belong to a <tr>, it returns -1. + * + * MDN + */ def cellIndex: Int = js.native - /** - * Is an unsigned long that represents the number of columns this cell must span. It - * reflects the colspan attribute. - * - * MDN - */ + /** Is an unsigned long that represents the number of columns this cell must span. It reflects the colspan attribute. + * + * MDN + */ var colSpan: Int = js.native - /** - * Is an unsigned long that represents the number of rows this cell must span. It - * reflects the rowspan attribute. - * - * MDN - */ + /** Is an unsigned long that represents the number of rows this cell must span. It reflects the rowspan attribute. + * + * MDN + */ var rowSpan: Int = js.native } -/** - * The HTMLTextAreaElement interface, which provides special properties and - * methods (beyond the regular HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of <textarea> - * elements. - * - * MDN - */ +/** The HTMLTextAreaElement interface, which provides special properties and methods (beyond the regular HTMLElement + * interface it also has available to it by inheritance) for manipulating the layout and presentation of + * <textarea> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLTextAreaElement extends HTMLElement { - /** - * The raw value contained in the control. - * - * MDN - */ + /** The raw value contained in the control. + * + * MDN + */ var value: String = js.native var status: js.Any = js.native - /** - * The containing form element, if this element is in a form. If this element is not - * contained in a form element, it can be the id attribute of any <form> element in the - * same document or the value null. - * - * MDN - */ + /** The containing form element, if this element is in a form. If this element is not contained in a form element, it + * can be the id attribute of any <form> element in the same document or the value null. + * + * MDN + */ def form: HTMLFormElement = js.native - /** - * Reflects name HTML attribute, containing the name of the control. - * - * MDN - */ + /** Reflects name HTML attribute, containing the name of the control. + * + * MDN + */ var name: String = js.native - /** - * Reflects the disabled HTML attribute, indicating that the control is not available - * for interaction. - * - * MDN - */ + /** Reflects the disabled HTML attribute, indicating that the control is not available for interaction. + * + * MDN + */ var disabled: Boolean = js.native - /** - * The index of the beginning of selected text. If no text is selected, contains the - * index of the character that follows the input cursor. On being set, the control - * behaves as if setSelectionRange() had been called with this as the first argument, - * and selectionEnd as the second argument. - * - * MDN - */ + /** The index of the beginning of selected text. If no text is selected, contains the index of the character that + * follows the input cursor. On being set, the control behaves as if setSelectionRange() had been called with this as + * the first argument, and selectionEnd as the second argument. + * + * MDN + */ var selectionStart: Int = js.native - /** - * Reflects the rows HTML attribute, indicating the number of visible text lines for - * the control. - * - * MDN - */ + /** Reflects the rows HTML attribute, indicating the number of visible text lines for the control. + * + * MDN + */ var rows: Int = js.native - /** - * Reflects the cols HTML attribute, indicating the visible width of the text area. - * - * MDN - */ + /** Reflects the cols HTML attribute, indicating the visible width of the text area. + * + * MDN + */ var cols: Int = js.native - /** - * Reflects the readonly HTML attribute, indicating that the user cannot modify the - * value of the control. - * - * MDN - */ + /** Reflects the readonly HTML attribute, indicating that the user cannot modify the value of the control. + * + * MDN + */ var readOnly: Boolean = js.native - /** - * Reflects the wrap HTML attribute, indicating how the control wraps text. - * - * MDN - */ + /** Reflects the wrap HTML attribute, indicating how the control wraps text. + * + * MDN + */ var wrap: String = js.native - /** - * The index of the end of selected text. If no text is selected, contains the index of - * the character that follows the input cursor. On being set, the control behaves as if - * setSelectionRange() had been called with this as the second argument, and - * selectionStart as the first argument. - * - * MDN - */ + /** The index of the end of selected text. If no text is selected, contains the index of the character that follows + * the input cursor. On being set, the control behaves as if setSelectionRange() had been called with this as the + * second argument, and selectionStart as the first argument. + * + * MDN + */ var selectionEnd: Int = js.native - /** - * The string textarea. - */ + /** The string textarea. + */ def `type`: String = js.native - /** - * The control's default value, which behaves like the element.textContent - * property. - * - * MDN - */ + /** The control's default value, which behaves like the element.textContent property. + * + * MDN + */ var defaultValue: String = js.native - /** - * Selects a range of text, and sets selectionStart and selectionEnd. If either - * argument is greater than the length of the value, it is treated as pointing to the end - * of the value. If end is less than start, then both are treated as the value of end. - * - * MDN - */ + /** Selects a range of text, and sets selectionStart and selectionEnd. If either argument is greater than the length + * of the value, it is treated as pointing to the end of the value. If end is less than start, then both are treated + * as the value of end. + * + * MDN + */ def setSelectionRange(start: Int, end: Int): Unit = js.native - /** - * Selects the contents of the control. - * - * MDN - */ + /** Selects the contents of the control. + * + * MDN + */ def select(): Unit = js.native - /** - * A localized message that describes the validation constraints that the control - * does not satisfy (if any). This is the empty string if the control is not a candidate - * for constraint validation (willValidate is false), or it satisfies its - * constraints. - * - * MDN - */ + /** A localized message that describes the validation constraints that the control does not satisfy (if any). This is + * the empty string if the control is not a candidate for constraint validation (willValidate is false), or it + * satisfies its constraints. + * + * MDN + */ def validationMessage: String = js.native - /** - * Reflects the autofocus HTML attribute, indicating that the control should have - * input focus when the page loads - * - * MDN - */ + /** Reflects the autofocus HTML attribute, indicating that the control should have input focus when the page loads + * + * MDN + */ var autofocus: Boolean = js.native - /** - * The validity states that this element is in. - * - * MDN - */ + /** The validity states that this element is in. + * + * MDN + */ def validity: ValidityState = js.native - /** - * Reflects the required HTML attribute, indicating that the user must specify a - * value before submitting the form. - * - * MDN - */ + /** Reflects the required HTML attribute, indicating that the user must specify a value before submitting the form. + * + * MDN + */ var required: Boolean = js.native - /** - * Reflects the maxlength HTML attribute, indicating the maximum number of - * characters the user can enter. This constraint is evaluated only when the value - * changes. - * - * MDN - */ + /** Reflects the maxlength HTML attribute, indicating the maximum number of characters the user can enter. This + * constraint is evaluated only when the value changes. + * + * MDN + */ var maxLength: Int = js.native - /** - * Indicates whether the element is a candidate for constraint validation. It is - * false if any conditions bar it from constraint validation. - * - * MDN - */ + /** Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from + * constraint validation. + * + * MDN + */ def willValidate: Boolean = js.native - /** - * Reflects the placeholder HTML attribute, containing a hint to the user about what - * to enter in the control. - * - * MDN - */ + /** Reflects the placeholder HTML attribute, containing a hint to the user about what to enter in the control. + * + * MDN + */ var placeholder: String = js.native - /** - * Returns false if the button is a candidate for constraint validation, and it does - * not satisfy its constraints. In this case, it also fires an invalid event at the - * control. It returns true if the control is not a candidate for constraint - * validation, or if it satisfies its constraints. - * - * MDN - */ + /** Returns false if the button is a candidate for constraint validation, and it does not satisfy its constraints. In + * this case, it also fires an invalid event at the control. It returns true if the control is not a candidate for + * constraint validation, or if it satisfies its constraints. + * + * MDN + */ def checkValidity(): Boolean = js.native - /** - * Sets a custom validity message for the element. If this message is not the empty - * string, then the element is suffering from a custom validity error, and does not - * validate. - * - * MDN - */ + /** Sets a custom validity message for the element. If this message is not the empty string, then the element is + * suffering from a custom validity error, and does not validate. + * + * MDN + */ def setCustomValidity(error: String): Unit = js.native } -/** - * The HTMLModElement interface provides special properties (beyond the regular - * methods and properties available through the HTMLElement interface they also - * have available to them by inheritance) for manipulating modification elements, - * that is <del> and <ins>. - * - * MDN - */ +/** The HTMLModElement interface provides special properties (beyond the regular methods and properties available + * through the HTMLElement interface they also have available to them by inheritance) for manipulating modification + * elements, that is <del> and <ins>. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLModElement extends HTMLElement { var dateTime: String = js.native - /** - * Reflects the cite HTML attribute, containing a URI of a resource explaining the - * change. - * - * MDN - */ + /** Reflects the cite HTML attribute, containing a URI of a resource explaining the change. + * + * MDN + */ var cite: String = js.native } -/** - * The HTMLTableColElement interface provides special properties (beyond the - * HTMLElement interface it also has available to it inheritance) for manipulating - * single or grouped table column elements. - * - * MDN - */ +/** The HTMLTableColElement interface provides special properties (beyond the HTMLElement interface it also has + * available to it inheritance) for manipulating single or grouped table column elements. + * + * MDN + */ @js.native @JSGlobal -abstract class HTMLTableColElement - extends HTMLElement with HTMLTableAlignment { - - /** - * Reflects the span HTML attribute, indicating the number of columns to apply this - * object's attributes to. Must be a positive integer. - * - * MDN - */ +abstract class HTMLTableColElement extends HTMLElement with HTMLTableAlignment { + + /** Reflects the span HTML attribute, indicating the number of columns to apply this object's attributes to. Must be a + * positive integer. + * + * MDN + */ var span: Int = js.native } @js.native trait HTMLTableAlignment extends js.Object -/** - * The HTMLUListElement interface provides special properties (beyond those - * defined on the regular HTMLElement interface it also has available to it by - * inheritance) for manipulating unordered list elements. - * - * MDN - */ +/** The HTMLUListElement interface provides special properties (beyond those defined on the regular HTMLElement + * interface it also has available to it by inheritance) for manipulating unordered list elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLUListElement extends HTMLElement -/** - * The HTMLDivElement interface provides special properties (beyond the regular - * HTMLElement interface it also has available to it by inheritance) for - * manipulating div elements. - * - * MDN - */ +/** The HTMLDivElement interface provides special properties (beyond the regular HTMLElement interface it also has + * available to it by inheritance) for manipulating div elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLDivElement extends HTMLElement -/** - * The HTMLBRElement interface represents a HTML line break element (<br>). It - * inherits from HTMLElement. - * - * MDN - */ +/** The HTMLBRElement interface represents a HTML line break element (<br>). It inherits from HTMLElement. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLBRElement extends HTMLElement -/** - * The HTMLMediaElement interface has special properties and methods (beyond the - * properties and methods available for all children of HTMLElement), that are - * common to all media-related objects. - * - * MDN - */ +/** The HTMLMediaElement interface has special properties and methods (beyond the properties and methods available for + * all children of HTMLElement), that are common to all media-related objects. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLMediaElement extends HTMLElement { - /** - * The initial playback position in seconds. - * - * MDN - */ + /** The initial playback position in seconds. + * + * MDN + */ def initialTime: Double = js.native - /** - * The ranges of the media source that the browser has played, if any. - * - * MDN - */ + /** The ranges of the media source that the browser has played, if any. + * + * MDN + */ def played: TimeRanges = js.native - /** - * The absolute URL of the chosen media resource (if, for example, the server selects a - * media file based on the resolution of the user's display), or an empty string if the - * networkState is EMPTY. - * - * MDN - */ + /** The absolute URL of the chosen media resource (if, for example, the server selects a media file based on the + * resolution of the user's display), or an empty string if the networkState is EMPTY. + * + * MDN + */ def currentSrc: String = js.native - /** - * Reflects the loop HTML attribute, indicating whether the media element should - * start over when it reaches the end. - * - * MDN - */ + /** Reflects the loop HTML attribute, indicating whether the media element should start over when it reaches the end. + * + * MDN + */ var loop: Boolean = js.native - /** - * Indicates whether the media element has ended playback. - * - * MDN - */ + /** Indicates whether the media element has ended playback. + * + * MDN + */ def ended: Boolean = js.native - /** - * The ranges of the media source that the browser has buffered (if any) at the moment - * the buffered property is accessed. The returned TimeRanges object is normalized. - * - * MDN - */ + /** The ranges of the media source that the browser has buffered (if any) at the moment the buffered property is + * accessed. The returned TimeRanges object is normalized. + * + * MDN + */ def buffered: TimeRanges = js.native - /** - * The MediaError object for the most recent error, or null if there has not been an - * error. - * - * MDN - */ + /** The MediaError object for the most recent error, or null if there has not been an error. + * + * MDN + */ def error: MediaError = js.native - /** - * The time ranges that the user is able to seek to, if any. - * - * MDN - */ + /** The time ranges that the user is able to seek to, if any. + * + * MDN + */ def seekable: TimeRanges = js.native - /** - * Reflects the autoplay HTML attribute, indicating whether playback should - * automatically begin as soon as enough media is available to do so without - * interruption. - * - * MDN - */ + /** Reflects the autoplay HTML attribute, indicating whether playback should automatically begin as soon as enough + * media is available to do so without interruption. + * + * MDN + */ var autoplay: Boolean = js.native - /** - * Reflects the controls HTML attribute, indicating whether user interface items - * for controlling the resource should be displayed. - * - * MDN - */ + /** Reflects the controls HTML attribute, indicating whether user interface items for controlling the resource should + * be displayed. + * + * MDN + */ var controls: Boolean = js.native - /** - * The audio volume, from 0.0 (silent) to 1.0 (loudest). - * - * MDN - */ + /** The audio volume, from 0.0 (silent) to 1.0 (loudest). + * + * MDN + */ var volume: Double = js.native - /** - * Reflects the src HTML attribute, containing the URL of a media resource to use. - * Gecko implements a similar functionality is available for streams: - * mozSrcObject. - * - * MDN - */ + /** Reflects the src HTML attribute, containing the URL of a media resource to use. Gecko implements a similar + * functionality is available for streams: mozSrcObject. + * + * MDN + */ var src: String = js.native - /** - * The current rate at which the media is being played back. This is used to implement - * user controls for fast forward, slow motion, and so forth. The normal playback rate - * is multiplied by this value to obtain the current rate, so a value of 1.0 indicates - * normal speed. If the playbackRate is negative, the media is played backwards. The - * audio is muted when the media plays backwards or if the fast forward or slow motion is - * outside a useful range (E.g. Gecko mute the sound outside the range 0.25 and 5.0). - * The pitch of the audio is corrected by default and is the same for every speed. Some - * navigators implement the non-standard preservespitch property to control this. - * - * MDN - */ + /** The current rate at which the media is being played back. This is used to implement user controls for fast + * forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current + * rate, so a value of 1.0 indicates normal speed. If the playbackRate is negative, the media is played backwards. + * The audio is muted when the media plays backwards or if the fast forward or slow motion is outside a useful range + * (E.g. Gecko mute the sound outside the range 0.25 and 5.0). The pitch of the audio is corrected by default and is + * the same for every speed. Some navigators implement the non-standard preservespitch property to control this. + * + * MDN + */ var playbackRate: Double = js.native - /** - * The length of the media in seconds, or zero if no media data is available.  If the - * media data is available but the length is unknown, this value is NaN.  If the media is - * streamed and has no predefined length, the value is Inf. - * - * MDN - */ + /** The length of the media in seconds, or zero if no media data is available.  If the media data is available but the + * length is unknown, this value is NaN.  If the media is streamed and has no predefined length, the value is Inf. + * + * MDN + */ def duration: Double = js.native - /** - * true if the audio is muted, and false otherwise. - * - * MDN - */ + /** true if the audio is muted, and false otherwise. + * + * MDN + */ var muted: Boolean = js.native - /** - * The default playback rate for the media. 1.0 is "normal speed," values lower than - * 1.0 make the media play slower than normal, higher values make it play faster. The - * value 0.0 is invalid and throws a NOT_SUPPORTED_ERR exception. - * - * MDN - */ + /** The default playback rate for the media. 1.0 is "normal speed," values lower than + * 1.0 make the media play slower than normal, higher values make it play faster. The value 0.0 is invalid and throws + * a NOT_SUPPORTED_ERR exception. + * + * MDN + */ var defaultPlaybackRate: Double = js.native - /** - * Indicates whether the media element is paused. - * - * MDN - */ + /** Indicates whether the media element is paused. + * + * MDN + */ def paused: Boolean = js.native - /** - * Indicates whether the media is in the process of seeking to a new position. - * - * MDN - */ + /** Indicates whether the media is in the process of seeking to a new position. + * + * MDN + */ def seeking: Boolean = js.native - /** - * The current playback time, in seconds. Setting this value seeks the media to the new - * time. - * - * MDN - */ + /** The current playback time, in seconds. Setting this value seeks the media to the new time. + * + * MDN + */ var currentTime: Double = js.native - /** - * Reflects the preload HTML attribute, indicating what data should be preloaded, if - * any. Possible values are: none, metadata, auto. See preload attribute - * documentation for details. - * - * MDN - */ + /** Reflects the preload HTML attribute, indicating what data should be preloaded, if any. Possible values are: none, + * metadata, auto. See preload attribute documentation for details. + * + * MDN + */ var preload: String = js.native - /** - * The current state of fetching the media over the network. Constant Value - * Description NETWORK_EMPTY 0 There is no data yet.  The readyState is also - * HAVE_NOTHING. NETWORK_IDLE 1   NETWORK_LOADING 2 The media is loading. - * NETWORK_NO_SOURCE[1] 3   - * - * MDN - */ + /** The current state of fetching the media over the network. Constant Value Description NETWORK_EMPTY 0 There is no + * data yet.  The readyState is also HAVE_NOTHING. NETWORK_IDLE 1   NETWORK_LOADING 2 The media is loading. + * NETWORK_NO_SOURCE[1] 3 + * + * MDN + */ def networkState: Int = js.native def pause(): Unit = js.native - /** - * Begins playback of the media. If you have changed the src attribute of the media - * element since the page was loaded, you must call load() before play(), otherwise - * the original media plays again. - * - * MDN - */ + /** Begins playback of the media. If you have changed the src attribute of the media element since the page was + * loaded, you must call load() before play(), otherwise the original media plays again. + * + * MDN + */ def play(): js.UndefOr[js.Promise[Unit]] = js.native - /** - * Begins loading the media content from the server. - * - * MDN - */ + /** Begins loading the media content from the server. + * + * MDN + */ def load(): Unit = js.native - /** - * Determines whether the specified media type can be played back. - * - * MDN - */ + /** Determines whether the specified media type can be played back. + * + * MDN + */ def canPlayType(`type`: String): String = js.native - /** - * Represents the list of TextTrack objects contained in the element. - * - * MDN - */ + /** Represents the list of TextTrack objects contained in the element. + * + * MDN + */ def textTracks: TextTrackList = js.native - /** - * Represents the list of AudioTrack objects contained in the element. - * - * MDN - */ + /** Represents the list of AudioTrack objects contained in the element. + * + * MDN + */ def audioTracks: AudioTrackList = js.native - /** - * Sets or returns the object which serves as the source of the media associated with the HTMLMediaElement. - */ + /** Sets or returns the object which serves as the source of the media associated with the HTMLMediaElement. + */ var srcObject: js.UndefOr[MediaStream | MediaSource | Blob] } @@ -3204,134 +2650,111 @@ abstract class HTMLMediaElement extends HTMLElement { @JSGlobal object HTMLMediaElement extends js.Object { /* ??? ConstructorMember(FunSignature(List(),List(),Some(TypeRef(TypeName(HTMLMediaElement),List())))) */ - /** - * Enough of the media resource has been retrieved that the metadata attributes are - * initialized.  Seeking will no longer raise an exception. - * - * MDN - */ + /** Enough of the media resource has been retrieved that the metadata attributes are initialized.  Seeking will no + * longer raise an exception. + * + * MDN + */ val HAVE_METADATA: Int = js.native - /** - * Data is available for the current playback position, but not enough to actually - * play more than one frame. - * - * MDN - */ + /** Data is available for the current playback position, but not enough to actually play more than one frame. + * + * MDN + */ val HAVE_CURRENT_DATA: Int = js.native - /** - * No information is available about the media resource. - * - * MDN - */ + /** No information is available about the media resource. + * + * MDN + */ val HAVE_NOTHING: Int = js.native val NETWORK_NO_SOURCE: Int = js.native - /** - * Enough data is available—and the download rate is high enough—that the media can be - * played through to the end without interruption. - * - * MDN - */ + /** Enough data is available—and the download rate is high enough—that the media can be played through to the end + * without interruption. + * + * MDN + */ val HAVE_ENOUGH_DATA: Int = js.native - /** - * There is no data yet.  The readyState is also HAVE_NOTHING. - * - * MDN - */ + /** There is no data yet.  The readyState is also HAVE_NOTHING. + * + * MDN + */ val NETWORK_EMPTY: Int = js.native val NETWORK_LOADING: Int = js.native val NETWORK_IDLE: Int = js.native - /** - * Data for the current playback position as well as for at least a little bit of time - * into the future is available (in other words, at least two frames of video, for - * example). - * - * MDN - */ + /** Data for the current playback position as well as for at least a little bit of time into the future is available + * (in other words, at least two frames of video, for example). + * + * MDN + */ val HAVE_FUTURE_DATA: Int = js.native } -/** - * The HTMLFieldSetElement interface special properties and methods (beyond the - * regular HTMLelement interface it also has available to it by inheritance) for - * manipulating the layout and presentation of field-set elements. - * - * MDN - */ +/** The HTMLFieldSetElement interface special properties and methods (beyond the regular HTMLelement interface it also + * has available to it by inheritance) for manipulating the layout and presentation of field-set elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLFieldSetElement extends HTMLElement { - /** - * The containing form element, if this element is in a form. If the button is not a - * descendant of a form element, then the attribute can be the ID of any form element in - * the same document it is related to, or the null value if none matches. - * - * MDN - */ + /** The containing form element, if this element is in a form. If the button is not a descendant of a form element, + * then the attribute can be the ID of any form element in the same document it is related to, or the null value if + * none matches. + * + * MDN + */ def form: HTMLFormElement = js.native - /** - * Reflects the disabled HTML attribute, indicating whether the user can interact with - * the control. - * - * MDN - */ + /** Reflects the disabled HTML attribute, indicating whether the user can interact with the control. + * + * MDN + */ var disabled: Boolean = js.native - /** - * A localized message that describes the validation constraints that the element - * does not satisfy (if any). This is the empty string if the element is not a candidate - * for constraint validation (willValidate is false), or it satisfies its - * constraints. - * - * MDN - */ + /** A localized message that describes the validation constraints that the element does not satisfy (if any). This is + * the empty string if the element is not a candidate for constraint validation (willValidate is false), or it + * satisfies its constraints. + * + * MDN + */ def validationMessage: String = js.native - /** - * The validity states that this element is in. - * - * MDN - */ + /** The validity states that this element is in. + * + * MDN + */ def validity: ValidityState = js.native - /** - * Always false because <fieldset> objects are never candidates for constraint - * validation. - * - * MDN - */ + /** Always false because <fieldset> objects are never candidates for constraint validation. + * + * MDN + */ def willValidate: Boolean = js.native - /** - * Always returns true because <fieldset> objects are never candidates for - * constraint validation. - * - * MDN - */ + /** Always returns true because <fieldset> objects are never candidates for constraint validation. + * + * MDN + */ def checkValidity(): Boolean = js.native - /** - * Sets a custom validity message for the field set. If this message is not the empty - * string, then the field set is suffering from a custom validity error, and does not - * validate. - * - * MDN - */ + /** Sets a custom validity message for the field set. If this message is not the empty string, then the field set is + * suffering from a custom validity error, and does not validate. + * + * MDN + */ def setCustomValidity(error: String): Unit = js.native } -/** - * The HTMLElement interface represents any HTML element. Some elements directly - * implement this interface, other implement it via an interface that inherit it. - * - * MDN - */ +/** The HTMLElement interface represents any HTML element. Some elements directly implement this interface, other + * implement it via an interface that inherit it. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLElement extends Element { @@ -3349,29 +2772,24 @@ abstract class HTMLElement extends Element { var onseeked: js.Function1[Event, _] = js.native var recordNumber: js.Any = js.native - /** - * Establishes the text to be displayed in a 'tool tip' popup when the mouse is over the - * displayed node. - * - * MDN - */ + /** Establishes the text to be displayed in a 'tool tip' popup when the mouse is over the displayed node. + * + * MDN + */ var title: String = js.native var ondurationchange: js.Function1[Event, _] = js.native - /** - * Height of an element relative to the element's offsetParent. - * - * MDN - */ + /** Height of an element relative to the element's offsetParent. + * + * MDN + */ def offsetHeight: Double = js.native - /** - * The dir attribute gets or sets the text writing directionality of the content of the - * current element. - * - * MDN - */ + /** The dir attribute gets or sets the text writing directionality of the content of the current element. + * + * MDN + */ var dir: String = js.native var onemptied: js.Function1[Event, _] = js.native var onseeking: js.Function1[Event, _] = js.native @@ -3387,16 +2805,14 @@ abstract class HTMLElement extends Element { var onbeforeactivate: js.Function1[UIEvent, _] = js.native var oncanplaythrough: js.Function1[Event, _] = js.native - /** - * offsetParent returns a reference to the object which is the closest (nearest in the - * containment hierarchy) positioned containing element. If the element is - * non-positioned, the nearest table cell or root element (html in standards - * compliant mode; body in quirks rendering mode) is the offsetParent. offsetParent - * returns null when the element has style.display set to "none". The offsetParent is - * useful because offsetTop and offsetLeft are relative to its padding edge. - * - * MDN - */ + /** offsetParent returns a reference to the object which is the closest (nearest in the containment hierarchy) + * positioned containing element. If the element is non-positioned, the nearest table cell or root element (html in + * standards compliant mode; body in quirks rendering mode) is the offsetParent. offsetParent returns null when the + * element has style.display set to "none". The offsetParent is useful because offsetTop and offsetLeft are relative + * to its padding edge. + * + * MDN + */ def offsetParent: Element = js.native var onsuspend: js.Function1[Event, _] = js.native @@ -3410,26 +2826,21 @@ abstract class HTMLElement extends Element { var onvolumechange: js.Function1[Event, _] = js.native var filters: Object = js.native - /** - * The ParentNode.children read-only property returns a live HTMLCollection of - * child elements of the given object. - * - * The items in the returned collection are objects and not strings. To get data - * from those node objects, you must use their properties (e.g. - * elementNodeReference.children[1].nodeName to get the name, etc.). - * - * MDN - */ + /** The ParentNode.children read-only property returns a live HTMLCollection of child elements of the given object. + * + * The items in the returned collection are objects and not strings. To get data from those node objects, you must + * use their properties (e.g. elementNodeReference.children[1].nodeName to get the name, etc.). + * + * MDN + */ var ondragend: js.Function1[DragEvent, _] = js.native var onbeforepaste: js.Function1[DragEvent, _] = js.native var ondragover: js.Function1[DragEvent, _] = js.native - /** - * offsetTop returns the distance of the current element relative to the top of - * the offsetParent node. - * - * MDN - */ + /** offsetTop returns the distance of the current element relative to the top of the offsetParent node. + * + * MDN + */ def offsetTop: Double = js.native var onmouseup: js.Function1[MouseEvent, _] = js.native @@ -3438,12 +2849,10 @@ abstract class HTMLElement extends Element { var ondrag: js.Function1[DragEvent, _] = js.native var onmouseover: js.Function1[MouseEvent, _] = js.native - /** - * This property gets or sets the base language of an element's attribute values and - * text content. - * - * MDN - */ + /** This property gets or sets the base language of an element's attribute values and text content. + * + * MDN + */ var lang: String = js.native var onpause: js.Function1[Event, _] = js.native @@ -3452,57 +2861,52 @@ abstract class HTMLElement extends Element { var onclick: js.Function1[MouseEvent, _] = js.native var onwaiting: js.Function1[Event, _] = js.native - /** - * Returns the number of pixels that the upper left corner of the current element is - * offset to the left within the offsetParent node. - * - * MDN - */ + /** Returns the number of pixels that the upper left corner of the current element is offset to the left within the + * offsetParent node. + * + * MDN + */ def offsetLeft: Double = js.native var onstalled: js.Function1[Event, _] = js.native var onmousemove: js.Function1[MouseEvent, _] = js.native - /** - * isContentEditable returns true if the contents of the element are editable; - * otherwise it returns false. - * - * MDN - */ + /** isContentEditable returns true if the contents of the element are editable; otherwise it returns false. + * + * MDN + */ def isContentEditable: Boolean = js.native var onratechange: js.Function1[Event, _] = js.native - /** - * contentEditable is used to indicate whether or not the element is editable. This - * enumerated attribute can have the following values: - * - * MDN - */ + /** contentEditable is used to indicate whether or not the element is editable. This enumerated attribute can have the + * following values: + * + * MDN + */ var contentEditable: String = js.native - /** - * Gets/sets the tab order of the current element. - * - * The '''tabindex''' global attribute is an integer indicating if the element can take input - * focus (is ''focusable''), if it should participate to sequential keyboard navigation, and if - * so, at what position. It can take several values: - * - * - a ''negative value'' means that the element should be focusable, but should not be - * reachable via sequential keyboard navigation; - * - * - '''0''' means that the element should be focusable and reachable via sequential keyboard - * navigation, but its relative order is defined by the platform convention; - * - * - a ''positive value'' which means should be focusable and reachable via sequential keyboard - * navigation; its relative order is defined by the value of the attribute: the sequential - * follow the increasing number of the '''tabindex'''. If several elements share the same - * tabindex, their relative order follows their relative position in the document). - * - * An element with a '''0''' value, an invalid value, or no '''tabindex''' value should be placed - * after elements with a positive '''tabindex''' in the sequential keyboard navigation order. - * - * MDN - */ + /** Gets/sets the tab order of the current element. + * + * The '''tabindex''' global attribute is an integer indicating if the element can take input focus (is + * ''focusable''), if it should participate to sequential keyboard navigation, and if so, at what position. It can + * take several values: + * + * - a ''negative value'' means that the element should be focusable, but should not be reachable via sequential + * keyboard navigation; + * + * - '''0''' means that the element should be focusable and reachable via sequential keyboard navigation, but its + * relative order is defined by the platform convention; + * + * - a ''positive value'' which means should be focusable and reachable via sequential keyboard navigation; its + * relative order is defined by the value of the attribute: the sequential follow the increasing number of the + * '''tabindex'''. If several elements share the same tabindex, their relative order follows their relative + * position in the document). + * + * An element with a '''0''' value, an invalid value, or no '''tabindex''' value should be placed after elements with + * a positive '''tabindex''' in the sequential keyboard navigation order. + * + * MDN + */ var tabIndex: Int = js.native var onprogress: js.Function1[js.Any, _] = js.native @@ -3526,11 +2930,10 @@ abstract class HTMLElement extends Element { var onselect: js.Function1[UIEvent, _] = js.native var ondrop: js.Function1[DragEvent, _] = js.native - /** - * Returns the layout width of an element. - * - * MDN - */ + /** Returns the layout width of an element. + * + * MDN + */ def offsetWidth: Double = js.native var onended: js.Function1[Event, _] = js.native @@ -3538,456 +2941,380 @@ abstract class HTMLElement extends Element { var oninput: js.Function1[Event, _] = js.native - /** - * Sets focus on the specified element, if it can be focused. - * - * MDN - */ + /** Sets focus on the specified element, if it can be focused. + * + * MDN + */ def focus(): Unit = js.native - /** - * The blur method removes keyboard focus from the current element. - * - * MDN - */ + /** The blur method removes keyboard focus from the current element. + * + * MDN + */ def blur(): Unit = js.native def contains(child: HTMLElement): Boolean = js.native - /** - * The click method simulates a mouse click on an element. - * - * MDN - */ + /** The click method simulates a mouse click on an element. + * + * MDN + */ def click(): Unit = js.native var oncuechange: js.Function1[Event, _] = js.native var spellcheck: Boolean = js.native var draggable: Boolean = js.native - /** - * Returns an object that represents the element's style attribute. - * - * MDN - */ + /** Returns an object that represents the element's style attribute. + * + * MDN + */ def style: CSSStyleDeclaration = js.native def style_=(value: CSSStyleDeclaration): Unit = js.native def style_=(value: String): Unit = js.native - /** - * Returns the Document that this node belongs to. If no document is associated with - * it, returns null. - * - * MDN - * - * This is defined on Node; we override it here because we know (from the fact that this - * is an HTMLElement) that we are getting an HTMLDocument here. - */ + /** Returns the Document that this node belongs to. If no document is associated with it, returns null. + * + * MDN + * + * This is defined on Node; we override it here because we know (from the fact that this is an HTMLElement) that we + * are getting an HTMLDocument here. + */ override def ownerDocument: HTMLDocument = js.native - /** - * The dataset property on the HTMLElement interface provides - * read/write access to all the custom data attributes (data-*) set - * on the element. This access is available both in HTML and within - * the DOM. It is a map of DOMString, one entry for each custom - * data attribute. Note that the dataset property itself can be - * read, but not directly written. Instead, all writes must be to - * the individual properties within the dataset, which in turn - * represent the data attributes. - * - * MDN - */ + /** The dataset property on the HTMLElement interface provides read/write access to all the custom data attributes + * (data-*) set on the element. This access is available both in HTML and within the DOM. It is a map of DOMString, + * one entry for each custom data attribute. Note that the dataset property itself can be read, but not directly + * written. Instead, all writes must be to the individual properties within the dataset, which in turn represent the + * data attributes. + * + * MDN + */ def dataset: js.Dictionary[String] = js.native - /** - * fired when a pointing device is moved into an element's hit test boundaries. - * - * MDN - */ + /** fired when a pointing device is moved into an element's hit test boundaries. + * + * MDN + */ var onpointerover: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointing device is moved into the hit test boundaries of an element - * or one of its descendants, including as a result of a pointerdown event - * from a device that does not support hover (see pointerdown). - * - * MDN - */ + /** fired when a pointing device is moved into the hit test boundaries of an element or one of its descendants, + * including as a result of a pointerdown event from a device that does not support hover (see pointerdown). + * + * MDN + */ var onpointerenter: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer becomes active. - * - * MDN - */ + /** fired when a pointer becomes active. + * + * MDN + */ var onpointerdown: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer changes coordinates. - * - * MDN - */ + /** fired when a pointer changes coordinates. + * + * MDN + */ var onpointermove: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer is no longer active. - * - * MDN - */ + /** fired when a pointer is no longer active. + * + * MDN + */ var onpointerup: js.Function1[PointerEvent, _] = js.native - /** - * a browser fires this event if it concludes the pointer will no longer be able - * to generate events (for example the related device is deactived). - * - * MDN - */ + /** a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the + * related device is deactived). + * + * MDN + */ var onpointercancel: js.Function1[PointerEvent, _] = js.native - /** - * fired for several reasons including: pointing device is moved out of - * the hit test boundaries of an element; - * firing the pointerup event for a device that does not support hover (see pointerup); - * after firing the pointercancel event (see pointercancel); - * when a pen stylus leaves the hover range detectable by the digitizer. - * - * MDN - */ + /** fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing + * the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event + * (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. + * + * MDN + */ var onpointerout: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointing device is moved out of the hit test boundaries of an element. - * For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. - * - * MDN - */ + /** fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is + * fired when the stylus leaves the hover range detectable by the digitizer. + * + * MDN + */ var onpointerleave: js.Function1[PointerEvent, _] = js.native - /** - * fired when an element receives pointer capture. - * - * MDN - */ + /** fired when an element receives pointer capture. + * + * MDN + */ var gotpointercapture: js.Function1[PointerEvent, _] = js.native - /** - * Fired after pointer capture is released for a pointer. - * - * MDN - */ + /** Fired after pointer capture is released for a pointer. + * + * MDN + */ var lostpointercapture: js.Function1[PointerEvent, _] = js.native } -/** - * The HTMLHRElement interface provides special properties (beyond those of the - * HTMLElement interface it also has available to it by inheritance) for - * manipulating <hr> elements. - * - * MDN - */ +/** The HTMLHRElement interface provides special properties (beyond those of the HTMLElement interface it also has + * available to it by inheritance) for manipulating <hr> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLHRElement extends HTMLElement -/** - * The HTMLObjectElement interface provides special properties and methods - * (beyond those on the HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of <object> element, - * representing external resources. - * - * MDN - */ +/** The HTMLObjectElement interface provides special properties and methods (beyond those on the HTMLElement interface + * it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, + * representing external resources. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLObjectElement extends HTMLElement with GetSVGDocument { - /** - * Reflects the width HTML attribute, specifying the displayed width of the resource - * in CSS pixels. - * - * MDN - */ + /** Reflects the width HTML attribute, specifying the displayed width of the resource in CSS pixels. + * + * MDN + */ var width: String = js.native var `object`: Object = js.native - /** - * The object element's form owner, or null if there isn't one. - * - * MDN - */ + /** The object element's form owner, or null if there isn't one. + * + * MDN + */ def form: HTMLFormElement = js.native var alt: String = js.native var classid: String = js.native - /** - * Reflects the name HTML attribute, specifying the name of the object (HTML 4, or of a - * browsing context (HTML5. - * - * MDN - */ + /** Reflects the name HTML attribute, specifying the name of the object (HTML 4, or of a browsing context (HTML5. + * + * MDN + */ var name: String = js.native - /** - * Reflects the usemap HTML attribute, specifying a <map> element to use. - * - * MDN - */ + /** Reflects the usemap HTML attribute, specifying a <map> element to use. + * + * MDN + */ var useMap: String = js.native - /** - * Reflects the data HTML attribute, specifying the address of a resource's data. - * - * MDN - */ + /** Reflects the data HTML attribute, specifying the address of a resource's data. + * + * MDN + */ var data: String = js.native - /** - * Reflects the height HTML attribute, specifying the displayed height of the - * resource in CSS pixels. - * - * MDN - */ + /** Reflects the height HTML attribute, specifying the displayed height of the resource in CSS pixels. + * + * MDN + */ var height: String = js.native - /** - * The active document of the object element's nested browsing context, if any; - * otherwise null. - * - * MDN - */ + /** The active document of the object element's nested browsing context, if any; otherwise null. + * + * MDN + */ def contentDocument: Document = js.native var altHtml: String = js.native var `type`: String = js.native var BaseHref: String = js.native - /** - * A localized message that describes the validation constraints that the control - * does not satisfy (if any). This is the empty string if the control is not a candidate - * for constraint validation (willValidate is false), or it satisfies its - * constraints. - * - * MDN - */ + /** A localized message that describes the validation constraints that the control does not satisfy (if any). This is + * the empty string if the control is not a candidate for constraint validation (willValidate is false), or it + * satisfies its constraints. + * + * MDN + */ def validationMessage: String = js.native - /** - * The validity states that this element is in. - * - * MDN - */ + /** The validity states that this element is in. + * + * MDN + */ def validity: ValidityState = js.native - /** - * Indicates whether the element is a candidate for constraint validation. Always - * false for HTMLObjectElement objects. - * - * MDN - */ + /** Indicates whether the element is a candidate for constraint validation. Always false for HTMLObjectElement + * objects. + * + * MDN + */ def willValidate: Boolean = js.native - /** - * Always returns true, because object objects are never candidates for constraint - * validation. - * - * MDN - */ + /** Always returns true, because object objects are never candidates for constraint validation. + * + * MDN + */ def checkValidity(): Boolean = js.native - /** - * Sets a custom validity message for the element. If this message is not the empty - * string, then the element is suffering from a custom validity error, and does not - * validate. - * - * MDN - */ + /** Sets a custom validity message for the element. If this message is not the empty string, then the element is + * suffering from a custom validity error, and does not validate. + * + * MDN + */ def setCustomValidity(error: String): Unit = js.native } -/** - * The HTMLEmbedElement interface, which provides special properties (beyond the - * regular <htmlelement> interface it also has available to it by inheritance) for - * manipulating <embed> elements. - * - * MDN - */ +/** The HTMLEmbedElement interface, which provides special properties (beyond the regular <htmlelement> interface + * it also has available to it by inheritance) for manipulating <embed> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLEmbedElement extends HTMLElement with GetSVGDocument { - /** - * Reflects the width HTML attribute, containing the displayed width of the - * resource. - * - * MDN - */ + /** Reflects the width HTML attribute, containing the displayed width of the resource. + * + * MDN + */ var width: String = js.native - /** - * Reflects the src HTML attribute, containing the address of the resource. - * - * MDN - */ + /** Reflects the src HTML attribute, containing the address of the resource. + * + * MDN + */ var src: String = js.native - /** - * Reflects the height HTML attribute, containing the displayed height of the - * resource. - * - * MDN - */ + /** Reflects the height HTML attribute, containing the displayed height of the resource. + * + * MDN + */ var height: String = js.native } -/** - * The HTMLOptGroupElement interface provides special properties and methods - * (beyond the regular HTMLElement object interface they also have available to them - * by inheritance) for manipulating the layout and presentation of <optgroup> - * elements. - * - * MDN - */ +/** The HTMLOptGroupElement interface provides special properties and methods (beyond the regular HTMLElement object + * interface they also have available to them by inheritance) for manipulating the layout and presentation of + * <optgroup> elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLOptGroupElement extends HTMLElement { - /** - * Set or get the label for the group. - * - * MDN - */ + /** Set or get the label for the group. + * + * MDN + */ var label: String = js.native - /** - * If true, the whole list of children <option> is disabled - * - * MDN - */ + /** If true, the whole list of children <option> is disabled + * + * MDN + */ var disabled: Boolean = js.native } -/** - * The HTMLVideoElement interface provides special properties and methods for - * manipulating video objects. It also inherits properties and methods of - * HTMLMediaElement and HTMLElement. - * - * MDN - */ +/** The HTMLVideoElement interface provides special properties and methods for manipulating video objects. It also + * inherits properties and methods of HTMLMediaElement and HTMLElement. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLVideoElement extends HTMLMediaElement { - /** - * Is a DOMString that reflects the width HTML attribute, which specifies the width of - * the display area, in CSS pixels. - * - * MDN - */ + /** Is a DOMString that reflects the width HTML attribute, which specifies the width of the display area, in CSS + * pixels. + * + * MDN + */ var width: Int = js.native - /** - * Returns an unsigned long containing the intrinsic width of the resource in CSS - * pixels, taking into account the dimensions, aspect ratio, clean aperture, - * resolution, and so forth, as defined for the format used by the resource. If the - * element's ready state is HAVE_NOTHING, the value is 0. - * - * MDN - */ + /** Returns an unsigned long containing the intrinsic width of the resource in CSS pixels, taking into account the + * dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the + * resource. If the element's ready state is HAVE_NOTHING, the value is 0. + * + * MDN + */ def videoWidth: Int = js.native - /** - * Returns an unsigned long containing the intrinsic height of the resource in CSS - * pixels, taking into account the dimensions, aspect ratio, clean aperture, - * resolution, and so forth, as defined for the format used by the resource. If the - * element's ready state is HAVE_NOTHING, the value is 0. - * - * MDN - */ + /** Returns an unsigned long containing the intrinsic height of the resource in CSS pixels, taking into account the + * dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the + * resource. If the element's ready state is HAVE_NOTHING, the value is 0. + * + * MDN + */ def videoHeight: Int = js.native - /** - * Is a DOMString that reflects the height HTML attribute, which specifies the height - * of the display area, in CSS pixels. - * - * MDN - */ + /** Is a DOMString that reflects the height HTML attribute, which specifies the height of the display area, in CSS + * pixels. + * + * MDN + */ var height: Int = js.native - /** - * Is a DOMString that reflects the poster HTML attribute, which specifies an image to - * show while no video data is available. - * - * MDN - */ + /** Is a DOMString that reflects the poster HTML attribute, which specifies an image to show while no video data is + * available. + * + * MDN + */ var poster: String = js.native } -/** - * The HTMLProgressElement interface provides special properties and methods - * (beyond the regular HTMLElement interface it also has available to it by - * inheritance) for manipulating the layout and presentation of <progress> - * elements. - * - * MDN - */ +/** The HTMLProgressElement interface provides special properties and methods (beyond the regular HTMLElement interface + * it also has available to it by inheritance) for manipulating the layout and presentation of <progress> + * elements. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLProgressElement extends HTMLElement { - /** - * If the progress bar is an indeterminate progress bar, then this property return 0. - * Otherwise, it returns the current value. - * - * MDN - */ + /** If the progress bar is an indeterminate progress bar, then this property return 0. Otherwise, it returns the + * current value. + * + * MDN + */ var value: Double = js.native - /** - * This property reflect the content attribute of the same name, limited to numbers - * greater than zero. Its default value is 1.0. - * - * MDN - */ + /** This property reflect the content attribute of the same name, limited to numbers greater than zero. Its default + * value is 1.0. + * + * MDN + */ var max: Double = js.native - /** - * If the progress bar is an indeterminate progress bar, then the position property - * return −1. Otherwise, it returns the result of dividing the current value by the - * maximum value. - * - * MDN - */ + /** If the progress bar is an indeterminate progress bar, then the position property return −1. Otherwise, it returns + * the result of dividing the current value by the maximum value. + * + * MDN + */ def position: Double = js.native var form: HTMLFormElement = js.native } -/** - * The HTMLDataListElement interface provides special properties (beyond the - * HTMLElement object interface it also has available to it by inheritance) to - * manipulate <datalist> elements and their content. - * - * MDN - */ +/** The HTMLDataListElement interface provides special properties (beyond the HTMLElement object interface it also has + * available to it by inheritance) to manipulate <datalist> elements and their content. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLDataListElement extends HTMLElement { - /** - * A collection of the contained option elements. - * - * MDN - */ + /** A collection of the contained option elements. + * + * MDN + */ def options: HTMLCollection = js.native } -/** - * The HTMLTrackElement interface provides access to the properties of <track> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The HTMLTrackElement interface provides access to the properties of <track> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLTrackElement extends HTMLElement { @@ -3998,147 +3325,124 @@ abstract class HTMLTrackElement extends HTMLElement { var label: String = js.native } -/** - * The HTMLSpanElement interface represents a <span> element and derives from the - * HTMLElement interface, but without implementing any additional properties or - * methods. - * - * MDN - */ +/** The HTMLSpanElement interface represents a <span> element and derives from the HTMLElement interface, but + * without implementing any additional properties or methods. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLSpanElement extends HTMLElement -/** - * The HTMLHeadElement interface contains the descriptive information, or - * metadata, for a document. This object inherits all of the properties and methods - * described in the HTMLElement interface. - * - * MDN - */ +/** The HTMLHeadElement interface contains the descriptive information, or metadata, for a document. This object + * inherits all of the properties and methods described in the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLHeadElement extends HTMLElement -/** - * The HTMLHeadingElement interface represents the different heading elements. It - * inherits methods and properties from the HTMLElement interface. - * - * MDN - */ +/** The HTMLHeadingElement interface represents the different heading elements. It inherits methods and properties from + * the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLHeadingElement extends HTMLElement -/** - * The HTMLFormElement interface provides methods to create and modify <form> - * elements; it inherits from properties and methods of the HTMLElement interface. - * - * MDN - */ +/** The HTMLFormElement interface provides methods to create and modify <form> elements; it inherits from + * properties and methods of the HTMLElement interface. + * + * MDN + */ @js.native @JSGlobal abstract class HTMLFormElement extends HTMLElement { - /** - * length returns the number of controls in the FORM element. - * - * MDN - */ + /** length returns the number of controls in the FORM element. + * + * MDN + */ def length: Int = js.native - /** - * target gets/sets the target of the action (i.e., the frame to render its output in). - * - * MDN - */ + /** target gets/sets the target of the action (i.e., the frame to render its output in). + * + * MDN + */ var target: String = js.native - /** - * acceptCharset returns a list of the supported character encodings for the given - * FORM element. This list can be comma- or space-separated. - * - * MDN - */ + /** acceptCharset returns a list of the supported character encodings for the given FORM element. This list can be + * comma- or space-separated. + * + * MDN + */ var acceptCharset: String = js.native - /** - * enctype gets/sets the content type of the FORM element. - * - * MDN - */ + /** enctype gets/sets the content type of the FORM element. + * + * MDN + */ var enctype: String = js.native - /** - * elements returns an HTMLFormControlsCollection (HTML 4 HTMLCollection) of all - * the form controls contained in the FORM element, with the exception of input - * elements which have a type attribute of image. - * - * MDN - */ + /** elements returns an HTMLFormControlsCollection (HTML 4 HTMLCollection) of all the form controls contained in the + * FORM element, with the exception of input elements which have a type attribute of image. + * + * MDN + */ def elements: HTMLCollection = js.native - /** - * action gets/sets the action of the <form> element. - * - * MDN - */ + /** action gets/sets the action of the <form> element. + * + * MDN + */ var action: String = js.native - /** - * name returns the name of the current form element as a string. - * - * MDN - */ + /** name returns the name of the current form element as a string. + * + * MDN + */ var name: String = js.native - /** - * method gets/sets the HTTP method used to submit the form. - * - * MDN - */ + /** method gets/sets the HTTP method used to submit the form. + * + * MDN + */ var method: String = js.native - /** - * encoding is an alternative name for the enctype element on the DOM HTMLFormElement - * object. - * - * MDN - */ + /** encoding is an alternative name for the enctype element on the DOM HTMLFormElement object. + * + * MDN + */ var encoding: String = js.native - /** - * reset restores a form element's default values. - * - * MDN - */ + /** reset restores a form element's default values. + * + * MDN + */ def reset(): Unit = js.native - /** - * Gets the item in the elements collection at the specified index, or null if there is - * no item at that index. You can also specify the index in array-style brackets or - * parentheses after the form object name, without calling this method explicitly. - * - * MDN - */ - def item(name: js.Any = js.native, - index: js.Any = js.native): js.Dynamic = js.native - - /** - * This method does something similar to activating a submit button of the form. - * - * MDN - */ + /** Gets the item in the elements collection at the specified index, or null if there is no item at that index. You + * can also specify the index in array-style brackets or parentheses after the form object name, without calling this + * method explicitly. + * + * MDN + */ + def item(name: js.Any = js.native, index: js.Any = js.native): js.Dynamic = js.native + + /** This method does something similar to activating a submit button of the form. + * + * MDN + */ def submit(): Unit = js.native - /** - * Gets the item or list of items in elements collection whose name or id match the - * specified name, or null if no items match. You can also specify the name in - * array-style brackets or parentheses after the form object name, without calling - * this method explicitly. - * - * MDN - */ + /** Gets the item or list of items in elements collection whose name or id match the specified name, or null if no + * items match. You can also specify the name in array-style brackets or parentheses after the form object name, + * without calling this method explicitly. + * + * MDN + */ def namedItem(name: String): js.Dynamic = js.native @scala.scalajs.js.annotation.JSBracketAccess @@ -4147,21 +3451,17 @@ abstract class HTMLFormElement extends HTMLElement { @scala.scalajs.js.annotation.JSBracketAccess def update(name: String, v: js.Any): Unit = js.native - /** - * Reflects the autocomplete HTML attribute, containing a string that indicates - * whether the controls in this form can have their values automatically populated by - * the browser. - * - * MDN - */ + /** Reflects the autocomplete HTML attribute, containing a string that indicates whether the controls in this form can + * have their values automatically populated by the browser. + * + * MDN + */ var autocomplete: String = js.native - /** - * Reflects the novalidate HTML attribute, indicating that the form should not be - * validated. - * - * MDN - */ + /** Reflects the novalidate HTML attribute, indicating that the form should not be validated. + * + * MDN + */ var noValidate: Boolean = js.native def checkValidity(): Boolean = js.native diff --git a/src/main/scala/org/scalajs/dom/IDBTypes.scala b/src/main/scala/org/scalajs/dom/IDBTypes.scala index befb77c84..e57b426f1 100644 --- a/src/main/scala/org/scalajs/dom/IDBTypes.scala +++ b/src/main/scala/org/scalajs/dom/IDBTypes.scala @@ -1,206 +1,168 @@ -/** - * Documentation marked "MDN" is thanks to Mozilla Contributors - * at https://developer.mozilla.org/en-US/docs/Web/API and available - * under the Creative Commons Attribution-ShareAlike v2.5 or later. - * http://creativecommons.org/licenses/by-sa/2.5/ - * - * Everything else is under the MIT License - * http://opensource.org/licenses/MIT - */ +/** Documentation marked "MDN" is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and + * available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.| -/** - * IndexedDB transaction mode - * Provides constants for IDB Transaction modes - * These constants have been removed from browser support - * and replaced by String values - */ +/** IndexedDB transaction mode Provides constants for IDB Transaction modes These constants have been removed from + * browser support and replaced by String values + */ @js.native sealed trait IDBTransactionMode extends js.Any object IDBTransactionMode { - /** - * Allows data to be read but not changed. - * It is the default transaction mode. - * - * MDN - */ + /** Allows data to be read but not changed. It is the default transaction mode. + * + * MDN + */ val READ_ONLY = "readonly".asInstanceOf[IDBTransactionMode] - /** - * Allows any operation to be performed, including ones that delete and create object - * stores and indexes. This mode is for updating the version number of transactions - * that were started using the setVersion() method of IDBDatabase objects. - * Transactions of this mode cannot run concurrently with other transactions. - * - * MDN - */ + /** Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode + * is for updating the version number of transactions that were started using the setVersion() method of IDBDatabase + * objects. Transactions of this mode cannot run concurrently with other transactions. + * + * MDN + */ val VERSION_CHANGE = "versionchange".asInstanceOf[IDBTransactionMode] - /** - * Allows reading and writing of data in existing data stores to be changed. - * - * MDN - */ + /** Allows reading and writing of data in existing data stores to be changed. + * + * MDN + */ val READ_WRITE = "readwrite".asInstanceOf[IDBTransactionMode] } -/** - * The IDBObjectStore interface of the IndexedDB API represents an object store in - * a database. Records within an object store are sorted according to their keys. - * This sorting enables fast insertion, look-up, and ordered retrieval. - * - * MDN - */ +/** The IDBObjectStore interface of the IndexedDB API represents an object store in a database. Records within an object + * store are sorted according to their keys. This sorting enables fast insertion, look-up, and ordered retrieval. + * + * MDN + */ @js.native @JSGlobal class IDBObjectStore extends js.Object { - /** - * A list of the names of indexes on objects in this object store. - * - * MDN - */ + /** A list of the names of indexes on objects in this object store. + * + * MDN + */ def indexNames: DOMStringList = js.native def name: String = js.native - /** - * The name of the transaction to which this object store belongs. - * - * MDN - */ + /** The name of the transaction to which this object store belongs. + * + * MDN + */ def transaction: IDBTransaction = js.native - /** - * The key path of this object store. If this attribute is null, the application must - * provide a key for each modification operation. - * - * MDN - */ + /** The key path of this object store. If this attribute is null, the application must provide a key for each + * modification operation. + * + * MDN + */ def keyPath: String = js.native def count(key: js.Any = js.native): IDBRequest = js.native - /** - * To determine if the add operation has completed successfully, listen for the - * transaction’s complete event in addition to the IDBObjectStore.add request’s - * success event, because the transaction may still fail after the success event - * fires. In other words, the success event is only triggered when the transaction has - * been successfully queued. - * - * MDN - */ + /** To determine if the add operation has completed successfully, listen for the transaction’s complete event in + * addition to the IDBObjectStore.add request’s success event, because the transaction may still fail after the + * success event fires. In other words, the success event is only triggered when the transaction has been + * successfully queued. + * + * MDN + */ def add(value: js.Any, key: js.Any = js.native): IDBRequest = js.native - /** - * Clearing an object store consists of removing all records from the object store and - * removing all records in indexes that reference the object store. - * - * MDN - */ + /** Clearing an object store consists of removing all records from the object store and removing all records in + * indexes that reference the object store. + * + * MDN + */ def clear(): IDBRequest = js.native - /** - * Note that this method must be called only from a VersionChange transaction mode - * callback. - * - * MDN - */ - def createIndex(name: String, keyPath: String, - optionalParameters: js.Any = js.native): IDBIndex = js.native - - /** - * If the record is successfully stored, then a success event is fired on the returned - * request object with the result set to the key for the stored record, and the - * transaction set to the transaction in which this object store is opened. - * - * MDN - */ + /** Note that this method must be called only from a VersionChange transaction mode callback. + * + * MDN + */ + def createIndex(name: String, keyPath: String, optionalParameters: js.Any = js.native): IDBIndex = js.native + + /** If the record is successfully stored, then a success event is fired on the returned request object with the result + * set to the key for the stored record, and the transaction set to the transaction in which this object store is + * opened. + * + * MDN + */ def put(value: js.Any, key: js.Any = js.native): IDBRequest = js.native - /** - * The method sets the position of the cursor to the appropriate record, - * based on the specified direction. - * - * MDN - */ + /** The method sets the position of the cursor to the appropriate record, based on the specified direction. + * + * MDN + */ def openCursor(range: js.UndefOr[IDBKeyRange | js.Any] = js.undefined, - direction: js.UndefOr[ - IDBCursorDirection] = js.undefined): IDBRequest = js.native - - /** - * The method sets the position of the cursor to the appropriate key, - * based on the specified direction. - * - * MDN - */ + direction: js.UndefOr[IDBCursorDirection] = js.undefined): IDBRequest = js.native + + /** The method sets the position of the cursor to the appropriate key, based on the specified direction. + * + * MDN + */ def openKeyCursor(range: js.UndefOr[IDBKeyRange | js.Any] = js.undefined, - direction: js.UndefOr[ - IDBCursorDirection] = js.undefined): IDBRequest = js.native - - /** - * Note that this method must be called only from a VersionChange transaction mode - * callback. Note that this method synchronously modifies the - * IDBObjectStore.indexNames property. - * - * MDN - */ + direction: js.UndefOr[IDBCursorDirection] = js.undefined): IDBRequest = js.native + + /** Note that this method must be called only from a VersionChange transaction mode callback. Note that this method + * synchronously modifies the IDBObjectStore.indexNames property. + * + * MDN + */ def deleteIndex(indexName: String): Unit = js.native - /** - * This method may raise a DOMException of one of the following types: - * - * MDN - */ + /** This method may raise a DOMException of one of the following types: + * + * MDN + */ def index(name: String): IDBIndex = js.native - /** - * If a value is successfully found, then a structured clone of it is created and set as - * the result of the request object. - * - * MDN - */ + /** If a value is successfully found, then a structured clone of it is created and set as the result of the request + * object. + * + * MDN + */ def get(key: js.Any): IDBRequest = js.native - /** - * If a value is successfully found, then a structured clone of it is created and set as - * the result of the request object. - * - * MDN - */ + /** If a value is successfully found, then a structured clone of it is created and set as the result of the request + * object. + * + * MDN + */ def getAll(query: js.UndefOr[IDBKeyRange | js.Any] = js.undefined, count: js.UndefOr[Int] = js.undefined): IDBRequest = js.native - /** - * If a value is successfully found, then a structured clone of it is created and set as - * the result of the request object. - * - * MDN - */ + /** If a value is successfully found, then a structured clone of it is created and set as the result of the request + * object. + * + * MDN + */ def getAllKeys(query: js.UndefOr[IDBKeyRange | js.Any] = js.undefined, count: js.UndefOr[Int] = js.undefined): IDBRequest = js.native - /** - * If a value is successfully found, then a structured clone of it is created and set as - * the result of the request object. - * - * MDN - */ + /** If a value is successfully found, then a structured clone of it is created and set as the result of the request + * object. + * + * MDN + */ def getKey(key: js.Any): IDBRequest = js.native - /** - * returns an IDBRequest object, and, in a separate thread, deletes the current - * object store. - * - * MDN - */ + /** returns an IDBRequest object, and, in a separate thread, deletes the current object store. + * + * MDN + */ def delete(key: js.Any): IDBRequest = js.native } @@ -209,211 +171,177 @@ trait IDBVersionChangeEventInit extends EventInit { var oldVersion: js.UndefOr[Int] = js.undefined } -/** - * The specification has changed and some not up-to-date browsers only support the - * deprecated unique attribute, version, from an early draft version. - * - * MDN - */ +/** The specification has changed and some not up-to-date browsers only support the deprecated unique attribute, + * version, from an early draft version. + * + * MDN + */ @js.native @JSGlobal -class IDBVersionChangeEvent(typeArg: String, - init: js.UndefOr[IDBVersionChangeEventInit]) - extends Event(typeArg, init) { - - /** - * Returns the new version of the database. - * - * This is null when the database is being deleted. - * - * MDN - */ +class IDBVersionChangeEvent(typeArg: String, init: js.UndefOr[IDBVersionChangeEventInit]) extends Event(typeArg, init) { + + /** Returns the new version of the database. + * + * This is null when the database is being deleted. + * + * MDN + */ def newVersion: Integer = js.native - /** - * Returns the old version of the database. - * - * MDN - */ + /** Returns the old version of the database. + * + * MDN + */ def oldVersion: Int = js.native } -/** - * The IDBIndex interface of the IndexedDB API provides asynchronous access - * to an index in a database. An index is a kind of object store for looking - * up records in another object store, called the referenced object store. - * You use this interface to retrieve data. - * - * You can retrieve records in an object store through their keys or by using - * an index (cursors provide a third way: see IDBCursor). An index lets you - * look up records in an object store using properties of the values in the - * object stores records. - * - * The index is a persistent key-value storage where the value part of its - * records is the key part of a record in the referenced object store. The - * records in an index are automatically populated whenever records in the - * referenced object store are inserted, updated, or deleted. Each record in - * an index can point to only one record in its referenced object store, but - * several indexes can reference the same object store. When the object store - * changes, all indexes that refers to the object store are automatically - * updated. - * - * MDN - */ +/** The IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a + * kind of object store for looking up records in another object store, called the referenced object store. You use + * this interface to retrieve data. + * + * You can retrieve records in an object store through their keys or by using an index (cursors provide a third way: + * see IDBCursor). An index lets you look up records in an object store using properties of the values in the object + * stores records. + * + * The index is a persistent key-value storage where the value part of its records is the key part of a record in the + * referenced object store. The records in an index are automatically populated whenever records in the referenced + * object store are inserted, updated, or deleted. Each record in an index can point to only one record in its + * referenced object store, but several indexes can reference the same object store. When the object store changes, all + * indexes that refers to the object store are automatically updated. + * + * MDN + */ @js.native @JSGlobal class IDBIndex extends js.Object { - /** - * If true, this index does not allow duplicate values for a key. - * - * MDN - */ + /** If true, this index does not allow duplicate values for a key. + * + * MDN + */ def unique: Boolean = js.native def name: String = js.native - /** - * The key path of this index. If null, this index is not auto-populated. - * - * MDN - */ + /** The key path of this index. If null, this index is not auto-populated. + * + * MDN + */ def keyPath: String = js.native - /** - * The name of the object store referenced by this index. - * - * MDN - */ + /** The name of the object store referenced by this index. + * + * MDN + */ def objectStore: IDBObjectStore = js.native def count(key: js.Any): IDBRequest = js.native - /** - * If you want to see how many records are between keys 1000 and 2000 in an object store, - * you can write the following: - * - * MDN - */ + /** If you want to see how many records are between keys 1000 and 2000 in an object store, you can write the + * following: + * + * MDN + */ def count(): IDBRequest = js.native - /** - * Returns an IDBRequest object, and, in a separate thread, finds either the given key - * or the primary key, if key is a key range. - * - * MDN - */ + /** Returns an IDBRequest object, and, in a separate thread, finds either the given key or the primary key, if key is + * a key range. + * + * MDN + */ def getKey(key: js.Any): IDBRequest = js.native - /** - * Returns an IDBRequest object, and, in a separate thread, creates a cursor over the - * specified key range, as arranged by this index. - * - * MDN - */ - def openKeyCursor(range: IDBKeyRange = js.native, - direction: IDBCursorDirection = js.native): IDBRequest = js.native - - /** - * Returns an IDBRequest object, and, in a separate thread, finds either the value in - * the referenced object store that corresponds to the given key or the first - * corresponding value, if key is a key range. - * - * MDN - */ + /** Returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range, as + * arranged by this index. + * + * MDN + */ + def openKeyCursor(range: IDBKeyRange = js.native, direction: IDBCursorDirection = js.native): IDBRequest = js.native + + /** Returns an IDBRequest object, and, in a separate thread, finds either the value in the referenced object store + * that corresponds to the given key or the first corresponding value, if key is a key range. + * + * MDN + */ def get(key: js.Any): IDBRequest = js.native - /** - * The method sets the position of the cursor to the appropriate record, based on the - * specified direction. - * - * MDN - */ - def openCursor(range: IDBKeyRange = js.native, - direction: IDBCursorDirection = js.native): IDBRequest = js.native + /** The method sets the position of the cursor to the appropriate record, based on the specified direction. + * + * MDN + */ + def openCursor(range: IDBKeyRange = js.native, direction: IDBCursorDirection = js.native): IDBRequest = js.native } -/** - * The IDBCursor interface of the IndexedDB API represents a cursor for traversing - * or iterating over multiple records in a database. - * - * The cursor has a source that indicates which index or object store it is iterating. - * It has a position within the range, and moves in a direction that is increasing or - * decreasing in the order of record keys. The cursor enables an application to - * asynchronously process all the records in the cursor's range. - * - * MDN - */ +/** The IDBCursor interface of the IndexedDB API represents a cursor for traversing or iterating over multiple records + * in a database. + * + * The cursor has a source that indicates which index or object store it is iterating. It has a position within the + * range, and moves in a direction that is increasing or decreasing in the order of record keys. The cursor enables an + * application to asynchronously process all the records in the cursor's range. + * + * MDN + */ @js.native @JSGlobal class IDBCursor extends js.Object { - /** - * On getting, this object returns the IDBObjectStore or IDBIndex that the cursor is - * iterating. This function never returns null or throws an exception, even if the - * cursor is currently being iterated, has iterated past its end, or its transaction - * is not active. - * - * MDN - */ + /** On getting, this object returns the IDBObjectStore or IDBIndex that the cursor is iterating. This function never + * returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or + * its transaction is not active. + * + * MDN + */ def source: js.Any = js.native - /** - * Is a DOMString that, on getting, returns the direction of traversal of the cursor. - * See Constants for possible values. - * - * MDN - */ + /** Is a DOMString that, on getting, returns the direction of traversal of the cursor. See Constants for possible + * values. + * + * MDN + */ def direction: IDBCursorDirection = js.native - /** - * Returns the key for the record at the cursor's position. If the cursor is outside its - * range, this is set to undefined. The cursor's key can be any data type. - * - * MDN - */ + /** Returns the key for the record at the cursor's position. If the cursor is outside its range, this is set to + * undefined. The cursor's key can be any data type. + * + * MDN + */ def key: js.Any = js.native - /** - * Returns the cursor's current effective key. If the cursor is currently being - * iterated or has iterated outside its range, this is set to undefined. The cursor's - * primary key can be any data type. - * - * MDN - */ + /** Returns the cursor's current effective key. If the cursor is currently being iterated or has iterated outside its + * range, this is set to undefined. The cursor's primary key can be any data type. + * + * MDN + */ def primaryKey: js.Any = js.native - /** - * This method may raise a DOMException of one of the following types: - * - * MDN - */ + /** This method may raise a DOMException of one of the following types: + * + * MDN + */ def advance(count: Int): Unit = js.native - /** - * Sets cursor to key if specified, otherwise advances cursor by one. - * - * @note calling this method twice from the same onsuccess handler results - * in a InvalidStateError DOMException being thrown on the second call - * - * W3C - */ + /** Sets cursor to key if specified, otherwise advances cursor by one. + * + * @note + * calling this method twice from the same onsuccess handler results in a InvalidStateError DOMException being + * thrown on the second call + * + * W3C + */ def continue(key: js.Any = ???): Unit = js.native - /** - * Returns an IDBRequest object, and, in a separate thread, deletes the record at the - * cursor's position, without changing the cursor's position. - * - * MDN - */ + /** Returns an IDBRequest object, and, in a separate thread, deletes the record at the cursor's position, without + * changing the cursor's position. + * + * MDN + */ def delete(): IDBRequest = js.native - /** - * Returns an IDBRequest object, and, in a separate thread, updates the value at the - * current position of the cursor in the object store. - * - * MDN - */ + /** Returns an IDBRequest object, and, in a separate thread, updates the value at the current position of the cursor + * in the object store. + * + * MDN + */ def update(value: js.Any): IDBRequest = js.native } @@ -422,99 +350,82 @@ sealed trait IDBCursorDirection extends js.Any object IDBCursorDirection { - /** - * The cursor shows all records, including duplicates. - * It starts at the upper bound of the key range and moves downwards - * (monotonically decreasing in the order of keys). - * - * MDN - */ + /** The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves + * downwards (monotonically decreasing in the order of keys). + * + * MDN + */ val PREV = "prev".asInstanceOf[IDBCursorDirection] - /** - * The cursor shows all records, excluding duplicates. - * If multiple records exist with the same key, only the first one iterated is retrieved. - * It starts at the upper bound of the key range and moves downwards. - * - * MDN - */ + /** The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first + * one iterated is retrieved. It starts at the upper bound of the key range and moves downwards. + * + * MDN + */ val PREV_UNIQUE = "prevunique".asInstanceOf[IDBCursorDirection] - /** - * The cursor shows all records, including duplicates. - * It starts at the lower bound of the key range and moves upwards - * (monotonically increasing in the order of keys). - * - * MDN - */ + /** The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves + * upwards (monotonically increasing in the order of keys). + * + * MDN + */ val NEXT = "next".asInstanceOf[IDBCursorDirection] - /** - * The cursor shows all records, excluding duplicates. - * If multiple records exist with the same key, only the first one iterated is retrieved. - * It starts at the lower bound of the key range and moves upwards. - * - * MDN - */ + /** The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first + * one iterated is retrieved. It starts at the lower bound of the key range and moves upwards. + * + * MDN + */ val NEXT_UNIQUE = "nextunique".asInstanceOf[IDBCursorDirection] } -/** - * Same as IDBCursor with the value property. - * - * MDN - */ +/** Same as IDBCursor with the value property. + * + * MDN + */ @js.native @JSGlobal class IDBCursorWithValue extends IDBCursor { def value: js.Any = js.native } -/** - * The IDBKeyRange interface of the IndexedDB API represents a continuous interval - * over some data type that is used for keys. Records can be retrieved from object - * stores and indexes using keys or a range of keys. You can limit the range using - * lower and upper bounds. For example, you can iterate over all values of a key - * between x and y. - * - * A key range can have a single value or a range with upper and lower bounds or - * endpoints. If the key range has both upper and lower bounds, then it is bounded; if it - * has no bounds, it is unbounded. A bounded key range can either be open (the endpoints - * are excluded) or closed (the endpoints are included). To retrieve all keys within a - * certain range, you can use the following code constructs: - * - * MDN - */ +/** The IDBKeyRange interface of the IndexedDB API represents a continuous interval over some data type that is used for + * keys. Records can be retrieved from object stores and indexes using keys or a range of keys. You can limit the range + * using lower and upper bounds. For example, you can iterate over all values of a key between x and y. + * + * A key range can have a single value or a range with upper and lower bounds or endpoints. If the key range has both + * upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be + * open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain + * range, you can use the following code constructs: + * + * MDN + */ @js.native @JSGlobal class IDBKeyRange extends js.Object { - /** - * The upper bound of the key range (can be any type.) - * - * MDN - */ + /** The upper bound of the key range (can be any type.) + * + * MDN + */ def upper: js.Any = js.native - /** - * Returns false if the upper-bound value is included in the key range. - * - * MDN - */ + /** Returns false if the upper-bound value is included in the key range. + * + * MDN + */ def upperOpen: Boolean = js.native - /** - * The lower bound of the key range (can be any type.) - * - * MDN - */ + /** The lower bound of the key range (can be any type.) + * + * MDN + */ def lower: js.Any = js.native - /** - * Returns false if the lower-bound value is included in the key range. - * - * MDN - */ + /** Returns false if the lower-bound value is included in the key range. + * + * MDN + */ def lowerOpen: Boolean = js.native } @@ -522,386 +433,315 @@ class IDBKeyRange extends js.Object { @JSGlobal object IDBKeyRange extends js.Object { - /** - * The bounds can be open (that is, the bounds exclude the endpoint values) or closed - * (that is, the bounds include the endpoint values). By default, the bounds are - * closed. - * - * MDN - */ + /** The bounds can be open (that is, the bounds exclude the endpoint values) or closed (that is, the bounds include + * the endpoint values). By default, the bounds are closed. + * + * MDN + */ def bound(lower: js.Any, upper: js.Any, lowerOpen: Boolean = js.native, upperOpen: Boolean = js.native): IDBKeyRange = js.native - /** - * This method may raise a DOMException of the following types: - * - * MDN - */ + /** This method may raise a DOMException of the following types: + * + * MDN + */ def only(value: js.Any): IDBKeyRange = js.native - /** - * By default, it includes the lower endpoint value and is closed. - * - * MDN - */ - def lowerBound(bound: js.Any, - open: Boolean = js.native): IDBKeyRange = js.native - - /** - * By default, it includes the upper endpoint value and is closed. - * - * MDN - */ - def upperBound(bound: js.Any, - open: Boolean = js.native): IDBKeyRange = js.native + /** By default, it includes the lower endpoint value and is closed. + * + * MDN + */ + def lowerBound(bound: js.Any, open: Boolean = js.native): IDBKeyRange = js.native + + /** By default, it includes the upper endpoint value and is closed. + * + * MDN + */ + def upperBound(bound: js.Any, open: Boolean = js.native): IDBKeyRange = js.native } -/** - * The IDBTransaction interface of the IndexedDB API provides a static, - * asynchronous transaction on a database using event handler attributes. All - * reading and writing of data are done within transactions. You actually use - * IDBDatabase to start transactions and use IDBTransaction to set the mode of - * the transaction and access an object store and make your request. You can - * also use it to abort transactions. - * - * MDN - */ +/** The IDBTransaction interface of the IndexedDB API provides a static, asynchronous transaction on a database using + * event handler attributes. All reading and writing of data are done within transactions. You actually use IDBDatabase + * to start transactions and use IDBTransaction to set the mode of the transaction and access an object store and make + * your request. You can also use it to abort transactions. + * + * MDN + */ @js.native @JSGlobal class IDBTransaction extends EventTarget { - /** - * The event handler for the oncomplete event. - * - * MDN - */ + /** The event handler for the oncomplete event. + * + * MDN + */ var oncomplete: js.Function1[Event, _] = js.native - /** - * The database connection with which this transaction is associated. - * - * MDN - */ + /** The database connection with which this transaction is associated. + * + * MDN + */ def db: IDBDatabase = js.native - /** - * The mode for isolating access to data in the object stores that are in the scope of the - * transaction. For possible values, see Constants. The default value is readonly. - * - * MDN - */ + /** The mode for isolating access to data in the object stores that are in the scope of the transaction. For possible + * values, see Constants. The default value is readonly. + * + * MDN + */ def mode: IDBTransactionMode = js.native - /** - * Returns a DOMException indicating the type of error that occured when there is an - * unsuccessful transaction. This property is null if the transaction is not finished, - * is finished and successfully committed, or was aborted with IDBTransaction.abort function. - * - * MDN - */ + /** Returns a DOMException indicating the type of error that occured when there is an unsuccessful transaction. This + * property is null if the transaction is not finished, is finished and successfully committed, or was aborted with + * IDBTransaction.abort function. + * + * MDN + */ def error: DOMException = js.native - /** - * The event handler for the onerror event. - * - * MDN - */ + /** The event handler for the onerror event. + * + * MDN + */ var onerror: js.Function1[Event, _] = js.native - /** - * The event handler for the onabort event. - * - * MDN - */ + /** The event handler for the onabort event. + * + * MDN + */ var onabort: js.Function1[Event, _] = js.native - /** - * Returns immediately, and rolls back all the changes to objects in the database - * associated with this transaction. If this transaction has been aborted or - * completed, then this method throws an error event. - * - * MDN - */ + /** Returns immediately, and rolls back all the changes to objects in the database associated with this transaction. + * If this transaction has been aborted or completed, then this method throws an error event. + * + * MDN + */ def abort(): Unit = js.native - /** - * Every call to this method on the same transaction object, with the same name, - * returns the same IDBObjectStore instance. If this method is called on a different - * transaction object, a different IDBObjectStore instance is returned. - * - * MDN - */ + /** Every call to this method on the same transaction object, with the same name, returns the same IDBObjectStore + * instance. If this method is called on a different transaction object, a different IDBObjectStore instance is + * returned. + * + * MDN + */ def objectStore(name: String): IDBObjectStore = js.native } -/** - * The IDBDatabase interface of the IndexedDB API provides asynchronous access - * to a connection to a database. Use it to create, manipulate, and delete - * objects in that database. The interface also provides the only way to get a - * transaction and manage versions on that database. - * - * Everything you do in IndexedDB always happens in the context of a transaction, - * representing interactions with data in the database. All objects in - * IndexedDB—including object stores, indexes, and cursors—are tied to a - * particular transaction. Thus, you cannot execute commands, access data, or open - * anything outside of a transaction. - * - * MDN - */ +/** The IDBDatabase interface of the IndexedDB API provides asynchronous access to a connection to a database. Use it to + * create, manipulate, and delete objects in that database. The interface also provides the only way to get a + * transaction and manage versions on that database. + * + * Everything you do in IndexedDB always happens in the context of a transaction, representing interactions with data + * in the database. All objects in IndexedDB—including object stores, indexes, and cursors—are tied to a particular + * transaction. Thus, you cannot execute commands, access data, or open anything outside of a transaction. + * + * MDN + */ @js.native @JSGlobal class IDBDatabase extends EventTarget { - /** - * A 64-bit integer that contains the version of the connected database. - * When a database is first created or upgraded you should use - * [[IDBVersionChangeEvent#newVersion]] instead. - * Webkit returns always integer and the value is 1 when - * database is first created. - */ + /** A 64-bit integer that contains the version of the connected database. When a database is first created or upgraded + * you should use [[IDBVersionChangeEvent#newVersion]] instead. Webkit returns always integer and the value is 1 when + * database is first created. + */ def version: Int = js.native - /** - * A DOMString that contains the name of the connected database. - * - * MDN - */ + /** A DOMString that contains the name of the connected database. + * + * MDN + */ def name: String = js.native - /** - * A DOMStringList that contains a list of the names of the object stores currently in - * the connected database. - * - * MDN - */ + /** A DOMStringList that contains a list of the names of the object stores currently in the connected database. + * + * MDN + */ def objectStoreNames: DOMStringList = js.native - /** - * Fires when access to the database fails. - * - * MDN - */ + /** Fires when access to the database fails. + * + * MDN + */ var onerror: js.Function1[Event, _] = js.native - /** - * Fires when access of the database is aborted. - * - * MDN - */ + /** Fires when access of the database is aborted. + * + * MDN + */ var onabort: js.Function1[Event, _] = js.native - /** - * The onversionchange event handler of the IDBDatabase interface handles the versionchange - * event, fired when a database structure change (IDBOpenDBRequest.onupgradeneeded event or - * IDBFactory.deleteDatabase) was requested elsewhere (most probably in another window/tab - * on the same computer). - */ + /** The onversionchange event handler of the IDBDatabase interface handles the versionchange event, fired when a + * database structure change (IDBOpenDBRequest.onupgradeneeded event or IDBFactory.deleteDatabase) was requested + * elsewhere (most probably in another window/tab on the same computer). + */ var onversionchange: js.Function1[IDBVersionChangeEvent, _] = js.native - /** - * The method takes the name of the store as well as a parameter object. The parameter - * object lets you define important optional properties. You can use the property to - * uniquely identify individual objects in the store. As the property is an - * identifier, it should be unique to every object, and every object should have that - * property. - * - * MDN - */ - def createObjectStore(name: String, - optionalParameters: js.Any = js.native): IDBObjectStore = js.native - - /** - * The connection is not actually closed until all transactions created using this - * connection are complete. No new transactions can be created for this connection - * once this method is called. Methods that create transactions throw an exception if - * a closing operation is pending. - * - * MDN - */ + /** The method takes the name of the store as well as a parameter object. The parameter object lets you define + * important optional properties. You can use the property to uniquely identify individual objects in the store. As + * the property is an identifier, it should be unique to every object, and every object should have that property. + * + * MDN + */ + def createObjectStore(name: String, optionalParameters: js.Any = js.native): IDBObjectStore = js.native + + /** The connection is not actually closed until all transactions created using this connection are complete. No new + * transactions can be created for this connection once this method is called. Methods that create transactions throw + * an exception if a closing operation is pending. + * + * MDN + */ def close(): Unit = js.native - /** - * Immediately returns a transaction object (IDBTransaction) containing the - * IDBTransaction.objectStore method, which you can use to access your object - * store. Runs in a separate thread. - * - * MDN - */ - def transaction(storeNames: js.Any, - mode: IDBTransactionMode = js.native): IDBTransaction = js.native - - /** - * As with createObjectStore, this method can be called only within a versionchange - * transaction. So for WebKit browsers you must call the - * IDBVersionChangeRequest.setVersion method first before you can remove any - * object store or index. - * - * MDN - */ + /** Immediately returns a transaction object (IDBTransaction) containing the IDBTransaction.objectStore method, which + * you can use to access your object store. Runs in a separate thread. + * + * MDN + */ + def transaction(storeNames: js.Any, mode: IDBTransactionMode = js.native): IDBTransaction = js.native + + /** As with createObjectStore, this method can be called only within a versionchange transaction. So for WebKit + * browsers you must call the IDBVersionChangeRequest.setVersion method first before you can remove any object store + * or index. + * + * MDN + */ def deleteObjectStore(name: String): Unit = js.native } -/** - * The IDBOpenDBRequest interface of the IndexedDB API provides access to results - * of requests to open databases using specific event handler attributes. - * - * MDN - */ +/** The IDBOpenDBRequest interface of the IndexedDB API provides access to results of requests to open databases using + * specific event handler attributes. + * + * MDN + */ @js.native @JSGlobal class IDBOpenDBRequest extends IDBRequest { - /** - * The event handler for the upgradeneeded event, fired when a database of a bigger - * version number than the existing stored database is loaded. - * - * MDN - */ + /** The event handler for the upgradeneeded event, fired when a database of a bigger version number than the existing + * stored database is loaded. + * + * MDN + */ var onupgradeneeded: js.Function1[IDBVersionChangeEvent, _] = js.native - /** - * The event handler for the blocked event. This event is triggered when the - * upgradeneeded should be triggered because of a version change but the database is - * still in use (ie not closed) somewhere, even after the versionchange event was - * sent. - * - * MDN - */ + /** The event handler for the blocked event. This event is triggered when the upgradeneeded should be triggered + * because of a version change but the database is still in use (ie not closed) somewhere, even after the + * versionchange event was sent. + * + * MDN + */ var onblocked: js.Function1[IDBVersionChangeEvent, _] = js.native } -/** - * The IDBFactory interface of the IndexedDB API lets applications asynchronously - * access the indexed databases. The object that implements the interface is - * window.indexedDB. You open — that is, create and access — and delete a - * database with the object and not directly with IDBFactory. - * see [[https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory IDBFactory on MDN]] - * - * official documentation [[http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory IDBFactory]] in w3c spec - * - */ +/** The IDBFactory interface of the IndexedDB API lets applications asynchronously access the indexed databases. The + * object that implements the interface is window.indexedDB. You open — that is, create and access — and delete a + * database with the object and not directly with IDBFactory. see + * [[https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory IDBFactory on MDN]] + * + * official documentation [[http://www.w3.org/TR/IndexedDB/#idl-def-IDBFactory IDBFactory]] in w3c spec + */ @js.native @JSGlobal class IDBFactory extends js.Object { def open(name: String, version: Int): IDBOpenDBRequest = js.native - /** - * The open() method of the IDBFactory interface requests opening a connection to a database. - * see [[https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open IDBFactory.open() on MDN]] - * - * w3c spec [[http://www.w3.org/TR/IndexedDB/#requests ¶3.2.3 Opening a database]] - */ + /** The open() method of the IDBFactory interface requests opening a connection to a database. see + * [[https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open IDBFactory.open() on MDN]] + * + * w3c spec [[http://www.w3.org/TR/IndexedDB/#requests ¶3.2.3 Opening a database]] + */ def open(name: String): IDBOpenDBRequest = js.native - /** - * A method that compares two keys and returns a result indicating which one is greater - * in value. - * - * MDN - */ + /** A method that compares two keys and returns a result indicating which one is greater in value. + * + * MDN + */ def cmp(first: js.Any, second: js.Any): Int = js.native - /** - * The deletion operation (performed in a different thread) consists of the - * following steps: - * - * MDN - */ + /** The deletion operation (performed in a different thread) consists of the following steps: + * + * MDN + */ def deleteDatabase(name: String): IDBOpenDBRequest = js.native } -/** - * The IDBRequest interface of the IndexedDB API provides access to results of - * asynchronous requests to databases and database objects using event handler - * attributes. Each reading and writing operation on a database is done using - * a request. - * - * The request object does not initially contain any information about the result of - * the operation, but once information becomes available, an event is fired on the - * request, and the information becomes available through the properties of the - * IDBRequest instance. - * - * MDN - */ +/** The IDBRequest interface of the IndexedDB API provides access to results of asynchronous requests to databases and + * database objects using event handler attributes. Each reading and writing operation on a database is done using a + * request. + * + * The request object does not initially contain any information about the result of the operation, but once + * information becomes available, an event is fired on the request, and the information becomes available through the + * properties of the IDBRequest instance. + * + * MDN + */ @js.native @JSGlobal class IDBRequest extends EventTarget { - /** - * The source of the request, such as an Index or a ObjectStore. If no source exists - * (such as when calling IDBFactory.open), it returns null. - * - * MDN - */ + /** The source of the request, such as an Index or a ObjectStore. If no source exists (such as when calling + * IDBFactory.open), it returns null. + * + * MDN + */ def source: js.Any = js.native - /** - * The event handler for the success event. - * - * MDN - */ + /** The event handler for the success event. + * + * MDN + */ var onsuccess: js.Function1[Event, _] = js.native - /** - * Returns a DOMException in the event of an unsuccessful request, indicating what - * went wrong. - * - * MDN - */ + /** Returns a DOMException in the event of an unsuccessful request, indicating what went wrong. + * + * MDN + */ def error: DOMException = js.native - /** - * The transaction for the request. This property can be null for certain requests, - * such as for request returned from IDBFactory.open (You're just connecting to a - * database, so there is no transaction to return). - * - * MDN - */ + /** The transaction for the request. This property can be null for certain requests, such as for request returned from + * IDBFactory.open (You're just connecting to a database, so there is no transaction to return). + * + * MDN + */ def transaction: IDBTransaction = js.native - /** - * The event handler for the error event. - * - * MDN - */ + /** The event handler for the error event. + * + * MDN + */ var onerror: js.Function1[Event, _] = js.native - /** - * The state of the request. Every request starts in the pending state. The state - * changes to done when the request completes successfully or when an error occurs. - * - * MDN - */ + /** The state of the request. Every request starts in the pending state. The state changes to done when the request + * completes successfully or when an error occurs. + * + * MDN + */ def readyState: String = js.native - /** - * Returns the result of the request. If the the request failed and the result is not - * available, the InvalidStateError exception is thrown. - * - * MDN - */ + /** Returns the result of the request. If the the request failed and the result is not available, + * the InvalidStateError exception is thrown. + * + * MDN + */ def result: js.Any = js.native } -/** - * The IDBEvironment interface of the IndexedDB API provides asynchronous access - * to a client-side database. It is implemented by window and Worker objects. - * - * MDN - */ +/** The IDBEvironment interface of the IndexedDB API provides asynchronous access to a client-side database. It is + * implemented by window and Worker objects. + * + * MDN + */ @deprecated( "Removed. This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible. See https://developer.mozilla.org/en-US/docs/Web/API/IDBEnvironment", "1.2.0") @js.native trait IDBEnvironment extends js.Object { - /** - * an IDBRequest object that communicates back to the requesting application - * through events. This design means that any number of requests can be active on any - * database at a time. - * - * MDN - */ + /** an IDBRequest object that communicates back to the requesting application through events. This design means that + * any number of requests can be active on any database at a time. + * + * MDN + */ @deprecated("Use window.indexedDB", "1.2.0") def indexedDB: IDBFactory = js.native } diff --git a/src/main/scala/org/scalajs/dom/KeyboardEventConstants.scala b/src/main/scala/org/scalajs/dom/KeyboardEventConstants.scala index 9d6aeffc7..386b8a8e6 100644 --- a/src/main/scala/org/scalajs/dom/KeyboardEventConstants.scala +++ b/src/main/scala/org/scalajs/dom/KeyboardEventConstants.scala @@ -1,49 +1,66 @@ package org.scalajs.dom -/** - * The KeyboardEvent.key attribute of an event must always contain one of these control key or character values (even if - * the value is 'Unidentified'). - * - * If the key represents one of the set of printable control characters which has a Unicode character entry, such as the - * tab key, the KeyboardEvent.key attribute must have the key value (e.g., 'Tab'). - * - * Implementations that are unable to identify a key must use the key value 'Unidentified'. - * - * Taken from http://www.w3.org/TR/DOM-Level-3-Events/#keys-special - */ +/** The KeyboardEvent.key attribute of an event must always contain one of these control key or character values (even + * if the value is 'Unidentified'). + * + * If the key represents one of the set of printable control characters which has a Unicode character entry, such as + * the tab key, the KeyboardEvent.key attribute must have the key value (e.g., 'Tab'). + * + * Implementations that are unable to identify a key must use the key value 'Unidentified'. + * + * Taken from http://www.w3.org/TR/DOM-Level-3-Events/#keys-special + */ object KeyValue { // =================================================================================================================== // 6.3.1 Special Key Values - /** This key value is used when an implementation is unable to identify another key value, due to either hardware, platform, or software constraints. */ + /** This key value is used when an implementation is unable to identify another key value, due to either hardware, + * platform, or software constraints. + */ final val Unidentified = "Unidentified" // =================================================================================================================== // 6.3.2 Modifier Keys - /** The Alternative (Alt, Option, Menu) key. Enable alternate modifier function for interpreting concurrent or subsequent keyboard input. This key value is also used for the Apple 'Option' key. */ + /** The Alternative (Alt, Option, Menu) key. Enable alternate modifier function for interpreting concurrent or + * subsequent keyboard input. This key value is also used for the Apple 'Option' key. + */ final val Alt = "Alt" - /** The Alternate Graphics (AltGr or AltGraph) key. This key is used enable the ISO Level 3 shift modifier (the standard 'Shift' key is the level 2 modifier). */ + /** The Alternate Graphics (AltGr or AltGraph) key. This key is used enable the ISO Level 3 shift modifier (the + * standard 'Shift' key is the level 2 modifier). + */ final val AltGraph = "AltGraph" - /** The Caps Lock (Capital) key. Toggle capital character lock function for interpreting subsequent keyboard input event. */ + /** The Caps Lock (Capital) key. Toggle capital character lock function for interpreting subsequent keyboard input + * event. + */ final val CapsLock = "CapsLock" - /** The Control (Ctrl) key, to enable control modifier function for interpreting concurrent or subsequent keyboard input. */ + /** The Control (Ctrl) key, to enable control modifier function for interpreting concurrent or subsequent keyboard + * input. + */ final val Control = "Control" - /** The Function switch (Fn) key. Activating this key simultaneously with another key changes that key's value to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events. */ + /** The Function switch (Fn) key. Activating this key simultaneously with another key changes that key's value to an + * alternate character or function. This key is often handled directly in the keyboard hardware and does not usually + * generate key events. + */ final val Fn = "Fn" - /** The Function-Lock (FnLock, F-Lock) key. Activating this key switches the mode of the keyboard to changes some keys' values to an alternate character or function. This key is often handled directly in the keyboard hardware and does not usually generate key events. */ + /** The Function-Lock (FnLock, F-Lock) key. Activating this key switches the mode of the keyboard to changes some + * keys' values to an alternate character or function. This key is often handled directly in the keyboard hardware + * and does not usually generate key events. + */ final val FnLock = "FnLock" /** The Hyper key. */ final val Hyper = "Hyper" - /** The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input. This key value is also used for the Apple 'Command' key. */ + /** The Meta key, to enable meta modifier function for interpreting concurrent or subsequent keyboard input. This key + * value is also used for the Apple 'Command' key. + */ final val Meta = "Meta" /** The Number Lock key, to toggle numer-pad mode function for interpreting subsequent keyboard input. */ @@ -67,7 +84,9 @@ object KeyValue { // =================================================================================================================== // 6.3.3 Whitespace Keys - /** The Enter key, to activate current selection or accept current input. This key value is also used for the 'Return' (Macintosh numpad) key. */ + /** The Enter key, to activate current selection or accept current input. This key value is also used for the 'Return' + * (Macintosh numpad) key. + */ final val Enter = "Enter" /** The Separator key, for context-sensitive text separators. */ @@ -123,10 +142,14 @@ object KeyValue { /** The Cut key. */ final val Cut = "Cut" - /** The Delete (Del) Key. This key value is also used for the key labeled 'delete' on MacOS keyboards when modified by the 'Fn' key. */ + /** The Delete (Del) Key. This key value is also used for the key labeled 'delete' on MacOS keyboards when modified by + * the 'Fn' key. + */ final val Delete = "Delete" - /** The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the current field. */ + /** The Erase to End of Field key. This key deletes all characters from the current cursor position to the end of the + * current field. + */ final val EraseEof = "EraseEof" /** The Extend Selection (Exsel) key. */ @@ -159,7 +182,9 @@ object KeyValue { /** The Cancel key. */ final val Cancel = "Cancel" - /** Show the application's context menu. This key is commonly found between the right 'OS' key and the right 'Control' key. */ + /** Show the application's context menu. This key is commonly found between the right 'OS' key and the right 'Control' + * key. + */ final val ContextMenu = "ContextMenu" /** The Escape (Esc) key, to initiate an escape sequence. */ @@ -174,18 +199,16 @@ object KeyValue { /** Toggle display of help information. */ final val Help = "Help" - /** - * Pause the current state or application (as appropriate). - * - * Note: Do not use this value for the pause button on media controllers. Use 'MediaPause' instead. - */ + /** Pause the current state or application (as appropriate). + * + * Note: Do not use this value for the pause button on media controllers. Use 'MediaPause' instead. + */ final val Pause = "Pause" - /** - * Play or resume the current state or application (as appropriate). - * - * Note: Do not use this value for the play button on media controllers. Use 'MediaPlay' instead. - */ + /** Play or resume the current state or application (as appropriate). + * + * Note: Do not use this value for the play button on media controllers. Use 'MediaPlay' instead. + */ final val Play = "Play" /** The properties (Props) key. */ @@ -220,11 +243,10 @@ object KeyValue { /** The LogOff key. */ final val LogOff = "LogOff" - /** - * Toggle power state. - * - * Note: Some devices might not expose this key to the operating environment. - */ + /** Toggle power state. + * + * Note: Some devices might not expose this key to the operating environment. + */ final val Power = "Power" /** The PowerOff key. Sometime called "PowerDown". */ @@ -233,10 +255,14 @@ object KeyValue { /** The Print Screen (PrintScrn, SnapShot) key, to initiate print-screen function. */ final val PrintScreen = "PrintScreen" - /** The Hibernate key. This key saves the current state of the computer to disk so that it can be restored. The computer will then shutdown. */ + /** The Hibernate key. This key saves the current state of the computer to disk so that it can be restored. The + * computer will then shutdown. + */ final val Hibernate = "Hibernate" - /** The Standby key. This key turns off the display and places the computer into a low-power mode without completely shutting down. It is sometimes called the "Suspend" or "Sleep" key. */ + /** The Standby key. This key turns off the display and places the computer into a low-power mode without completely + * shutting down. It is sometimes called the "Suspend" or "Sleep" key. + */ final val Standby = "Standby" /** The WakeUp key. */ @@ -257,7 +283,9 @@ object KeyValue { /** The Code Input key, to initiate the Code Input mode to allow characters to be entered by their code points. */ final val CodeInput = "CodeInput" - /** The Compose key, also known as Multi_key on the X Window System. This key acts in a manner similar to a dead key, triggering a mode where subsequent key presses are combined to produce a different character. */ + /** The Compose key, also known as Multi_key on the X Window System. This key acts in a manner similar to a dead + * key, triggering a mode where subsequent key presses are combined to produce a different character. + */ final val Compose = "Compose" /** The Convert key, to convert the current input method sequence. */ @@ -636,24 +664,25 @@ object KeyValue { /** Lock or unlock current content or program. (VK_LOCK) */ final val Lock = "Lock" - /** - * Show a list of media applications. (VK_APPS) - * - * Note: Do not confuse this key value with the Windows' VK_APPS / VK_CONTEXT_MENU key, which is encoded as 'ContextMenu'. - */ + /** Show a list of media applications. (VK_APPS) + * + * Note: Do not confuse this key value with the Windows' VK_APPS / VK_CONTEXT_MENU key, which is encoded as + * 'ContextMenu'. + */ final val MediaApps = "MediaApps" - /** Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. (VK_FAST_FWD) */ + /** Initiate or continue forward playback at faster than normal speed, or increase speed if already fast forwarding. + * (VK_FAST_FWD) + */ final val MediaFastForward = "MediaFastForward" /** Select previously selected channel or media. (VK_LAST) */ final val MediaLast = "MediaLast" - /** - * Pause the currently playing media. (VK_PAUSE) - * - * Note: Media controller devices should use this value rather than 'Pause' for their pause keys. - */ + /** Pause the currently playing media. (VK_PAUSE) + * + * Note: Media controller devices should use this value rather than 'Pause' for their pause keys. + */ final val MediaPause = "MediaPause" /** Initiate or continue media playback at normal speed, if not currently playing at normal speed. (VK_PLAY) */ @@ -662,7 +691,9 @@ object KeyValue { /** Initiate or resume recording of currently selected media. (VK_RECORD) */ final val MediaRecord = "MediaRecord" - /** Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. (VK_REWIND) */ + /** Initiate or continue reverse playback at faster than normal speed, or increase speed if already rewinding. + * (VK_REWIND) + */ final val MediaRewind = "MediaRewind" /** Skip forward to next content or program. (VK_SKIP) */ @@ -739,9 +770,8 @@ object KeyValue { } } -/** - * A list of the codes returned by KeyEvents. - */ +/** A list of the codes returned by KeyEvents. + */ object KeyCode { final val Backspace = 8 final val Tab = 9 diff --git a/src/main/scala/org/scalajs/dom/Notification.scala b/src/main/scala/org/scalajs/dom/Notification.scala index 836e68f77..c776c7a5d 100644 --- a/src/main/scala/org/scalajs/dom/Notification.scala +++ b/src/main/scala/org/scalajs/dom/Notification.scala @@ -6,111 +6,89 @@ import scala.scalajs.js.annotation._ @js.native trait NotificationOptions extends js.Object { - /** - * The body property of the Notification interface indicates the - * body string of the notification. - * - * MDN - */ + /** The body property of the Notification interface indicates the body string of the notification. + * + * MDN + */ val body: String = js.native - /** - * The dir property of the Notification interface indicates the - * text direction of the notification. - * - * MDN - */ + /** The dir property of the Notification interface indicates the text direction of the notification. + * + * MDN + */ val dir: String = js.native - /** - * The icon property of the Notification interface contains the - * URL of an icon to be displayed as part of the notification. - * - * MDN - */ + /** The icon property of the Notification interface contains the URL of an icon to be displayed as part of the + * notification. + * + * MDN + */ val icon: String = js.native - /** - * The lang property of the Notification interface indicates the - * text direction of the notification. - * - * MDN - */ + /** The lang property of the Notification interface indicates the text direction of the notification. + * + * MDN + */ val lang: String = js.native - /** - * The noscreen property of the Notification interface specifies - * whether the notification firing should enable the device's screen or not. - * - * MDN - */ + /** The noscreen property of the Notification interface specifies whether the notification firing should enable the + * device's screen or not. + * + * MDN + */ val noscreen: Boolean = js.native - /** - * The renotify property of the Notification interface specifies - * whether the user should be notified after a new notification replaces an - * old one. - * - * MDN - */ + /** The renotify property of the Notification interface specifies whether the user should be notified after a new + * notification replaces an old one. + * + * MDN + */ val renotify: Boolean = js.native - /** - * The silent property of the Notification interface specifies - * whether the notification should be silent, i.e. no sounds or vibrations - * should be issued, regardless of the device settings. - * - * MDN - */ + /** The silent property of the Notification interface specifies whether the notification should be silent, i.e. no + * sounds or vibrations should be issued, regardless of the device settings. + * + * MDN + */ val silent: Boolean = js.native - /** - * The sound property of the Notification interface specifies the - * URL of an audio file to be played when the notification fires. - * - * MDN - */ + /** The sound property of the Notification interface specifies the URL of an audio file to be played when the + * notification fires. + * + * MDN + */ val sound: String = js.native - /** - * The sticky property of the Notification interface specifies - * whether the notification should be 'sticky', i.e. not easily clearable - * by the user. - * - * MDN - */ + /** The sticky property of the Notification interface specifies whether the notification should be 'sticky', i.e. not + * easily clearable by the user. + * + * MDN + */ val sticky: Boolean = js.native - /** - * The tag property of the Notification interface signifies an - * identifying tag for the notification. - * - * The idea of notification tags is that more than one notification can - * share the same tag, linking them together. One notification can then - * be programmatically replaced with another to avoid the users' screen - * being filled up with a huge number of similar notifications. - * - * MDN - */ + /** The tag property of the Notification interface signifies an identifying tag for the notification. + * + * The idea of notification tags is that more than one notification can share the same tag, linking them together. + * One notification can then be programmatically replaced with another to avoid the users' screen being filled up + * with a huge number of similar notifications. + * + * MDN + */ val tag: String = js.native - /** - * The onclick property of the Notification interface specifies an event - * listener to receive click events. These events occur when the user - * clicks on a displayed Notification. - * - * MDN - */ + /** The onclick property of the Notification interface specifies an event listener to receive click events. These + * events occur when the user clicks on a displayed Notification. + * + * MDN + */ val onclick: js.Function0[Any] = js.native - /** - * The onerror property of the Notification interface specifies an event - * listener to receive error events. These events occur when something goes - * wrong with a Notification (in many cases an error preventing the - * notification from being displayed.) - * - * MDN - */ + /** The onerror property of the Notification interface specifies an event listener to receive error events. These + * events occur when something goes wrong with a Notification (in many cases an error preventing the notification + * from being displayed.) + * + * MDN + */ val onerror: js.Function0[Any] = js.native val vibrate: js.Array[Double] = js.native @@ -118,42 +96,42 @@ trait NotificationOptions extends js.Object { object NotificationOptions { - /** - * Construct a new NotificationOptions - * - * @param body The body text of the notification. - * @param dir The text direction of the notification. - * @param icon The icon URL of the notification. - * @param lang The text direction of the notification. - * @param noscreen Boolean indicating if notification firing should enable - * the device's screen or not - * @param renotify Boolean indicating whether the user should be notified - * after a new notification replaces an old one. - * @param silent Boolean indicating specifies whether the notification - * should be silent, i.e. no sounds or vibrations should - * be issued, regardless of the device settings - * @param sound The URL of an audio file to be played when the - * notification fires. - * @param sticky Boolean indicating whether the notification should be - * 'sticky', i.e. not easily clearable by the user. - * @param tag A text identifying tag for the notification. - * @param vibrate The vibration pattern for hardware to emit - * @return a new NotificationOptions - */ + /** Construct a new NotificationOptions + * + * @param body + * The body text of the notification. + * @param dir + * The text direction of the notification. + * @param icon + * The icon URL of the notification. + * @param lang + * The text direction of the notification. + * @param noscreen + * Boolean indicating if notification firing should enable the device's screen or not + * @param renotify + * Boolean indicating whether the user should be notified after a new notification replaces an old one. + * @param silent + * Boolean indicating specifies whether the notification should be silent, i.e. no sounds or vibrations should be + * issued, regardless of the device settings + * @param sound + * The URL of an audio file to be played when the notification fires. + * @param sticky + * Boolean indicating whether the notification should be 'sticky', i.e. not easily clearable by the user. + * @param tag + * A text identifying tag for the notification. + * @param vibrate + * The vibration pattern for hardware to emit + * @return + * a new NotificationOptions + */ @inline def apply( - body: js.UndefOr[String] = js.undefined, - dir: js.UndefOr[String] = js.undefined, - icon: js.UndefOr[String] = js.undefined, - lang: js.UndefOr[String] = js.undefined, - noscreen: js.UndefOr[Boolean] = js.undefined, - renotify: js.UndefOr[Boolean] = js.undefined, - silent: js.UndefOr[Boolean] = js.undefined, - sound: js.UndefOr[String] = js.undefined, - sticky: js.UndefOr[Boolean] = js.undefined, - tag: js.UndefOr[String] = js.undefined, - onclick: js.UndefOr[js.Function0[Any]] = js.undefined, - onerror: js.UndefOr[js.Function0[Any]] = js.undefined, + body: js.UndefOr[String] = js.undefined, dir: js.UndefOr[String] = js.undefined, + icon: js.UndefOr[String] = js.undefined, lang: js.UndefOr[String] = js.undefined, + noscreen: js.UndefOr[Boolean] = js.undefined, renotify: js.UndefOr[Boolean] = js.undefined, + silent: js.UndefOr[Boolean] = js.undefined, sound: js.UndefOr[String] = js.undefined, + sticky: js.UndefOr[Boolean] = js.undefined, tag: js.UndefOr[String] = js.undefined, + onclick: js.UndefOr[js.Function0[Any]] = js.undefined, onerror: js.UndefOr[js.Function0[Any]] = js.undefined, vibrate: js.UndefOr[js.Array[Double]] = js.undefined ): NotificationOptions = { val result = js.Dynamic.literal() @@ -174,195 +152,155 @@ object NotificationOptions { } } -/** - * Implicit imports for the notification api. - * - * https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API - */ +/** Implicit imports for the notification api. + * + * https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API + */ @js.native @JSGlobal object Notification extends js.Object { - /** - * The permission read-only property of the Notification interface - * indicates the current permission granted by the user for the current - * origin to display web notifications. - * - * MDN - */ + /** The permission read-only property of the Notification interface indicates the current permission granted by the + * user for the current origin to display web notifications. + * + * MDN + */ val permission: String = js.native - /** - * The requestPermission() method of the Notification interface requests - * permission from the user for the current origin to display - * notifications. - * - * MDN - */ + /** The requestPermission() method of the Notification interface requests permission from the user for the current + * origin to display notifications. + * + * MDN + */ def requestPermission(callback: js.Function1[String, Any]): Unit = js.native } -/** - * The Notification interface allows to notify users of an incoming message - * or event. - * - * NOTE: requires permission - * Note: This feature is available in Web Workers. - * - * MDN - * - * @param title The text title of the notification - * @param options The options to configure this notification - * @return a new Notification - */ +/** The Notification interface allows to notify users of an incoming message or event. + * + * NOTE: requires permission Note: This feature is available in Web Workers. + * + * MDN + * + * @param title + * The text title of the notification + * @param options + * The options to configure this notification + * @return + * a new Notification + */ @JSGlobal("Notification") @js.native -class Notification(title: String, options: NotificationOptions = ???) - extends EventTarget { - - /** - * The body read-only property of the Notification interface indicates the - * body string of the notification, as specified in the body option of the - * Notification() constructor. - * - * MDN - */ +class Notification(title: String, options: NotificationOptions = ???) extends EventTarget { + + /** The body read-only property of the Notification interface indicates the body string of the notification, as + * specified in the body option of the Notification() constructor. + * + * MDN + */ val body: String = js.native - /** - * The data read-only property of the Notification interface returns a - * structured clone of the notification's data, as specified in the - * data option of the Notification() constructor. - * - * The notification's data can be any arbitrary data that you want - * associated with the notification. - * - * MDN - */ + /** The data read-only property of the Notification interface returns a structured clone of the notification's data, + * as specified in the data option of the Notification() constructor. + * + * The notification's data can be any arbitrary data that you want associated with the notification. + * + * MDN + */ val data: js.Object = js.native - /** - * The dir read-only property of the Notification interface indicates the - * text direction of the notification, asspecified in the dir option of - * the Notification() constructor. - * - * MDN - */ + /** The dir read-only property of the Notification interface indicates the text direction of the notification, + * asspecified in the dir option of the Notification() constructor. + * + * MDN + */ val dir: String = js.native - /** - * The icon read-only property of the Notification interface contains the - * URL of an icon to be displayed as part of the notification, as specified - * in the icon option of the Notification() constructor. - * - * MDN - */ + /** The icon read-only property of the Notification interface contains the URL of an icon to be displayed as part of + * the notification, as specified in the icon option of the Notification() constructor. + * + * MDN + */ val icon: String = js.native - /** - * The lang read-only property of the Notification interface indicates the - * text direction of the notification, as specified in the lang option of - * the Notification() constructor. - * - * MDN - */ + /** The lang read-only property of the Notification interface indicates the text direction of the notification, as + * specified in the lang option of the Notification() constructor. + * + * MDN + */ val lang: String = js.native - /** - * The noscreen read-only property of the Notification interface specifies - * whether the notification firing should enable the device's screen or not, - * as specified in the noscreen option of the Notification() constructor. - * - * MDN - */ + /** The noscreen read-only property of the Notification interface specifies whether the notification firing should + * enable the device's screen or not, as specified in the noscreen option of the Notification() constructor. + * + * MDN + */ val noscreen: Boolean = js.native - /** - * The onclick property of the Notification interface specifies an event - * listener to receive click events. These events occur when the user - * clicks on a displayed Notification. - * - * MDN - */ + /** The onclick property of the Notification interface specifies an event listener to receive click events. These + * events occur when the user clicks on a displayed Notification. + * + * MDN + */ var onclick: js.Function0[Any] = js.native - /** - * The onerror property of the Notification interface specifies an event - * listener to receive error events. These events occur when something goes - * wrong with a Notification (in many cases an error preventing the - * notification from being displayed.) - * - * MDN - */ + /** The onerror property of the Notification interface specifies an event listener to receive error events. These + * events occur when something goes wrong with a Notification (in many cases an error preventing the notification + * from being displayed.) + * + * MDN + */ var onerror: js.Function0[Any] = js.native - /** - * The renotify read-only property of the Notification interface specifies - * whether the user should be notified after a new notification replaces an - * old one, as specified in the renotify option of the Notification() - * constructor. - * - * MDN - */ + /** The renotify read-only property of the Notification interface specifies whether the user should be notified after + * a new notification replaces an old one, as specified in the renotify option of the Notification() constructor. + * + * MDN + */ val renotify: Boolean = js.native - /** - * The silent read-only property of the Notification interface specifies - * whether the notification should be silent, i.e. no sounds or vibrations - * should be issued, regardless of the device settings. This is specified - * in the renotify option of the Notification() constructor. - * - * MDN - */ + /** The silent read-only property of the Notification interface specifies whether the notification should be silent, + * i.e. no sounds or vibrations should be issued, regardless of the device settings. This is specified in the + * renotify option of the Notification() constructor. + * + * MDN + */ val silent: Boolean = js.native - /** - * The sound read-only property of the Notification interface specifies the - * URL of an audio file to be played when the notification fires. This is - * specified in the sound option of the Notification() constructor. - * - * MDN - */ + /** The sound read-only property of the Notification interface specifies the URL of an audio file to be played when + * the notification fires. This is specified in the sound option of the Notification() constructor. + * + * MDN + */ val sound: String = js.native - /** - * The sticky read-only property of the Notification interface specifies - * whether the notification should be 'sticky', i.e. not easily clearable - * by the user. This is specified in the sticky option of the - * Notification() constructor. - * - * MDN - */ + /** The sticky read-only property of the Notification interface specifies whether the notification should be 'sticky', + * i.e. not easily clearable by the user. This is specified in the sticky option of the Notification() constructor. + * + * MDN + */ val sticky: Boolean = js.native - /** - * The tag read-only property of the Notification interface signifies an - * identifying tag for the notification, as specified in the tag option - * of the Notification() constructor. - * - * The idea of notification tags is that more than one notification can - * share the same tag, linking them together. One notification can then - * be programmatically replaced with another to avoid the users' screen - * being filled up with a huge number of similar notifications. - * - * MDN - */ + /** The tag read-only property of the Notification interface signifies an identifying tag for the notification, as + * specified in the tag option of the Notification() constructor. + * + * The idea of notification tags is that more than one notification can share the same tag, linking them together. + * One notification can then be programmatically replaced with another to avoid the users' screen being filled up + * with a huge number of similar notifications. + * + * MDN + */ val tag: String = js.native - /** - * The vibrate read-only property of the Notification interface. - * Specifies a vibration pattern for devices with vibration hardware - * to emit. - * - * MDN - */ + /** The vibrate read-only property of the Notification interface. Specifies a vibration pattern for devices with + * vibration hardware to emit. + * + * MDN + */ val vibrate: js.Array[Double] = js.native - /** - * The close() method of the Notification interface is used to close a - * previously displayed notification. - * - * MDN - */ + /** The close() method of the Notification interface is used to close a previously displayed notification. + * + * MDN + */ def close(): Unit = js.native } diff --git a/src/main/scala/org/scalajs/dom/OffscreenCanvas.scala b/src/main/scala/org/scalajs/dom/OffscreenCanvas.scala index 8bcd7851b..9ee8cfbb4 100644 --- a/src/main/scala/org/scalajs/dom/OffscreenCanvas.scala +++ b/src/main/scala/org/scalajs/dom/OffscreenCanvas.scala @@ -3,43 +3,33 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation.JSGlobal -/** - * The OffscreenCanvas interface provides a canvas that can be rendered off - * screen. - * It is available in both the window and worker contexts. - * - * MDN - */ +/** The OffscreenCanvas interface provides a canvas that can be rendered off screen. It is available in both the window + * and worker contexts. + * + * MDN + */ @js.native @JSGlobal -class OffscreenCanvas(var width: Double, var height: Double) - extends js.Object { - - /** - * Returns a rendering context for the offscreen canvas. - * - * MDN - */ +class OffscreenCanvas(var width: Double, var height: Double) extends js.Object { + + /** Returns a rendering context for the offscreen canvas. + * + * MDN + */ def getContext(contextType: String): js.Dynamic = js.native - def getContext(contextType: String, - contextAttributes: WebGLContextAttributes): js.Dynamic = js.native - def getContext(contextType: String, - contextAttributes: TwoDContextAttributes): js.Dynamic = js.native - - /** - * Creates a Blob object representing the image contained in the canvas. - * - * MDN - */ - def convertToBlob( - options: ConvertToBlobOptions = ???): js.Promise[Blob] = js.native - - /** - * Creates an ImageBitmap object from the most recently rendered image of - * the OffscreenCanvas. - * - * MDN - */ + def getContext(contextType: String, contextAttributes: WebGLContextAttributes): js.Dynamic = js.native + def getContext(contextType: String, contextAttributes: TwoDContextAttributes): js.Dynamic = js.native + + /** Creates a Blob object representing the image contained in the canvas. + * + * MDN + */ + def convertToBlob(options: ConvertToBlobOptions = ???): js.Promise[Blob] = js.native + + /** Creates an ImageBitmap object from the most recently rendered image of the OffscreenCanvas. + * + * MDN + */ def transferToImageBitmap(): ImageBitmap = js.native } diff --git a/src/main/scala/org/scalajs/dom/SVGTypes.scala b/src/main/scala/org/scalajs/dom/SVGTypes.scala index e615ab745..11e17e102 100644 --- a/src/main/scala/org/scalajs/dom/SVGTypes.scala +++ b/src/main/scala/org/scalajs/dom/SVGTypes.scala @@ -1,12 +1,9 @@ -/** - * Documentation marked "MDN" is thanks to Mozilla Contributors - * at https://developer.mozilla.org/en-US/docs/Web/API and available - * under the Creative Commons Attribution-ShareAlike v2.5 or later. - * http://creativecommons.org/licenses/by-sa/2.5/ - * - * Everything else is under the MIT License - * http://opensource.org/licenses/MIT - */ +/** Documentation marked "MDN" is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and + * available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ package org.scalajs.dom import scala.scalajs.js @@ -26,18 +23,15 @@ class SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { var x1: Double = js.native } -/** - * The marker element defines the graphics that is to be used for drawing - * arrowheads or polymarkers on a given <path> , <line> , <polyline> or - * <polygon> element. - * - * MDN - */ +/** The marker element defines the graphics that is to be used for drawing arrowheads or polymarkers on a given + * <path> , <line> , <polyline> or <polygon> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGMarkerElement - extends SVGElement with SVGStylable with SVGLangSpace with SVGFitToViewBox - with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGLangSpace with SVGFitToViewBox with SVGExternalResourcesRequired { var orientType: SVGAnimatedEnumeration = js.native var markerUnits: SVGAnimatedEnumeration = js.native @@ -67,16 +61,15 @@ object SVGMarkerElement extends js.Object { val SVG_MARKERUNITS_USERSPACEONUSE: Int = js.native } -/** - * The SVGGElement interface corresponds to the <g> element. - * - * MDN - */ +/** The SVGGElement interface corresponds to the <g> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGGElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired @js.native @JSGlobal @@ -117,56 +110,49 @@ class SVGPathSegMovetoRel extends SVGPathSeg { var x: Double = js.native } -/** - * The SVGLineElement interface provides access to the properties of <line> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGLineElement interface provides access to the properties of <line> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGLineElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute y1 on the given <line> element. - * - * MDN - */ + /** Corresponds to attribute y1 on the given <line> element. + * + * MDN + */ def y1: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x2 on the given <line> element. - * - * MDN - */ + /** Corresponds to attribute x2 on the given <line> element. + * + * MDN + */ def x2: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x1 on the given <line> element. - * - * MDN - */ + /** Corresponds to attribute x1 on the given <line> element. + * + * MDN + */ def x1: SVGAnimatedLength = js.native - /** - * Corresponds to attribute y2 on the given <line> element. - * - * MDN - */ + /** Corresponds to attribute y2 on the given <line> element. + * + * MDN + */ def y2: SVGAnimatedLength = js.native } -/** - * The SVGDescElement interface corresponds to the <desc> element. - * - * MDN - */ +/** The SVGDescElement interface corresponds to the <desc> element. + * + * MDN + */ @js.native @JSGlobal -abstract class SVGDescElement - extends SVGElement with SVGStylable with SVGLangSpace +abstract class SVGDescElement extends SVGElement with SVGStylable with SVGLangSpace @js.native @JSGlobal @@ -175,71 +161,62 @@ class SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { var x: Double = js.native } -/** - * The SVGClipPathElement interface provides access to the properties of - * <clippath> elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGClipPathElement interface provides access to the properties of <clippath> elements, as well as methods + * to manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGClipPathElement - extends SVGElement with SVGUnitTypes with SVGStylable with SVGTransformable - with SVGLangSpace with SVGTests with SVGExternalResourcesRequired { + extends SVGElement with SVGUnitTypes with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute clipPathUnits on the given <clippath> element. Takes - * one of the constants defined in SVGUnitTypes - * - * MDN - */ + /** Corresponds to attribute clipPathUnits on the given <clippath> element. Takes one of the constants defined + * in SVGUnitTypes + * + * MDN + */ def clipPathUnits: SVGAnimatedEnumeration = js.native } -/** - * The SVGTextPositioningElement interface is inherited by text-related - * interfaces: SVGTextElement, SVGTSpanElement, SVGTRefElement and - * SVGAltGlyphElement. - * - * MDN - */ +/** The SVGTextPositioningElement interface is inherited by text-related interfaces: SVGTextElement, SVGTSpanElement, + * SVGTRefElement and SVGAltGlyphElement. + * + * MDN + */ @js.native @JSGlobal abstract class SVGTextPositioningElement extends SVGTextContentElement { - /** - * Corresponds to attribute y on the given element. - * - * MDN - */ + /** Corresponds to attribute y on the given element. + * + * MDN + */ def y: SVGAnimatedLengthList = js.native - /** - * Corresponds to attribute rotate on the given element. - * - * MDN - */ + /** Corresponds to attribute rotate on the given element. + * + * MDN + */ def rotate: SVGAnimatedNumberList = js.native - /** - * Corresponds to attribute dy on the given element. - * - * MDN - */ + /** Corresponds to attribute dy on the given element. + * + * MDN + */ def dy: SVGAnimatedLengthList = js.native - /** - * Corresponds to attribute x on the given element. - * - * MDN - */ + /** Corresponds to attribute x on the given element. + * + * MDN + */ def x: SVGAnimatedLengthList = js.native - /** - * Corresponds to attribute dx on the given element. - * - * MDN - */ + /** Corresponds to attribute dx on the given element. + * + * MDN + */ def dx: SVGAnimatedLengthList = js.native } @@ -249,196 +226,165 @@ class SVGPathSegLinetoVerticalRel extends SVGPathSeg { var y: Double = js.native } -/** - * The SVGAnimatedString interface is used for attributes of type DOMString which - * can be animated. - * - * MDN - */ +/** The SVGAnimatedString interface is used for attributes of type DOMString which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedString extends js.Object { - /** - * If the given attribute or property is being animated, contains the current - * animated value of the attribute or property. If the given attribute or property is - * not currently being animated, contains the same value as baseVal. - * - * MDN - */ + /** If the given attribute or property is being animated, contains the current animated value of the attribute or + * property. If the given attribute or property is not currently being animated, contains the same value as baseVal. + * + * MDN + */ def animVal: String = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: String = js.native } -/** - * Interface SVGTests defines an interface which applies to all elements which have - * attributes requiredFeatures, requiredExtensions and systemLanguage. - * - * MDN - */ +/** Interface SVGTests defines an interface which applies to all elements which have attributes requiredFeatures, + * requiredExtensions and systemLanguage. + * + * MDN + */ @js.native trait SVGTests extends js.Object { - /** - * Corresponds to attribute requiredFeatures on the given element. - * - * MDN - */ + /** Corresponds to attribute requiredFeatures on the given element. + * + * MDN + */ var requiredFeatures: SVGStringList = js.native - /** - * Corresponds to attribute requiredExtensions on the given element. - * - * MDN - */ + /** Corresponds to attribute requiredExtensions on the given element. + * + * MDN + */ var requiredExtensions: SVGStringList = js.native - /** - * Corresponds to attribute systemLanguage on the given element. - * - * MDN - */ + /** Corresponds to attribute systemLanguage on the given element. + * + * MDN + */ var systemLanguage: SVGStringList = js.native - /** - * Returns true if the browser supports the given extension, specified by a URI. - * - * MDN - */ + /** Returns true if the browser supports the given extension, specified by a URI. + * + * MDN + */ def hasExtension(extension: String): Boolean = js.native } -/** - * The SVGPatternElement interface corresponds to the <pattern> element. - * - * MDN - */ +/** The SVGPatternElement interface corresponds to the <pattern> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGPatternElement - extends SVGElement with SVGUnitTypes with SVGStylable with SVGLangSpace - with SVGTests with SVGFitToViewBox with SVGExternalResourcesRequired - with SVGURIReference { + extends SVGElement with SVGUnitTypes with SVGStylable with SVGLangSpace with SVGTests with SVGFitToViewBox + with SVGExternalResourcesRequired with SVGURIReference { - /** - * Corresponds to attribute patternUnits on the given <pattern> element. Takes one - * of the constants defined in SVGUnitTypes. - * - * MDN - */ + /** Corresponds to attribute patternUnits on the given <pattern> element. Takes one of the constants defined in + * SVGUnitTypes. + * + * MDN + */ def patternUnits: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute y on the given <pattern> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <pattern> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * Corresponds to attribute width on the given <pattern> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <pattern> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x on the given <pattern> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <pattern> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute patternContentUnits on the given <pattern> element. - * Takes one of the constants defined in SVGUnitTypes. - * - * MDN - */ + /** Corresponds to attribute patternContentUnits on the given <pattern> element. Takes one of the constants + * defined in SVGUnitTypes. + * + * MDN + */ def patternContentUnits: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute patternTransform on the given <pattern> element. - * - * MDN - */ + /** Corresponds to attribute patternTransform on the given <pattern> element. + * + * MDN + */ def patternTransform: SVGAnimatedTransformList = js.native - /** - * Corresponds to attribute height on the given <pattern> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <pattern> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native } -/** - * The SVGAnimatedAngle interface is used for attributes of basic type <angle> which - * can be animated. - * - * MDN - */ +/** The SVGAnimatedAngle interface is used for attributes of basic type <angle> which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedAngle extends js.Object { - /** - * A read only SVGAngle representing the current animated value of the given - * attribute. If the given attribute is not currently being animated, then the - * SVGAngle will have the same contents as baseVal. The object referenced by animVal - * will always be distinct from the one referenced by baseVal, even when the attribute - * is not animated. - * - * MDN - */ + /** A read only SVGAngle representing the current animated value of the given attribute. If the given attribute is not + * currently being animated, then the SVGAngle will have the same contents as baseVal. The object referenced by + * animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. + * + * MDN + */ def animVal: SVGAngle = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: SVGAngle = js.native } -/** - * The SVGScriptElement interface corresponds to the SVG <script> element. - * - * MDN - */ +/** The SVGScriptElement interface corresponds to the SVG <script> element. + * + * MDN + */ @js.native @JSGlobal -abstract class SVGScriptElement - extends SVGElement with SVGExternalResourcesRequired with SVGURIReference { +abstract class SVGScriptElement extends SVGElement with SVGExternalResourcesRequired with SVGURIReference { def `type`: String = js.native } -/** - * The SVGViewElement interface provides access to the properties of <view> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGViewElement interface provides access to the properties of <view> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGViewElement - extends SVGElement with SVGZoomAndPan with SVGFitToViewBox - with SVGExternalResourcesRequired { - - /** - * Corresponds to attribute viewTarget on the given <view> element. A list of - * DOMString values which contain the names listed in the viewTarget attribute. Each - * of the DOMString values can be associated with the corresponding element using the - * getElementById() method call. - * - * MDN - */ + extends SVGElement with SVGZoomAndPan with SVGFitToViewBox with SVGExternalResourcesRequired { + + /** Corresponds to attribute viewTarget on the given <view> element. A list of DOMString values which contain + * the names listed in the viewTarget attribute. Each of the DOMString values can be associated with the + * corresponding element using the getElementById() method call. + * + * MDN + */ def viewTarget: SVGStringList = js.native } @@ -456,42 +402,36 @@ trait SVGLocatable extends js.Object { def getScreenCTM(): SVGMatrix = js.native } -/** - * The SVGTitleElement interface corresponds to the <title> element. - * - * MDN - */ +/** The SVGTitleElement interface corresponds to the <title> element. + * + * MDN + */ @js.native @JSGlobal -abstract class SVGTitleElement - extends SVGElement with SVGStylable with SVGLangSpace +abstract class SVGTitleElement extends SVGElement with SVGStylable with SVGLangSpace -/** - * The SVGAnimatedTransformList interface is used for attributes which take a list - * of numbers and which can be animated. - * - * MDN - */ +/** The SVGAnimatedTransformList interface is used for attributes which take a list of numbers and which can be + * animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedTransformList extends js.Object { - /** - * A read only SVGTransformList representing the current animated value of the given - * attribute. If the given attribute is not currently being animated, then the - * SVGTransformList will have the same contents as baseVal. The object referenced by - * animVal will always be distinct from the one referenced by baseVal, even when the - * attribute is not animated. - * - * MDN - */ + /** A read only SVGTransformList representing the current animated value of the given attribute. If the given + * attribute is not currently being animated, then the SVGTransformList will have the same contents as baseVal. The + * object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute + * is not animated. + * + * MDN + */ def animVal: SVGTransformList = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: SVGTransformList = js.native } @@ -521,61 +461,52 @@ class SVGPointList extends js.Object { def insertItemBefore(newItem: SVGPoint, index: Int): SVGPoint = js.native } -/** - * The SVGAnimatedLengthList interface is used for attributes of type - * SVGLengthList which can be animated. - * - * MDN - */ +/** The SVGAnimatedLengthList interface is used for attributes of type SVGLengthList which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedLengthList extends js.Object { - /** - * A read only SVGLengthList representing the current animated value of the given - * attribute. If the given attribute is not currently being animated, then the - * SVGLengthList will have the same contents as baseVal. The object referenced by - * animVal will always be distinct from the one referenced by baseVal, even when the - * attribute is not animated. - * - * MDN - */ + /** A read only SVGLengthList representing the current animated value of the given attribute. If the given attribute + * is not currently being animated, then the SVGLengthList will have the same contents as baseVal. The object + * referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not + * animated. + * + * MDN + */ def animVal: SVGLengthList = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: SVGLengthList = js.native } -/** - * The SVGAnimatedPreserveAspectRatio interface is used for attributes of type - * SVGPreserveAspectRatio which can be animated. - * - * MDN - */ +/** The SVGAnimatedPreserveAspectRatio interface is used for attributes of type SVGPreserveAspectRatio which can be + * animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedPreserveAspectRatio extends js.Object { - /** - * A read only SVGPreserveAspectRatio representing the current animated value of - * the given attribute. If the given attribute is not currently being animated, then - * the SVGPreserveAspectRatio will have the same contents as baseVal. The object - * referenced by animVal is always distinct from the one referenced by baseVal, even - * when the attribute is not animated. - * - * MDN - */ + /** A read only SVGPreserveAspectRatio representing the current animated value of the given attribute. If the given + * attribute is not currently being animated, then the SVGPreserveAspectRatio will have the same contents as baseVal. + * The object referenced by animVal is always distinct from the one referenced by baseVal, even when the attribute is + * not animated. + * + * MDN + */ def animVal: SVGPreserveAspectRatio = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: SVGPreserveAspectRatio = js.native } @@ -584,128 +515,107 @@ trait SVGExternalResourcesRequired extends js.Object { var externalResourcesRequired: SVGAnimatedBoolean = js.native } -/** - * The SVGAngle interface correspond to the <angle> basic data type. - * - * MDN - */ +/** The SVGAngle interface correspond to the <angle> basic data type. + * + * MDN + */ @js.native @JSGlobal class SVGAngle extends js.Object { - /** - * The value as a string value, in the units expressed by unitType. Setting this - * attribute will cause value, valueInSpecifiedUnits and unitType to be updated - * automatically to reflect this setting. Exceptions on setting: a DOMException - * with code SYNTAX_ERR is raised if the assigned string cannot be parsed as a valid - * <angle>. a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when - * the length corresponds to a read only attribute or when the object itself is read - * only. - * - * MDN - */ + /** The value as a string value, in the units expressed by unitType. Setting this attribute will cause value, + * valueInSpecifiedUnits and unitType to be updated automatically to reflect this setting. Exceptions on setting: a + * DOMException with code SYNTAX_ERR is raised if the assigned string cannot be parsed as a valid <angle>. a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute + * or when the object itself is read only. + * + * MDN + */ var valueAsString: String = js.native - /** - * The value as a floating point value, in the units expressed by unitType. Setting - * this attribute will cause value and valueAsString to be updated automatically to - * reflect this setting. Exceptions on setting: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** The value as a floating point value, in the units expressed by unitType. Setting this attribute will cause value + * and valueAsString to be updated automatically to reflect this setting. Exceptions on setting: a DOMException with + * code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the object + * itself is read only. + * + * MDN + */ var valueInSpecifiedUnits: Double = js.native - /** - * The value as a floating point value, in user units. Setting this attribute will - * cause valueInSpecifiedUnits and valueAsString to be updated automatically to - * reflect this setting. Exceptions on setting: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** The value as a floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits and + * valueAsString to be updated automatically to reflect this setting. Exceptions on setting: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the object + * itself is read only. + * + * MDN + */ var value: Double = js.native - /** - * The type of the value as specified by one of the SVG_ANGLETYPE_* constants defined - * on this interface. - * - * MDN - */ + /** The type of the value as specified by one of the SVG_ANGLETYPE_* constants defined on this interface. + * + * MDN + */ def unitType: Int = js.native - /** - * Reset the value as a number with an associated unitType, thereby replacing the - * values for all of the attributes on the object. Exceptions: a DOMException with - * code NOT_SUPPORTED_ERR is raised if unitType is SVG_ANGLETYPE_UNKNOWN or not a - * valid unit type constant (one of the other SVG_ANGLETYPE_* constants defined on - * this interface). a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when the length corresponds to a read only attribute or when the object - * itself is read only. - * - * MDN - */ - def newValueSpecifiedUnits(unitType: Int, - valueInSpecifiedUnits: Double): Unit = js.native - - /** - * Preserve the same underlying stored value, but reset the stored unit identifier to - * the given unitType. Object attributes unitType, valueInSpecifiedUnits and - * valueAsString might be modified as a result of this method. - * - * MDN - */ + /** Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on + * the object. Exceptions: a DOMException with code NOT_SUPPORTED_ERR is raised if unitType is SVG_ANGLETYPE_UNKNOWN + * or not a valid unit type constant (one of the other SVG_ANGLETYPE_* constants defined on this interface). a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute + * or when the object itself is read only. + * + * MDN + */ + def newValueSpecifiedUnits(unitType: Int, valueInSpecifiedUnits: Double): Unit = js.native + + /** Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object + * attributes unitType, valueInSpecifiedUnits and valueAsString might be modified as a result of this method. + * + * MDN + */ def convertToSpecifiedUnits(unitType: Int): Unit = js.native } -/** - * The SVGAngle interface correspond to the <angle> basic data type. - * - * MDN - */ +/** The SVGAngle interface correspond to the <angle> basic data type. + * + * MDN + */ @js.native @JSGlobal object SVGAngle extends js.Object { val SVG_ANGLETYPE_RAD: Int = js.native - /** - * The unit type is not one of predefined unit types. It is invalid to attempt to define a - * new value of this type or to attempt to switch an existing value to this type. - * - * MDN - */ + /** The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or + * to attempt to switch an existing value to this type. + * + * MDN + */ val SVG_ANGLETYPE_UNKNOWN: Int = js.native val SVG_ANGLETYPE_UNSPECIFIED: Int = js.native - /** - * The unit type was explicitly set to degrees. - * - * MDN - */ + /** The unit type was explicitly set to degrees. + * + * MDN + */ val SVG_ANGLETYPE_DEG: Int = js.native val SVG_ANGLETYPE_GRAD: Int = js.native } -/** - * All of the SVG DOM interfaces that correspond directly to elements in the SVG - * language derive from the SVGElement interface. - * - * MDN - */ +/** All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement + * interface. + * + * MDN + */ @js.native @JSGlobal abstract class SVGElement extends Element { var onmouseover: js.Function1[MouseEvent, _] = js.native - /** - * The element which established the current viewport. Often, the nearest ancestor - * <svg> element. Null if the given element is the outermost svg element. - * - * MDN - */ + /** The element which established the current viewport. Often, the nearest ancestor <svg> element. Null if the + * given element is the outermost svg element. + * + * MDN + */ def viewportElement: SVGElement = js.native var onmousemove: js.Function1[MouseEvent, _] = js.native @@ -714,23 +624,20 @@ abstract class SVGElement extends Element { var onfocusout: js.Function1[FocusEvent, _] = js.native var onfocusin: js.Function1[FocusEvent, _] = js.native - /** - * Corresponds to attribute xml:base on the given element. - * - * MDN - */ + /** Corresponds to attribute xml:base on the given element. + * + * MDN + */ var xmlbase: String = js.native var onmousedown: js.Function1[MouseEvent, _] = js.native var onload: js.Function1[Event, _] = js.native var onmouseup: js.Function1[MouseEvent, _] = js.native var onclick: js.Function1[MouseEvent, _] = js.native - /** - * The nearest ancestor <svg> element. Null if the given element is the outermost svg - * element. - * - * MDN - */ + /** The nearest ancestor <svg> element. Null if the given element is the outermost svg element. + * + * MDN + */ def ownerSVGElement: SVGSVGElement = js.native } @@ -752,102 +659,82 @@ class SVGPathSegArcAbs extends SVGPathSeg { var largeArcFlag: Boolean = js.native } -/** - * The SVGTransformList defines a list of SVGTransform objects. - * - * MDN - */ +/** The SVGTransformList defines a list of SVGTransform objects. + * + * MDN + */ @js.native @JSGlobal class SVGTransformList extends js.Object { def numberOfItems: Int = js.native - /** - * Returns the specified item from the list. The returned item is the item itself and - * not a copy. Any changes made to the item are immediately reflected in the list. The - * first item is number 0. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to + * the item are immediately reflected in the list. The first item is number 0. Exceptions: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself + * is read only. + * + * MDN + */ def getItem(index: Int): SVGTransform = js.native def consolidate(): SVGTransform = js.native - /** - * Clears all existing current items from the list, with the result being an empty - * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when the list corresponds to a read only attribute or when the object itself - * is read only. - * - * MDN - */ + /** Clears all existing current items from the list, with the result being an empty list. Exceptions: a DOMException + * with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the + * object itself is read only. + * + * MDN + */ def clear(): Unit = js.native - /** - * Inserts a new item at the end of the list. If newItem is already in a list, it is removed - * from its previous list before it is inserted into this list. The inserted item is the - * item itself and not a copy. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item at the end of the list. If newItem is already in a list, it is removed from its previous list + * before it is inserted into this list. The inserted item is the item itself and not a copy. Exceptions: a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or + * when the object itself is read only. + * + * MDN + */ def appendItem(newItem: SVGTransform): SVGTransform = js.native - /** - * Clears all existing current items from the list and re-initializes the list to hold - * the single item specified by the parameter. If the inserted item is already in a - * list, it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. The return value is the item inserted - * into the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Clears all existing current items from the list and re-initializes the list to hold the single item specified by + * the parameter. If the inserted item is already in a list, it is removed from its previous list before it is + * inserted into this list. The inserted item is the item itself and not a copy. The return value is the item + * inserted into the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list + * corresponds to a read only attribute or when the object itself is read only. + * + * MDN + */ def initialize(newItem: SVGTransform): SVGTransform = js.native - /** - * Removes an existing item from the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. a DOMException with code - * INDEX_SIZE_ERR is raised if the index number is greater than or equal to - * numberOfItems. - * - * MDN - */ + /** Removes an existing item from the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised + * when the list corresponds to a read only attribute or when the object itself is read only. a DOMException with + * code INDEX_SIZE_ERR is raised if the index number is greater than or equal to numberOfItems. + * + * MDN + */ def removeItem(index: Int): SVGTransform = js.native - /** - * Inserts a new item into the list at the specified position. The first item is number - * 0. If newItem is already in a list, it is removed from its previous list before it is - * inserted into this list. The inserted item is the item itself and not a copy. If the - * item is already in this list, note that the index of the item to insert before is - * before the removal of the item. If the index is equal to 0, then the new item is - * inserted at the front of the list. If the index is greater than or equal to - * numberOfItems, then the new item is appended to the end of the list. Exceptions: a - * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list - * corresponds to a read only attribute or when the object itself is read only. - * - * MDN - */ - def insertItemBefore(newItem: SVGTransform, - index: Int): SVGTransform = js.native - - /** - * Replaces an existing item in the list with a new item. If newItem is already in a list, - * it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. If the item is already in this list, - * note that the index of the item to replace is before the removal of the item. - * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised - * when the list corresponds to a read only attribute or when the object itself is read - * only. a DOMException with code INDEX_SIZE_ERR is raised if the index number is - * greater than or equal to numberOfItems. - * - * MDN - */ + /** Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a + * list, it is removed from its previous list before it is inserted into this list. The inserted item is the item + * itself and not a copy. If the item is already in this list, note that the index of the item to insert before is + * before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the + * list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the + * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a + * read only attribute or when the object itself is read only. + * + * MDN + */ + def insertItemBefore(newItem: SVGTransform, index: Int): SVGTransform = js.native + + /** Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its + * previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the + * item is already in this list, note that the index of the item to replace is before the removal of the item. + * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read + * only attribute or when the object itself is read only. a DOMException with code INDEX_SIZE_ERR is raised if the + * index number is greater than or equal to numberOfItems. + * + * MDN + */ def replaceItem(newItem: SVGTransform, index: Int): SVGTransform = js.native def createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform = js.native @@ -857,71 +744,60 @@ class SVGTransformList extends js.Object { @JSGlobal class SVGPathSegClosePath extends SVGPathSeg -/** - * The SVGAnimatedLength interface is used for attributes of basic type <length> - * which can be animated. - * - * MDN - */ +/** The SVGAnimatedLength interface is used for attributes of basic type <length> which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedLength extends js.Object { - /** - * If the given attribute or property is being animated, contains the current - * animated value of the attribute or property. If the given attribute or property is - * not currently being animated, contains the same value as baseVal. - * - * MDN - */ + /** If the given attribute or property is being animated, contains the current animated value of the attribute or + * property. If the given attribute or property is not currently being animated, contains the same value as baseVal. + * + * MDN + */ def animVal: SVGLength = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: SVGLength = js.native } -/** - * The SVGAnimatedPoints interface supports elements which have a points attribute - * which holds a list of coordinate values and which support the ability to animate - * that attribute. - * - * MDN - */ +/** The SVGAnimatedPoints interface supports elements which have a points attribute which holds a list of coordinate + * values and which support the ability to animate that attribute. + * + * MDN + */ @js.native trait SVGAnimatedPoints extends js.Object { - /** - * Provides access to the base (i.e., static) contents of the points attribute. - * - * MDN - */ + /** Provides access to the base (i.e., static) contents of the points attribute. + * + * MDN + */ var points: SVGPointList = js.native - /** - * Provides access to the current animated contents of the points attribute. If the - * given attribute or property is being animated, contains the current animated - * value of the attribute or property. If the given attribute or property is not - * currently being animated, contains the same value as points. - * - * MDN - */ + /** Provides access to the current animated contents of the points attribute. If the given attribute or property is + * being animated, contains the current animated value of the attribute or property. If the given attribute or + * property is not currently being animated, contains the same value as points. + * + * MDN + */ def animatedPoints: SVGPointList = js.native } -/** - * The SVGDefsElement interface corresponds to the <defs> element. - * - * MDN - */ +/** The SVGDefsElement interface corresponds to the <defs> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGDefsElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired @js.native @JSGlobal @@ -929,106 +805,93 @@ class SVGPathSegLinetoHorizontalRel extends SVGPathSeg { var x: Double = js.native } -/** - * The SVGEllipseElement interface provides access to the properties of <ellipse> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGEllipseElement interface provides access to the properties of <ellipse> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGEllipseElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute ry on the given <ellipse> element. - * - * MDN - */ + /** Corresponds to attribute ry on the given <ellipse> element. + * + * MDN + */ def ry: SVGAnimatedLength = js.native - /** - * Corresponds to attribute cx on the given <ellipse> element. - * - * MDN - */ + /** Corresponds to attribute cx on the given <ellipse> element. + * + * MDN + */ def cx: SVGAnimatedLength = js.native - /** - * Corresponds to attribute rx on the given <ellipse> element. - * - * MDN - */ + /** Corresponds to attribute rx on the given <ellipse> element. + * + * MDN + */ def rx: SVGAnimatedLength = js.native - /** - * Corresponds to attribute cy on the given <ellipse> element. - * - * MDN - */ + /** Corresponds to attribute cy on the given <ellipse> element. + * + * MDN + */ def cy: SVGAnimatedLength = js.native } -/** - * The SVGAElement interface provides access to the properties of <a> elements, as - * well as methods to manipulate them. - * - * MDN - */ +/** The SVGAElement interface provides access to the properties of <a> elements, as well as methods to manipulate + * them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGAElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired with SVGURIReference { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired with SVGURIReference { - /** - * Corresponds to attribute target on the given <a> element. - * - * MDN - */ + /** Corresponds to attribute target on the given <a> element. + * + * MDN + */ def target: SVGAnimatedString = js.native } -/** - * The SVGStylable interface is implemented on all objects corresponding to SVG - * elements that can have style, class and presentation attributes specified on - * them. - * - * MDN - */ +/** The SVGStylable interface is implemented on all objects corresponding to SVG elements that can have style, class and + * presentation attributes specified on them. + * + * MDN + */ @js.native trait SVGStylable extends js.Object { - /** - * Corresponds to attribute class on the given element. - * - * MDN - */ + /** Corresponds to attribute class on the given element. + * + * MDN + */ var className: SVGAnimatedString = js.native - /** - * Corresponds to attribute style on the given element. - * - * MDN - */ + /** Corresponds to attribute style on the given element. + * + * MDN + */ var style: CSSStyleDeclaration = js.native } -/** - * Interface SVGTransformable contains properties and methods that apply to all - * elements which have attribute transform. - * - * MDN - */ +/** Interface SVGTransformable contains properties and methods that apply to all elements which have attribute + * transform. + * + * MDN + */ @js.native trait SVGTransformable extends SVGLocatable { - /** - * Corresponds to attribute transform on the given element. - * - * MDN - */ + /** Corresponds to attribute transform on the given element. + * + * MDN + */ var transform: SVGAnimatedTransformList = js.native } @@ -1047,423 +910,347 @@ class SVGPoint extends js.Object { def matrixTransform(matrix: SVGMatrix): SVGPoint = js.native } -/** - * The SVGAnimatedNumber interface is used for attributes which take a list of - * numbers and which can be animated. - * - * MDN - */ +/** The SVGAnimatedNumber interface is used for attributes which take a list of numbers and which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedNumberList extends js.Object { - /** - * A read only SVGNumberList representing the current animated value of the given - * attribute. If the given attribute is not currently being animated, then the - * SVGNumberList will have the same contents as baseVal. The object referenced by - * animVal will always be distinct from the one referenced by baseVal, even when the - * attribute is not animated. - * - * MDN - */ + /** A read only SVGNumberList representing the current animated value of the given attribute. If the given attribute + * is not currently being animated, then the SVGNumberList will have the same contents as baseVal. The object + * referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not + * animated. + * + * MDN + */ def animVal: SVGNumberList = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ def baseVal: SVGNumberList = js.native } -/** - * The SVGSVGElement interface provides access to the properties of <svg> elements, - * as well as methods to manipulate them. This interface contains also various - * miscellaneous commonly-used utility methods, such as matrix operations and the - * ability to control the time of redraw on visual rendering devices. - * - * MDN - */ +/** The SVGSVGElement interface provides access to the properties of <svg> elements, as well as methods to + * manipulate them. This interface contains also various miscellaneous commonly-used utility methods, such as matrix + * operations and the ability to control the time of redraw on visual rendering devices. + * + * MDN + */ @js.native @JSGlobal abstract class SVGSVGElement - extends SVGElement with SVGStylable with SVGZoomAndPan with DocumentEvent - with SVGLangSpace with SVGLocatable with SVGTests with SVGFitToViewBox - with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGZoomAndPan with DocumentEvent with SVGLangSpace with SVGLocatable + with SVGTests with SVGFitToViewBox with SVGExternalResourcesRequired { - /** - * Corresponds to attribute width on the given <svg> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <svg> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x on the given <svg> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <svg> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute contentStyleType on the given <svg> element. - * - * MDN - */ + /** Corresponds to attribute contentStyleType on the given <svg> element. + * + * MDN + */ var contentStyleType: String = js.native var onzoom: js.Function1[js.Any, _] = js.native - /** - * Corresponds to attribute y on the given <svg> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <svg> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * The position and size of the viewport (implicit or explicit) that corresponds to - * this <svg> element. When the browser is actually rendering the content, then the - * position and size values represent the actual values when rendering. The position - * and size values are unitless values in the coordinate system of the parent element. - * If no parent element exists (i.e., <svg> element represents the root of the - * document tree), if this SVG document is embedded as part of another document (e.g., - * via the HTML <object> element), then the position and size are unitless values in - * the coordinate system of the parent document. (If the parent uses CSS or XSL layout, - * then unitless values represent pixel units for the current CSS or XSL viewport.) - * - * MDN - */ + /** The position and size of the viewport (implicit or explicit) that corresponds to this <svg> element. When + * the browser is actually rendering the content, then the position and size values represent the actual values when + * rendering. The position and size values are unitless values in the coordinate system of the parent element. If no + * parent element exists (i.e., <svg> element represents the root of the document tree), if this SVG document + * is embedded as part of another document (e.g., via the HTML <object> element), then the position and size + * are unitless values in the coordinate system of the parent document. (If the parent uses CSS or XSL layout, then + * unitless values represent pixel units for the current CSS or XSL viewport.) + * + * MDN + */ def viewport: SVGRect = js.native var onerror: js.Function1[Event, _] = js.native - /** - * Corresponding size of a pixel unit along the y-axis of the viewport. - * - * MDN - */ + /** Corresponding size of a pixel unit along the y-axis of the viewport. + * + * MDN + */ def pixelUnitToMillimeterY: Double = js.native var onresize: js.Function1[UIEvent, _] = js.native - /** - * Corresponding size of a screen pixel along the y-axis of the viewport. - * - * MDN - */ + /** Corresponding size of a screen pixel along the y-axis of the viewport. + * + * MDN + */ def screenPixelToMillimeterY: Double = js.native - /** - * Corresponds to attribute height on the given <svg> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <svg> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native var onabort: js.Function1[UIEvent, _] = js.native - /** - * Corresponds to attribute contentScriptType on the given <svg> element. - * - * MDN - */ + /** Corresponds to attribute contentScriptType on the given <svg> element. + * + * MDN + */ var contentScriptType: String = js.native - /** - * Size of a pixel units (as defined by CSS2) along the x-axis of the viewport, which - * represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that - * support this, might actually match the characteristics of the target medium. On - * systems where it is impossible to know the size of a pixel, a suitable default pixel - * size is provided. - * - * MDN - */ + /** Size of a pixel units (as defined by CSS2) along the x-axis of the viewport, which represents a unit somewhere in + * the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the + * target medium. On systems where it is impossible to know the size of a pixel, a suitable default pixel size is + * provided. + * + * MDN + */ def pixelUnitToMillimeterX: Double = js.native - /** - * On an outermost <svg> element, the corresponding translation factor that takes - * into account user "magnification". - * - * MDN - */ + /** On an outermost <svg> element, the corresponding translation factor that takes into account user + * "magnification". + * + * MDN + */ def currentTranslate: SVGPoint = js.native var onunload: js.Function1[Event, _] = js.native - /** - * On an outermost <svg> element, this attribute indicates the current scale factor - * relative to the initial view to take into account user magnification and panning - * operations. DOM attributes currentScale and currentTranslate are equivalent to - * the 2x3 matrix [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x - * currentTranslate.y]. If "magnification" is enabled (i.e., - * zoomAndPan="magnify"), then the effect is as if an extra transformation were - * placed at the outermost level on the SVG document fragment (i.e., outside the - * outermost <svg> element). - * - * MDN - */ + /** On an outermost <svg> element, this attribute indicates the current scale factor relative to the initial + * view to take into account user magnification and panning operations. DOM attributes currentScale and + * currentTranslate are equivalent to the 2x3 matrix [a b c d e f] = [currentScale 0 0 currentScale + * currentTranslate.x currentTranslate.y]. If "magnification" is enabled (i.e., zoomAndPan="magnify"), then the + * effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., + * outside the outermost <svg> element). + * + * MDN + */ def currentScale: Double = js.native var onscroll: js.Function1[UIEvent, _] = js.native - /** - * User interface (UI) events in DOM Level 2 indicate the screen positions at which the - * given UI event occurred. When the browser actually knows the physical size of a - * "screen unit", this attribute will express that information; otherwise, user - * agents will provide a suitable default value such as .28mm. - * - * MDN - */ + /** User interface (UI) events in DOM Level 2 indicate the screen positions at which the given UI event occurred. When + * the browser actually knows the physical size of a "screen unit", this attribute will express that information; + * otherwise, user agents will provide a suitable default value such as .28mm. + * + * MDN + */ def screenPixelToMillimeterX: Double = js.native - /** - * Adjusts the clock for this SVG document fragment, establishing a new current time. - * If setCurrentTime is called before the document timeline has begun (for example, - * by script running in a <script> element before the document's SVGLoad event is - * dispatched), then the value of seconds in the last invocation of the method gives - * the time that the document will seek to once the document timeline has begun. - * - * MDN - */ + /** Adjusts the clock for this SVG document fragment, establishing a new current time. If setCurrentTime is called + * before the document timeline has begun (for example, by script running in a <script> element before the + * document's SVGLoad event is dispatched), then the value of seconds in the last invocation of the method gives the + * time that the document will seek to once the document timeline has begun. + * + * MDN + */ def setCurrentTime(seconds: Double): Unit = js.native - /** - * Creates an SVGLength object outside of any document trees. The object is - * initialized to a value of zero user units. - * - * MDN - */ + /** Creates an SVGLength object outside of any document trees. The object is initialized to a value of zero user + * units. + * + * MDN + */ def createSVGLength(): SVGLength = js.native - /** - * Returns the list of graphics elements whose rendered content intersects the - * supplied rectangle. Each candidate graphics element is to be considered a match - * only if the same graphics element can be a target of pointer events as defined in - * pointer-events processing. - * - * MDN - */ - def getIntersectionList(rect: SVGRect, - referenceElement: SVGElement): NodeList[Node] = js.native - - /** - * Unsuspends (i.e., unpauses) currently running animations that are defined - * within the SVG document fragment, causing the animation clock to continue from the - * time at which it was suspended. - * - * MDN - */ + /** Returns the list of graphics elements whose rendered content intersects the supplied rectangle. Each candidate + * graphics element is to be considered a match only if the same graphics element can be a target of pointer events + * as defined in pointer-events processing. + * + * MDN + */ + def getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList[Node] = js.native + + /** Unsuspends (i.e., unpauses) currently running animations that are defined within the SVG document fragment, + * causing the animation clock to continue from the time at which it was suspended. + * + * MDN + */ def unpauseAnimations(): Unit = js.native - /** - * Creates an SVGRect object outside of any document trees. The object is initialized - * such that all values are set to 0 user units. - * - * MDN - */ + /** Creates an SVGRect object outside of any document trees. The object is initialized such that all values are set to + * 0 user units. + * + * MDN + */ def createSVGRect(): SVGRect = js.native - /** - * Returns true if the rendered content of the given element intersects the supplied - * rectangle. Each candidate graphics element is to be considered a match only if the - * same graphics element can be a target of pointer events as defined in - * pointer-events processing. - * - * MDN - */ - def checkIntersection(element: SVGElement, - rect: SVGRect): Boolean = js.native - - /** - * Cancels all currently active suspendRedraw() method calls. This method is most - * useful at the very end of a set of SVG DOM calls to ensure that all pending - * suspendRedraw() method calls have been cancelled. - * - * MDN - */ + /** Returns true if the rendered content of the given element intersects the supplied rectangle. Each candidate + * graphics element is to be considered a match only if the same graphics element can be a target of pointer events + * as defined in pointer-events processing. + * + * MDN + */ + def checkIntersection(element: SVGElement, rect: SVGRect): Boolean = js.native + + /** Cancels all currently active suspendRedraw() method calls. This method is most useful at the very end of a set of + * SVG DOM calls to ensure that all pending suspendRedraw() method calls have been cancelled. + * + * MDN + */ def unsuspendRedrawAll(): Unit = js.native - /** - * Suspends (i.e., pauses) all currently running animations that are defined within - * the SVG document fragment corresponding to this <svg> element, causing the - * animation clock corresponding to this document fragment to stand still until it is - * unpaused. - * - * MDN - */ + /** Suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment + * corresponding to this <svg> element, causing the animation clock corresponding to this document fragment to + * stand still until it is unpaused. + * + * MDN + */ def pauseAnimations(): Unit = js.native - /** - * Takes a time-out value which indicates that redraw shall not occur until: the - * corresponding unsuspendRedraw() call has been made, an unsuspendRedrawAll() - * call has been made, or its timer has timed out. In environments that do not support - * interactivity (e.g., print media), then redraw shall not be suspended. Calls to - * suspendRedraw() and unsuspendRedraw() should, but need not be, made in balanced - * pairs. To suspend redraw actions as a collection of SVG DOM changes occur, precede - * the changes to the SVG DOM with a method call similar to: suspendHandleID = - * suspendRedraw(maxWaitMilliseconds); and follow the changes with a method call - * similar to: unsuspendRedraw(suspendHandleID); Note that multiple - * suspendRedraw calls can be used at once and that each such method call is treated - * independently of the other suspendRedraw method calls. - * - * MDN - */ + /** Takes a time-out value which indicates that redraw shall not occur until: the corresponding unsuspendRedraw() call + * has been made, an unsuspendRedrawAll() call has been made, or its timer has timed out. In environments that do not + * support interactivity (e.g., print media), then redraw shall not be suspended. Calls to suspendRedraw() and + * unsuspendRedraw() should, but need not be, made in balanced pairs. To suspend redraw actions as a collection of + * SVG DOM changes occur, precede the changes to the SVG DOM with a method call similar to: suspendHandleID = + * suspendRedraw(maxWaitMilliseconds); and follow the changes with a method call similar to: + * unsuspendRedraw(suspendHandleID); Note that multiple suspendRedraw calls can be used at once and that each such + * method call is treated independently of the other suspendRedraw method calls. + * + * MDN + */ def suspendRedraw(maxWaitMilliseconds: Int): Int = js.native - /** - * Unselects any selected objects, including any selections of text strings and - * type-in bars. - * - * MDN - */ + /** Unselects any selected objects, including any selections of text strings and type-in bars. + * + * MDN + */ def deselectAll(): Unit = js.native - /** - * Creates an SVGAngle object outside of any document trees. The object is - * initialized to a value of zero degrees (unitless). - * - * MDN - */ + /** Creates an SVGAngle object outside of any document trees. The object is initialized to a value of zero degrees + * (unitless). + * + * MDN + */ def createSVGAngle(): SVGAngle = js.native - def getEnclosureList(rect: SVGRect, - referenceElement: SVGElement): NodeList[Node] = js.native + def getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList[Node] = js.native - /** - * Creates an SVGTransform object outside of any document trees. The object is - * initialized to an identity matrix transform (SVG_TRANSFORM_MATRIX). - * - * MDN - */ + /** Creates an SVGTransform object outside of any document trees. The object is initialized to an identity matrix + * transform (SVG_TRANSFORM_MATRIX). + * + * MDN + */ def createSVGTransform(): SVGTransform = js.native - /** - * Cancels a specified suspendRedraw() by providing a unique suspend handle ID that - * was returned by a previous suspendRedraw() call. - * - * MDN - */ + /** Cancels a specified suspendRedraw() by providing a unique suspend handle ID that was returned by a previous + * suspendRedraw() call. + * + * MDN + */ def unsuspendRedraw(suspendHandleID: Int): Unit = js.native - /** - * In rendering environments supporting interactivity, forces the user agent to - * immediately redraw all regions of the viewport that require updating. - * - * MDN - */ + /** In rendering environments supporting interactivity, forces the user agent to immediately redraw all regions of the + * viewport that require updating. + * + * MDN + */ def forceRedraw(): Unit = js.native - /** - * Returns the current time in seconds relative to the start time for the current SVG - * document fragment. If getCurrentTime is called before the document timeline has - * begun (for example, by script running in a <script> element before the document's - * SVGLoad event is dispatched), then 0 is returned. - * - * MDN - */ + /** Returns the current time in seconds relative to the start time for the current SVG document fragment. If + * getCurrentTime is called before the document timeline has begun (for example, by script running in a + * <script> element before the document's SVGLoad event is dispatched), then 0 is returned. + * + * MDN + */ def getCurrentTime(): Int = js.native - /** - * Returns true if the rendered content of the given element is entirely contained - * within the supplied rectangle. Each candidate graphics element is to be - * considered a match only if the same graphics element can be a target of pointer - * events as defined in pointer-events processing. - * - * MDN - */ + /** Returns true if the rendered content of the given element is entirely contained within the supplied rectangle. + * Each candidate graphics element is to be considered a match only if the same graphics element can be a target of + * pointer events as defined in pointer-events processing. + * + * MDN + */ def checkEnclosure(element: SVGElement, rect: SVGRect): Boolean = js.native - /** - * Creates an SVGMatrix object outside of any document trees. The object is - * initialized to the identity matrix. - * - * MDN - */ + /** Creates an SVGMatrix object outside of any document trees. The object is initialized to the identity matrix. + * + * MDN + */ def createSVGMatrix(): SVGMatrix = js.native - /** - * Creates an SVGPoint object outside of any document trees. The object is - * initialized to the point (0,0) in the user coordinate system. - * - * MDN - */ + /** Creates an SVGPoint object outside of any document trees. The object is initialized to the point (0,0) in the user + * coordinate system. + * + * MDN + */ def createSVGPoint(): SVGPoint = js.native - /** - * Creates an SVGNumber object outside of any document trees. The object is - * initialized to a value of zero. - * - * MDN - */ + /** Creates an SVGNumber object outside of any document trees. The object is initialized to a value of zero. + * + * MDN + */ def createSVGNumber(): SVGNumber = js.native - /** - * Creates an SVGTransform object outside of any document trees. The object is - * initialized to the given matrix transform (i.e., SVG_TRANSFORM_MATRIX). The - * values from the parameter matrix are copied, the matrix parameter is not adopted as - * SVGTransform::matrix. - * - * MDN - */ + /** Creates an SVGTransform object outside of any document trees. The object is initialized to the given matrix + * transform (i.e., SVG_TRANSFORM_MATRIX). The values from the parameter matrix are copied, the matrix parameter is + * not adopted as SVGTransform::matrix. + * + * MDN + */ def createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform = js.native - def getComputedStyle(elt: Element, - pseudoElt: String = js.native): CSSStyleDeclaration = js.native + def getComputedStyle(elt: Element, pseudoElt: String = js.native): CSSStyleDeclaration = js.native - /** - * Searches this SVG document fragment (i.e., the search is restricted to a subset of - * the document tree) for an Element whose id is given by elementId. If an Element is - * found, that Element is returned. If no such element exists, returns null. Behavior - * is not defined if more than one element has this id. - * - * MDN - */ + /** Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an + * Element whose id is given by elementId. If an Element is found, that Element is returned. If no such element + * exists, returns null. Behavior is not defined if more than one element has this id. + * + * MDN + */ def getElementById(elementId: String): Element = js.native } -/** - * The SVGAnimatedInteger interface is used for attributes of basic type <integer> - * which can be animated. - * - * MDN - */ +/** The SVGAnimatedInteger interface is used for attributes of basic type <integer> which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedInteger extends js.Object { - /** - * If the given attribute or property is being animated, contains the current - * animated value of the attribute or property. If the given attribute or property is - * not currently being animated, contains the same value as baseVal. - * - * MDN - */ + /** If the given attribute or property is being animated, contains the current animated value of the attribute or + * property. If the given attribute or property is not currently being animated, contains the same value as baseVal. + * + * MDN + */ def animVal: Int = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: Int = js.native } -/** - * The SVGTextElement interface corresponds to the <text> elements. - * - * MDN - */ +/** The SVGTextElement interface corresponds to the <text> elements. + * + * MDN + */ @js.native @JSGlobal -abstract class SVGTextElement - extends SVGTextPositioningElement with SVGTransformable +abstract class SVGTextElement extends SVGTextPositioningElement with SVGTransformable -/** - * The SVGTSpanElement interface provides access to the properties of <tspan> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGTSpanElement interface provides access to the properties of <tspan> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGTSpanElement extends SVGTextPositioningElement @@ -1474,153 +1261,130 @@ class SVGPathSegLinetoVerticalAbs extends SVGPathSeg { var y: Double = js.native } -/** - * The SVGStyleElement interface corresponds to the SVG <style> element. - * - * MDN - */ +/** The SVGStyleElement interface corresponds to the SVG <style> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGStyleElement extends SVGElement with SVGLangSpace { - /** - * Corresponds to attribute media on the given element. A DOMException is raised with - * code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only - * attribute. - * - * MDN - */ + /** Corresponds to attribute media on the given element. A DOMException is raised with code + * NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute. + * + * MDN + */ var media: String = js.native def `type`: String = js.native - /** - * Corresponds to attribute title on the given element. A DOMException is raised with - * code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only - * attribute. - * - * MDN - */ + /** Corresponds to attribute title on the given element. A DOMException is raised with code + * NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read only attribute. + * + * MDN + */ var title: String = js.native } -/** - * The SVGRadialGradientElement interface corresponds to the <radialgradient> - * element. - * - * MDN - */ +/** The SVGRadialGradientElement interface corresponds to the <radialgradient> element. + * + * MDN + */ @js.native @JSGlobal class SVGRadialGradientElement extends SVGGradientElement { - /** - * Corresponds to attribute cx on the given <radialgradient> element. - * - * MDN - */ + /** Corresponds to attribute cx on the given <radialgradient> element. + * + * MDN + */ def cx: SVGAnimatedLength = js.native - /** - * Corresponds to attribute r on the given <radialgradient> element. - * - * MDN - */ + /** Corresponds to attribute r on the given <radialgradient> element. + * + * MDN + */ def r: SVGAnimatedLength = js.native - /** - * Corresponds to attribute cy on the given <radialgradient> element. - * - * MDN - */ + /** Corresponds to attribute cy on the given <radialgradient> element. + * + * MDN + */ def cy: SVGAnimatedLength = js.native - /** - * Corresponds to attribute fx on the given <radialgradient> element. - * - * MDN - */ + /** Corresponds to attribute fx on the given <radialgradient> element. + * + * MDN + */ def fx: SVGAnimatedLength = js.native - /** - * Corresponds to attribute fy on the given <radialgradient> element. - * - * MDN - */ + /** Corresponds to attribute fy on the given <radialgradient> element. + * + * MDN + */ def fy: SVGAnimatedLength = js.native } -/** - * The SVGImageElement interface corresponds to the <image> element. - * - * MDN - */ +/** The SVGImageElement interface corresponds to the <image> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGImageElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired with SVGURIReference { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired with SVGURIReference { - /** - * Corresponds to attribute y on the given <image> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <image> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * Corresponds to attribute width on the given <image> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <image> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * Corresponds to attribute preserveAspectRatio on the given <image> element. - * - * MDN - */ + /** Corresponds to attribute preserveAspectRatio on the given <image> element. + * + * MDN + */ def preserveAspectRatio: SVGAnimatedPreserveAspectRatio = js.native - /** - * Corresponds to attribute x on the given <image> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <image> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute height on the given <image> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <image> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native } -/** - * The SVGAnimatedNumber interface is used for attributes of basic type <Number> - * which can be animated. - * - * MDN - */ +/** The SVGAnimatedNumber interface is used for attributes of basic type <Number> which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedNumber extends js.Object { - /** - * If the given attribute or property is being animated, contains the current - * animated value of the attribute or property. If the given attribute or property is - * not currently being animated, contains the same value as baseVal. - * - * MDN - */ + /** If the given attribute or property is being animated, contains the current animated value of the attribute or + * property. If the given attribute or property is not currently being animated, contains the same value as baseVal. + * + * MDN + */ def animVal: Double = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: Double = js.native } @@ -1647,186 +1411,150 @@ class SVGPathSegMovetoAbs extends SVGPathSeg { var x: Double = js.native } -/** - * The SVGStringList defines a list of DOMString objects. - * - * MDN - */ +/** The SVGStringList defines a list of DOMString objects. + * + * MDN + */ @js.native @JSGlobal class SVGStringList extends js.Object { def numberOfItems: Int = js.native - /** - * Replaces an existing item in the list with a new item. If newItem is already in a list, - * it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. If the item is already in this list, - * note that the index of the item to replace is before the removal of the item. - * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised - * when the list corresponds to a read only attribute or when the object itself is read - * only. a DOMException with code INDEX_SIZE_ERR is raised if the index number is - * greater than or equal to numberOfItems. - * - * MDN - */ + /** Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its + * previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the + * item is already in this list, note that the index of the item to replace is before the removal of the item. + * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read + * only attribute or when the object itself is read only. a DOMException with code INDEX_SIZE_ERR is raised if the + * index number is greater than or equal to numberOfItems. + * + * MDN + */ def replaceItem(newItem: String, index: Int): String = js.native - /** - * Returns the specified item from the list. The returned item is the item itself and - * not a copy. Any changes made to the item are immediately reflected in the list. The - * first item is number 0. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to + * the item are immediately reflected in the list. The first item is number 0. Exceptions: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself + * is read only. + * + * MDN + */ def getItem(index: Int): String = js.native - /** - * Clears all existing current items from the list, with the result being an empty - * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when the list corresponds to a read only attribute or when the object itself - * is read only. - * - * MDN - */ + /** Clears all existing current items from the list, with the result being an empty list. Exceptions: a DOMException + * with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the + * object itself is read only. + * + * MDN + */ def clear(): Unit = js.native - /** - * Inserts a new item at the end of the list. If newItem is already in a list, it is removed - * from its previous list before it is inserted into this list. The inserted item is the - * item itself and not a copy. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item at the end of the list. If newItem is already in a list, it is removed from its previous list + * before it is inserted into this list. The inserted item is the item itself and not a copy. Exceptions: a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or + * when the object itself is read only. + * + * MDN + */ def appendItem(newItem: String): String = js.native - /** - * Clears all existing current items from the list and re-initializes the list to hold - * the single item specified by the parameter. If the inserted item is already in a - * list, it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. The return value is the item inserted - * into the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Clears all existing current items from the list and re-initializes the list to hold the single item specified by + * the parameter. If the inserted item is already in a list, it is removed from its previous list before it is + * inserted into this list. The inserted item is the item itself and not a copy. The return value is the item + * inserted into the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list + * corresponds to a read only attribute or when the object itself is read only. + * + * MDN + */ def initialize(newItem: String): String = js.native - /** - * Removes an existing item from the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. a DOMException with code - * INDEX_SIZE_ERR is raised if the index number is greater than or equal to - * numberOfItems. - * - * MDN - */ + /** Removes an existing item from the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised + * when the list corresponds to a read only attribute or when the object itself is read only. a DOMException with + * code INDEX_SIZE_ERR is raised if the index number is greater than or equal to numberOfItems. + * + * MDN + */ def removeItem(index: Int): String = js.native - /** - * Inserts a new item into the list at the specified position. The first item is number - * 0. If newItem is already in a list, it is removed from its previous list before it is - * inserted into this list. The inserted item is the item itself and not a copy. If the - * item is already in this list, note that the index of the item to insert before is - * before the removal of the item. If the index is equal to 0, then the new item is - * inserted at the front of the list. If the index is greater than or equal to - * numberOfItems, then the new item is appended to the end of the list. Exceptions: a - * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list - * corresponds to a read only attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a + * list, it is removed from its previous list before it is inserted into this list. The inserted item is the item + * itself and not a copy. If the item is already in this list, note that the index of the item to insert before is + * before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the + * list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the + * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a + * read only attribute or when the object itself is read only. + * + * MDN + */ def insertItemBefore(newItem: String, index: Int): String = js.native } -/** - * The SVGLength interface correspond to the <length> basic data type. - * - * MDN - */ +/** The SVGLength interface correspond to the <length> basic data type. + * + * MDN + */ @js.native @JSGlobal class SVGLength extends js.Object { - /** - * The value as a string value, in the units expressed by unitType. Setting this - * attribute will cause value, valueInSpecifiedUnits and unitType to be updated - * automatically to reflect this setting. Exceptions on setting: a DOMException - * with code SYNTAX_ERR is raised if the assigned string cannot be parsed as a valid - * <length>. a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when - * the length corresponds to a read only attribute or when the object itself is read - * only. - * - * MDN - */ + /** The value as a string value, in the units expressed by unitType. Setting this attribute will cause value, + * valueInSpecifiedUnits and unitType to be updated automatically to reflect this setting. Exceptions on setting: a + * DOMException with code SYNTAX_ERR is raised if the assigned string cannot be parsed as a valid <length>. a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute + * or when the object itself is read only. + * + * MDN + */ var valueAsString: String = js.native - /** - * The value as a floating point value, in the units expressed by unitType. Setting - * this attribute will cause value and valueAsString to be updated automatically to - * reflect this setting. Exceptions on setting: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** The value as a floating point value, in the units expressed by unitType. Setting this attribute will cause value + * and valueAsString to be updated automatically to reflect this setting. Exceptions on setting: a DOMException with + * code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the object + * itself is read only. + * + * MDN + */ var valueInSpecifiedUnits: Double = js.native - /** - * The value as a floating point value, in user units. Setting this attribute will - * cause valueInSpecifiedUnits and valueAsString to be updated automatically to - * reflect this setting. Exceptions on setting: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** The value as a floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits and + * valueAsString to be updated automatically to reflect this setting. Exceptions on setting: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the object + * itself is read only. + * + * MDN + */ var value: Double = js.native - /** - * The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined - * on this interface. - * - * MDN - */ + /** The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface. + * + * MDN + */ def unitType: Int = js.native - /** - * Reset the value as a number with an associated unitType, thereby replacing the - * values for all of the attributes on the object. Exceptions: a DOMException with - * code NOT_SUPPORTED_ERR is raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a - * valid unit type constant (one of the other SVG_LENGTHTYPE_* constants defined on - * this interface). a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when the length corresponds to a read only attribute or when the object - * itself is read only. - * - * MDN - */ - def newValueSpecifiedUnits(unitType: Int, - valueInSpecifiedUnits: Double): Unit = js.native - - /** - * Preserve the same underlying stored value, but reset the stored unit identifier to - * the given unitType. Object attributes unitType, valueInSpecifiedUnits and - * valueAsString might be modified as a result of this method. For example, if the - * original value were "0.5cm" and the method was invoked to convert to millimeters, - * then the unitType would be changed to SVG_LENGTHTYPE_MM, valueInSpecifiedUnits - * would be changed to the numeric value 5 and valueAsString would be changed to "5mm". - * - * MDN - */ + /** Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on + * the object. Exceptions: a DOMException with code NOT_SUPPORTED_ERR is raised if unitType is SVG_LENGTHTYPE_UNKNOWN + * or not a valid unit type constant (one of the other SVG_LENGTHTYPE_* constants defined on this interface). a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute + * or when the object itself is read only. + * + * MDN + */ + def newValueSpecifiedUnits(unitType: Int, valueInSpecifiedUnits: Double): Unit = js.native + + /** Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object + * attributes unitType, valueInSpecifiedUnits and valueAsString might be modified as a result of this method. For + * example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the + * unitType would be changed to SVG_LENGTHTYPE_MM, valueInSpecifiedUnits would be changed to the numeric value 5 and + * valueAsString would be changed to "5mm". + * + * MDN + */ def convertToSpecifiedUnits(unitType: Int): Unit = js.native } -/** - * The SVGLength interface correspond to the <length> basic data type. - * - * MDN - */ +/** The SVGLength interface correspond to the <length> basic data type. + * + * MDN + */ @js.native @JSGlobal object SVGLength extends js.Object { @@ -1841,27 +1569,25 @@ object SVGLength extends js.Object { val SVG_LENGTHTYPE_EMS: Int = js.native val SVG_LENGTHTYPE_PX: Int = js.native - /** - * The unit type is not one of predefined unit types. It is invalid to attempt to define a - * new value of this type or to attempt to switch an existing value to this type. - * - * MDN - */ + /** The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or + * to attempt to switch an existing value to this type. + * + * MDN + */ val SVG_LENGTHTYPE_UNKNOWN: Int = js.native val SVG_LENGTHTYPE_EXS: Int = js.native } -/** - * The SVGPolygonElement interface provides access to the properties of <polygon> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGPolygonElement interface provides access to the properties of <polygon> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGPolygonElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGAnimatedPoints with SVGTests with SVGExternalResourcesRequired + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGAnimatedPoints with SVGTests + with SVGExternalResourcesRequired @js.native @JSGlobal @@ -1877,8 +1603,7 @@ class SVGPathSegCurvetoCubicRel extends SVGPathSeg { @js.native @JSGlobal abstract class SVGTextContentElement - extends SVGElement with SVGStylable with SVGLangSpace with SVGTests - with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGLangSpace with SVGTests with SVGExternalResourcesRequired { def textLength: SVGAnimatedLength = js.native def lengthAdjust: SVGAnimatedEnumeration = js.native @@ -1911,129 +1636,103 @@ object SVGTextContentElement extends js.Object { val LENGTHADJUST_UNKNOWN: Int = js.native } -/** - * SVGTransform is the interface for one of the component transformations within an - * SVGTransformList; thus, an SVGTransform object corresponds to a single - * component (e.g., scale(…) or matrix(…)) within a transform attribute. - * - * MDN - */ +/** SVGTransform is the interface for one of the component transformations within an SVGTransformList; thus, an + * SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a transform attribute. + * + * MDN + */ @js.native @JSGlobal class SVGTransform extends js.Object { def `type`: Int = js.native - /** - * A convenience attribute for SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and - * SVG_TRANSFORM_SKEWY. It holds the angle that was specified. For - * SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, - * angle will be zero. - * - * MDN - */ + /** A convenience attribute for SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY. It holds the angle + * that was specified. For SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, angle will be zero. + * + * MDN + */ def angle: Double = js.native - /** - * The matrix that represents this transformation. The matrix object is live, - * meaning that any changes made to the SVGTransform object are immediately - * reflected in the matrix object and vice versa. In case the matrix object is changed - * directly (i.e., without using the methods on the SVGTransform interface itself) - * then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX. For - * SVG_TRANSFORM_MATRIX, the matrix contains the a, b, c, d, e, f values supplied by - * the user. For SVG_TRANSFORM_TRANSLATE, e and f represent the translation amounts - * (a=1, b=0, c=0 and d=1). For SVG_TRANSFORM_SCALE, a and d represent the scale - * amounts (b=0, c=0, e=0 and f=0). For SVG_TRANSFORM_SKEWX and - * SVG_TRANSFORM_SKEWY, a, b, c and d represent the matrix which will result in the - * given skew (e=0 and f=0). For SVG_TRANSFORM_ROTATE, a, b, c, d, e and f together - * represent the matrix which will result in the given rotation. When the rotation is - * around the center point (0, 0), e and f will be zero. - * - * MDN - */ + /** The matrix that represents this transformation. The matrix object is live, meaning that any changes made to the + * SVGTransform object are immediately reflected in the matrix object and vice versa. In case the matrix object is + * changed directly (i.e., without using the methods on the SVGTransform interface itself) then the type of the + * SVGTransform changes to SVG_TRANSFORM_MATRIX. For SVG_TRANSFORM_MATRIX, the matrix contains the a, b, c, d, e, f + * values supplied by the user. For SVG_TRANSFORM_TRANSLATE, e and f represent the translation amounts (a=1, b=0, c=0 + * and d=1). For SVG_TRANSFORM_SCALE, a and d represent the scale amounts (b=0, c=0, e=0 and f=0). For + * SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY, a, b, c and d represent the matrix which will result in the given + * skew (e=0 and f=0). For SVG_TRANSFORM_ROTATE, a, b, c, d, e and f together represent the matrix which will result + * in the given rotation. When the rotation is around the center point (0, 0), e and f will be zero. + * + * MDN + */ def matrix: SVGMatrix = js.native - /** - * Sets the transform type to SVG_TRANSFORM_TRANSLATE, with parameters tx and ty - * defining the translation amounts. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Sets the transform type to SVG_TRANSFORM_TRANSLATE, with parameters tx and ty defining the translation amounts. + * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only + * attribute or when the object itself is read only. + * + * MDN + */ def setTranslate(tx: Double, ty: Double): Unit = js.native - /** - * Sets the transform type to SVG_TRANSFORM_SCALE, with parameters sx and sy - * defining the scale amounts. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Sets the transform type to SVG_TRANSFORM_SCALE, with parameters sx and sy defining the scale amounts. Exceptions: + * a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only attribute or + * when the object itself is read only. + * + * MDN + */ def setScale(sx: Double, sy: Double): Unit = js.native - /** - * Sets the transform type to SVG_TRANSFORM_MATRIX, with parameter matrix defining - * the new transformation. Note that the values from the parameter matrix are copied. - * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised - * when attempting to modify a read only attribute or when the object itself is read - * only. - * - * MDN - */ + /** Sets the transform type to SVG_TRANSFORM_MATRIX, with parameter matrix defining the new transformation. Note that + * the values from the parameter matrix are copied. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR + * is raised when attempting to modify a read only attribute or when the object itself is read only. + * + * MDN + */ def setMatrix(matrix: SVGMatrix): Unit = js.native - /** - * Sets the transform type to SVG_TRANSFORM_SKEWY, with parameter angle defining - * the amount of skew. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Sets the transform type to SVG_TRANSFORM_SKEWY, with parameter angle defining the amount of skew. Exceptions: a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only attribute or + * when the object itself is read only. + * + * MDN + */ def setSkewY(angle: Double): Unit = js.native - /** - * Sets the transform type to SVG_TRANSFORM_ROTATE, with parameter angle defining - * the rotation angle and parameters cx and cy defining the optional center of - * rotation. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when attempting to modify a read only attribute or when the object itself is - * read only. - * - * MDN - */ + /** Sets the transform type to SVG_TRANSFORM_ROTATE, with parameter angle defining the rotation angle and parameters + * cx and cy defining the optional center of rotation. Exceptions: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only attribute or when the object itself is + * read only. + * + * MDN + */ def setRotate(angle: Double, cx: Double, cy: Double): Unit = js.native - /** - * Sets the transform type to SVG_TRANSFORM_SKEWX, with parameter angle defining - * the amount of skew. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Sets the transform type to SVG_TRANSFORM_SKEWX, with parameter angle defining the amount of skew. Exceptions: a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only attribute or + * when the object itself is read only. + * + * MDN + */ def setSkewX(angle: Double): Unit = js.native } -/** - * SVGTransform is the interface for one of the component transformations within an - * SVGTransformList; thus, an SVGTransform object corresponds to a single - * component (e.g., scale(…) or matrix(…)) within a transform attribute. - * - * MDN - */ +/** SVGTransform is the interface for one of the component transformations within an SVGTransformList; thus, an + * SVGTransform object corresponds to a single component (e.g., scale(…) or matrix(…)) within a transform attribute. + * + * MDN + */ @js.native @JSGlobal object SVGTransform extends js.Object { /* ??? ConstructorMember(FunSignature(List(),List(),Some(TypeRef(TypeName(SVGTransform),List())))) */ val SVG_TRANSFORM_SKEWX: Int = js.native - /** - * The unit type is not one of predefined unit types. It is invalid to attempt to define a - * new value of this type or to attempt to switch an existing value to this type. - * - * MDN - */ + /** The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or + * to attempt to switch an existing value to this type. + * + * MDN + */ val SVG_TRANSFORM_UNKNOWN: Int = js.native val SVG_TRANSFORM_SCALE: Int = js.native val SVG_TRANSFORM_TRANSLATE: Int = js.native @@ -2081,297 +1780,231 @@ object SVGPathSeg extends js.Object { val PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: Int = js.native } -/** - * The SVGNumber interface correspond to the <number> basic data type. - * - * MDN - */ +/** The SVGNumber interface correspond to the <number> basic data type. + * + * MDN + */ @js.native @JSGlobal class SVGNumber extends js.Object { - /** - * The value of the given attribute. Exceptions on setting: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is Raised on an attempt to change the value of a read - * only attribute. - * - * MDN - */ + /** The value of the given attribute. Exceptions on setting: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is + * Raised on an attempt to change the value of a read only attribute. + * + * MDN + */ var value: Double = js.native } -/** - * The SVGPathElement interface corresponds to the <path> element. - * - * MDN - */ +/** The SVGPathElement interface corresponds to the <path> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGPathElement - extends SVGElement with SVGStylable with SVGAnimatedPathData - with SVGTransformable with SVGLangSpace with SVGTests + extends SVGElement with SVGStylable with SVGAnimatedPathData with SVGTransformable with SVGLangSpace with SVGTests with SVGExternalResourcesRequired { - /** - * Returns the index into pathSegList which is distance units along the path, - * utilizing the user agent's distance-along-a-path algorithm. - * - * MDN - */ + /** Returns the index into pathSegList which is distance units along the path, utilizing the user agent's + * distance-along-a-path algorithm. + * + * MDN + */ def getPathSegAtLength(distance: Double): Int = js.native - /** - * Returns the (x,y) coordinate in user space which is distance units along the path, - * utilizing the browser's distance-along-a-path algorithm. - * - * MDN - */ + /** Returns the (x,y) coordinate in user space which is distance units along the path, utilizing the browser's + * distance-along-a-path algorithm. + * + * MDN + */ def getPointAtLength(distance: Double): SVGPoint = js.native - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object. - * Parameters: float x The absolute X coordinate for the end point of this path - * segment. float y The absolute Y coordinate for the end point of this path segment. - * float x1 The absolute X coordinate for the first control point. float y1 The - * absolute Y coordinate for the first control point. - * - * MDN - */ + /** Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticAbs object. Parameters: float x The absolute X + * coordinate for the end point of this path segment. float y The absolute Y coordinate for the end point of this + * path segment. float x1 The absolute X coordinate for the first control point. float y1 The absolute Y coordinate + * for the first control point. + * + * MDN + */ def createSVGPathSegCurvetoQuadraticAbs(x: Double, y: Double, x1: Double, y1: Double): SVGPathSegCurvetoQuadraticAbs = js.native - /** - * Returns a stand-alone, parentless SVGPathSegLinetoRel object. Parameters: - * float x The relative X coordinate for the end point of this path segment. float y The - * relative Y coordinate for the end point of this path segment. - * - * MDN - */ - def createSVGPathSegLinetoRel(x: Double, - y: Double): SVGPathSegLinetoRel = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object. - * Parameters: float x The relative X coordinate for the end point of this path - * segment. float y The relative Y coordinate for the end point of this path segment. - * float x1 The relative X coordinate for the first control point. float y1 The - * relative Y coordinate for the first control point. - * - * MDN - */ + /** Returns a stand-alone, parentless SVGPathSegLinetoRel object. Parameters: float x The relative X coordinate for + * the end point of this path segment. float y The relative Y coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegLinetoRel(x: Double, y: Double): SVGPathSegLinetoRel = js.native + + /** Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticRel object. Parameters: float x The relative X + * coordinate for the end point of this path segment. float y The relative Y coordinate for the end point of this + * path segment. float x1 The relative X coordinate for the first control point. float y1 The relative Y coordinate + * for the first control point. + * + * MDN + */ def createSVGPathSegCurvetoQuadraticRel(x: Double, y: Double, x1: Double, y1: Double): SVGPathSegCurvetoQuadraticRel = js.native - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object. - * Parameters: float x The absolute X coordinate for the end point of this path - * segment. float y The absolute Y coordinate for the end point of this path segment. - * float x1 The absolute X coordinate for the first control point. float y1 The - * absolute Y coordinate for the first control point. float x2 The absolute X - * coordinate for the second control point. float y2 The absolute Y coordinate for the - * second control point. - * - * MDN - */ - def createSVGPathSegCurvetoCubicAbs(x: Double, y: Double, x1: Double, - y1: Double, x2: Double, + /** Returns a stand-alone, parentless SVGPathSegCurvetoCubicAbs object. Parameters: float x The absolute X coordinate + * for the end point of this path segment. float y The absolute Y coordinate for the end point of this path segment. + * float x1 The absolute X coordinate for the first control point. float y1 The absolute Y coordinate for the first + * control point. float x2 The absolute X coordinate for the second control point. float y2 The absolute Y coordinate + * for the second control point. + * + * MDN + */ + def createSVGPathSegCurvetoCubicAbs(x: Double, y: Double, x1: Double, y1: Double, x2: Double, y2: Double): SVGPathSegCurvetoCubicAbs = js.native - /** - * Returns a stand-alone, parentless SVGPathSegLinetoAbs object. Parameters: - * float x The absolute X coordinate for the end point of this path segment. float y The - * absolute Y coordinate for the end point of this path segment. - * - * MDN - */ - def createSVGPathSegLinetoAbs(x: Double, - y: Double): SVGPathSegLinetoAbs = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegClosePath object. - * - * MDN - */ + /** Returns a stand-alone, parentless SVGPathSegLinetoAbs object. Parameters: float x The absolute X coordinate for + * the end point of this path segment. float y The absolute Y coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegLinetoAbs(x: Double, y: Double): SVGPathSegLinetoAbs = js.native + + /** Returns a stand-alone, parentless SVGPathSegClosePath object. + * + * MDN + */ def createSVGPathSegClosePath(): SVGPathSegClosePath = js.native - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object. - * Parameters: float x The relative X coordinate for the end point of this path - * segment. float y The relative Y coordinate for the end point of this path segment. - * float x1 The relative X coordinate for the first control point. float y1 The - * relative Y coordinate for the first control point. float x2 The relative X - * coordinate for the second control point. float y2 The relative Y coordinate for the - * second control point. - * - * MDN - */ - def createSVGPathSegCurvetoCubicRel(x: Double, y: Double, x1: Double, - y1: Double, x2: Double, + /** Returns a stand-alone, parentless SVGPathSegCurvetoCubicRel object. Parameters: float x The relative X coordinate + * for the end point of this path segment. float y The relative Y coordinate for the end point of this path segment. + * float x1 The relative X coordinate for the first control point. float y1 The relative Y coordinate for the first + * control point. float x2 The relative X coordinate for the second control point. float y2 The relative Y coordinate + * for the second control point. + * + * MDN + */ + def createSVGPathSegCurvetoCubicRel(x: Double, y: Double, x1: Double, y1: Double, x2: Double, y2: Double): SVGPathSegCurvetoCubicRel = js.native - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel - * object. Parameters: float x The absolute X coordinate for the end point of this path - * segment. float y The absolute Y coordinate for the end point of this path segment. - * - * MDN - */ - def createSVGPathSegCurvetoQuadraticSmoothRel(x: Double, - y: Double): SVGPathSegCurvetoQuadraticSmoothRel = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegMovetoRel object. Parameters: - * float x The relative X coordinate for the end point of this path segment. float y The - * relative Y coordinate for the end point of this path segment. - * - * MDN - */ - def createSVGPathSegMovetoRel(x: Double, - y: Double): SVGPathSegMovetoRel = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object. - * Parameters float x The absolute X coordinate for the end point of this path segment. - * float y The absolute Y coordinate for the end point of this path segment. float x2 The - * absolute X coordinate for the second control point. float y2 The absolute Y - * coordinate for the second control point. - * - * MDN - */ + /** Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothRel object. Parameters: float x The absolute X + * coordinate for the end point of this path segment. float y The absolute Y coordinate for the end point of this + * path segment. + * + * MDN + */ + def createSVGPathSegCurvetoQuadraticSmoothRel(x: Double, y: Double): SVGPathSegCurvetoQuadraticSmoothRel = js.native + + /** Returns a stand-alone, parentless SVGPathSegMovetoRel object. Parameters: float x The relative X coordinate for + * the end point of this path segment. float y The relative Y coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegMovetoRel(x: Double, y: Double): SVGPathSegMovetoRel = js.native + + /** Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothAbs object. Parameters float x The absolute X + * coordinate for the end point of this path segment. float y The absolute Y coordinate for the end point of this + * path segment. float x2 The absolute X coordinate for the second control point. float y2 The absolute Y coordinate + * for the second control point. + * + * MDN + */ def createSVGPathSegCurvetoCubicSmoothAbs(x: Double, y: Double, x2: Double, y2: Double): SVGPathSegCurvetoCubicSmoothAbs = js.native - /** - * Returns a stand-alone, parentless SVGPathSegMovetoAbs object. Parameters: - * float x The absolute X coordinate for the end point of this path segment. float y The - * absolute Y coordinate for the end point of this path segment. - * - * MDN - */ - def createSVGPathSegMovetoAbs(x: Double, - y: Double): SVGPathSegMovetoAbs = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object. - * Parameters: float y The relative Y coordinate for the end point of this path - * segment. - * - * MDN - */ - def createSVGPathSegLinetoVerticalRel( - y: Double): SVGPathSegLinetoVerticalRel = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegArcRel object. Parameters: float x - * The relative X coordinate for the end point of this path segment. float y The - * relative Y coordinate for the end point of this path segment. float r1 The x-axis - * radius for the ellipse. float r2 The y-axis radius for the ellipse. float angle The - * rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the - * user coordinate system. boolean largeArcFlag The value of the large-arc-flag - * parameter. boolean sweepFlag The value of the large-arc-flag parameter. - * - * MDN - */ - def createSVGPathSegArcRel(x: Double, y: Double, r1: Double, r2: Double, - angle: Double, largeArcFlag: Boolean, + /** Returns a stand-alone, parentless SVGPathSegMovetoAbs object. Parameters: float x The absolute X coordinate for + * the end point of this path segment. float y The absolute Y coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegMovetoAbs(x: Double, y: Double): SVGPathSegMovetoAbs = js.native + + /** Returns a stand-alone, parentless SVGPathSegLinetoVerticalRel object. Parameters: float y The relative Y + * coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegLinetoVerticalRel(y: Double): SVGPathSegLinetoVerticalRel = js.native + + /** Returns a stand-alone, parentless SVGPathSegArcRel object. Parameters: float x The relative X coordinate for the + * end point of this path segment. float y The relative Y coordinate for the end point of this path segment. float r1 + * The x-axis radius for the ellipse. float r2 The y-axis radius for the ellipse. float angle The rotation angle in + * degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system. boolean largeArcFlag The + * value of the large-arc-flag parameter. boolean sweepFlag The value of the large-arc-flag parameter. + * + * MDN + */ + def createSVGPathSegArcRel(x: Double, y: Double, r1: Double, r2: Double, angle: Double, largeArcFlag: Boolean, sweepFlag: Boolean): SVGPathSegArcRel = js.native - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs - * object. Parameters: float x The absolute X coordinate for the end point of this path - * segment. float y The absolute Y coordinate for the end point of this path segment. - * - * MDN - */ - def createSVGPathSegCurvetoQuadraticSmoothAbs(x: Double, - y: Double): SVGPathSegCurvetoQuadraticSmoothAbs = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object. - * Parameters: float x The relative X coordinate for the end point of this path - * segment. - * - * MDN - */ - def createSVGPathSegLinetoHorizontalRel( - x: Double): SVGPathSegLinetoHorizontalRel = js.native + /** Returns a stand-alone, parentless SVGPathSegCurvetoQuadraticSmoothAbs object. Parameters: float x The absolute X + * coordinate for the end point of this path segment. float y The absolute Y coordinate for the end point of this + * path segment. + * + * MDN + */ + def createSVGPathSegCurvetoQuadraticSmoothAbs(x: Double, y: Double): SVGPathSegCurvetoQuadraticSmoothAbs = js.native + + /** Returns a stand-alone, parentless SVGPathSegLinetoHorizontalRel object. Parameters: float x The relative X + * coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegLinetoHorizontalRel(x: Double): SVGPathSegLinetoHorizontalRel = js.native def getTotalLength(): Double = js.native - /** - * Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object. - * Parameters float x The absolute X coordinate for the end point of this path segment. - * float y The absolute Y coordinate for the end point of this path segment. float x2 The - * absolute X coordinate for the second control point. float y2 The absolute Y - * coordinate for the second control point. - * - * MDN - */ + /** Returns a stand-alone, parentless SVGPathSegCurvetoCubicSmoothRel object. Parameters float x The absolute X + * coordinate for the end point of this path segment. float y The absolute Y coordinate for the end point of this + * path segment. float x2 The absolute X coordinate for the second control point. float y2 The absolute Y coordinate + * for the second control point. + * + * MDN + */ def createSVGPathSegCurvetoCubicSmoothRel(x: Double, y: Double, x2: Double, y2: Double): SVGPathSegCurvetoCubicSmoothRel = js.native - /** - * Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object. - * Parameters: float x The absolute X coordinate for the end point of this path - * segment. - * - * MDN - */ - def createSVGPathSegLinetoHorizontalAbs( - x: Double): SVGPathSegLinetoHorizontalAbs = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object. - * Parameters: float y The absolute Y coordinate for the end point of this path - * segment. - * - * MDN - */ - def createSVGPathSegLinetoVerticalAbs( - y: Double): SVGPathSegLinetoVerticalAbs = js.native - - /** - * Returns a stand-alone, parentless SVGPathSegArcAbs object. Parameters: float x - * The absolute X coordinate for the end point of this path segment. float y The - * absolute Y coordinate for the end point of this path segment. float r1 The x-axis - * radius for the ellipse. float r2 The y-axis radius for the ellipse. float angle The - * rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the - * user coordinate system. boolean largeArcFlag The value of the large-arc-flag - * parameter. boolean sweepFlag The value of the large-arc-flag parameter. - * - * MDN - */ - def createSVGPathSegArcAbs(x: Double, y: Double, r1: Double, r2: Double, - angle: Double, largeArcFlag: Boolean, + /** Returns a stand-alone, parentless SVGPathSegLinetoHorizontalAbs object. Parameters: float x The absolute X + * coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegLinetoHorizontalAbs(x: Double): SVGPathSegLinetoHorizontalAbs = js.native + + /** Returns a stand-alone, parentless SVGPathSegLinetoVerticalAbs object. Parameters: float y The absolute Y + * coordinate for the end point of this path segment. + * + * MDN + */ + def createSVGPathSegLinetoVerticalAbs(y: Double): SVGPathSegLinetoVerticalAbs = js.native + + /** Returns a stand-alone, parentless SVGPathSegArcAbs object. Parameters: float x The absolute X coordinate for the + * end point of this path segment. float y The absolute Y coordinate for the end point of this path segment. float r1 + * The x-axis radius for the ellipse. float r2 The y-axis radius for the ellipse. float angle The rotation angle in + * degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system. boolean largeArcFlag The + * value of the large-arc-flag parameter. boolean sweepFlag The value of the large-arc-flag parameter. + * + * MDN + */ + def createSVGPathSegArcAbs(x: Double, y: Double, r1: Double, r2: Double, angle: Double, largeArcFlag: Boolean, sweepFlag: Boolean): SVGPathSegArcAbs = js.native } -/** - * The SVGAnimatedRect interface is used for attributes of basic SVGRect which can be - * animated. - * - * MDN - */ +/** The SVGAnimatedRect interface is used for attributes of basic SVGRect which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedRect extends js.Object { - /** - * A read only SVGRect representing the current animated value of the given - * attribute. If the given attribute is not currently being animated, then the - * SVGRect will have the same contents as baseVal. The object referenced by animVal - * will always be distinct from the one referenced by baseVal, even when the attribute - * is not animated. - * - * MDN - */ + /** A read only SVGRect representing the current animated value of the given attribute. If the given attribute is not + * currently being animated, then the SVGRect will have the same contents as baseVal. The object referenced by + * animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. + * + * MDN + */ def animVal: SVGRect = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ def baseVal: SVGRect = js.native } @@ -2415,77 +2048,68 @@ class SVGElementInstance extends EventTarget { def firstChild: SVGElementInstance = js.native } -/** - * The SVGCircleElement interface provides access to the properties of <circle> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGCircleElement interface provides access to the properties of <circle> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGCircleElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute cx on the given <circle> element. - * - * MDN - */ + /** Corresponds to attribute cx on the given <circle> element. + * + * MDN + */ def cx: SVGAnimatedLength = js.native - /** - * Corresponds to attribute r on the given <circle> element. - * - * MDN - */ + /** Corresponds to attribute r on the given <circle> element. + * + * MDN + */ def r: SVGAnimatedLength = js.native - /** - * Corresponds to attribute cy on the given <circle> element. - * - * MDN - */ + /** Corresponds to attribute cy on the given <circle> element. + * + * MDN + */ def cy: SVGAnimatedLength = js.native } -/** - * The SVGRect represents rectangular geometry. Rectangles are defined as - * consisting of a (x,y) coordinate pair identifying a minimum X value, a minimum Y - * value, and a width and height, which are usually constrained to be non-negative. - * - * MDN - */ +/** The SVGRect represents rectangular geometry. Rectangles are defined as consisting of a (x,y) coordinate pair + * identifying a minimum X value, a minimum Y value, and a width and height, which are usually constrained to be + * non-negative. + * + * MDN + */ @js.native @JSGlobal class SVGRect extends js.Object { - /** - * The y coordinate of the rectangle, in user units. - * - * MDN - */ + /** The y coordinate of the rectangle, in user units. + * + * MDN + */ var y: Double = js.native - /** - * The width coordinate of the rectangle, in user units. - * - * MDN - */ + /** The width coordinate of the rectangle, in user units. + * + * MDN + */ var width: Double = js.native - /** - * The x coordinate of the rectangle, in user units. - * - * MDN - */ + /** The x coordinate of the rectangle, in user units. + * + * MDN + */ var x: Double = js.native - /** - * The height coordinate of the rectangle, in user units. - * - * MDN - */ + /** The height coordinate of the rectangle, in user units. + * + * MDN + */ var height: Double = js.native } @@ -2516,11 +2140,10 @@ class SVGPathSegLinetoAbs extends SVGPathSeg { var x: Double = js.native } -/** - * Many of SVG's graphics operations utilize 2x3 matrices of the form: - * - * MDN - */ +/** Many of SVG's graphics operations utilize 2x3 matrices of the form: + * + * MDN + */ @js.native @JSGlobal class SVGMatrix extends js.Object { @@ -2531,155 +2154,125 @@ class SVGMatrix extends js.Object { var d: Double = js.native var f: Double = js.native - /** - * Performs matrix multiplication. This matrix is post-multiplied by another - * matrix, returning the resulting new matrix. - * - * MDN - */ + /** Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new + * matrix. + * + * MDN + */ def multiply(secondMatrix: SVGMatrix): SVGMatrix = js.native - /** - * Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting - * matrix. - * - * MDN - */ + /** Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix. + * + * MDN + */ def flipY(): SVGMatrix = js.native - /** - * Post-multiplies a skewY transformation on the current matrix and returns the - * resulting matrix. - * - * MDN - */ + /** Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix. + * + * MDN + */ def skewY(angle: Double): SVGMatrix = js.native - /** - * Return the inverse matrix Exceptions: a DOMException with code - * SVG_MATRIX_NOT_INVERTABLE is raised if the matrix is not invertable. - * - * MDN - */ + /** Return the inverse matrix Exceptions: a DOMException with code SVG_MATRIX_NOT_INVERTABLE is raised if the matrix + * is not invertable. + * + * MDN + */ def inverse(): SVGMatrix = js.native - /** - * Post-multiplies a non-uniform scale transformation on the current matrix and - * returns the resulting matrix. - * - * MDN - */ - def scaleNonUniform(scaleFactorX: Double, - scaleFactorY: Double): SVGMatrix = js.native + /** Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix. + * + * MDN + */ + def scaleNonUniform(scaleFactorX: Double, scaleFactorY: Double): SVGMatrix = js.native - /** - * Post-multiplies a rotation transformation on the current matrix and returns the - * resulting matrix. - * - * MDN - */ + /** Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix. + * + * MDN + */ def rotate(angle: Double): SVGMatrix = js.native - /** - * Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting - * matrix. - * - * MDN - */ + /** Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix. + * + * MDN + */ def flipX(): SVGMatrix = js.native - /** - * Post-multiplies a translation transformation on the current matrix and returns - * the resulting matrix. - * - * MDN - */ + /** Post-multiplies a translation transformation on the current matrix and returns the resulting matrix. + * + * MDN + */ def translate(x: Double, y: Double): SVGMatrix = js.native - /** - * Post-multiplies a uniform scale transformation on the current matrix and returns - * the resulting matrix. - * - * MDN - */ + /** Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix. + * + * MDN + */ def scale(scaleFactor: Double): SVGMatrix = js.native - /** - * Post-multiplies a rotation transformation on the current matrix and returns the - * resulting matrix. The rotation angle is determined by taking (+/-) atan(y/x). The - * direction of the vector (x, y) determines whether the positive or negative angle - * value is used. Exceptions: a DOMException with code SVG_INVALID_VALUE_ERR is - * raised if one of the parameters has an invalid value. - * - * MDN - */ + /** Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix. The rotation + * angle is determined by taking (+/-) atan(y/x). The direction of the vector (x, y) determines whether the positive + * or negative angle value is used. Exceptions: a DOMException with code SVG_INVALID_VALUE_ERR is raised if one of + * the parameters has an invalid value. + * + * MDN + */ def rotateFromVector(x: Double, y: Double): SVGMatrix = js.native - /** - * Post-multiplies a skewX transformation on the current matrix and returns the - * resulting matrix. - * - * MDN - */ + /** Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix. + * + * MDN + */ def skewX(angle: Double): SVGMatrix = js.native } -/** - * The SVGUseElement interface provides access to the properties of <use> elements, - * as well as methods to manipulate them. - * - * MDN - */ +/** The SVGUseElement interface provides access to the properties of <use> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGUseElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired with SVGURIReference { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired with SVGURIReference { - /** - * Corresponds to attribute y on the given <use> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <use> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * Corresponds to attribute width on the given <use> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <use> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * If the xlink:href attribute is being animated, contains the current animated root - * of the instance tree. If the xlink:href attribute is not currently being animated, - * contains the same value as instanceRoot. See description of SVGElementInstance - * to learn more about the instance tree. - * - * MDN - */ + /** If the xlink:href attribute is being animated, contains the current animated root of the instance tree. If the + * xlink:href attribute is not currently being animated, contains the same value as instanceRoot. See description of + * SVGElementInstance to learn more about the instance tree. + * + * MDN + */ def animatedInstanceRoot: SVGElementInstance = js.native - /** - * The root of the instance tree. See description of SVGElementInstance to learn more - * about the instance tree. - * - * MDN - */ + /** The root of the instance tree. See description of SVGElementInstance to learn more about the instance tree. + * + * MDN + */ def instanceRoot: SVGElementInstance = js.native - /** - * Corresponds to attribute x on the given <use> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <use> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute height on the given <use> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <use> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native } @@ -2700,124 +2293,107 @@ object SVGException extends js.Object { val SVG_INVALID_VALUE_ERR: Int = js.native } -/** - * The SVGLinearGradientElement interface corresponds to the <lineargradient> - * element. - * - * MDN - */ +/** The SVGLinearGradientElement interface corresponds to the <lineargradient> element. + * + * MDN + */ @js.native @JSGlobal class SVGLinearGradientElement extends SVGGradientElement { - /** - * Corresponds to attribute y1 on the given <lineargradient> element. - * - * MDN - */ + /** Corresponds to attribute y1 on the given <lineargradient> element. + * + * MDN + */ def y1: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x2 on the given <lineargradient> element. - * - * MDN - */ + /** Corresponds to attribute x2 on the given <lineargradient> element. + * + * MDN + */ def x2: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x1 on the given <lineargradient> element. - * - * MDN - */ + /** Corresponds to attribute x1 on the given <lineargradient> element. + * + * MDN + */ def x1: SVGAnimatedLength = js.native - /** - * Corresponds to attribute y2 on the given <lineargradient> element. - * - * MDN - */ + /** Corresponds to attribute y2 on the given <lineargradient> element. + * + * MDN + */ def y2: SVGAnimatedLength = js.native } -/** - * The SVGAnimatedEnumeration interface is used for attributes whose value must be a - * constant from a particular enumeration and which can be animated. - * - * MDN - */ +/** The SVGAnimatedEnumeration interface is used for attributes whose value must be a constant from a particular + * enumeration and which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedEnumeration extends js.Object { - /** - * If the given attribute or property is being animated, contains the current - * animated value of the attribute or property. If the given attribute or property is - * not currently being animated, contains the same value as baseVal. - * - * MDN - */ + /** If the given attribute or property is being animated, contains the current animated value of the attribute or + * property. If the given attribute or property is not currently being animated, contains the same value as baseVal. + * + * MDN + */ def animVal: Int = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: Int = js.native } -/** - * The SVGRectElement interface provides access to the properties of <rect> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGRectElement interface provides access to the properties of <rect> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGRectElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired { + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute y on the given <rect> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <rect> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * Corresponds to attribute width on the given <rect> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <rect> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * Corresponds to attribute ry on the given <rect> element. - * - * MDN - */ + /** Corresponds to attribute ry on the given <rect> element. + * + * MDN + */ def ry: SVGAnimatedLength = js.native - /** - * Corresponds to attribute rx on the given <rect> element. - * - * MDN - */ + /** Corresponds to attribute rx on the given <rect> element. + * + * MDN + */ def rx: SVGAnimatedLength = js.native - /** - * Corresponds to attribute x on the given <rect> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <rect> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute height on the given <rect> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <rect> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native } @@ -2837,113 +2413,93 @@ class SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { var y2: Double = js.native } -/** - * The SVGLengthList defines a list of SVGLength objects. - * - * MDN - */ +/** The SVGLengthList defines a list of SVGLength objects. + * + * MDN + */ @js.native @JSGlobal class SVGLengthList extends js.Object { def numberOfItems: Int = js.native - /** - * Replaces an existing item in the list with a new item. If newItem is already in a list, - * it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. If the item is already in this list, - * note that the index of the item to replace is before the removal of the item. - * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised - * when the list corresponds to a read only attribute or when the object itself is read - * only. a DOMException with code INDEX_SIZE_ERR is raised if the index number is - * greater than or equal to numberOfItems. - * - * MDN - */ + /** Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its + * previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the + * item is already in this list, note that the index of the item to replace is before the removal of the item. + * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read + * only attribute or when the object itself is read only. a DOMException with code INDEX_SIZE_ERR is raised if the + * index number is greater than or equal to numberOfItems. + * + * MDN + */ def replaceItem(newItem: SVGLength, index: Int): SVGLength = js.native - /** - * Returns the specified item from the list. The returned item is the item itself and - * not a copy. Any changes made to the item are immediately reflected in the list. The - * first item is number 0. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to + * the item are immediately reflected in the list. The first item is number 0. Exceptions: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself + * is read only. + * + * MDN + */ def getItem(index: Int): SVGLength = js.native - /** - * Clears all existing current items from the list, with the result being an empty - * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when the list corresponds to a read only attribute or when the object itself - * is read only. - * - * MDN - */ + /** Clears all existing current items from the list, with the result being an empty list. Exceptions: a DOMException + * with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the + * object itself is read only. + * + * MDN + */ def clear(): Unit = js.native - /** - * Inserts a new item at the end of the list. If newItem is already in a list, it is removed - * from its previous list before it is inserted into this list. The inserted item is the - * item itself and not a copy. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item at the end of the list. If newItem is already in a list, it is removed from its previous list + * before it is inserted into this list. The inserted item is the item itself and not a copy. Exceptions: a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or + * when the object itself is read only. + * + * MDN + */ def appendItem(newItem: SVGLength): SVGLength = js.native - /** - * Clears all existing current items from the list and re-initializes the list to hold - * the single item specified by the parameter. If the inserted item is already in a - * list, it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. The return value is the item inserted - * into the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Clears all existing current items from the list and re-initializes the list to hold the single item specified by + * the parameter. If the inserted item is already in a list, it is removed from its previous list before it is + * inserted into this list. The inserted item is the item itself and not a copy. The return value is the item + * inserted into the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list + * corresponds to a read only attribute or when the object itself is read only. + * + * MDN + */ def initialize(newItem: SVGLength): SVGLength = js.native - /** - * Removes an existing item from the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. a DOMException with code - * INDEX_SIZE_ERR is raised if the index number is greater than or equal to - * numberOfItems. - * - * MDN - */ + /** Removes an existing item from the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised + * when the list corresponds to a read only attribute or when the object itself is read only. a DOMException with + * code INDEX_SIZE_ERR is raised if the index number is greater than or equal to numberOfItems. + * + * MDN + */ def removeItem(index: Int): SVGLength = js.native - /** - * Inserts a new item into the list at the specified position. The first item is number - * 0. If newItem is already in a list, it is removed from its previous list before it is - * inserted into this list. The inserted item is the item itself and not a copy. If the - * item is already in this list, note that the index of the item to insert before is - * before the removal of the item. If the index is equal to 0, then the new item is - * inserted at the front of the list. If the index is greater than or equal to - * numberOfItems, then the new item is appended to the end of the list. Exceptions: a - * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list - * corresponds to a read only attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a + * list, it is removed from its previous list before it is inserted into this list. The inserted item is the item + * itself and not a copy. If the item is already in this list, note that the index of the item to insert before is + * before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the + * list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the + * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a + * read only attribute or when the object itself is read only. + * + * MDN + */ def insertItemBefore(newItem: SVGLength, index: Int): SVGLength = js.native } -/** - * The SVGPolylineElement interface provides access to the properties of - * <polyline> elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGPolylineElement interface provides access to the properties of <polyline> elements, as well as methods + * to manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGPolylineElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGAnimatedPoints with SVGTests with SVGExternalResourcesRequired + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGAnimatedPoints with SVGTests + with SVGExternalResourcesRequired @js.native trait SVGAnimatedPathData extends js.Object { @@ -2965,8 +2521,7 @@ object SVGZoomAndPan extends js.Object { @js.native @JSGlobal -abstract class SVGTextPathElement - extends SVGTextContentElement with SVGURIReference { +abstract class SVGTextPathElement extends SVGTextContentElement with SVGURIReference { def startOffset: SVGAnimatedLength = js.native def method: SVGAnimatedEnumeration = js.native @@ -2986,157 +2541,128 @@ object SVGTextPathElement extends js.Object { val TEXTPATH_METHODTYPE_ALIGN: Int = js.native } -/** - * The SVGGradient interface is a base interface used by SVGLinearGradientElement - * and SVGRadialGradientElement. - * - * MDN - */ +/** The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement. + * + * MDN + */ @js.native @JSGlobal abstract class SVGGradientElement - extends SVGElement with SVGUnitTypes with SVGStylable - with SVGExternalResourcesRequired with SVGURIReference { + extends SVGElement with SVGUnitTypes with SVGStylable with SVGExternalResourcesRequired with SVGURIReference { - /** - * Corresponds to attribute spreadMethod on the given element. One of the Spread - * Method Types defined on this interface. - * - * MDN - */ + /** Corresponds to attribute spreadMethod on the given element. One of the Spread Method Types defined on this + * interface. + * + * MDN + */ def spreadMethod: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute gradientTransform on the given element. - * - * MDN - */ + /** Corresponds to attribute gradientTransform on the given element. + * + * MDN + */ def gradientTransform: SVGAnimatedTransformList = js.native - /** - * Corresponds to attribute gradientUnits on the given element. Takes one of the - * constants defined in SVGUnitTypes. - * - * MDN - */ + /** Corresponds to attribute gradientUnits on the given element. Takes one of the constants defined in SVGUnitTypes. + * + * MDN + */ def gradientUnits: SVGAnimatedEnumeration = js.native } -/** - * The SVGGradient interface is a base interface used by SVGLinearGradientElement - * and SVGRadialGradientElement. - * - * MDN - */ +/** The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement. + * + * MDN + */ @js.native @JSGlobal object SVGGradientElement extends js.Object { val SVG_SPREADMETHOD_REFLECT: Int = js.native val SVG_SPREADMETHOD_PAD: Int = js.native - /** - * The type is not one of predefined types. It is invalid to attempt to define a new value - * of this type or to attempt to switch an existing value to this type. - * - * MDN - */ + /** The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt + * to switch an existing value to this type. + * + * MDN + */ val SVG_SPREADMETHOD_UNKNOWN: Int = js.native val SVG_SPREADMETHOD_REPEAT: Int = js.native } -/** - * The SVGNumberList defines a list of SVGNumber objects. - * - * MDN - */ +/** The SVGNumberList defines a list of SVGNumber objects. + * + * MDN + */ @js.native @JSGlobal class SVGNumberList extends js.Object { def numberOfItems: Int = js.native - /** - * Replaces an existing item in the list with a new item. If newItem is already in a list, - * it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. If the item is already in this list, - * note that the index of the item to replace is before the removal of the item. - * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised - * when the list corresponds to a read only attribute or when the object itself is read - * only. a DOMException with code INDEX_SIZE_ERR is raised if the index number is - * greater than or equal to numberOfItems. - * - * MDN - */ + /** Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its + * previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the + * item is already in this list, note that the index of the item to replace is before the removal of the item. + * Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read + * only attribute or when the object itself is read only. a DOMException with code INDEX_SIZE_ERR is raised if the + * index number is greater than or equal to numberOfItems. + * + * MDN + */ def replaceItem(newItem: SVGNumber, index: Int): SVGNumber = js.native - /** - * Returns the specified item from the list. The returned item is the item itself and - * not a copy. Any changes made to the item are immediately reflected in the list. The - * first item is number 0. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to + * the item are immediately reflected in the list. The first item is number 0. Exceptions: a DOMException with code + * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself + * is read only. + * + * MDN + */ def getItem(index: Int): SVGNumber = js.native - /** - * Clears all existing current items from the list, with the result being an empty - * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is - * raised when the list corresponds to a read only attribute or when the object itself - * is read only. - * - * MDN - */ + /** Clears all existing current items from the list, with the result being an empty list. Exceptions: a DOMException + * with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the + * object itself is read only. + * + * MDN + */ def clear(): Unit = js.native - /** - * Inserts a new item at the end of the list. If newItem is already in a list, it is removed - * from its previous list before it is inserted into this list. The inserted item is the - * item itself and not a copy. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item at the end of the list. If newItem is already in a list, it is removed from its previous list + * before it is inserted into this list. The inserted item is the item itself and not a copy. Exceptions: a + * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or + * when the object itself is read only. + * + * MDN + */ def appendItem(newItem: SVGNumber): SVGNumber = js.native - /** - * Clears all existing current items from the list and re-initializes the list to hold - * the single item specified by the parameter. If the inserted item is already in a - * list, it is removed from its previous list before it is inserted into this list. The - * inserted item is the item itself and not a copy. The return value is the item inserted - * into the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. - * - * MDN - */ + /** Clears all existing current items from the list and re-initializes the list to hold the single item specified by + * the parameter. If the inserted item is already in a list, it is removed from its previous list before it is + * inserted into this list. The inserted item is the item itself and not a copy. The return value is the item + * inserted into the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list + * corresponds to a read only attribute or when the object itself is read only. + * + * MDN + */ def initialize(newItem: SVGNumber): SVGNumber = js.native - /** - * Removes an existing item from the list. Exceptions: a DOMException with code - * NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only - * attribute or when the object itself is read only. a DOMException with code - * INDEX_SIZE_ERR is raised if the index number is greater than or equal to - * numberOfItems. - * - * MDN - */ + /** Removes an existing item from the list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised + * when the list corresponds to a read only attribute or when the object itself is read only. a DOMException with + * code INDEX_SIZE_ERR is raised if the index number is greater than or equal to numberOfItems. + * + * MDN + */ def removeItem(index: Int): SVGNumber = js.native - /** - * Inserts a new item into the list at the specified position. The first item is number - * 0. If newItem is already in a list, it is removed from its previous list before it is - * inserted into this list. The inserted item is the item itself and not a copy. If the - * item is already in this list, note that the index of the item to insert before is - * before the removal of the item. If the index is equal to 0, then the new item is - * inserted at the front of the list. If the index is greater than or equal to - * numberOfItems, then the new item is appended to the end of the list. Exceptions: a - * DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list - * corresponds to a read only attribute or when the object itself is read only. - * - * MDN - */ + /** Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a + * list, it is removed from its previous list before it is inserted into this list. The inserted item is the item + * itself and not a copy. If the item is already in this list, note that the index of the item to insert before is + * before the removal of the item. If the index is equal to 0, then the new item is inserted at the front of the + * list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the + * list. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a + * read only attribute or when the object itself is read only. + * + * MDN + */ def insertItemBefore(newItem: SVGNumber, index: Int): SVGNumber = js.native } @@ -3147,77 +2673,67 @@ class SVGPathSegLinetoRel extends SVGPathSeg { var x: Double = js.native } -/** - * The SVGAnimatedBoolean interface is used for attributes of type boolean which can - * be animated. - * - * MDN - */ +/** The SVGAnimatedBoolean interface is used for attributes of type boolean which can be animated. + * + * MDN + */ @js.native @JSGlobal class SVGAnimatedBoolean extends js.Object { - /** - * If the given attribute or property is being animated, contains the current - * animated value of the attribute or property. If the given attribute or property is - * not currently being animated, contains the same value as baseVal. - * - * MDN - */ + /** If the given attribute or property is being animated, contains the current animated value of the attribute or + * property. If the given attribute or property is not currently being animated, contains the same value as baseVal. + * + * MDN + */ def animVal: Boolean = js.native - /** - * The base value of the given attribute before applying any animations. - * - * MDN - */ + /** The base value of the given attribute before applying any animations. + * + * MDN + */ var baseVal: Boolean = js.native } -/** - * The SVGSwitchElement interface corresponds to the <switch> element. - * - * MDN - */ +/** The SVGSwitchElement interface corresponds to the <switch> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGSwitchElement - extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired + extends SVGElement with SVGStylable with SVGTransformable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired -/** - * The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio - * attribute, which is available for some of SVG's elements. - * - * MDN - */ +/** The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio attribute, which is available for some + * of SVG's elements. + * + * MDN + */ @js.native @JSGlobal class SVGPreserveAspectRatio extends js.Object { - /** - * The type of the alignment value as specified by one of the - * SVG_PRESERVEASPECTRATIO_* constants defined on this interface. - * - * MDN - */ + /** The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_* constants defined on this + * interface. + * + * MDN + */ var align: Int = js.native - /** - * The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_* - * constants defined on this interface. - * - * MDN - */ + /** The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_* constants defined on this + * interface. + * + * MDN + */ var meetOrSlice: Int = js.native } -/** - * The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio - * attribute, which is available for some of SVG's elements. - * - * MDN - */ +/** The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio attribute, which is available for some + * of SVG's elements. + * + * MDN + */ @js.native @JSGlobal object SVGPreserveAspectRatio extends js.Object { @@ -3228,13 +2744,11 @@ object SVGPreserveAspectRatio extends js.Object { val SVG_PRESERVEASPECTRATIO_XMINYMAX: Int = js.native val SVG_PRESERVEASPECTRATIO_XMAXYMAX: Int = js.native - /** - * The enumeration was set to a value that is not one of predefined types. It is invalid - * to attempt to define a new value of this type or to attempt to switch an existing value - * to this type. - * - * MDN - */ + /** The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new + * value of this type or to attempt to switch an existing value to this type. + * + * MDN + */ val SVG_MEETORSLICE_UNKNOWN: Int = js.native val SVG_PRESERVEASPECTRATIO_XMAXYMID: Int = js.native val SVG_PRESERVEASPECTRATIO_XMIDYMAX: Int = js.native @@ -3248,42 +2762,37 @@ object SVGPreserveAspectRatio extends js.Object { val SVG_PRESERVEASPECTRATIO_XMIDYMID: Int = js.native val SVG_PRESERVEASPECTRATIO_XMIDYMIN: Int = js.native - /** - * Corresponds to value slice for attribute preserveAspectRatio. - * - * MDN - */ + /** Corresponds to value slice for attribute preserveAspectRatio. + * + * MDN + */ val SVG_MEETORSLICE_SLICE: Int = js.native val SVG_PRESERVEASPECTRATIO_UNKNOWN: Int = js.native } -/** - * The SVGStopElement interface corresponds to the <stop> element. - * - * MDN - */ +/** The SVGStopElement interface corresponds to the <stop> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGStopElement extends SVGElement with SVGStylable { - /** - * Corresponds to attribute offset on the given <stop> element. - * - * MDN - */ + /** Corresponds to attribute offset on the given <stop> element. + * + * MDN + */ var offset: SVGAnimatedNumber = js.native } -/** - * The SVGSymbolElement interface corresponds to the <symbol> element. - * - * MDN - */ +/** The SVGSymbolElement interface corresponds to the <symbol> element. + * + * MDN + */ @js.native @JSGlobal abstract class SVGSymbolElement - extends SVGElement with SVGStylable with SVGLangSpace with SVGFitToViewBox - with SVGExternalResourcesRequired + extends SVGElement with SVGStylable with SVGLangSpace with SVGFitToViewBox with SVGExternalResourcesRequired @js.native @JSGlobal @@ -3293,138 +2802,121 @@ class SVGElementInstanceList extends js.Object { def item(index: Int): SVGElementInstance = js.native } -/** - * The SVGMaskElement interface provides access to the properties of <mask> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGMaskElement interface provides access to the properties of <mask> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGMaskElement - extends SVGElement with SVGUnitTypes with SVGStylable with SVGLangSpace - with SVGTests with SVGExternalResourcesRequired { + extends SVGElement with SVGUnitTypes with SVGStylable with SVGLangSpace with SVGTests + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute y on the given <mask> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <mask> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * Corresponds to attribute width on the given <mask> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <mask> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * Corresponds to attribute maskUnits on the given <mask> element. Takes one of the - * constants defined in SVGUnitTypes - * - * MDN - */ + /** Corresponds to attribute maskUnits on the given <mask> element. Takes one of the constants defined in + * SVGUnitTypes + * + * MDN + */ def maskUnits: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute maskContentUnits on the given <mask> element. Takes one - * of the constants defined in SVGUnitTypes - * - * MDN - */ + /** Corresponds to attribute maskContentUnits on the given <mask> element. Takes one of the constants defined in + * SVGUnitTypes + * + * MDN + */ def maskContentUnits: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute x on the given <mask> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <mask> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute height on the given <mask> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <mask> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native } -/** - * The SVGFilterElement interface provides access to the properties of <filter> - * elements, as well as methods to manipulate them. - * - * MDN - */ +/** The SVGFilterElement interface provides access to the properties of <filter> elements, as well as methods to + * manipulate them. + * + * MDN + */ @js.native @JSGlobal abstract class SVGFilterElement - extends SVGElement with SVGUnitTypes with SVGStylable with SVGLangSpace - with SVGURIReference with SVGExternalResourcesRequired { + extends SVGElement with SVGUnitTypes with SVGStylable with SVGLangSpace with SVGURIReference + with SVGExternalResourcesRequired { - /** - * Corresponds to attribute y on the given <filter> element. - * - * MDN - */ + /** Corresponds to attribute y on the given <filter> element. + * + * MDN + */ def y: SVGAnimatedLength = js.native - /** - * Corresponds to attribute width on the given <filter> element. - * - * MDN - */ + /** Corresponds to attribute width on the given <filter> element. + * + * MDN + */ def width: SVGAnimatedLength = js.native - /** - * Contains the X component of attribute filterRes on the given <filter> element. - * - * MDN - */ + /** Contains the X component of attribute filterRes on the given <filter> element. + * + * MDN + */ def filterResX: SVGAnimatedInteger = js.native - /** - * Corresponds to attribute filterUnits on the given <filter> element. Takes one of - * the constants defined in SVGUnitTypes. - * - * MDN - */ + /** Corresponds to attribute filterUnits on the given <filter> element. Takes one of the constants defined in + * SVGUnitTypes. + * + * MDN + */ def filterUnits: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute primitiveUnits on the given <filter> element. Takes one - * of the constants defined in SVGUnitTypes. - * - * MDN - */ + /** Corresponds to attribute primitiveUnits on the given <filter> element. Takes one of the constants defined in + * SVGUnitTypes. + * + * MDN + */ def primitiveUnits: SVGAnimatedEnumeration = js.native - /** - * Corresponds to attribute x on the given <filter> element. - * - * MDN - */ + /** Corresponds to attribute x on the given <filter> element. + * + * MDN + */ def x: SVGAnimatedLength = js.native - /** - * Corresponds to attribute height on the given <filter> element. - * - * MDN - */ + /** Corresponds to attribute height on the given <filter> element. + * + * MDN + */ def height: SVGAnimatedLength = js.native - /** - * Contains the Y component of attribute filterRes on the given <filter> element. - * - * MDN - */ + /** Contains the Y component of attribute filterRes on the given <filter> element. + * + * MDN + */ def filterResY: SVGAnimatedInteger = js.native - /** - * Sets the values for attribute filterRes. - * - * MDN - */ + /** Sets the values for attribute filterRes. + * + * MDN + */ def setFilterRes(filterResX: Double, filterResY: Double): Unit = js.native } @@ -3436,8 +2928,7 @@ abstract class SVGFEMergeNodeElement extends SVGElement { @js.native @JSGlobal -abstract class SVGFEFloodElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes +abstract class SVGFEFloodElement extends SVGElement with SVGFilterPrimitiveStandardAttributes @js.native @JSGlobal @@ -3445,15 +2936,13 @@ abstract class SVGFEFuncAElement extends SVGComponentTransferFunctionElement @js.native @JSGlobal -abstract class SVGFETileElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFETileElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def in1: SVGAnimatedString = js.native } @js.native @JSGlobal -abstract class SVGFEBlendElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEBlendElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def in2: SVGAnimatedString = js.native def mode: SVGAnimatedEnumeration = js.native @@ -3475,8 +2964,7 @@ object SVGFEBlendElement extends js.Object { @js.native @JSGlobal -abstract class SVGFEMergeElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes +abstract class SVGFEMergeElement extends SVGElement with SVGFilterPrimitiveStandardAttributes @js.native @JSGlobal @@ -3490,16 +2978,14 @@ abstract class SVGFEPointLightElement extends SVGElement { @js.native @JSGlobal -abstract class SVGFEGaussianBlurElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEGaussianBlurElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def stdDeviationX: SVGAnimatedNumber = js.native def in1: SVGAnimatedString = js.native def stdDeviationY: SVGAnimatedNumber = js.native - def setStdDeviation(stdDeviationX: Double, - stdDeviationY: Double): Unit = js.native + def setStdDeviation(stdDeviationX: Double, stdDeviationY: Double): Unit = js.native } @js.native @@ -3517,8 +3003,7 @@ trait SVGFilterPrimitiveStandardAttributes extends SVGStylable { @js.native @JSGlobal -abstract class SVGFESpecularLightingElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFESpecularLightingElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def kernelUnitLengthY: SVGAnimatedNumber = js.native def surfaceScale: SVGAnimatedNumber = js.native @@ -3534,8 +3019,7 @@ abstract class SVGFESpecularLightingElement @js.native @JSGlobal -abstract class SVGFEMorphologyElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEMorphologyElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def operator: SVGAnimatedEnumeration = js.native def radiusX: SVGAnimatedNumber = js.native @@ -3559,8 +3043,7 @@ abstract class SVGFEFuncRElement extends SVGComponentTransferFunctionElement @js.native @JSGlobal -abstract class SVGFEDisplacementMapElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEDisplacementMapElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def in2: SVGAnimatedString = js.native def xChannelSelector: SVGAnimatedEnumeration = js.native @@ -3625,8 +3108,7 @@ abstract class SVGFEFuncBElement extends SVGComponentTransferFunctionElement @js.native @JSGlobal -abstract class SVGFETurbulenceElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFETurbulenceElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def baseFrequencyX: SVGAnimatedNumber = js.native def numOctaves: SVGAnimatedInteger = js.native @@ -3658,8 +3140,7 @@ abstract class SVGFEFuncGElement extends SVGComponentTransferFunctionElement @js.native @JSGlobal -abstract class SVGFEColorMatrixElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEColorMatrixElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def in1: SVGAnimatedString = js.native def `type`: SVGAnimatedEnumeration = js.native @@ -3700,8 +3181,7 @@ abstract class SVGFESpotLightElement extends SVGElement { @js.native @JSGlobal -abstract class SVGFEOffsetElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEOffsetElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def dy: SVGAnimatedNumber = js.native def in1: SVGAnimatedString = js.native @@ -3712,16 +3192,14 @@ abstract class SVGFEOffsetElement @js.native @JSGlobal abstract class SVGFEImageElement - extends SVGElement with SVGLangSpace - with SVGFilterPrimitiveStandardAttributes with SVGURIReference + extends SVGElement with SVGLangSpace with SVGFilterPrimitiveStandardAttributes with SVGURIReference with SVGExternalResourcesRequired { def preserveAspectRatio: SVGAnimatedPreserveAspectRatio = js.native } @js.native @JSGlobal -abstract class SVGFECompositeElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFECompositeElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def operator: SVGAnimatedEnumeration = js.native def in2: SVGAnimatedString = js.native @@ -3752,15 +3230,13 @@ object SVGFECompositeElement extends js.Object { @js.native @JSGlobal -abstract class SVGFEComponentTransferElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEComponentTransferElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def in1: SVGAnimatedString = js.native } @js.native @JSGlobal -abstract class SVGFEDiffuseLightingElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEDiffuseLightingElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def kernelUnitLengthY: SVGAnimatedNumber = js.native def surfaceScale: SVGAnimatedNumber = js.native @@ -3784,8 +3260,7 @@ object SVGFEConvolveMatrixElement extends js.Object { @js.native @JSGlobal -abstract class SVGFEConvolveMatrixElement - extends SVGElement with SVGFilterPrimitiveStandardAttributes { +abstract class SVGFEConvolveMatrixElement extends SVGElement with SVGFilterPrimitiveStandardAttributes { def orderY: SVGAnimatedInteger = js.native def kernelUnitLengthY: SVGAnimatedNumber = js.native diff --git a/src/main/scala/org/scalajs/dom/Stream.scala b/src/main/scala/org/scalajs/dom/Stream.scala index 00b9ea2f5..e147ee451 100644 --- a/src/main/scala/org/scalajs/dom/Stream.scala +++ b/src/main/scala/org/scalajs/dom/Stream.scala @@ -5,382 +5,298 @@ import scala.scalajs.js.annotation._ // the stream API is defined in https://streams.spec.whatwg.org/ -/** - * [[https://streams.spec.whatwg.org/#ws-state ¶4.2.4.3. get state]] of - * whatwg streams spec - */ +/** [[https://streams.spec.whatwg.org/#ws-state ¶4.2.4.3. get state]] of whatwg streams spec + */ @js.native sealed trait WriteableState extends js.Any object WriteableState { - /** - * The stream’s internal queue is full; that is, the stream is exerting - * backpressure. Use .ready to be notified of when the pressure subsides. - */ + /** The stream’s internal queue is full; that is, the stream is exerting backpressure. Use .ready to be notified of + * when the pressure subsides. + */ val waiting = "waiting".asInstanceOf[WriteableState] - /** - * The stream’s internal queue is not full; call .write() until - * backpressure is exerted. - */ + /** The stream’s internal queue is not full; call .write() until backpressure is exerted. + */ val writable = "writable".asInstanceOf[WriteableState] - /** - * The stream’s .close() method has been called, and a command to close is - * in the queue or being processed by the underlying sink; attempts to - * write will now fail. */ + /** The stream’s .close() method has been called, and a command to close is in the queue or being processed by the + * underlying sink; attempts to write will now fail. + */ val closing = "closing".asInstanceOf[WriteableState] /** The underlying sink has been closed; writing is no longer possible. */ val closed = "closed".asInstanceOf[WriteableState] - /** An error occurred interacting with the underlying sink or the stream - * has been aborted, so the stream is now - * dead. */ + /** An error occurred interacting with the underlying sink or the stream has been aborted, so the stream is now dead. + */ val errored = "errored".asInstanceOf[WriteableState] } -/** - * [[https://streams.spec.whatwg.org/#ws-class ¶4.2. Class WritableStream]] of - * whatwg Stream spec - * - * - * todo: the constructor - * @tparam T Type of the Chunks to be written to the Stream - */ +/** [[https://streams.spec.whatwg.org/#ws-class ¶4.2. Class WritableStream]] of whatwg Stream spec + * + * todo: the constructor + * @tparam T + * Type of the Chunks to be written to the Stream + */ @js.native trait WriteableStream[-T] extends js.Object { - /** - * The closed getter returns a promise that will be fulfilled when the - * stream becomes closed, or rejected if it ever errors. - * see [[https://streams.spec.whatwg.org/#ws-closed ¶4.2.4.1. get closed]] - */ + /** The closed getter returns a promise that will be fulfilled when the stream becomes closed, or rejected if it ever + * errors. see [[https://streams.spec.whatwg.org/#ws-closed ¶4.2.4.1. get closed]] + */ val closed: js.Promise[WriteableStream[T]] = js.native - /** - * The ready getter returns a promise that will be fulfilled when the - * stream transitions away from the "waiting" state to any other state. - * Once the stream transitions back to "waiting", the getter will return a - * new promise that stays pending until the next state transition. In - * essence, this promise gives a signal as to when any backpressure has let - * up (or that the stream has been - * closed or errored). - * - * see [[https://streams.spec.whatwg.org/#ws-ready ¶4.2.4.2. get ready]] - * of whatwg streams spec. - */ + /** The ready getter returns a promise that will be fulfilled when the stream transitions away from the "waiting" + * state to any other state. Once the stream transitions back to "waiting", the getter will return a new promise that + * stays pending until the next state transition. In essence, this promise gives a signal as to when any backpressure + * has let up (or that the stream has been closed or errored). + * + * see [[https://streams.spec.whatwg.org/#ws-ready ¶4.2.4.2. get ready]] of whatwg streams spec. + */ val ready: js.Promise[WriteableStream[T]] = js.native - /** - * The state getter returns the state of the stream - * see [[https://streams.spec.whatwg.org/#ws-state ¶4.2.4.3. get state]] - * of whatwg streams spec - */ + /** The state getter returns the state of the stream see + * [[https://streams.spec.whatwg.org/#ws-state ¶4.2.4.3. get state]] of whatwg streams spec + */ def state: WriteableState = js.native - /** - * The abort method signals that the producer can no longer successfully - * write to the stream and it should be immediately moved to an "errored" - * state, with any queued-up writes discarded. This will also execute any - * abort mechanism of the underlying sink. - * see [[https://streams.spec.whatwg.org/#ws-abort ¶4.2.4.4. abort(reason)]] - * - * @param reason - */ - def abort( - reason: js.UndefOr[Any] = js.undefined): js.Promise[Unit] = js.native - - /** - * The close method signals that the producer is done writing chunks to the - * stream and wishes to move the stream to a "closed" state. This queues an - * action to close the stream, such that once any currently queued-up - * writes complete, the close mechanism of the underlying sink will - * execute, releasing any held resources. In the meantime, the stream will - * be in a "closing" state. - * - * [[https://streams.spec.whatwg.org/#ws-close ¶4.2.4.5. close()]] - * - * @return a promise of this stream being closed - */ + /** The abort method signals that the producer can no longer successfully write to the stream and it should be + * immediately moved to an "errored" state, with any queued-up writes discarded. This will also execute any abort + * mechanism of the underlying sink. see [[https://streams.spec.whatwg.org/#ws-abort ¶4.2.4.4. abort(reason)]] + * + * @param reason + */ + def abort(reason: js.UndefOr[Any] = js.undefined): js.Promise[Unit] = js.native + + /** The close method signals that the producer is done writing chunks to the stream and wishes to move the stream to a + * "closed" state. This queues an action to close the stream, such that once any currently queued-up writes complete, + * the close mechanism of the underlying sink will execute, releasing any held resources. In the meantime, the stream + * will be in a "closing" state. + * + * [[https://streams.spec.whatwg.org/#ws-close ¶4.2.4.5. close()]] + * + * @return + * a promise of this stream being closed + */ def close(): js.Promise[WriteableStream[T]] = js.native - /** - * The write method adds a write to the stream’s internal queue, - * instructing the stream to write the given chunk of data to the - * underlying sink once all other pending writes have finished successfully - * . It returns a promise that will be fulfilled or rejected depending on - * the success or failure of writing the chunk to the underlying sink. The - * impact of enqueuing this chunk will be immediately reflected in the - * stream’s state property; in particular, if the internal queue is now - * full according to the stream’s queuing strategy, the stream will exert - * backpressure by changing its state to "waiting". - * - * see [[https://streams.spec.whatwg.org/#ws-write 4.2.4.6. write(chunk)]] - * of whatwg streams spec - * - * @param chunk - * @return bblfish: not sure what the type of the promise returned is - */ + /** The write method adds a write to the stream’s internal queue, instructing the stream to write the given chunk of + * data to the underlying sink once all other pending writes have finished successfully . It returns a promise that + * will be fulfilled or rejected depending on the success or failure of writing the chunk to the underlying sink. The + * impact of enqueuing this chunk will be immediately reflected in the stream’s state property; in particular, if the + * internal queue is now full according to the stream’s queuing strategy, the stream will exert backpressure by + * changing its state to "waiting". + * + * see [[https://streams.spec.whatwg.org/#ws-write 4.2.4.6. write(chunk)]] of whatwg streams spec + * + * @param chunk + * @return + * bblfish: not sure what the type of the promise returned is + */ def write(chunk: Chunk[T]): js.Promise[Any] = js.native } -/** - * defined at [[https://streams.spec.whatwg.org/#readable-stream ¶2.1. Readable Streams]] of - * whatwg Streams spec. - * - * @tparam T Type of the Chunks returned by the Stream. Can't make it coveriant, - * due to T - */ +/** defined at [[https://streams.spec.whatwg.org/#readable-stream ¶2.1. Readable Streams]] of whatwg Streams spec. + * + * @tparam T + * Type of the Chunks returned by the Stream. Can't make it coveriant, due to T + */ @js.native trait ReadableStream[+T] extends js.Object { - /** - * The locked getter returns whether or not the readable stream is locked - * to a reader. - * - * throws scala.scalajs.js.TypeError if the stream is not readable - */ + /** The locked getter returns whether or not the readable stream is locked to a reader. + * + * throws scala.scalajs.js.TypeError if the stream is not readable + */ def locked: Boolean = js.native - /** - * The cancel method cancels the stream, signaling a loss of interest in - * the stream by a consumer. The supplied reason argument will be given to - * the underlying source, which may or may not use it. - * - * @param reason the reason - * @return a Promise - */ - def cancel( - reason: js.UndefOr[Any] = js.undefined): js.Promise[Unit] = js.native - - /** - * See [[https://streams.spec.whatwg.org/#rs-get-reader ¶3.2.4.3. getReader()]] - * of whatwg streams spec. Also see the example usage there. - * - * The getReader method creates a readable stream reader and locks the - * stream to the new reader. While the stream is locked, no other reader - * can be acquired until this one is released. The returned reader provides - * the ability to directly read individual chunks from the stream via the - * reader’s read method. This functionality is especially useful for - * creating abstractions that desire the ability to consume a stream in its - * entirety. By getting a reader for the stream, you can ensure nobodyA - * else can interleave reads with yours or cancel the stream, which would - * interfere with your abstraction. - * - * Note that if a stream becomes closed or errored, any reader it is locked - * to is automatically released. - * - * throws scala.scalajs.js.TypeError if not a readable stream - * - * @return a new ReadableStreamReader - * - */ + /** The cancel method cancels the stream, signaling a loss of interest in the stream by a consumer. The supplied + * reason argument will be given to the underlying source, which may or may not use it. + * + * @param reason + * the reason + * @return + * a Promise + */ + def cancel(reason: js.UndefOr[Any] = js.undefined): js.Promise[Unit] = js.native + + /** See [[https://streams.spec.whatwg.org/#rs-get-reader ¶3.2.4.3. getReader()]] of whatwg streams spec. Also see the + * example usage there. + * + * The getReader method creates a readable stream reader and locks the stream to the new reader. While the stream is + * locked, no other reader can be acquired until this one is released. The returned reader provides the ability to + * directly read individual chunks from the stream via the reader’s read method. This functionality is especially + * useful for creating abstractions that desire the ability to consume a stream in its entirety. By getting a reader + * for the stream, you can ensure nobodyA else can interleave reads with yours or cancel the stream, which would + * interfere with your abstraction. + * + * Note that if a stream becomes closed or errored, any reader it is locked to is automatically released. + * + * throws scala.scalajs.js.TypeError if not a readable stream + * + * @return + * a new ReadableStreamReader + */ def getReader(): ReadableStreamReader[T] = js.native - /** - * see [[https://streams.spec.whatwg.org/#rs-pipe-through §3.2.4.4. pipeThrough({ writable, readable }, options)]] - * - * The pipeThrough method provides a convenient, chainable way of piping - * this readable stream through a transform stream (or any other { - * writable, readable } pair). It simply pipes the stream into the writable - * side of the supplied pair, and returns the readable side for further use - * . Piping a stream will generally lock it for the duration of the pipe, - * preventing any other consumer fromA acquiring a - * reader. - * - * This method is intentionally generic; it does not require that its this - * value be a ReadableStream object. It also does not require that its - * writable argument be a WritableStream instance, or that its readable - * argument be a ReadableStream instance. - * - * //todo: determine the type of options - */ - def pipeThrough[U]( - pair: Any, // TODO js.Tuple2[WriteableStream[T], ReadableStream[U]] + /** see [[https://streams.spec.whatwg.org/#rs-pipe-through §3.2.4.4. pipeThrough({ writable, readable }, options)]] + * + * The pipeThrough method provides a convenient, chainable way of piping this readable stream through a transform + * stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the + * supplied pair, and returns the readable side for further use . Piping a stream will generally lock it for the + * duration of the pipe, preventing any other consumer fromA acquiring a reader. + * + * This method is intentionally generic; it does not require that its this value be a ReadableStream object. It also + * does not require that its writable argument be a WritableStream instance, or that its readable argument be a + * ReadableStream instance. + * + * //todo: determine the type of options + */ + def pipeThrough[U](pair: Any, // TODO js.Tuple2[WriteableStream[T], ReadableStream[U]] options: Any = js.undefined): ReadableStream[U] = js.native - /** - * See [[https://streams.spec.whatwg.org/#rs-pipe-to ¶3.2.4.5. pipeTo(dest, { preventClose, preventAbort, preventCancel } = {})]] - * of whatwg Streams spec. - * - * The pipeTo method pipes this readable stream to a given writable stream. - * The way in which the piping process behaves under various error - * conditions can be customized with a number of passed options. It returns - * a promise that fulfills when the piping process completes successfully, - * or rejects if any errors were encountered. - * - * Piping a stream will generally lock it for the duration of the pipe, - * preventing any other consumer from acquiring a reader. This method is - * intentionally generic; it does not require that its this value be a - * ReadableStream object. - * - * //todo: determine the type of options - */ - def pipeTo(dest: WriteableStream[T], - options: Any = js.undefined): Unit = js.native - - /** - * See [[https://streams.spec.whatwg.org/#rs-tee ¶3.2.4.6. tee()]] of whatwg - * streams spec. - * - * The tee method tees this readable stream, returning a two-element array - * containing the two resulting branches as new ReadableStream instances. - * - * Teeing a stream will lock it, preventing any other consumer from - * acquiring a reader. To cancel the stream, cancel both of the resulting - * branches; a composite cancellation reason will then be propagated to the - * stream’s underlying source. - * - * Note that the chunks seen in each branch will be the same object. If the - * chunks are not immutable, this could allow interference between the two - * branches. (Let us know if you think we should add an option to tee that - * creates structured clones of the chunks for each branch.) - */ + /** See + * [[https://streams.spec.whatwg.org/#rs-pipe-to ¶3.2.4.5. pipeTo(dest, { preventClose, preventAbort, preventCancel } = {})]] + * of whatwg Streams spec. + * + * The pipeTo method pipes this readable stream to a given writable stream. The way in which the piping process + * behaves under various error conditions can be customized with a number of passed options. It returns a promise + * that fulfills when the piping process completes successfully, or rejects if any errors were encountered. + * + * Piping a stream will generally lock it for the duration of the pipe, preventing any other consumer from acquiring + * a reader. This method is intentionally generic; it does not require that its this value be a ReadableStream + * object. + * + * //todo: determine the type of options + */ + def pipeTo(dest: WriteableStream[T], options: Any = js.undefined): Unit = js.native + + /** See [[https://streams.spec.whatwg.org/#rs-tee ¶3.2.4.6. tee()]] of whatwg streams spec. + * + * The tee method tees this readable stream, returning a two-element array containing the two resulting branches as + * new ReadableStream instances. + * + * Teeing a stream will lock it, preventing any other consumer from acquiring a reader. To cancel the stream, cancel + * both of the resulting branches; a composite cancellation reason will then be propagated to the stream’s underlying + * source. + * + * Note that the chunks seen in each branch will be the same object. If the chunks are not immutable, this could + * allow interference between the two branches. (Let us know if you think we should add an option to tee that creates + * structured clones of the chunks for each branch.) + */ def tee(): js.Array[_ <: ReadableStream[T]] = js.native //TODO js.Tuple2[ReadableStream[T], ReadableStream[T]] } -/** - * See [[https://streams.spec.whatwg.org/#reader-class ¶3.4. Class ReadableStreamReader]] - * of whatwg streams spec. - * - * The ReadableStreamReader class represents a readable stream reader designed - * to be vended [sic] by a ReadableStream instance. - * - * The ReadableStreamReader constructor is generally not meant to be used directly; - * instead, a stream’s getReader() method should be used. This allows different - * classes of readable streams to vend different classes of readers without the - * consumer needing to know which goes with which. - * - * @tparam T Type of the Chunks returned by the Stream - */ +/** See [[https://streams.spec.whatwg.org/#reader-class ¶3.4. Class ReadableStreamReader]] of whatwg streams spec. + * + * The ReadableStreamReader class represents a readable stream reader designed to be vended [sic] by a ReadableStream + * instance. + * + * The ReadableStreamReader constructor is generally not meant to be used directly; instead, a stream’s getReader() + * method should be used. This allows different classes of readable streams to vend different classes of readers + * without the consumer needing to know which goes with which. + * + * @tparam T + * Type of the Chunks returned by the Stream + */ @js.native @JSGlobal class ReadableStreamReader[+T](stream: ReadableStream[T]) extends js.Object { - /** - * See [[https://streams.spec.whatwg.org/#reader-closed §3.4.4.1. get closed]] - * of whatwg Streams spec. - * - * The closed getter returns a promise that will be fulfilled when the stream - * becomes closed or the reader’s lock is released, or rejected if the - * stream ever errors. - */ + /** See [[https://streams.spec.whatwg.org/#reader-closed §3.4.4.1. get closed]] of whatwg Streams spec. + * + * The closed getter returns a promise that will be fulfilled when the stream becomes closed or the reader’s lock is + * released, or rejected if the stream ever errors. + */ def closed: js.Promise[ReadableStreamReader[T]] = js.native - /** - * See [[https://streams.spec.whatwg.org/#reader-cancel §3.4.4.2. cancel(reason)]] - * of whatwg Streams spec. - * - * If the reader is active, the cancel method behaves the same as that for - * the associated stream. When done, it automatically releases the lock. - * - * //todo determine type of reason - */ + /** See [[https://streams.spec.whatwg.org/#reader-cancel §3.4.4.2. cancel(reason)]] of whatwg Streams spec. + * + * If the reader is active, the cancel method behaves the same as that for the associated stream. When done, it + * automatically releases the lock. + * + * //todo determine type of reason + */ // not actually sure what the return type is here def cancel(reason: Any): js.Promise[Any] = js.native - /** - * See [[https://streams.spec.whatwg.org/#reader-read 3.4.4.3. read()]] of - * whatwg Stream spec. - * - * The read method will return a promise that allows access to the next chunk - * from the stream’s internal queue, if available. If the chunk does become - * available, the promise will be fulfilled with an object of the form { - * value: theChunk, done: false }. If the stream becomes closed, the - * promise will be fulfilled with an object of the form { value: undefined, - * done: true }. If the stream becomes errored, the promise will be - * rejected with the relevant error. If reading a chunk causes the queue to - * become empty, more data will be pulled from the underlying source. - */ + /** See [[https://streams.spec.whatwg.org/#reader-read 3.4.4.3. read()]] of whatwg Stream spec. + * + * The read method will return a promise that allows access to the next chunk from the stream’s internal queue, if + * available. If the chunk does become available, the promise will be fulfilled with an object of the form { value: + * theChunk, done: false }. If the stream becomes closed, the promise will be fulfilled with an object of the form { + * value: undefined, done: true }. If the stream becomes errored, the promise will be rejected with the relevant + * error. If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. + */ def read(): js.Promise[Chunk[T]] = js.native - /** - * The releaseLock method releases the reader’s lock on the corresponding - * stream. After the lock is released, the reader is no longer active. If the - * associated stream is errored when the lock is released, the reader will - * appear errored in the same way from now on; otherwise, the reader will - * appear closed. - * A reader’s lock cannot be released while it still has a pending read - * request, i.e., if a promise returned by the reader’s read() method has - * not yet been settled. Attempting to do so will throw a TypeError and leave - * the reader locked to the stream. - * - * throws scala.scalajs.js.TypeError - */ + /** The releaseLock method releases the reader’s lock on the corresponding stream. After the lock is released, the + * reader is no longer active. If the associated stream is errored when the lock is released, the reader will appear + * errored in the same way from now on; otherwise, the reader will appear closed. A reader’s lock cannot be released + * while it still has a pending read request, i.e., if a promise returned by the reader’s read() method has not yet + * been settled. Attempting to do so will throw a TypeError and leave the reader locked to the stream. + * + * throws scala.scalajs.js.TypeError + */ def releaseLock(): Unit = js.native } -/** - * - * [[https://streams.spec.whatwg.org/#rs-controller-class ¶3.3 Class - * ReadableStreamController]] of whatwg spec - * - * The ReadableStreamController constructor cannot be used directly; it only - * works on a ReadableStream that is in the middle of being constructed. - * - * @param stream can be null - * @tparam T Type of the Chunks to be enqueued to the Stream - - */ +/** [[https://streams.spec.whatwg.org/#rs-controller-class ¶3.3 Class ReadableStreamController]] of whatwg spec + * + * The ReadableStreamController constructor cannot be used directly; it only works on a ReadableStream that is in the + * middle of being constructed. + * + * @param stream + * can be null + * @tparam T + * Type of the Chunks to be enqueued to the Stream + */ @js.native @JSGlobal -class ReadableStreamController[-T](stream: ReadableStream[T] = null) - extends js.Object { - - /** - * - * The desiredSize getter returns the desired size to fill the controlled - * stream’s internal queue. It can be negative, if the queue is over-full. - * An underlying source should use this information to determine when and how - * to apply backpressure. - * - * @return the size of the strem - no idea if this actually is an int - */ +class ReadableStreamController[-T](stream: ReadableStream[T] = null) extends js.Object { + + /** The desiredSize getter returns the desired size to fill the controlled stream’s internal queue. It can be + * negative, if the queue is over-full. An underlying source should use this information to determine when and how to + * apply backpressure. + * + * @return + * the size of the strem - no idea if this actually is an int + */ def desiredSize: Int = js.native - /** - * The close method will close the controlled readable stream. Consumers will - * still be able to read any previously-enqueued chunks from the stream, but - * once those are read, the stream will become closed - * throws scala.scalajs.js.TypeError if this is not a readable controller - */ + /** The close method will close the controlled readable stream. Consumers will still be able to read any + * previously-enqueued chunks from the stream, but once those are read, the stream will become closed throws + * scala.scalajs.js.TypeError if this is not a readable controller + */ def close(): Unit = js.native - /** - * The enqueue method will enqueue a given chunk in the controlled readable - * stream. - * - * @param chunk - * throws scala.scalajs.js.RangeError if size is too big - * @return seems like its an undefOr[Int] of the size - * - */ + /** The enqueue method will enqueue a given chunk in the controlled readable stream. + * + * @param chunk + * throws scala.scalajs.js.RangeError if size is too big + * @return + * seems like its an undefOr[Int] of the size + */ def enqueue(chunk: Chunk[T]): js.UndefOr[Int] = js.native - /** - * The error method will error the readable stream, making all future - * interactions with it fail with the given error e. - * - * @param e : an error - can this be any type? - * throws scala.scalajs.js.TypeError - */ + /** The error method will error the readable stream, making all future interactions with it fail with the given error + * e. + * + * @param e + * : an error - can this be any type? throws scala.scalajs.js.TypeError + */ def error(e: Any): Unit = js.native } -/** - * - * See [[https://streams.spec.whatwg.org/#chunk ¶2 Model]] but mostly the - * examples in the whatwg streams spec - * - */ +/** See [[https://streams.spec.whatwg.org/#chunk ¶2 Model]] but mostly the examples in the whatwg streams spec + */ @js.native trait Chunk[+T] extends js.Object { - /** - * The value of the chunk. - */ + /** The value of the chunk. + */ def value: T = js.native def done: Boolean = js.native diff --git a/src/main/scala/org/scalajs/dom/URL.scala b/src/main/scala/org/scalajs/dom/URL.scala index bba3beb2b..889a710c7 100644 --- a/src/main/scala/org/scalajs/dom/URL.scala +++ b/src/main/scala/org/scalajs/dom/URL.scala @@ -3,144 +3,120 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ -/** - * The URL object provides static methods used for creating object URLs. - * - * MDN - */ +/** The URL object provides static methods used for creating object URLs. + * + * MDN + */ @js.native @JSGlobal object URL extends js.Object { - /** - * The URL.revokeObjectURL() static method releases an existing object URL which - * was previously created by calling window.URL.createObjectURL().  Call this - * method when you've finished using a object URL, in order to let the browser know it - * doesn't need to keep the reference to the file any longer. - * - * MDN - */ + /** The URL.revokeObjectURL() static method releases an existing object URL which was previously created by calling + * window.URL.createObjectURL().  Call this method when you've finished using a object URL, in order to let the + * browser know it doesn't need to keep the reference to the file any longer. + * + * MDN + */ def revokeObjectURL(url: String): Unit = js.native - /** - * The URL.createObjectURL() static method creates a DOMString containing an URL - * representing the object given in parameter. The URL lifetime is tied to the - * document in the window on which it was created. The new object URL represents the - * specified File object or Blob object. - * - * MDN - */ + /** The URL.createObjectURL() static method creates a DOMString containing an URL representing the object given in + * parameter. The URL lifetime is tied to the document in the window on which it was created. The new object URL + * represents the specified File object or Blob object. + * + * MDN + */ def createObjectURL(blob: Blob): String = js.native } -/** - * The URL() constructor returns a newly created URL object representing the URL - * defined by the parameters. - * - * MDN - */ +/** The URL() constructor returns a newly created URL object representing the URL defined by the parameters. + * + * MDN + */ @js.native @JSGlobal class URL(url: String, base: String = js.native) extends js.Object { - /** - * Returns a DOMString containing the origin of the URL, that is its scheme, - * its domain and its port. - * - * MDN - */ + /** Returns a DOMString containing the origin of the URL, that is its scheme, its domain and its port. + * + * MDN + */ def origin: String = js.native - /** - * Is a DOMString containing the whole URL. - * - * MDN - */ + /** Is a DOMString containing the whole URL. + * + * MDN + */ var href: String = js.native - /** - * Is a DOMString containing the protocol scheme of the URL, - * including the final ':'. - * - * MDN - */ + /** Is a DOMString containing the protocol scheme of the URL, including the final ':'. + * + * MDN + */ var protocol: String = js.native - /** - * Is a DOMString containing the username specified before the domain name. - * - * MDN - */ + /** Is a DOMString containing the username specified before the domain name. + * + * MDN + */ var username: String = js.native - /** - * Is a DOMString containing the password specified before the domain name. - * - * MDN - */ + /** Is a DOMString containing the password specified before the domain name. + * + * MDN + */ var password: String = js.native - /** - * Is a DOMString containing the host, that is the hostname, a ':', - * and the port of the URL. - * - * MDN - */ + /** Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL. + * + * MDN + */ var host: String = js.native - /** - * Is a DOMString containing the domain of the URL. - * - * MDN - */ + /** Is a DOMString containing the domain of the URL. + * + * MDN + */ var hostname: String = js.native - /** - * Is a DOMString containing the port number of the URL. - * - * MDN - */ + /** Is a DOMString containing the port number of the URL. + * + * MDN + */ var port: String = js.native - /** - * Is a DOMString containing an initial '/' followed by the path of the URL. - * - * MDN - */ + /** Is a DOMString containing an initial '/' followed by the path of the URL. + * + * MDN + */ var pathname: String = js.native - /** - * Is a DOMString containing a '?' followed by the parameters of the URL. - * - * MDN - */ + /** Is a DOMString containing a '?' followed by the parameters of the URL. + * + * MDN + */ var search: String = js.native - /** - * Is a DOMString containing a '#' followed by the fragment identifier of the URL. - * - * MDN - */ + /** Is a DOMString containing a '#' followed by the fragment identifier of the URL. + * + * MDN + */ var hash: String = js.native var searchParams: URLSearchParams = js.native } -/** - * The URLSearchParams defines utility methods to work with the query string of a URL. - * - * MDN - */ +/** The URLSearchParams defines utility methods to work with the query string of a URL. + * + * MDN + */ @js.native @JSGlobal -class URLSearchParams - extends js.Iterable[js.Tuple2[String, String]] { - - /** - * Leading '?' characters are ignored. - * - * MDN - */ +class URLSearchParams extends js.Iterable[js.Tuple2[String, String]] { + + /** Leading '?' characters are ignored. + * + * MDN + */ def this(init: String) = this() def this(init: Sequence[String]) = this() def this(init: js.Dictionary[String]) = this() diff --git a/src/main/scala/org/scalajs/dom/WebGLTypes.scala b/src/main/scala/org/scalajs/dom/WebGLTypes.scala index e65fb09e8..33bf57ede 100644 --- a/src/main/scala/org/scalajs/dom/WebGLTypes.scala +++ b/src/main/scala/org/scalajs/dom/WebGLTypes.scala @@ -10,147 +10,126 @@ import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.typedarray._ -/** - * Contains drawing surface attributes. - */ +/** Contains drawing surface attributes. + */ @js.native @JSGlobal class WebGLContextAttributes extends js.Object { - /** - * When `true`, the drawing buffer has an alpha channel. - */ + /** When `true`, the drawing buffer has an alpha channel. + */ var alpha: Boolean = js.native - /** - * When `true`, the drawing buffer has a depth buffer of at least 16 bits. - */ + /** When `true`, the drawing buffer has a depth buffer of at least 16 bits. + */ var depth: Boolean = js.native - /** - * When `true`, the drawing buffer has a stencil buffer of at least 8 bits. - */ + /** When `true`, the drawing buffer has a stencil buffer of at least 8 bits. + */ var stencil: Boolean = js.native - /** - * When `true` and antialiasing is supported, the drawing buffer will use an antialiasing method if it's choice. - */ + /** When `true` and antialiasing is supported, the drawing buffer will use an antialiasing method if it's choice. + */ var antialias: Boolean = js.native - /** - * When `true` the page compositor assumes the buffer's contents is premultiplied. Used for sensible transparency when using - * WebGL canvases for overlays. - */ + /** When `true` the page compositor assumes the buffer's contents is premultiplied. Used for sensible transparency + * when using WebGL canvases for overlays. + */ var premultipliedAlpha: Boolean = js.native - /** - * When `true`, the drawing buffer is preserved after rendering, otherwise it is cleared. On some implementations preserving the drawing buffer - * can dramatically impact performance. - */ + /** When `true`, the drawing buffer is preserved after rendering, otherwise it is cleared. On some implementations + * preserving the drawing buffer can dramatically impact performance. + */ var preserveDrawingBuffer: Boolean = js.native } -/** - * An opaque type representing a WebGL buffer. - */ +/** An opaque type representing a WebGL buffer. + */ @js.native @JSGlobal class WebGLBuffer private[this] () extends js.Object -/** - * An opaque type representing a WebGL framebuffer. - */ +/** An opaque type representing a WebGL framebuffer. + */ @js.native @JSGlobal class WebGLFramebuffer private[this] () extends js.Object -/** - * An opaque type representing a WebGL program. - */ +/** An opaque type representing a WebGL program. + */ @js.native @JSGlobal class WebGLProgram private[this] () extends js.Object -/** - * An opaque type representing a WebGL renderbuffer. - */ +/** An opaque type representing a WebGL renderbuffer. + */ @js.native @JSGlobal class WebGLRenderbuffer private[this] () extends js.Object -/** - * An opaque type representing a WebGL shader. - */ +/** An opaque type representing a WebGL shader. + */ @js.native @JSGlobal class WebGLShader private[this] () extends js.Object -/** - * An opaque type representing a WebGL texture. - */ +/** An opaque type representing a WebGL texture. + */ @js.native @JSGlobal class WebGLTexture private[this] () extends js.Object -/** - * An opaque type representing a WebGL uniform location. - */ +/** An opaque type representing a WebGL uniform location. + */ @js.native @JSGlobal class WebGLUniformLocation private[this] () extends js.Object -/** - * Holds information returned by [[WebGLRenderingContext#getActiveAttrib]] and [[WebGLRenderingContext#getActiveUniform]]. - */ +/** Holds information returned by [[WebGLRenderingContext#getActiveAttrib]] and + * [[WebGLRenderingContext#getActiveUniform]]. + */ @js.native @JSGlobal class WebGLActiveInfo private[this] () extends js.Object { - /** - * The size of the requested variable. - */ + /** The size of the requested variable. + */ val size: Int = js.native - /** - * The type of the requested variable. - */ + /** The type of the requested variable. + */ val `type`: Int = js.native - /** - * The name of the requested variable. - */ + /** The name of the requested variable. + */ val name: String = js.native } -/** - * Represents information about the implementation's precision for given parameters. See [[WebGLRenderingContext#getShaderPrecisionFormat]]. - */ +/** Represents information about the implementation's precision for given parameters. See + * [[WebGLRenderingContext#getShaderPrecisionFormat]]. + */ @js.native @JSGlobal class WebGLShaderPrecisionFormat private[this] () extends js.Object { - /** - * The base 2 log of the absolute value of the minimum value that can be represented. - */ + /** The base 2 log of the absolute value of the minimum value that can be represented. + */ val rangeMin: Int = js.native - /** - * The base 2 log of the absolute value of the maximum value that can be represented. - */ + /** The base 2 log of the absolute value of the maximum value that can be represented. + */ val rangeMax: Int = js.native - /** - * The number of bits of precision that can be represented. For integer formats this value is always 0. - */ + /** The number of bits of precision that can be represented. For integer formats this value is always 0. + */ val precision: Int = js.native } -/** - * WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL - * which provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element. - * - * MDN - */ +/** WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL which + * provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element. + * + * MDN + */ object WebGLRenderingContext { /* Note: * Normally we'd make this object @js.native extends js.Object @@ -159,79 +138,86 @@ object WebGLRenderingContext { * have to explicitly define them as final vals instead. */ - /** - * Specifies the depth buffer should be cleared. - * @see [[WebGLRenderingContext#clear]] - */ + /** Specifies the depth buffer should be cleared. + * @see + * [[WebGLRenderingContext#clear]] + */ final val DEPTH_BUFFER_BIT = 0x00000100 - /** - * Specifies the stencil buffer should be cleared. - * @see [[WebGLRenderingContext#clear]] - */ + /** Specifies the stencil buffer should be cleared. + * @see + * [[WebGLRenderingContext#clear]] + */ final val STENCIL_BUFFER_BIT = 0x00000400 - /** - * Specifies the color buffer should be cleared. - * @see [[WebGLRenderingContext#clear]] - */ + /** Specifies the color buffer should be cleared. + * @see + * [[WebGLRenderingContext#clear]] + */ final val COLOR_BUFFER_BIT = 0x00004000 /* BeginMode */ - /** - * Specifies the elements should be drawn as points. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as points. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val POINTS = 0x0000 - /** - * Specifies the elements should be drawn as lines. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as lines. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val LINES = 0x0001 - /** - * Specifies the elements should be drawn as a line loop. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as a line loop. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val LINE_LOOP = 0x0002 - /** - * Specifies the elements should be drawn as a line strip. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as a line strip. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val LINE_STRIP = 0x0003 - /** - * Specifies the elements should be drawn as triangles. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as triangles. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val TRIANGLES = 0x0004 - /** - * Specifies the elements should be drawn as a triangle strip. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as a triangle strip. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val TRIANGLE_STRIP = 0x0005 - /** - * Specifies the elements should be drawn as a triangle fan. - * - * @see [[WebGLRenderingContext#drawArrays]] - * @see [[WebGLRenderingContext#drawElements]] - */ + /** Specifies the elements should be drawn as a triangle fan. + * + * @see + * [[WebGLRenderingContext#drawArrays]] + * @see + * [[WebGLRenderingContext#drawElements]] + */ final val TRIANGLE_FAN = 0x0006 /* AlphaFunction (not supported in ES20) */ @@ -302,19 +288,16 @@ object WebGLRenderingContext { final val CURRENT_VERTEX_ATTRIB = 0x8626 /* CullFaceMode */ - /** - * Specifies front faces. - */ + /** Specifies front faces. + */ final val FRONT = 0x0404 - /** - * Specifies back faces. - */ + /** Specifies back faces. + */ final val BACK = 0x0405 - /** - * Specifies both front and back faces. - */ + /** Specifies both front and back faces. + */ final val FRONT_AND_BACK = 0x0408 /* DepthFunction */ @@ -329,78 +312,64 @@ object WebGLRenderingContext { /* EnableCap */ /* TEXTURE_2D */ - /** - * Capability to enable/disable backface culling. - */ + /** Capability to enable/disable backface culling. + */ final val CULL_FACE = 0x0B44 - /** - * Capability to enable/disable blending. - */ + /** Capability to enable/disable blending. + */ final val BLEND = 0x0BE2 - /** - * Capability to enable/disable dithering. - */ + /** Capability to enable/disable dithering. + */ final val DITHER = 0x0BD0 - /** - * Capability to enable/disable the stencil test. - */ + /** Capability to enable/disable the stencil test. + */ final val STENCIL_TEST = 0x0B90 - /** - * Capability to enable/disable the depth test. - */ + /** Capability to enable/disable the depth test. + */ final val DEPTH_TEST = 0x0B71 - /** - * Capability to enable/disable the scissor test. - */ + /** Capability to enable/disable the scissor test. + */ final val SCISSOR_TEST = 0x0C11 - /** - * Capability to enable/disable polygon offset. - */ + /** Capability to enable/disable polygon offset. + */ final val POLYGON_OFFSET_FILL = 0x8037 final val SAMPLE_ALPHA_TO_COVERAGE = 0x809E final val SAMPLE_COVERAGE = 0x80A0 /* ErrorCode */ - /** - * No error has occurred. - */ + /** No error has occurred. + */ final val NO_ERROR = 0 - /** - * An invalid enumerated name has been passed to an API function. - */ + /** An invalid enumerated name has been passed to an API function. + */ final val INVALID_ENUM = 0x0500 - /** - * An invalid value has been passed to an API function. - */ + /** An invalid value has been passed to an API function. + */ final val INVALID_VALUE = 0x0501 - /** - * The requested operation is not valid. - */ + /** The requested operation is not valid. + */ final val INVALID_OPERATION = 0x0502 - /** - * The operation requested could not be completed because it ran out of memory. - */ + /** The operation requested could not be completed because it ran out of memory. + */ final val OUT_OF_MEMORY = 0x0505 /* FrontFaceDirection */ - /** - * Clockwise wound triangles are front-facing. - */ + /** Clockwise wound triangles are front-facing. + */ final val CW = 0x0900 - /** - * Counter-Clockwise wound triangles are front-facing. - */ + /** Counter-Clockwise wound triangles are front-facing. + */ final val CCW = 0x0901 /* GetPName */ @@ -547,66 +516,56 @@ object WebGLRenderingContext { /* TextureMinFilter */ /* NEAREST */ /* LINEAR */ - /** - * Specifies nearest neighbour interpolation on the nearest mipmap level. - */ + /** Specifies nearest neighbour interpolation on the nearest mipmap level. + */ final val NEAREST_MIPMAP_NEAREST = 0x2700 - /** - * Specifies linear interpolation on the nearest mipmap level. - */ + /** Specifies linear interpolation on the nearest mipmap level. + */ final val LINEAR_MIPMAP_NEAREST = 0x2701 - /** - * Specifies nearest neighbour interpolation, linearly blending between mipmap levels. - */ + /** Specifies nearest neighbour interpolation, linearly blending between mipmap levels. + */ final val NEAREST_MIPMAP_LINEAR = 0x2702 - /** - * Specifies linear interpolation linearly blending between mipmap levels. - */ + /** Specifies linear interpolation linearly blending between mipmap levels. + */ final val LINEAR_MIPMAP_LINEAR = 0x2703 /* TextureParameterName */ - /** - * The texture magnification filter. - * - * Can be one of [[NEAREST]] or [[LINEAR]]. - */ + /** The texture magnification filter. + * + * Can be one of [[NEAREST]] or [[LINEAR]]. + */ final val TEXTURE_MAG_FILTER = 0x2800 - /** - * The texture minification filter. - * - * Can be one of [[NEAREST]], [[LINEAR]], [[NEAREST_MIPMAP_NEAREST]], [[LINEAR_MIPMAP_NEAREST]], - * [[NEAREST_MIPMAP_LINEAR]], [[LINEAR_MIPMAP_LINEAR]]. - */ + /** The texture minification filter. + * + * Can be one of [[NEAREST]], [[LINEAR]], [[NEAREST_MIPMAP_NEAREST]], [[LINEAR_MIPMAP_NEAREST]], + * [[NEAREST_MIPMAP_LINEAR]], [[LINEAR_MIPMAP_LINEAR]]. + */ final val TEXTURE_MIN_FILTER = 0x2801 - /** - * The horizontal texture wrap mode. - * - * Can be one of [[REPEAT]], [[CLAMP_TO_EDGE]], [[MIRRORED_REPEAT]]. - */ + /** The horizontal texture wrap mode. + * + * Can be one of [[REPEAT]], [[CLAMP_TO_EDGE]], [[MIRRORED_REPEAT]]. + */ final val TEXTURE_WRAP_S = 0x2802 - /** - * The vertical texture wrap. - * - * Can be one of [[REPEAT]], [[CLAMP_TO_EDGE]], [[MIRRORED_REPEAT]]. - */ + /** The vertical texture wrap. + * + * Can be one of [[REPEAT]], [[CLAMP_TO_EDGE]], [[MIRRORED_REPEAT]]. + */ final val TEXTURE_WRAP_T = 0x2803 /* TextureTarget */ - /** - * The target for a simple 2 dimensional texture. - */ + /** The target for a simple 2 dimensional texture. + */ final val TEXTURE_2D = 0x0DE1 final val TEXTURE = 0x1702 - /** - * The target for a cube mapped texture. - */ + /** The target for a cube mapped texture. + */ final val TEXTURE_CUBE_MAP = 0x8513 final val TEXTURE_BINDING_CUBE_MAP = 0x8514 final val TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 @@ -642,95 +601,140 @@ object WebGLRenderingContext { /** Identifies texture unit 7. This texture unit is guaranteed to exist. */ final val TEXTURE7 = 0x84C7 - /** Identifies texture unit 8. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 8. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE8 = 0x84C8 - /** Identifies texture unit 9. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 9. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE9 = 0x84C9 - /** Identifies texture unit 10. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 10. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE10 = 0x84CA - /** Identifies texture unit 11. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 11. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE11 = 0x84CB - /** Identifies texture unit 12. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 12. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE12 = 0x84CC - /** Identifies texture unit 13. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 13. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE13 = 0x84CD - /** Identifies texture unit 14. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 14. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE14 = 0x84CE - /** Identifies texture unit 15. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 15. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE15 = 0x84CF - /** Identifies texture unit 16. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 16. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE16 = 0x84D0 - /** Identifies texture unit 17. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 17. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE17 = 0x84D1 - /** Identifies texture unit 18. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 18. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE18 = 0x84D2 - /** Identifies texture unit 19. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 19. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE19 = 0x84D3 - /** Identifies texture unit 20. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 20. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE20 = 0x84D4 - /** Identifies texture unit 21. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 21. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE21 = 0x84D5 - /** Identifies texture unit 22. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 22. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE22 = 0x84D6 - /** Identifies texture unit 23. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 23. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE23 = 0x84D7 - /** Identifies texture unit 24. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 24. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE24 = 0x84D8 - /** Identifies texture unit 25. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 25. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE25 = 0x84D9 - /** Identifies texture unit 26. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 26. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE26 = 0x84DA - /** Identifies texture unit 27. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 27. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE27 = 0x84DB - /** Identifies texture unit 28. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 28. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE28 = 0x84DC - /** Identifies texture unit 29. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 29. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE29 = 0x84DD - /** Identifies texture unit 30. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 30. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE30 = 0x84DE - /** Identifies texture unit 31. This texture unit ''may not exist in a given implementation''. You should examine MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. */ + /** Identifies texture unit 31. This texture unit ''may not exist in a given implementation''. You should examine + * MAX_COMBINED_TEXTURE_IMAGE_UNITS before using it. + */ final val TEXTURE31 = 0x84DF /** The currently active texture unit. */ final val ACTIVE_TEXTURE = 0x84E0 /* TextureWrapMode */ - /** - * Repeat the texture along this axis. - */ + /** Repeat the texture along this axis. + */ final val REPEAT = 0x2901 - /** - * Clamp the texture along this axis. The colour of the edge pixels will be replicated to infinity. - */ + /** Clamp the texture along this axis. The colour of the edge pixels will be replicated to infinity. + */ final val CLAMP_TO_EDGE = 0x812F - /** - * Repeat the texture along this axis, mirroring it each step. - */ + /** Repeat the texture along this axis, mirroring it each step. + */ final val MIRRORED_REPEAT = 0x8370 /* Uniform Types */ @@ -767,45 +771,37 @@ object WebGLRenderingContext { final val COMPILE_STATUS = 0x8B81 /* Shader Precision-Specified Types */ - /** - * Specifies a low precision float. - */ + /** Specifies a low precision float. + */ final val LOW_FLOAT = 0x8DF0 - /** - * Specifies a medium precision float. - */ + /** Specifies a medium precision float. + */ final val MEDIUM_FLOAT = 0x8DF1 - /** - * Specifies a high precision float. - */ + /** Specifies a high precision float. + */ final val HIGH_FLOAT = 0x8DF2 - /** - * Specifies a low precision integer. - */ + /** Specifies a low precision integer. + */ final val LOW_INT = 0x8DF3 - /** - * Specifies a medium precision float. - */ + /** Specifies a medium precision float. + */ final val MEDIUM_INT = 0x8DF4 - /** - * Specifies a high precision float. - */ + /** Specifies a high precision float. + */ final val HIGH_INT = 0x8DF5 /* Framebuffer Object. */ - /** - * The framebuffer target. - */ + /** The framebuffer target. + */ final val FRAMEBUFFER = 0x8D40 - /** - * The renderbuffer target. - */ + /** The renderbuffer target. + */ final val RENDERBUFFER = 0x8D41 final val RGBA4 = 0x8056 @@ -862,1502 +858,1695 @@ object WebGLRenderingContext { @JSGlobal class WebGLRenderingContext extends js.Object { - /** - * The canvas object this WebGLRenderingContext is associated with. - */ + /** The canvas object this WebGLRenderingContext is associated with. + */ val canvas: HTMLCanvasElement = js.native - /** - * The actual width of the drawing buffer. - * This may be different than the underlying HTMLCanvasElement width. - */ + /** The actual width of the drawing buffer. This may be different than the underlying HTMLCanvasElement width. + */ val drawingBufferWidth: Int = js.native - /** - * The actual height of the drawing buffer. - * This may be different than the underlying HTMLCanvasElement height. - */ + /** The actual height of the drawing buffer. This may be different than the underlying HTMLCanvasElement height. + */ val drawingBufferHeight: Int = js.native - /** - * Returns `null` if [[isContextLost]] would return `false`, otherwise returns a copy of the context parameters. - */ + /** Returns `null` if [[isContextLost]] would return `false`, otherwise returns a copy of the context parameters. + */ def getContextAttributes(): WebGLContextAttributes = js.native - /** - * Returns `true` if the context has been lost, `false` otherwise. - */ + /** Returns `true` if the context has been lost, `false` otherwise. + */ def isContextLost(): Boolean = js.native - /** - * Returns an array of strings naming supported WebGL extensions. - */ + /** Returns an array of strings naming supported WebGL extensions. + */ def getSupportedExtensions(): js.Array[String] = js.native - /** - * Returns an object for the named extension, or `null` if no such extension exists. - * - * @param name the name of the extension - */ + /** Returns an object for the named extension, or `null` if no such extension exists. + * + * @param name + * the name of the extension + */ def getExtension(name: String): js.Any = js.native - /** - * Selects the active texture unit. - * - * @param texture an integer specifying the texture unit to make active. Must be in 0 .. MAX_COMBINED_TEXTURE_IMAGE_UNITS-1 - */ + /** Selects the active texture unit. + * + * @param texture + * an integer specifying the texture unit to make active. Must be in 0 .. MAX_COMBINED_TEXTURE_IMAGE_UNITS-1 + */ def activeTexture(texture: Int): Unit = js.native - /** - * Attaches a shader (fragment or vertex) to a [[WebGLProgram]]. - */ - def attachShader(program: WebGLProgram, - shader: WebGLShader): Unit = js.native + /** Attaches a shader (fragment or vertex) to a [[WebGLProgram]]. + */ + def attachShader(program: WebGLProgram, shader: WebGLShader): Unit = js.native - /** - * Associates a vertex attribute index with a named attribute variable. - */ - def bindAttribLocation(program: WebGLProgram, index: Int, - name: String): Unit = js.native + /** Associates a vertex attribute index with a named attribute variable. + */ + def bindAttribLocation(program: WebGLProgram, index: Int, name: String): Unit = js.native - /** - * Loads a a target into a [[WebGLBuffer]]. - * - * @param target the target to bind the buffer to. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] - */ + /** Loads a a target into a [[WebGLBuffer]]. + * + * @param target + * the target to bind the buffer to. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or + * [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] + */ def bindBuffer(target: Int, buffer: WebGLBuffer): Unit = js.native - /** - * Loads a a target into a [[WebGLFramebuffer]]. - * - * @param target the target to bind the framebuffer to. Must be [[WebGLRenderingContext.FRAMEBUFFER]]. - * @param framebuffer a framebuffer object, or null to bind the default framebuffer. - */ - def bindFramebuffer(target: Int, - framebuffer: WebGLFramebuffer): Unit = js.native - - /** - * Loads a a target into a [[WebGLRenderbuffer]]. - * - * @param target target to bind to, must be [[WebGLRenderingContext.RENDERBUFFER]] - * @param renderbuffer the renderbuffer to bind. If `null`, any object bound to `target` us unbound. - */ - def bindRenderbuffer(target: Int, - renderbuffer: WebGLRenderbuffer): Unit = js.native - - /** - * Loads a the active texture unit into a [[WebGLTexture]]. - * - * @param target the target to bind to. Must be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] - * @param texture the texture to bind. - */ + /** Loads a a target into a [[WebGLFramebuffer]]. + * + * @param target + * the target to bind the framebuffer to. Must be [[WebGLRenderingContext.FRAMEBUFFER]]. + * @param framebuffer + * a framebuffer object, or null to bind the default framebuffer. + */ + def bindFramebuffer(target: Int, framebuffer: WebGLFramebuffer): Unit = js.native + + /** Loads a a target into a [[WebGLRenderbuffer]]. + * + * @param target + * target to bind to, must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param renderbuffer + * the renderbuffer to bind. If `null`, any object bound to `target` us unbound. + */ + def bindRenderbuffer(target: Int, renderbuffer: WebGLRenderbuffer): Unit = js.native + + /** Loads a the active texture unit into a [[WebGLTexture]]. + * + * @param target + * the target to bind to. Must be [[WebGLRenderingContext.TEXTURE_2D]] or + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] + * @param texture + * the texture to bind. + */ def bindTexture(target: Int, texture: WebGLTexture): Unit = js.native - /** - * Sets the blend color used in [[WebGLRenderingContext.BLEND_COLOR]]. - */ - def blendColor(red: Double, green: Double, blue: Double, - alpha: Double): Unit = js.native + /** Sets the blend color used in [[WebGLRenderingContext.BLEND_COLOR]]. + */ + def blendColor(red: Double, green: Double, blue: Double, alpha: Double): Unit = js.native - /** - * Specifies the equation used for RGB and Alpha blending. - * - * @param mode blend equation to use. Can be one of [[WebGLRenderingContext.FUNC_ADD]], [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] - */ + /** Specifies the equation used for RGB and Alpha blending. + * + * @param mode + * blend equation to use. Can be one of [[WebGLRenderingContext.FUNC_ADD]], + * [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] + */ def blendEquation(mode: Int): Unit = js.native - /** - * Specifies the equation used for RGB and Alpha blending separately. - * - * @param modeRGB blend equation to use for RGB components. Can be one of [[WebGLRenderingContext.FUNC_ADD]], [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] - * @param modeAlpha blend equation to use for alpha components. Can be one of [[WebGLRenderingContext.FUNC_ADD]], [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] - */ + /** Specifies the equation used for RGB and Alpha blending separately. + * + * @param modeRGB + * blend equation to use for RGB components. Can be one of [[WebGLRenderingContext.FUNC_ADD]], + * [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] + * @param modeAlpha + * blend equation to use for alpha components. Can be one of [[WebGLRenderingContext.FUNC_ADD]], + * [[WebGLRenderingContext.FUNC_SUBTRACT]], or [[WebGLRenderingContext.FUNC_REVERSE_SUBTRACT]] + */ def blendEquationSeparate(modeRGB: Int, modeAlpha: Int): Unit = js.native - /** - * Specifies how the blending factors are computed for source and destination pixels. - * - * @param sfactor The source blending factors. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], - * [[WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR]], [[WebGLRenderingContext.CONSTANT_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]], - * or [[WebGLRenderingContext.SRC_ALPHA_SATURATE]]. Initially this value is [[WebGLRenderingContext.ONE]]. - * @param dfactor The destination blending factors. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], - * ` ONE_MINUS_CONSTANT_COLOR`, [[WebGLRenderingContext.CONSTANT_ALPHA]], or [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]]. - * This value is initially [[WebGLRenderingContext.ZERO]]. - */ + /** Specifies how the blending factors are computed for source and destination pixels. + * + * @param sfactor + * The source blending factors. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], + * [[WebGLRenderingContext.SRC_COLOR]], [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], + * [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], + * [[WebGLRenderingContext.SRC_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], + * [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], + * [[WebGLRenderingContext.CONSTANT_COLOR]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR]], + * [[WebGLRenderingContext.CONSTANT_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]], or + * [[WebGLRenderingContext.SRC_ALPHA_SATURATE]]. Initially this value is [[WebGLRenderingContext.ONE]]. + * @param dfactor + * The destination blending factors. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], + * [[WebGLRenderingContext.SRC_COLOR]], [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], + * [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], + * [[WebGLRenderingContext.SRC_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], + * [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], + * [[WebGLRenderingContext.CONSTANT_COLOR]], ` ONE_MINUS_CONSTANT_COLOR`, [[WebGLRenderingContext.CONSTANT_ALPHA]], + * or [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]]. This value is initially [[WebGLRenderingContext.ZERO]]. + */ def blendFunc(sfactor: Int, dfactor: Int): Unit = js.native - /** - * Specifies how the blending factors are computed for source and destination pixels, separately for alpha and RGB. - * - * @param srcRGB The source blending factor for RGB. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], - * [[WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR]], [[WebGLRenderingContext.CONSTANT_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]], - * or [[WebGLRenderingContext.SRC_ALPHA_SATURATE]]. Initially this value is [[WebGLRenderingContext.ONE]]. - * @param dstRGB The destination blending factor for RGB. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], - * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], - * ` ONE_MINUS_CONSTANT_COLOR`, [[WebGLRenderingContext.CONSTANT_ALPHA]], or [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]]. - * This value is initially [[WebGLRenderingContext.ZERO]]. - * @param srcAlpha The source blending factor for Alpha. Accepted values are the same as srcRGB. - * The initial value is [[WebGLRenderingContext.ONE]]. - * @param dstAlpha The destination blending factor for Alpha. Accepted values are the same as srcRGB. - * The initial value is [[WebGLRenderingContext.ZERO]]. - */ - def blendFuncSeparate(srcRGB: Int, dstRGB: Int, srcAlpha: Int, - dstAlpha: Int): Unit = js.native - - /** - * Sets the size of the bound [[WebGLBuffer]] for the given `target`. The contents of the buffer are cleared to 0. - * @param target The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. - * @param size The size of the new buffer - * @param usage The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. - */ + /** Specifies how the blending factors are computed for source and destination pixels, separately for alpha and RGB. + * + * @param srcRGB + * The source blending factor for RGB. May be one of [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.ONE]], + * [[WebGLRenderingContext.SRC_COLOR]], [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], + * [[WebGLRenderingContext.DST_COLOR]], [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], + * [[WebGLRenderingContext.SRC_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], + * [[WebGLRenderingContext.DST_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], + * [[WebGLRenderingContext.CONSTANT_COLOR]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_COLOR]], + * [[WebGLRenderingContext.CONSTANT_ALPHA]], [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]], or + * [[WebGLRenderingContext.SRC_ALPHA_SATURATE]]. Initially this value is [[WebGLRenderingContext.ONE]]. + * @param dstRGB + * The destination blending factor for RGB. May be one of [[WebGLRenderingContext.ZERO]], + * [[WebGLRenderingContext.ONE]], [[WebGLRenderingContext.SRC_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_COLOR]], [[WebGLRenderingContext.DST_COLOR]], + * [[WebGLRenderingContext.ONE_MINUS_DST_COLOR]], [[WebGLRenderingContext.SRC_ALPHA]], + * [[WebGLRenderingContext.ONE_MINUS_SRC_ALPHA]], [[WebGLRenderingContext.DST_ALPHA]], + * [[WebGLRenderingContext.ONE_MINUS_DST_ALPHA]], [[WebGLRenderingContext.CONSTANT_COLOR]], ` + * ONE_MINUS_CONSTANT_COLOR`, [[WebGLRenderingContext.CONSTANT_ALPHA]], or + * [[WebGLRenderingContext.ONE_MINUS_CONSTANT_ALPHA]]. This value is initially [[WebGLRenderingContext.ZERO]]. + * @param srcAlpha + * The source blending factor for Alpha. Accepted values are the same as srcRGB. The initial value is + * [[WebGLRenderingContext.ONE]]. + * @param dstAlpha + * The destination blending factor for Alpha. Accepted values are the same as srcRGB. The initial value is + * [[WebGLRenderingContext.ZERO]]. + */ + def blendFuncSeparate(srcRGB: Int, dstRGB: Int, srcAlpha: Int, dstAlpha: Int): Unit = js.native + + /** Sets the size of the bound [[WebGLBuffer]] for the given `target`. The contents of the buffer are cleared to 0. + * @param target + * The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or + * [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. + * @param size + * The size of the new buffer + * @param usage + * The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], + * [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. + */ def bufferData(target: Int, size: Int, usage: Int): Unit = js.native - /** - * Resizes the bound [[WebGLBuffer]] for the given `target` to the size of the passed buffer, and replaces its contents with the contents of the buffer. - * @param target The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. - * @param data the source data for the new buffer. - * @param usage The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. - */ - def bufferData(target: Int, data: ArrayBufferView, - usage: Int): Unit = js.native - - /** - * Resizes the bound [[WebGLBuffer]] for the given `target` to the size of the passed buffer, and replaces its contents with the contents of the buffer. - * - * @param target The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. - * @param data the source data for the new buffer. - * @param usage The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. - */ + /** Resizes the bound [[WebGLBuffer]] for the given `target` to the size of the passed buffer, and replaces its + * contents with the contents of the buffer. + * @param target + * The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or + * [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. + * @param data + * the source data for the new buffer. + * @param usage + * The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], + * [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. + */ + def bufferData(target: Int, data: ArrayBufferView, usage: Int): Unit = js.native + + /** Resizes the bound [[WebGLBuffer]] for the given `target` to the size of the passed buffer, and replaces its + * contents with the contents of the buffer. + * + * @param target + * The target to resize. May be [[WebGLRenderingContext.ARRAY_BUFFER]] or + * [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. + * @param data + * the source data for the new buffer. + * @param usage + * The specified usage for this buffer. May be [[WebGLRenderingContext.STREAM_DRAW]], + * [[WebGLRenderingContext.STATIC_DRAW]] or [[WebGLRenderingContext.DYNAMIC_DRAW]]. + */ def bufferData(target: Int, data: ArrayBuffer, usage: Int): Unit = js.native - def bufferSubData(target: Int, offset: Int, - data: ArrayBufferView): Unit = js.native - - def bufferSubData(target: Int, offset: Int, - data: ArrayBuffer): Unit = js.native - - /** - * Returns the completeness status for the framebuffer. - * - * The possible results are: - * - * - [[WebGLRenderingContext.FRAMEBUFFER_COMPLETE]] - the framebuffer is complete. - * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT]] - one or more attachment points are not complete in the framebuffer. - * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS]] - one or more attached images do not have a specified width and height. - * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT]] - there are no images attached to the framebuffer. - * - [[WebGLRenderingContext.FRAMEBUFFER_UNSUPPORTED]] - the attached image format combinations are not supported on this platform. - * - * @param target the target framebuffer object, must be [[WebGLRenderingContext.FRAMEBUFFER]]. - * @return the framebuffer status. - */ + def bufferSubData(target: Int, offset: Int, data: ArrayBufferView): Unit = js.native + + def bufferSubData(target: Int, offset: Int, data: ArrayBuffer): Unit = js.native + + /** Returns the completeness status for the framebuffer. + * + * The possible results are: + * + * - [[WebGLRenderingContext.FRAMEBUFFER_COMPLETE]] - the framebuffer is complete. + * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT]] - one or more attachment points are not complete + * in the framebuffer. + * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS]] - one or more attached images do not have a + * specified width and height. + * - [[WebGLRenderingContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT]] - there are no images attached to the + * framebuffer. + * - [[WebGLRenderingContext.FRAMEBUFFER_UNSUPPORTED]] - the attached image format combinations are not supported + * on this platform. + * + * @param target + * the target framebuffer object, must be [[WebGLRenderingContext.FRAMEBUFFER]]. + * @return + * the framebuffer status. + */ def checkFramebufferStatus(target: Int): Int = js.native - /** - * Clears the buffers specified in `mask` with the current [[WebGLRenderingContext#clearColor]], [[WebGLRenderingContext#clearDepth]] and [[WebGLRenderingContext#clearStencil]]. - * - * @param mask The buffers to clear, a bitmask of one or more of [[WebGLRenderingContext.COLOR_BUFFER_BIT]], [[WebGLRenderingContext.DEPTH_BUFFER_BIT]] and [[WebGLRenderingContext.STENCIL_BUFFER_BIT]]. - */ + /** Clears the buffers specified in `mask` with the current [[WebGLRenderingContext#clearColor]], + * [[WebGLRenderingContext#clearDepth]] and [[WebGLRenderingContext#clearStencil]]. + * + * @param mask + * The buffers to clear, a bitmask of one or more of [[WebGLRenderingContext.COLOR_BUFFER_BIT]], + * [[WebGLRenderingContext.DEPTH_BUFFER_BIT]] and [[WebGLRenderingContext.STENCIL_BUFFER_BIT]]. + */ def clear(mask: Int): Unit = js.native - /** - * Sets the clear color to use with [[WebGLRenderingContext#clear]]. - */ - def clearColor(red: Double, green: Double, blue: Double, - alpha: Double): Unit = js.native + /** Sets the clear color to use with [[WebGLRenderingContext#clear]]. + */ + def clearColor(red: Double, green: Double, blue: Double, alpha: Double): Unit = js.native - /** - * Sets the clear depth to use with [[WebGLRenderingContext#clear]]. - */ + /** Sets the clear depth to use with [[WebGLRenderingContext#clear]]. + */ def clearDepth(depth: Double): Unit = js.native - /** - * Sets the stencil value to use with [[WebGLRenderingContext#clear]]. - */ + /** Sets the stencil value to use with [[WebGLRenderingContext#clear]]. + */ def clearStencil(s: Int): Unit = js.native - /** - * Enable and disable writing to the given channels. For each channel, `true` will allow writing, `false` will prevent it. - */ - def colorMask(red: Boolean, green: Boolean, blue: Boolean, - alpha: Boolean): Unit = js.native + /** Enable and disable writing to the given channels. For each channel, `true` will allow writing, `false` will + * prevent it. + */ + def colorMask(red: Boolean, green: Boolean, blue: Boolean, alpha: Boolean): Unit = js.native - /** - * Compiles the provided shader. - * - * The [[WebGLRenderingContext#getShaderParameter]] can be used to determine if this operation succeeded. - */ + /** Compiles the provided shader. + * + * The [[WebGLRenderingContext#getShaderParameter]] can be used to determine if this operation succeeded. + */ def compileShader(shader: WebGLShader): Unit = js.native - /** - * Loads a 2-dimensional texture into a texture unit, compressed with the specified algorithm. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the compressed data. - * @param width the width of the texture image. - * @param height the height of the texture image. - * @param border the border width. Must be 0. - * @param data the compressed image data. - */ - def compressedTexImage2D(target: Int, level: Int, internalformat: Int, - width: Int, height: Int, border: Int, + /** Loads a 2-dimensional texture into a texture unit, compressed with the specified algorithm. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the compressed data. + * @param width + * the width of the texture image. + * @param height + * the height of the texture image. + * @param border + * the border width. Must be 0. + * @param data + * the compressed image data. + */ + def compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, data: ArrayBufferView): Unit = js.native - /** - * Loads a 2-dimensional texture subimage into a texture unit, compressed with the specified algorithm. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param width the width of the texture image. - * @param height the height of the texture image. - * @param format the format of the compressed image data - * @param data the compressed image data. - */ - def compressedTexSubImage2D(target: Int, level: Int, xoffset: Int, - yoffset: Int, width: Int, height: Int, format: Int, + /** Loads a 2-dimensional texture subimage into a texture unit, compressed with the specified algorithm. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param width + * the width of the texture image. + * @param height + * the height of the texture image. + * @param format + * the format of the compressed image data + * @param data + * the compressed image data. + */ + def compressedTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, data: ArrayBufferView): Unit = js.native - /** - * Loads a 2-dimensional texture into a texture unit from the current framebuffer. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the data. May be [[WebGLRenderingContext.ALPHA]], [[WebGLRenderingContext.LUMINANCE]], [[WebGLRenderingContext.LUMINANCE_ALPHA]], [[WebGLRenderingContext.RGB]], or [[WebGLRenderingContext.RGBA]]. - * @param x the window coordinates of the lower left corner of the framebuffer. - * @param y the window coordinates of the lower left corner of the framebuffer. - * @param width the width of the texture image. - * @param height the height of the texture image. - * @param border the border width. Must be 0. - */ - def copyTexImage2D(target: Int, level: Int, internalformat: Int, x: Int, - y: Int, width: Int, height: Int, border: Int): Unit = js.native - - /** - * Loads a 2-dimensional texture subimage into a texture unit from the current framebuffer. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param x the window coordinates of the lower left corner of the framebuffer. - * @param y the window coordinates of the lower left corner of the framebuffer. - * @param width the width of the texture image. - * @param height the height of the texture image. - */ - def copyTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, - x: Int, y: Int, width: Int, height: Int): Unit = js.native + /** Loads a 2-dimensional texture into a texture unit from the current framebuffer. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the data. May be [[WebGLRenderingContext.ALPHA]], [[WebGLRenderingContext.LUMINANCE]], + * [[WebGLRenderingContext.LUMINANCE_ALPHA]], [[WebGLRenderingContext.RGB]], or [[WebGLRenderingContext.RGBA]]. + * @param x + * the window coordinates of the lower left corner of the framebuffer. + * @param y + * the window coordinates of the lower left corner of the framebuffer. + * @param width + * the width of the texture image. + * @param height + * the height of the texture image. + * @param border + * the border width. Must be 0. + */ + def copyTexImage2D(target: Int, level: Int, internalformat: Int, x: Int, y: Int, width: Int, height: Int, + border: Int): Unit = js.native + + /** Loads a 2-dimensional texture subimage into a texture unit from the current framebuffer. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param x + * the window coordinates of the lower left corner of the framebuffer. + * @param y + * the window coordinates of the lower left corner of the framebuffer. + * @param width + * the width of the texture image. + * @param height + * the height of the texture image. + */ + def copyTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, x: Int, y: Int, width: Int, + height: Int): Unit = js.native - /** - * Creates a new [[WebGLBuffer]]. - */ + /** Creates a new [[WebGLBuffer]]. + */ def createBuffer(): WebGLBuffer = js.native - /** - * Creates a new [[WebGLFramebuffer]]. - */ + /** Creates a new [[WebGLFramebuffer]]. + */ def createFramebuffer(): WebGLFramebuffer = js.native - /** - * Creates a new [[WebGLProgram]]. - */ + /** Creates a new [[WebGLProgram]]. + */ def createProgram(): WebGLProgram = js.native - /** - * Creates a new [[WebGLRenderbuffer]]. - */ + /** Creates a new [[WebGLRenderbuffer]]. + */ def createRenderbuffer(): WebGLRenderbuffer = js.native - /** - * Creates a new [[WebGLShader]]. - */ + /** Creates a new [[WebGLShader]]. + */ def createShader(`type`: Int): WebGLShader = js.native - /** - * Creates a new [[WebGLTexture]]. - */ + /** Creates a new [[WebGLTexture]]. + */ def createTexture(): WebGLTexture = js.native - /** - * Set the culling mode for front and back facing polygons. - * - * @param mode the culling mode, may be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] or [[WebGLRenderingContext.FRONT_AND_BACK]]. - * When [[WebGLRenderingContext.FRONT_AND_BACK]] is set, no triangles are drawn, however lines and points will. - */ + /** Set the culling mode for front and back facing polygons. + * + * @param mode + * the culling mode, may be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] or + * [[WebGLRenderingContext.FRONT_AND_BACK]]. When [[WebGLRenderingContext.FRONT_AND_BACK]] is set, no triangles are + * drawn, however lines and points will. + */ def cullFace(mode: Int): Unit = js.native - /** - * Flags the specified [[WebGLBuffer]] for deletion. When it is no longer used by the WebGL system it - * will be deleted. - * - * ''Note'': garbage collection will also delete the buffer, it is not mandatory to call this method. - */ + /** Flags the specified [[WebGLBuffer]] for deletion. When it is no longer used by the WebGL system it will be + * deleted. + * + * ''Note'': garbage collection will also delete the buffer, it is not mandatory to call this method. + */ def deleteBuffer(buffer: WebGLBuffer): Unit = js.native - /** - * Flags the specified [[WebGLFramebuffer]] for deletion. When it is no longer used by the WebGL system it - * will be deleted. - * - * ''Note'': garbage collection will also delete the framebuffer, it is not mandatory to call this method. - */ + /** Flags the specified [[WebGLFramebuffer]] for deletion. When it is no longer used by the WebGL system it will be + * deleted. + * + * ''Note'': garbage collection will also delete the framebuffer, it is not mandatory to call this method. + */ def deleteFramebuffer(framebuffer: WebGLFramebuffer): Unit = js.native - /** - * Flags the specified [[WebGLProgram]] for deletion. When it is no longer used by the WebGL system it - * will be deleted. - * - * ''Note'': garbage collection will also delete the program, it is not mandatory to call this method. - */ + /** Flags the specified [[WebGLProgram]] for deletion. When it is no longer used by the WebGL system it will be + * deleted. + * + * ''Note'': garbage collection will also delete the program, it is not mandatory to call this method. + */ def deleteProgram(program: WebGLProgram): Unit = js.native - /** - * Flags the specified [[WebGLRenderbuffer]] for deletion. When it is no longer used by the WebGL system it - * will be deleted. - * - * ''Note'': garbage collection will also delete the renderbuffer, it is not mandatory to call this method. - */ + /** Flags the specified [[WebGLRenderbuffer]] for deletion. When it is no longer used by the WebGL system it will be + * deleted. + * + * ''Note'': garbage collection will also delete the renderbuffer, it is not mandatory to call this method. + */ def deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): Unit = js.native - /** - * Flags the specified [[WebGLShader]] for deletion. When it is no longer used by the WebGL system it - * will be deleted. - * - * ''Note'': garbage collection will also delete the shader, it is not mandatory to call this method. - */ + /** Flags the specified [[WebGLShader]] for deletion. When it is no longer used by the WebGL system it will be + * deleted. + * + * ''Note'': garbage collection will also delete the shader, it is not mandatory to call this method. + */ def deleteShader(shader: WebGLShader): Unit = js.native - /** - * Flags the specified [[WebGLTexture]] for deletion. When it is no longer used by the WebGL system it - * will be deleted. - * - * ''Note'': garbage collection will also delete the texture, it is not mandatory to call this method. - */ + /** Flags the specified [[WebGLTexture]] for deletion. When it is no longer used by the WebGL system it will be + * deleted. + * + * ''Note'': garbage collection will also delete the texture, it is not mandatory to call this method. + */ def deleteTexture(texture: WebGLTexture): Unit = js.native - /** - * Set the function used to discard fragments. When depth testing is enabled, the fragment depth is compared with - * the current depth, and is allowed onto the framebuffer. - * - * @param func the function to allow the fragment to be drawn. Values are [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.LEQUAL]] - * [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.NOTEQUAL]], [[WebGLRenderingContext.GEQUAL]], and [[WebGLRenderingContext.ALWAYS]]. - */ + /** Set the function used to discard fragments. When depth testing is enabled, the fragment depth is compared with the + * current depth, and is allowed onto the framebuffer. + * + * @param func + * the function to allow the fragment to be drawn. Values are [[WebGLRenderingContext.NEVER]], + * [[WebGLRenderingContext.LESS]], [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.LEQUAL]] + * [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.NOTEQUAL]], [[WebGLRenderingContext.GEQUAL]], and + * [[WebGLRenderingContext.ALWAYS]]. + */ def depthFunc(func: Int): Unit = js.native - /** - * Enables/disables writing to the depth buffer. - * - * @param flag when `false`, depth writing is disabled, otherwise it is enabled. - */ + /** Enables/disables writing to the depth buffer. + * + * @param flag + * when `false`, depth writing is disabled, otherwise it is enabled. + */ def depthMask(flag: Boolean): Unit = js.native - /** - * Sets the mapping from normalized device coordinates to window coordinates. - * "normalized device coordinates" in this context really means "normalized depth map values". - * - * ''note'' there is no requirement that zNear < zFar. - * - * Both parameters are clamped to -1 .. 1 - * @param zNear the near clipping plane, initially 0. - * @param zFar the far clipping plane, initially 1 - */ + /** Sets the mapping from normalized device coordinates to window coordinates. "normalized device coordinates" in this + * context really means "normalized depth map values". + * + * ''note'' there is no requirement that zNear < zFar. + * + * Both parameters are clamped to -1 .. 1 + * @param zNear + * the near clipping plane, initially 0. + * @param zFar + * the far clipping plane, initially 1 + */ def depthRange(zNear: Double, zFar: Double): Unit = js.native - /** - * Detaches a [[WebGLShader]] from a [[WebGLProgram]]. - * - * If the shader has been flagged as deleted by a call to [[WebGLRenderingContext#deleteShader]], it will be deleted. - */ - def detachShader(program: WebGLProgram, - shader: WebGLShader): Unit = js.native - - /** - * Disables a GL capability. - * - * @param cap the capability to disable. May be [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.CULL_FACE]], - * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], - * [[WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE]], [[WebGLRenderingContext.SAMPLE_COVERAGE]], - * [[WebGLRenderingContext.SCISSOR_TEST]], or [[WebGLRenderingContext.STENCIL_TEST]]. - */ + /** Detaches a [[WebGLShader]] from a [[WebGLProgram]]. + * + * If the shader has been flagged as deleted by a call to [[WebGLRenderingContext#deleteShader]], it will be deleted. + */ + def detachShader(program: WebGLProgram, shader: WebGLShader): Unit = js.native + + /** Disables a GL capability. + * + * @param cap + * the capability to disable. May be [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.CULL_FACE]], + * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DITHER]], + * [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], [[WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE]], + * [[WebGLRenderingContext.SAMPLE_COVERAGE]], [[WebGLRenderingContext.SCISSOR_TEST]], or + * [[WebGLRenderingContext.STENCIL_TEST]]. + */ def disable(cap: Int): Unit = js.native - /** - * Disables the generic vertex attribute array specified by index. - */ + /** Disables the generic vertex attribute array specified by index. + */ def disableVertexAttribArray(index: Int): Unit = js.native - /** - * Renders the primitives in the active arrays. - * - * @param mode the kind of primitives to render. May be [[WebGLRenderingContext.POINTS]], [[WebGLRenderingContext.LINES]], [[WebGLRenderingContext.LINE_STRIP]], [[WebGLRenderingContext.LINE_LOOP]], [[WebGLRenderingContext.TRIANGLES]], [[WebGLRenderingContext.TRIANGLE_STRIP]], [[WebGLRenderingContext.TRIANGLE_FAN]], or [[WebGLRenderingContext.TRIANGLES]] - * @param first the starting index into the arrays. - * @param count the number of indices to draw. - */ + /** Renders the primitives in the active arrays. + * + * @param mode + * the kind of primitives to render. May be [[WebGLRenderingContext.POINTS]], [[WebGLRenderingContext.LINES]], + * [[WebGLRenderingContext.LINE_STRIP]], [[WebGLRenderingContext.LINE_LOOP]], [[WebGLRenderingContext.TRIANGLES]], + * [[WebGLRenderingContext.TRIANGLE_STRIP]], [[WebGLRenderingContext.TRIANGLE_FAN]], or + * [[WebGLRenderingContext.TRIANGLES]] + * @param first + * the starting index into the arrays. + * @param count + * the number of indices to draw. + */ def drawArrays(mode: Int, first: Int, count: Int): Unit = js.native - /** - * Renders the primitives in the active arrays using an [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] to index them. - * - * @param mode the kind of primitives to render. May be [[WebGLRenderingContext.POINTS]], [[WebGLRenderingContext.LINES]], - * [[WebGLRenderingContext.LINE_STRIP]], [[WebGLRenderingContext.LINE_LOOP]], [[WebGLRenderingContext.TRIANGLES]], - * [[WebGLRenderingContext.TRIANGLE_STRIP]], [[WebGLRenderingContext.TRIANGLE_FAN]], - * or [[WebGLRenderingContext.TRIANGLES]] - * @param count the number of elements to render. - * @param type the type of index value in the [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. May be - * [[WebGLRenderingContext.UNSIGNED_BYTE]] or [[WebGLRenderingContext.UNSIGNED_SHORT]] - * @param offset the offset into the [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] to begin drawing from. - */ - def drawElements(mode: Int, count: Int, `type`: Int, - offset: Int): Unit = js.native - - /** - * Enables a GL capability. - * - * @param cap the capability to enable. May be [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.CULL_FACE]], - * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], - * [[WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE]], [[WebGLRenderingContext.SAMPLE_COVERAGE]], - * [[WebGLRenderingContext.SCISSOR_TEST]], or [[WebGLRenderingContext.STENCIL_TEST]]. - */ + /** Renders the primitives in the active arrays using an [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] to index them. + * + * @param mode + * the kind of primitives to render. May be [[WebGLRenderingContext.POINTS]], [[WebGLRenderingContext.LINES]], + * [[WebGLRenderingContext.LINE_STRIP]], [[WebGLRenderingContext.LINE_LOOP]], [[WebGLRenderingContext.TRIANGLES]], + * [[WebGLRenderingContext.TRIANGLE_STRIP]], [[WebGLRenderingContext.TRIANGLE_FAN]], or + * [[WebGLRenderingContext.TRIANGLES]] + * @param count + * the number of elements to render. + * @param type + * the type of index value in the [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]]. May be + * [[WebGLRenderingContext.UNSIGNED_BYTE]] or [[WebGLRenderingContext.UNSIGNED_SHORT]] + * @param offset + * the offset into the [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] to begin drawing from. + */ + def drawElements(mode: Int, count: Int, `type`: Int, offset: Int): Unit = js.native + + /** Enables a GL capability. + * + * @param cap + * the capability to enable. May be [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.CULL_FACE]], + * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DITHER]], + * [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], [[WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE]], + * [[WebGLRenderingContext.SAMPLE_COVERAGE]], [[WebGLRenderingContext.SCISSOR_TEST]], or + * [[WebGLRenderingContext.STENCIL_TEST]]. + */ def enable(cap: Int): Unit = js.native - /** - * Enables the generic vertex attribute array specified by index. - */ + /** Enables the generic vertex attribute array specified by index. + */ def enableVertexAttribArray(index: Int): Unit = js.native - /** - * Block until all GL execution is complete. - */ + /** Block until all GL execution is complete. + */ def finish(): Unit = js.native - /** - * Force all pending GL execution to complete as soon as possible. - */ + /** Force all pending GL execution to complete as soon as possible. + */ def flush(): Unit = js.native - /** - * Attach a [[WebGLRenderbuffer]] to a [[WebGLFramebuffer]]. - * - * @param target must be [[WebGLRenderingContext.FRAMEBUFFER]] - * @param attachment the attachment point on the framebuffer to attach the renderbuffer. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], - * [[WebGLRenderingContext.DEPTH_ATTACHMENT]], [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or - * [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. - * @param renderbuffertarget must be [[WebGLRenderingContext.RENDERBUFFER]] - * @param renderbuffer the renderbuffer to attach. - */ - def framebufferRenderbuffer(target: Int, attachment: Int, - renderbuffertarget: Int, + /** Attach a [[WebGLRenderbuffer]] to a [[WebGLFramebuffer]]. + * + * @param target + * must be [[WebGLRenderingContext.FRAMEBUFFER]] + * @param attachment + * the attachment point on the framebuffer to attach the renderbuffer. May be + * [[WebGLRenderingContext.COLOR_ATTACHMENT0]], [[WebGLRenderingContext.DEPTH_ATTACHMENT]], + * [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. + * @param renderbuffertarget + * must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param renderbuffer + * the renderbuffer to attach. + */ + def framebufferRenderbuffer(target: Int, attachment: Int, renderbuffertarget: Int, renderbuffer: WebGLRenderbuffer): Unit = js.native - /** - * Attach a [[WebGLTexture]] to a [[WebGLFramebuffer]]. - * - * @param target must be [[WebGLRenderingContext.FRAMEBUFFER]] - * @param attachment the attachment point on the framebuffer to attach the texture. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], [[WebGLRenderingContext.DEPTH_ATTACHMENT]], [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. - * @param textarget the texture target. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param texture the texture to be attached - * @param level the miplevel to be attached - */ - def framebufferTexture2D(target: Int, attachment: Int, textarget: Int, - texture: WebGLTexture, level: Int): Unit = js.native - - /** - * Specifies the winding that is considered front-facing for the purposes of CULL_FACE. - * - * @param mode The winding to consider front-facing. May be [[WebGLRenderingContext.CW]] or [[WebGLRenderingContext.CCW]] - */ + /** Attach a [[WebGLTexture]] to a [[WebGLFramebuffer]]. + * + * @param target + * must be [[WebGLRenderingContext.FRAMEBUFFER]] + * @param attachment + * the attachment point on the framebuffer to attach the texture. May be + * [[WebGLRenderingContext.COLOR_ATTACHMENT0]], [[WebGLRenderingContext.DEPTH_ATTACHMENT]], + * [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. + * @param textarget + * the texture target. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param texture + * the texture to be attached + * @param level + * the miplevel to be attached + */ + def framebufferTexture2D(target: Int, attachment: Int, textarget: Int, texture: WebGLTexture, + level: Int): Unit = js.native + + /** Specifies the winding that is considered front-facing for the purposes of CULL_FACE. + * + * @param mode + * The winding to consider front-facing. May be [[WebGLRenderingContext.CW]] or [[WebGLRenderingContext.CCW]] + */ def frontFace(mode: Int): Unit = js.native - /** - * Generate the complete set of mipmaps for the active texture derived from level 0. - * - * @param target the texture target, may be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]]. - */ + /** Generate the complete set of mipmaps for the active texture derived from level 0. + * + * @param target + * the texture target, may be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]]. + */ def generateMipmap(target: Int): Unit = js.native - /** - * Returns a new [[WebGLActiveInfo]] object describing the given attribute at `index`. - */ - def getActiveAttrib(program: WebGLProgram, - index: Int): WebGLActiveInfo = js.native + /** Returns a new [[WebGLActiveInfo]] object describing the given attribute at `index`. + */ + def getActiveAttrib(program: WebGLProgram, index: Int): WebGLActiveInfo = js.native - /** - * Returns a new [[WebGLActiveInfo]] object describing the given uniform at `index`. - */ - def getActiveUniform(program: WebGLProgram, - index: Int): WebGLActiveInfo = js.native + /** Returns a new [[WebGLActiveInfo]] object describing the given uniform at `index`. + */ + def getActiveUniform(program: WebGLProgram, index: Int): WebGLActiveInfo = js.native - /** - * Returns a new array containing the shaders attached to the given program. - */ - def getAttachedShaders( - program: WebGLProgram): js.Array[WebGLShader] = js.native + /** Returns a new array containing the shaders attached to the given program. + */ + def getAttachedShaders(program: WebGLProgram): js.Array[WebGLShader] = js.native - /** - * Returns the index of the named attribute, or -1 on error. - */ + /** Returns the index of the named attribute, or -1 on error. + */ def getAttribLocation(program: WebGLProgram, name: String): Int = js.native - /** - * Returns the value of the requested parameter for a buffer. - * - * @param target must be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] - * @param pname the buffer parameter to retrieve, may be [[WebGLRenderingContext.BUFFER_SIZE]] or [[WebGLRenderingContext.BUFFER_USAGE]] - * - */ + /** Returns the value of the requested parameter for a buffer. + * + * @param target + * must be [[WebGLRenderingContext.ARRAY_BUFFER]] or [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER]] + * @param pname + * the buffer parameter to retrieve, may be [[WebGLRenderingContext.BUFFER_SIZE]] or + * [[WebGLRenderingContext.BUFFER_USAGE]] + */ def getBufferParameter(target: Int, pname: Int): Int = js.native - /** - * Returns the value for the given `pname`. Returns a value who's type depends on the requested parameter. - * - * @param pname The parameter to query. May be [[WebGLRenderingContext.ACTIVE_TEXTURE]], [[WebGLRenderingContext.ALIASED_LINE_WIDTH_RANGE]], [[WebGLRenderingContext.ALIASED_POINT_SIZE_RANGE]], - * [[WebGLRenderingContext.ALPHA_BITS]], [[WebGLRenderingContext.ARRAY_BUFFER_BINDING]], [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.BLEND_COLOR]], [[WebGLRenderingContext.BLEND_DST_ALPHA]], [[WebGLRenderingContext.BLEND_DST_RGB]], - * [[WebGLRenderingContext.BLEND_EQUATION_ALPHA]], [[WebGLRenderingContext.BLEND_EQUATION_RGB]], [[WebGLRenderingContext.BLEND_SRC_ALPHA]], [[WebGLRenderingContext.BLEND_SRC_RGB]], [[WebGLRenderingContext.BLUE_BITS]], [[WebGLRenderingContext.COLOR_CLEAR_VALUE]], - * [[WebGLRenderingContext.COLOR_WRITEMASK]], [[WebGLRenderingContext.COMPRESSED_TEXTURE_FORMATS]], [[WebGLRenderingContext.CULL_FACE]], [[WebGLRenderingContext.CULL_FACE_MODE]], [[WebGLRenderingContext.CURRENT_PROGRAM]], [[WebGLRenderingContext.DEPTH_BITS]], - * [[WebGLRenderingContext.DEPTH_CLEAR_VALUE]], [[WebGLRenderingContext.DEPTH_FUNC]], `DEPTH-RANGE`, [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DEPTH_WRITEMASK]], [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER_BINDING]], - * [[WebGLRenderingContext.FRAMEBUFFER_BINDING]], [[WebGLRenderingContext.FRONT_FACE]], [[WebGLRenderingContext.GENERATE_MIPMAP_HINT]], [[WebGLRenderingContext.GREEN_BITS]], [[WebGLRenderingContext.LINE_WIDTH]], [[WebGLRenderingContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS]], - * [[WebGLRenderingContext.MAX_CUBE_MAP_TEXTURE_SIZE]], [[WebGLRenderingContext.MAX_FRAGMENT_UNIFORM_VECTORS]], [[WebGLRenderingContext.MAX_RENDERBUFFER_SIZE]], [[WebGLRenderingContext.MAX_TEXTURE_IMAGE_UNITS]], [[WebGLRenderingContext.MAX_TEXTURE_SIZE]], - * [[WebGLRenderingContext.MAX_VARYING_VECTORS]], [[WebGLRenderingContext.MAX_VERTEX_ATTRIBS]], [[WebGLRenderingContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS]], [[WebGLRenderingContext.MAX_VERTEX_UNIFORM_VECTORS]], - * [[WebGLRenderingContext.MAX_VIEWPORT_DIMS]], [[WebGLRenderingContext.PACK_ALIGNMENT]], [[WebGLRenderingContext.POLYGON_OFFSET_FACTOR]], [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], [[WebGLRenderingContext.POLYGON_OFFSET_UNITS]], - * [[WebGLRenderingContext.RED_BITS]], [[WebGLRenderingContext.RENDERBUFFER_BINDING]], [[WebGLRenderingContext.RENDERER]], [[WebGLRenderingContext.SAMPLE_BUFFERS]], [[WebGLRenderingContext.SAMPLE_COVERAGE_INVERT]], [[WebGLRenderingContext.SAMPLE_COVERAGE_VALUE]], - * [[WebGLRenderingContext.SAMPLES]], [[WebGLRenderingContext.SCISSOR_BOX]], [[WebGLRenderingContext.SCISSOR_TEST]], [[WebGLRenderingContext.SHADING_LANGUAGE_VERSION]], [[WebGLRenderingContext.STENCIL_BACK_FAIL]], [[WebGLRenderingContext.STENCIL_BACK_FUNC]], - * [[WebGLRenderingContext.STENCIL_BACK_PASS_DEPTH_FAIL]], [[WebGLRenderingContext.STENCIL_BACK_PASS_DEPTH_PASS]], [[WebGLRenderingContext.STENCIL_BACK_REF]], [[WebGLRenderingContext.STENCIL_BACK_VALUE_MASK]], - * [[WebGLRenderingContext.STENCIL_BACK_WRITEMASK]], [[WebGLRenderingContext.STENCIL_BITS]], [[WebGLRenderingContext.STENCIL_CLEAR_VALUE]], [[WebGLRenderingContext.STENCIL_FAIL]], [[WebGLRenderingContext.STENCIL_FUNC]], [[WebGLRenderingContext.STENCIL_PASS_DEPTH_FAIL]], - * [[WebGLRenderingContext.STENCIL_PASS_DEPTH_PASS]], [[WebGLRenderingContext.STENCIL_REF]], [[WebGLRenderingContext.STENCIL_TEST]], [[WebGLRenderingContext.STENCIL_VALUE_MASK]], [[WebGLRenderingContext.STENCIL_WRITEMASK]], [[WebGLRenderingContext.SUBPIXEL_BITS]], - * [[WebGLRenderingContext.TEXTURE_BINDING_2D]], [[WebGLRenderingContext.TEXTURE_BINDING_CUBE_MAP]], [[WebGLRenderingContext.UNPACK_ALIGNMENT]], [[WebGLRenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL]], [[WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL]], - * [[WebGLRenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL]], [[WebGLRenderingContext.VENDOR]], [[WebGLRenderingContext.VERSION]] or [[WebGLRenderingContext.VIEWPORT]]. - */ + /** Returns the value for the given `pname`. Returns a value who's type depends on the requested parameter. + * + * @param pname + * The parameter to query. May be [[WebGLRenderingContext.ACTIVE_TEXTURE]], + * [[WebGLRenderingContext.ALIASED_LINE_WIDTH_RANGE]], [[WebGLRenderingContext.ALIASED_POINT_SIZE_RANGE]], + * [[WebGLRenderingContext.ALPHA_BITS]], [[WebGLRenderingContext.ARRAY_BUFFER_BINDING]], + * [[WebGLRenderingContext.BLEND]], [[WebGLRenderingContext.BLEND_COLOR]], + * [[WebGLRenderingContext.BLEND_DST_ALPHA]], [[WebGLRenderingContext.BLEND_DST_RGB]], + * [[WebGLRenderingContext.BLEND_EQUATION_ALPHA]], [[WebGLRenderingContext.BLEND_EQUATION_RGB]], + * [[WebGLRenderingContext.BLEND_SRC_ALPHA]], [[WebGLRenderingContext.BLEND_SRC_RGB]], + * [[WebGLRenderingContext.BLUE_BITS]], [[WebGLRenderingContext.COLOR_CLEAR_VALUE]], + * [[WebGLRenderingContext.COLOR_WRITEMASK]], [[WebGLRenderingContext.COMPRESSED_TEXTURE_FORMATS]], + * [[WebGLRenderingContext.CULL_FACE]], [[WebGLRenderingContext.CULL_FACE_MODE]], + * [[WebGLRenderingContext.CURRENT_PROGRAM]], [[WebGLRenderingContext.DEPTH_BITS]], + * [[WebGLRenderingContext.DEPTH_CLEAR_VALUE]], [[WebGLRenderingContext.DEPTH_FUNC]], `DEPTH-RANGE`, + * [[WebGLRenderingContext.DEPTH_TEST]], [[WebGLRenderingContext.DEPTH_WRITEMASK]], + * [[WebGLRenderingContext.DITHER]], [[WebGLRenderingContext.ELEMENT_ARRAY_BUFFER_BINDING]], + * [[WebGLRenderingContext.FRAMEBUFFER_BINDING]], [[WebGLRenderingContext.FRONT_FACE]], + * [[WebGLRenderingContext.GENERATE_MIPMAP_HINT]], [[WebGLRenderingContext.GREEN_BITS]], + * [[WebGLRenderingContext.LINE_WIDTH]], [[WebGLRenderingContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS]], + * [[WebGLRenderingContext.MAX_CUBE_MAP_TEXTURE_SIZE]], [[WebGLRenderingContext.MAX_FRAGMENT_UNIFORM_VECTORS]], + * [[WebGLRenderingContext.MAX_RENDERBUFFER_SIZE]], [[WebGLRenderingContext.MAX_TEXTURE_IMAGE_UNITS]], + * [[WebGLRenderingContext.MAX_TEXTURE_SIZE]], [[WebGLRenderingContext.MAX_VARYING_VECTORS]], + * [[WebGLRenderingContext.MAX_VERTEX_ATTRIBS]], [[WebGLRenderingContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS]], + * [[WebGLRenderingContext.MAX_VERTEX_UNIFORM_VECTORS]], [[WebGLRenderingContext.MAX_VIEWPORT_DIMS]], + * [[WebGLRenderingContext.PACK_ALIGNMENT]], [[WebGLRenderingContext.POLYGON_OFFSET_FACTOR]], + * [[WebGLRenderingContext.POLYGON_OFFSET_FILL]], [[WebGLRenderingContext.POLYGON_OFFSET_UNITS]], + * [[WebGLRenderingContext.RED_BITS]], [[WebGLRenderingContext.RENDERBUFFER_BINDING]], + * [[WebGLRenderingContext.RENDERER]], [[WebGLRenderingContext.SAMPLE_BUFFERS]], + * [[WebGLRenderingContext.SAMPLE_COVERAGE_INVERT]], [[WebGLRenderingContext.SAMPLE_COVERAGE_VALUE]], + * [[WebGLRenderingContext.SAMPLES]], [[WebGLRenderingContext.SCISSOR_BOX]], + * [[WebGLRenderingContext.SCISSOR_TEST]], [[WebGLRenderingContext.SHADING_LANGUAGE_VERSION]], + * [[WebGLRenderingContext.STENCIL_BACK_FAIL]], [[WebGLRenderingContext.STENCIL_BACK_FUNC]], + * [[WebGLRenderingContext.STENCIL_BACK_PASS_DEPTH_FAIL]], [[WebGLRenderingContext.STENCIL_BACK_PASS_DEPTH_PASS]], + * [[WebGLRenderingContext.STENCIL_BACK_REF]], [[WebGLRenderingContext.STENCIL_BACK_VALUE_MASK]], + * [[WebGLRenderingContext.STENCIL_BACK_WRITEMASK]], [[WebGLRenderingContext.STENCIL_BITS]], + * [[WebGLRenderingContext.STENCIL_CLEAR_VALUE]], [[WebGLRenderingContext.STENCIL_FAIL]], + * [[WebGLRenderingContext.STENCIL_FUNC]], [[WebGLRenderingContext.STENCIL_PASS_DEPTH_FAIL]], + * [[WebGLRenderingContext.STENCIL_PASS_DEPTH_PASS]], [[WebGLRenderingContext.STENCIL_REF]], + * [[WebGLRenderingContext.STENCIL_TEST]], [[WebGLRenderingContext.STENCIL_VALUE_MASK]], + * [[WebGLRenderingContext.STENCIL_WRITEMASK]], [[WebGLRenderingContext.SUBPIXEL_BITS]], + * [[WebGLRenderingContext.TEXTURE_BINDING_2D]], [[WebGLRenderingContext.TEXTURE_BINDING_CUBE_MAP]], + * [[WebGLRenderingContext.UNPACK_ALIGNMENT]], [[WebGLRenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL]], + * [[WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL]], [[WebGLRenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL]], + * [[WebGLRenderingContext.VENDOR]], [[WebGLRenderingContext.VERSION]] or [[WebGLRenderingContext.VIEWPORT]]. + */ def getParameter(pname: Int): js.Any = js.native - /** - * Returns the error value, and resets the error to [[WebGLRenderingContext.NO_ERROR]]. - * - * Only the first error is recorded, new errors are not stored until the error value is reset - * to [[WebGLRenderingContext.NO_ERROR]] by a call to this method. - * - * @return the error code. One of [[WebGLRenderingContext.NO_ERROR]], [[WebGLRenderingContext.INVALID_ENUM]], [[WebGLRenderingContext.INVALID_VALUE]], [[WebGLRenderingContext.INVALID_OPERATION]], [[WebGLRenderingContext.INVALID_FRAMEBUFFER_OPERATION]], or [[WebGLRenderingContext.OUT_OF_MEMORY]]. - */ + /** Returns the error value, and resets the error to [[WebGLRenderingContext.NO_ERROR]]. + * + * Only the first error is recorded, new errors are not stored until the error value is reset to + * [[WebGLRenderingContext.NO_ERROR]] by a call to this method. + * + * @return + * the error code. One of [[WebGLRenderingContext.NO_ERROR]], [[WebGLRenderingContext.INVALID_ENUM]], + * [[WebGLRenderingContext.INVALID_VALUE]], [[WebGLRenderingContext.INVALID_OPERATION]], + * [[WebGLRenderingContext.INVALID_FRAMEBUFFER_OPERATION]], or [[WebGLRenderingContext.OUT_OF_MEMORY]]. + */ def getError(): Int = js.native - /** - * Returns the value for the given parameter name on for the target and attachment. - * The return type is dependent on the requested parameter. - * - * @param target must be FRAMEBUFFER - * @param attachment the attachment to examine. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], [[WebGLRenderingContext.DEPTH_ATTACHMENT]], - * [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. - * @param pname the framebuffer attachment parameter. May be [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE]], - * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME]], [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL]], or - * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE]] - */ - def getFramebufferAttachmentParameter(target: Int, attachment: Int, - pname: Int): js.Any = js.native - - /** - * Returns the value for the given parameter name for the program. - * The return type is dependent on the requested parameter. - * - * @param program the program to query. - * @param pname the parameter to get, may be one of [[WebGLRenderingContext.DELETE_STATUS]], [[WebGLRenderingContext.LINK_STATUS]], - * [[WebGLRenderingContext.VALIDATE_STATUS]], [[WebGLRenderingContext.ATTACHED_SHADERS]], - * [[WebGLRenderingContext.ACTIVE_ATTRIBUTES]], or [[WebGLRenderingContext.ACTIVE_UNIFORMS]]. - */ - def getProgramParameter(program: WebGLProgram, - pname: Int): js.Any = js.native - - /** - * Returns a string containing information about the last link or validation operation for a program. - */ + /** Returns the value for the given parameter name on for the target and attachment. The return type is dependent on + * the requested parameter. + * + * @param target + * must be FRAMEBUFFER + * @param attachment + * the attachment to examine. May be [[WebGLRenderingContext.COLOR_ATTACHMENT0]], + * [[WebGLRenderingContext.DEPTH_ATTACHMENT]], [[WebGLRenderingContext.STENCIL_ATTACHMENT]], or + * [[WebGLRenderingContext.DEPTH_STENCIL_ATTACHMENT]]. + * @param pname + * the framebuffer attachment parameter. May be [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE]], + * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME]], + * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL]], or + * [[WebGLRenderingContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE]] + */ + def getFramebufferAttachmentParameter(target: Int, attachment: Int, pname: Int): js.Any = js.native + + /** Returns the value for the given parameter name for the program. The return type is dependent on the requested + * parameter. + * + * @param program + * the program to query. + * @param pname + * the parameter to get, may be one of [[WebGLRenderingContext.DELETE_STATUS]], + * [[WebGLRenderingContext.LINK_STATUS]], [[WebGLRenderingContext.VALIDATE_STATUS]], + * [[WebGLRenderingContext.ATTACHED_SHADERS]], [[WebGLRenderingContext.ACTIVE_ATTRIBUTES]], or + * [[WebGLRenderingContext.ACTIVE_UNIFORMS]]. + */ + def getProgramParameter(program: WebGLProgram, pname: Int): js.Any = js.native + + /** Returns a string containing information about the last link or validation operation for a program. + */ def getProgramInfoLog(program: WebGLProgram): String = js.native - /** - * Returns the value of a parameter on the active renderbuffer. - * The return type is dependent on the requested parameter. - * - * @param target must be [[WebGLRenderingContext.RENDERBUFFER]] - * @param pname the parameter to query, may be [[WebGLRenderingContext.RENDERBUFFER_WIDTH]], - * [[WebGLRenderingContext.RENDERBUFFER_HEIGHT]], [[WebGLRenderingContext.RENDERBUFFER_INTERNAL_FORMAT]], - * [[WebGLRenderingContext.RENDERBUFFER_RED_SIZE]], [[WebGLRenderingContext.RENDERBUFFER_GREEN_SIZE]], - * [[WebGLRenderingContext.RENDERBUFFER_BLUE_SIZE]], [[WebGLRenderingContext.RENDERBUFFER_ALPHA_SIZE]], - * [[WebGLRenderingContext.RENDERBUFFER_STENCIL_SIZE]], or [[WebGLRenderingContext.RENDERBUFFER_DEPTH_SIZE]] - */ + /** Returns the value of a parameter on the active renderbuffer. The return type is dependent on the requested + * parameter. + * + * @param target + * must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param pname + * the parameter to query, may be [[WebGLRenderingContext.RENDERBUFFER_WIDTH]], + * [[WebGLRenderingContext.RENDERBUFFER_HEIGHT]], [[WebGLRenderingContext.RENDERBUFFER_INTERNAL_FORMAT]], + * [[WebGLRenderingContext.RENDERBUFFER_RED_SIZE]], [[WebGLRenderingContext.RENDERBUFFER_GREEN_SIZE]], + * [[WebGLRenderingContext.RENDERBUFFER_BLUE_SIZE]], [[WebGLRenderingContext.RENDERBUFFER_ALPHA_SIZE]], + * [[WebGLRenderingContext.RENDERBUFFER_STENCIL_SIZE]], or [[WebGLRenderingContext.RENDERBUFFER_DEPTH_SIZE]] + */ def getRenderbufferParameter(target: Int, pname: Int): js.Any = js.native - /** - * Returns the value of a parameter on the specified [[WebGLShader]]. - * The return type is dependent on the requested parameter. - * - * @param shader the shader to query - * @param pname the parameter to get, may be one of [[WebGLRenderingContext.SHADER_TYPE]], - * [[WebGLRenderingContext.DELETE_STATUS]] or [[WebGLRenderingContext.COMPILE_STATUS]] - * - */ + /** Returns the value of a parameter on the specified [[WebGLShader]]. The return type is dependent on the requested + * parameter. + * + * @param shader + * the shader to query + * @param pname + * the parameter to get, may be one of [[WebGLRenderingContext.SHADER_TYPE]], + * [[WebGLRenderingContext.DELETE_STATUS]] or [[WebGLRenderingContext.COMPILE_STATUS]] + */ def getShaderParameter(shader: WebGLShader, pname: Int): js.Any = js.native - /** - * Returns a new [[WebGLShaderPrecisionFormat]] for the given shader type and precision type. - * - * @param shadertype the type of shader, may be [[WebGLRenderingContext.FRAGMENT_SHADER]] or [[WebGLRenderingContext.VERTEX_SHADER]]. - * @param precisiontype the precision type to query, may be [[WebGLRenderingContext.LOW_FLOAT]], - * [[WebGLRenderingContext.MEDIUM_FLOAT]], [[WebGLRenderingContext.HIGH_FLOAT]], [[WebGLRenderingContext.LOW_INT]], - * [[WebGLRenderingContext.MEDIUM_INT]], or [[WebGLRenderingContext.HIGH_INT]]. - */ - def getShaderPrecisionFormat(shadertype: Int, - precisiontype: Int): WebGLShaderPrecisionFormat = js.native - - /** - * Returns the information log from the last compile of the shader. - */ + /** Returns a new [[WebGLShaderPrecisionFormat]] for the given shader type and precision type. + * + * @param shadertype + * the type of shader, may be [[WebGLRenderingContext.FRAGMENT_SHADER]] or [[WebGLRenderingContext.VERTEX_SHADER]]. + * @param precisiontype + * the precision type to query, may be [[WebGLRenderingContext.LOW_FLOAT]], [[WebGLRenderingContext.MEDIUM_FLOAT]], + * [[WebGLRenderingContext.HIGH_FLOAT]], [[WebGLRenderingContext.LOW_INT]], [[WebGLRenderingContext.MEDIUM_INT]], + * or [[WebGLRenderingContext.HIGH_INT]]. + */ + def getShaderPrecisionFormat(shadertype: Int, precisiontype: Int): WebGLShaderPrecisionFormat = js.native + + /** Returns the information log from the last compile of the shader. + */ def getShaderInfoLog(shader: WebGLShader): String = js.native - /** - * Returns the source of the given shader. - */ + /** Returns the source of the given shader. + */ def getShaderSource(shader: WebGLShader): String = js.native - /** - * Returns the value of the given texture parameter on the target of the active texture. - * - * @param target the target to query. May be either [[WebGLRenderingContext.TEXTURE_2D]] or `TEXTURE_CUBE_MAP`. - * @param pname the parameter to query. May be either [[WebGLRenderingContext.TEXTURE_MAG_FILTER]], - * [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_WRAP_S]], - * or [[WebGLRenderingContext.TEXTURE_WRAP_T]]. - */ + /** Returns the value of the given texture parameter on the target of the active texture. + * + * @param target + * the target to query. May be either [[WebGLRenderingContext.TEXTURE_2D]] or `TEXTURE_CUBE_MAP`. + * @param pname + * the parameter to query. May be either [[WebGLRenderingContext.TEXTURE_MAG_FILTER]], + * [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_WRAP_S]], or + * [[WebGLRenderingContext.TEXTURE_WRAP_T]]. + */ def getTexParameter(target: Int, pname: Int): js.Any = js.native - /** - * Returns the value of the uniform in the given program and location. The return type is dependent - * on the uniform type. - */ - def getUniform(program: WebGLProgram, - location: WebGLUniformLocation): js.Any = js.native - - /** - * Returns a new [[WebGLUniformLocation]] that represents the location of the given uniform in the specified program. - * If the uniform does not exist, or another error occurs, returns `null`. - */ - def getUniformLocation(program: WebGLProgram, - name: String): WebGLUniformLocation = js.native - - /** - * Returns the value of the named parameter for a given vertex attribute index. - * - * @param index the index of the vertex attribute to query. - * @param pname the requested parameter, may be [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING]], - * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_ENABLED]], [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_SIZE]], - * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_STRIDE]], [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_TYPE]], - * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_NORMALIZED]], [[WebGLRenderingContext.CURRENT_VERTEX_ATTRIB]] - * - */ + /** Returns the value of the uniform in the given program and location. The return type is dependent on the uniform + * type. + */ + def getUniform(program: WebGLProgram, location: WebGLUniformLocation): js.Any = js.native + + /** Returns a new [[WebGLUniformLocation]] that represents the location of the given uniform in the specified program. + * If the uniform does not exist, or another error occurs, returns `null`. + */ + def getUniformLocation(program: WebGLProgram, name: String): WebGLUniformLocation = js.native + + /** Returns the value of the named parameter for a given vertex attribute index. + * + * @param index + * the index of the vertex attribute to query. + * @param pname + * the requested parameter, may be [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING]], + * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_ENABLED]], [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_SIZE]], + * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_STRIDE]], [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_TYPE]], + * [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_NORMALIZED]], [[WebGLRenderingContext.CURRENT_VERTEX_ATTRIB]] + */ def getVertexAttrib(index: Int, pname: Int): js.Any = js.native - /** - * Returns the offset of the vertex attribute. - * - * @param index the index of the vertex attribute to retrieve - * @param pname must be [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_POINTER]] - */ + /** Returns the offset of the vertex attribute. + * + * @param index + * the index of the vertex attribute to retrieve + * @param pname + * must be [[WebGLRenderingContext.VERTEX_ATTRIB_ARRAY_POINTER]] + */ def getVertexAttribOffset(index: Int, pname: Int): Int = js.native - /** - * Specifies implementation specific hints. - * - * @param target the hint to specify. Must be [[WebGLRenderingContext.GENERATE_MIPMAP_HINT]] - * @param mode the desired mode. Must be one of [[WebGLRenderingContext.FASTEST]], - * [[WebGLRenderingContext.NICEST]], or [[WebGLRenderingContext.DONT_CARE]]. - */ + /** Specifies implementation specific hints. + * + * @param target + * the hint to specify. Must be [[WebGLRenderingContext.GENERATE_MIPMAP_HINT]] + * @param mode + * the desired mode. Must be one of [[WebGLRenderingContext.FASTEST]], [[WebGLRenderingContext.NICEST]], or + * [[WebGLRenderingContext.DONT_CARE]]. + */ def hint(target: Int, mode: Int): Unit = js.native - /** - * Returns `true` if the `buffer` is valid, `false` otherwise. - */ + /** Returns `true` if the `buffer` is valid, `false` otherwise. + */ def isBuffer(buffer: js.Any): Boolean = js.native - /** - * Returns `true` if the specified capability is enabled, `false` otherwise. - * @see [[WebGLRenderingContext#enable]] - */ + /** Returns `true` if the specified capability is enabled, `false` otherwise. + * @see + * [[WebGLRenderingContext#enable]] + */ def isEnabled(cap: Int): Boolean = js.native - /** - * Returns `true` if the `framebuffer` is valid, `false` otherwise. - */ + /** Returns `true` if the `framebuffer` is valid, `false` otherwise. + */ def isFramebuffer(framebuffer: js.Any): Boolean = js.native - /** - * Returns `true` if the `program` is valid, `false` otherwise. - */ + /** Returns `true` if the `program` is valid, `false` otherwise. + */ def isProgram(program: js.Any): Boolean = js.native - /** - * Returns `true` if the `renderbuffer` is valid, `false` otherwise. - */ + /** Returns `true` if the `renderbuffer` is valid, `false` otherwise. + */ def isRenderbuffer(renderbuffer: js.Any): Boolean = js.native - /** - * Returns `true` if the `shader` is valid, `false` otherwise. - */ + /** Returns `true` if the `shader` is valid, `false` otherwise. + */ def isShader(shader: js.Any): Boolean = js.native - /** - * Returns `true` if the `texture` is valid, `false` otherwise. - */ + /** Returns `true` if the `texture` is valid, `false` otherwise. + */ def isTexture(texture: js.Any): Boolean = js.native - /** - * Specifies the line width. - */ + /** Specifies the line width. + */ def lineWidth(width: Double): Unit = js.native - /** - * Attempts to link the specified [[WebGLProgram]]. - */ + /** Attempts to link the specified [[WebGLProgram]]. + */ def linkProgram(program: WebGLProgram): Unit = js.native - /** - * Sets the pixel store mode, used when copying image data such as framebuffers or textures. - * - * @param pname the property to change. May be one of [[WebGLRenderingContext.PACK_ALIGNMENT]], - * [[WebGLRenderingContext.UNPACK_ALIGNMENT]], [[WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL]], - * [[WebGLRenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL]] or [[WebGLRenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL]]. - */ + /** Sets the pixel store mode, used when copying image data such as framebuffers or textures. + * + * @param pname + * the property to change. May be one of [[WebGLRenderingContext.PACK_ALIGNMENT]], + * [[WebGLRenderingContext.UNPACK_ALIGNMENT]], [[WebGLRenderingContext.UNPACK_FLIP_Y_WEBGL]], + * [[WebGLRenderingContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL]] or + * [[WebGLRenderingContext.UNPACK_COLORSPACE_CONVERSION_WEBGL]]. + */ def pixelStorei(pname: Int, param: Int): Unit = js.native - /** - * Specifies the polygon offset. When [[WebGLRenderingContext.POLYGON_OFFSET_FILL]] is enabled, depth values for a fragment have an offset applied - * to them, calculated as `factor`*DZ + r*`units`, where DZ is the change in z based on the polygon's screen area, and r is the minimum value that - * is guaranteed produce a measurable offset. - */ + /** Specifies the polygon offset. When [[WebGLRenderingContext.POLYGON_OFFSET_FILL]] is enabled, depth values for a + * fragment have an offset applied to them, calculated as `factor`*DZ + r*`units`, where DZ is the change in z based + * on the polygon's screen area, and r is the minimum value that is guaranteed produce a measurable offset. + */ def polygonOffset(factor: Double, units: Double): Unit = js.native - /** - * Reads pixels from the framebuffer into `pixels`. - * - * @param x the x coordinate of the bottom left of the area to read. - * @param y the y coordinate of the bottom left of the area to read. - * @param width the width of the area to read. - * @param height the height of the area to read. - * @param format the format of the desired output. Must be one of [[WebGLRenderingContext.UNSIGNED_BYTE]], - * [[WebGLRenderingContext.UNSIGNED_SHORT_4_4_4_4]], [[WebGLRenderingContext.UNSIGNED_SHORT_5_5_5_1]], - * [[WebGLRenderingContext.UNSIGNED_SHORT_5_6_5]] - */ - def readPixels(x: Int, y: Int, width: Int, height: Int, format: Int, - `type`: Int, pixels: ArrayBufferView): Unit = js.native - - /** - * Create renderbuffer image storage. - * - * Initializes the renderbuffer to use the new storage format, replacing any previous store. - * - * @param target must be [[WebGLRenderingContext.RENDERBUFFER]] - * @param internalformat specifies the format of the renderbuffer. May be one of [[WebGLRenderingContext.RGBA4]], [[WebGLRenderingContext.RGB565]], - * [[WebGLRenderingContext.RGB5_A1]], [[WebGLRenderingContext.DEPTH_COMPONENT16]], [[WebGLRenderingContext.STENCIL_INDEX8]] or - * [[WebGLRenderingContext.DEPTH_STENCIL]]. - */ - def renderbufferStorage(target: Int, internalformat: Int, width: Int, - height: Int): Unit = js.native + /** Reads pixels from the framebuffer into `pixels`. + * + * @param x + * the x coordinate of the bottom left of the area to read. + * @param y + * the y coordinate of the bottom left of the area to read. + * @param width + * the width of the area to read. + * @param height + * the height of the area to read. + * @param format + * the format of the desired output. Must be one of [[WebGLRenderingContext.UNSIGNED_BYTE]], + * [[WebGLRenderingContext.UNSIGNED_SHORT_4_4_4_4]], [[WebGLRenderingContext.UNSIGNED_SHORT_5_5_5_1]], + * [[WebGLRenderingContext.UNSIGNED_SHORT_5_6_5]] + */ + def readPixels(x: Int, y: Int, width: Int, height: Int, format: Int, `type`: Int, + pixels: ArrayBufferView): Unit = js.native - /** - * Sets the sampling coverage parameters for primitive antialiasing. - * - * The OpenGL multisampling algorithm is too involved to concisely explain here. - * Please consult [[http://www.opengl.org/registry/specs/SGIS/multisample.txt]]. - * - * @param value the sample coverage value, clamped to 0..1. - * @param invert if true, the mask will be bitwise-inverted. - */ + /** Create renderbuffer image storage. + * + * Initializes the renderbuffer to use the new storage format, replacing any previous store. + * + * @param target + * must be [[WebGLRenderingContext.RENDERBUFFER]] + * @param internalformat + * specifies the format of the renderbuffer. May be one of [[WebGLRenderingContext.RGBA4]], + * [[WebGLRenderingContext.RGB565]], [[WebGLRenderingContext.RGB5_A1]], + * [[WebGLRenderingContext.DEPTH_COMPONENT16]], [[WebGLRenderingContext.STENCIL_INDEX8]] or + * [[WebGLRenderingContext.DEPTH_STENCIL]]. + */ + def renderbufferStorage(target: Int, internalformat: Int, width: Int, height: Int): Unit = js.native + + /** Sets the sampling coverage parameters for primitive antialiasing. + * + * The OpenGL multisampling algorithm is too involved to concisely explain here. Please consult + * [[http://www.opengl.org/registry/specs/SGIS/multisample.txt]]. + * + * @param value + * the sample coverage value, clamped to 0..1. + * @param invert + * if true, the mask will be bitwise-inverted. + */ def sampleCoverage(value: Int, invert: Boolean): Unit = js.native - /** - * Sets the scissor rectangle. When [[WebGLRenderingContext.SCISSOR_TEST]] is enabled, rendering will be restricted to this rectangle. - */ + /** Sets the scissor rectangle. When [[WebGLRenderingContext.SCISSOR_TEST]] is enabled, rendering will be restricted + * to this rectangle. + */ def scissor(x: Int, y: Int, width: Int, height: Int): Unit = js.native - /** - * Sets the GLSL source for the given shader. - */ + /** Sets the GLSL source for the given shader. + */ def shaderSource(shader: WebGLShader, source: String): Unit = js.native - /** - * Sets the stencil test for front and back faces. - * @param func the test function. One of [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], - * [[WebGLRenderingContext.LEQUAL]], [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.GEQUAL]], - * [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.NOTEQUAL]], and [[WebGLRenderingContext.ALWAYS]] - * @param ref the reference value to test against in the stencil buffer - * @param mask mask that is ANDed with `ref` and the tested value and stored in the stencil buffer. - */ + /** Sets the stencil test for front and back faces. + * @param func + * the test function. One of [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], + * [[WebGLRenderingContext.LEQUAL]], [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.GEQUAL]], + * [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.NOTEQUAL]], and [[WebGLRenderingContext.ALWAYS]] + * @param ref + * the reference value to test against in the stencil buffer + * @param mask + * mask that is ANDed with `ref` and the tested value and stored in the stencil buffer. + */ def stencilFunc(func: Int, ref: Int, mask: Int): Unit = js.native - /** - * Sets the stencil test for the given face type. - * @param face the face(s) to configure the test for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] - * or [[WebGLRenderingContext.FRONT_AND_BACK]]. - * @param func the test function. One of [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], - * [[WebGLRenderingContext.LEQUAL]], [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.GEQUAL]], - * [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.NOTEQUAL]], and [[WebGLRenderingContext.ALWAYS]] - * @param ref the reference value to test against in the stencil buffer - * @param mask mask that is ANDed with `ref` and the tested value and stored in the stencil buffer. - */ - def stencilFuncSeparate(face: Int, func: Int, ref: Int, - mask: Int): Unit = js.native - - /** - * Configure which bits in the stencil buffer may be written to by front or back faces. - * @param mask the write mask. Set bits are allowed to be written to the corresponding stencil buffer bit. - */ + /** Sets the stencil test for the given face type. + * @param face + * the face(s) to configure the test for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] or + * [[WebGLRenderingContext.FRONT_AND_BACK]]. + * @param func + * the test function. One of [[WebGLRenderingContext.NEVER]], [[WebGLRenderingContext.LESS]], + * [[WebGLRenderingContext.LEQUAL]], [[WebGLRenderingContext.GREATER]], [[WebGLRenderingContext.GEQUAL]], + * [[WebGLRenderingContext.EQUAL]], [[WebGLRenderingContext.NOTEQUAL]], and [[WebGLRenderingContext.ALWAYS]] + * @param ref + * the reference value to test against in the stencil buffer + * @param mask + * mask that is ANDed with `ref` and the tested value and stored in the stencil buffer. + */ + def stencilFuncSeparate(face: Int, func: Int, ref: Int, mask: Int): Unit = js.native + + /** Configure which bits in the stencil buffer may be written to by front or back faces. + * @param mask + * the write mask. Set bits are allowed to be written to the corresponding stencil buffer bit. + */ def stencilMask(mask: Int): Unit = js.native - /** - * Configure which bits in the stencil buffer may be written to by the given face type. - * @param face the face(s) to configure the mask for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] - * or [[WebGLRenderingContext.FRONT_AND_BACK]]. - * @param mask the write mask. Set bits are allowed to be written to the corresponding stencil buffer bit. - */ + /** Configure which bits in the stencil buffer may be written to by the given face type. + * @param face + * the face(s) to configure the mask for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] or + * [[WebGLRenderingContext.FRONT_AND_BACK]]. + * @param mask + * the write mask. Set bits are allowed to be written to the corresponding stencil buffer bit. + */ def stencilMaskSeparate(face: Int, mask: Int): Unit = js.native - /** - * Configure the effect of a stencil or depth test failing for front or back faces. - * - * @param fail the effect of the stencil test failing. May be one of - * [[WebGLRenderingContext.KEEP]], [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.REPLACE]], - * [[WebGLRenderingContext.INCR]], [[WebGLRenderingContext.INCR_WRAP]], [[WebGLRenderingContext.DECR]], - * [[WebGLRenderingContext.DECR_WRAP]], and [[WebGLRenderingContext.INVERT]] - * - * @param zfail the effect of the stencil test passing but the depth test failing. Parameters are as fail. - * @param zpass the effect of the stencil test failing but the depth test passing. Parameters are as fail. - */ + /** Configure the effect of a stencil or depth test failing for front or back faces. + * + * @param fail + * the effect of the stencil test failing. May be one of [[WebGLRenderingContext.KEEP]], + * [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.REPLACE]], [[WebGLRenderingContext.INCR]], + * [[WebGLRenderingContext.INCR_WRAP]], [[WebGLRenderingContext.DECR]], [[WebGLRenderingContext.DECR_WRAP]], and + * [[WebGLRenderingContext.INVERT]] + * + * @param zfail + * the effect of the stencil test passing but the depth test failing. Parameters are as fail. + * @param zpass + * the effect of the stencil test failing but the depth test passing. Parameters are as fail. + */ def stencilOp(fail: Int, zfail: Int, zpass: Int): Unit = js.native - /** - * Configure the effect of a stencil or depth test failing for the specified faces. - * - * @param face the face(s) to configure the stencil operation for. May be [[WebGLRenderingContext.FRONT]], [[WebGLRenderingContext.BACK]] - * or [[WebGLRenderingContext.FRONT_AND_BACK]]. - * @param fail the effect of the stencil test failing. May be one of - * [[WebGLRenderingContext.KEEP]], [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.REPLACE]], - * [[WebGLRenderingContext.INCR]], [[WebGLRenderingContext.INCR_WRAP]], [[WebGLRenderingContext.DECR]], - * [[WebGLRenderingContext.DECR_WRAP]], and [[WebGLRenderingContext.INVERT]] - * - * @param zfail the effect of the stencil test passing but the depth test failing. Parameters are as fail. - * @param zpass the effect of the stencil test failing but the depth test passing. Parameters are as fail. - */ - def stencilOpSeparate(face: Int, fail: Int, zfail: Int, - zpass: Int): Unit = js.native - - /** - * Loads a 2-dimensional texture into a texture unit from source data. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the target pixel data. - * @param width the width of the texture image. - * @param height the height of the texture image. - * @param border the border width. Must be 0. - * @param pixels the source image data. - */ - def texImage2D(target: Int, level: Int, internalformat: Int, width: Int, - height: Int, border: Int, format: Int, `type`: Int, - pixels: ArrayBufferView): Unit = js.native + /** Configure the effect of a stencil or depth test failing for the specified faces. + * + * @param face + * the face(s) to configure the stencil operation for. May be [[WebGLRenderingContext.FRONT]], + * [[WebGLRenderingContext.BACK]] or [[WebGLRenderingContext.FRONT_AND_BACK]]. + * @param fail + * the effect of the stencil test failing. May be one of [[WebGLRenderingContext.KEEP]], + * [[WebGLRenderingContext.ZERO]], [[WebGLRenderingContext.REPLACE]], [[WebGLRenderingContext.INCR]], + * [[WebGLRenderingContext.INCR_WRAP]], [[WebGLRenderingContext.DECR]], [[WebGLRenderingContext.DECR_WRAP]], and + * [[WebGLRenderingContext.INVERT]] + * + * @param zfail + * the effect of the stencil test passing but the depth test failing. Parameters are as fail. + * @param zpass + * the effect of the stencil test failing but the depth test passing. Parameters are as fail. + */ + def stencilOpSeparate(face: Int, fail: Int, zfail: Int, zpass: Int): Unit = js.native + + /** Loads a 2-dimensional texture into a texture unit from source data. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the target pixel data. + * @param width + * the width of the texture image. + * @param height + * the height of the texture image. + * @param border + * the border width. Must be 0. + * @param pixels + * the source image data. + */ + def texImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, format: Int, + `type`: Int, pixels: ArrayBufferView): Unit = js.native - /** - * Loads a 2-dimensional texture into a texture unit from an ImageData object. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the target pixel data. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the source image data. - */ - def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, - `type`: Int, pixels: ImageData): Unit = js.native - - /** - * Loads a 2-dimensional texture into a texture unit from an HTMLImageElement object. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the target pixel data. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the source image data. - */ - def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, - `type`: Int, pixels: HTMLImageElement): Unit = js.native - - /** - * Loads a 2-dimensional texture into a texture unit from an HTMLCanvasElement object. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the target pixel data. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the source image data. - */ - def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, - `type`: Int, pixels: HTMLCanvasElement): Unit = js.native - - /** - * Loads a 2-dimensional texture into a texture unit from an HTMLVideoElement object. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param internalformat the format of the target pixel data. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the source image data. - */ - def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, - `type`: Int, pixels: HTMLVideoElement): Unit = js.native - - /** - * Sets the texture parameter for the active texture unit. - * - * @param target the texture target to configure. May be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] - * @param pname the parameter to change. May be [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_MAG_FILTER]] - * [[WebGLRenderingContext.TEXTURE_WRAP_S]], or [[WebGLRenderingContext.TEXTURE_WRAP_T]] - * @param param the value to set. See the corresponding parameters for valid values. - */ + /** Loads a 2-dimensional texture into a texture unit from an ImageData object. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the target pixel data. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the source image data. + */ + def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, `type`: Int, + pixels: ImageData): Unit = js.native + + /** Loads a 2-dimensional texture into a texture unit from an HTMLImageElement object. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the target pixel data. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the source image data. + */ + def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, `type`: Int, + pixels: HTMLImageElement): Unit = js.native + + /** Loads a 2-dimensional texture into a texture unit from an HTMLCanvasElement object. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the target pixel data. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the source image data. + */ + def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, `type`: Int, + pixels: HTMLCanvasElement): Unit = js.native + + /** Loads a 2-dimensional texture into a texture unit from an HTMLVideoElement object. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param internalformat + * the format of the target pixel data. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the source image data. + */ + def texImage2D(target: Int, level: Int, internalformat: Int, format: Int, `type`: Int, + pixels: HTMLVideoElement): Unit = js.native + + /** Sets the texture parameter for the active texture unit. + * + * @param target + * the texture target to configure. May be [[WebGLRenderingContext.TEXTURE_2D]] or + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] + * @param pname + * the parameter to change. May be [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], + * [[WebGLRenderingContext.TEXTURE_MAG_FILTER]] [[WebGLRenderingContext.TEXTURE_WRAP_S]], or + * [[WebGLRenderingContext.TEXTURE_WRAP_T]] + * @param param + * the value to set. See the corresponding parameters for valid values. + */ def texParameterf(target: Int, pname: Int, param: Double): Unit = js.native - /** - * Sets the texture parameter for the active texture unit. - * - * @param target the texture target to configure. May be [[WebGLRenderingContext.TEXTURE_2D]] or [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] - * @param pname the parameter to change. May be [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], [[WebGLRenderingContext.TEXTURE_MAG_FILTER]] - * [[WebGLRenderingContext.TEXTURE_WRAP_S]], or [[WebGLRenderingContext.TEXTURE_WRAP_T]] - * @param param the value to set. See the corresponding parameters for valid values. - */ + /** Sets the texture parameter for the active texture unit. + * + * @param target + * the texture target to configure. May be [[WebGLRenderingContext.TEXTURE_2D]] or + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP]] + * @param pname + * the parameter to change. May be [[WebGLRenderingContext.TEXTURE_MIN_FILTER]], + * [[WebGLRenderingContext.TEXTURE_MAG_FILTER]] [[WebGLRenderingContext.TEXTURE_WRAP_S]], or + * [[WebGLRenderingContext.TEXTURE_WRAP_T]] + * @param param + * the value to set. See the corresponding parameters for valid values. + */ def texParameteri(target: Int, pname: Int, param: Int): Unit = js.native - /** - * Loads a 2-dimensional texture subimage into a texture unit from an `ArrayBufferView`. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param width the width of the texture image. - * @param height the height of the texture image. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the image data. - */ - def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, - width: Int, height: Int, format: Int, `type`: Int, - pixels: ArrayBufferView): Unit = js.native + /** Loads a 2-dimensional texture subimage into a texture unit from an `ArrayBufferView`. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param width + * the width of the texture image. + * @param height + * the height of the texture image. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the image data. + */ + def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, + `type`: Int, pixels: ArrayBufferView): Unit = js.native - /** - * Loads a 2-dimensional texture subimage into a texture unit from an `ImageData` object. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the image data. - */ - def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, - format: Int, `type`: Int, pixels: ImageData): Unit = js.native - - /** - * Loads a 2-dimensional texture subimage into a texture unit from an `HTMLImageElement`. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the image data. - */ - def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, - format: Int, `type`: Int, pixels: HTMLImageElement): Unit = js.native - - /** - * Loads a 2-dimensional texture subimage into a texture unit from an `HTMLCanvasElement`. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the image data.. - */ - def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, - format: Int, `type`: Int, pixels: HTMLCanvasElement): Unit = js.native - - /** - * Loads a 2-dimensional texture subimage into a texture unit from an `HTMLVideoElement`. - * - * @param target the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], - * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] - * @param level the mipmap level of detail. 0 is the base image. - * @param xoffset the x texel offset into the texture image. - * @param yoffset the y texel offset into the texture image. - * @param format the format of the incoming pixel data. - * @param type the data type of the pixel data. - * @param pixels the image data. - */ - def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, - format: Int, `type`: Int, pixels: HTMLVideoElement): Unit = js.native - - /** - * Loads a a scalar float into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the scalar to bind to. - */ + /** Loads a 2-dimensional texture subimage into a texture unit from an `ImageData` object. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the image data. + */ + def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, format: Int, `type`: Int, + pixels: ImageData): Unit = js.native + + /** Loads a 2-dimensional texture subimage into a texture unit from an `HTMLImageElement`. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the image data. + */ + def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, format: Int, `type`: Int, + pixels: HTMLImageElement): Unit = js.native + + /** Loads a 2-dimensional texture subimage into a texture unit from an `HTMLCanvasElement`. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the image data.. + */ + def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, format: Int, `type`: Int, + pixels: HTMLCanvasElement): Unit = js.native + + /** Loads a 2-dimensional texture subimage into a texture unit from an `HTMLVideoElement`. + * + * @param target + * the target on the active texture unit. May be [[WebGLRenderingContext.TEXTURE_2D]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_X]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_X]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Y]], [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Y]], + * [[WebGLRenderingContext.TEXTURE_CUBE_MAP_POSITIVE_Z]], or [[WebGLRenderingContext.TEXTURE_CUBE_MAP_NEGATIVE_Z]] + * @param level + * the mipmap level of detail. 0 is the base image. + * @param xoffset + * the x texel offset into the texture image. + * @param yoffset + * the y texel offset into the texture image. + * @param format + * the format of the incoming pixel data. + * @param type + * the data type of the pixel data. + * @param pixels + * the image data. + */ + def texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, format: Int, `type`: Int, + pixels: HTMLVideoElement): Unit = js.native + + /** Loads a a scalar float into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the scalar to bind to. + */ def uniform1f(location: WebGLUniformLocation, x: Double): Unit = js.native - /** - * Loads a a scalar float into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a `Float32Array` to bind to - */ - def uniform1fv(location: WebGLUniformLocation, - v: Float32Array): Unit = js.native - - /** - * Loads a a scalar float into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to. - */ - def uniform1fv(location: WebGLUniformLocation, - v: js.Array[Double]): Unit = js.native - - /** - * Loads a a scalar integer into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the scalar to bind to. - */ + /** Loads a a scalar float into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a `Float32Array` to bind to + */ + def uniform1fv(location: WebGLUniformLocation, v: Float32Array): Unit = js.native + + /** Loads a a scalar float into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to. + */ + def uniform1fv(location: WebGLUniformLocation, v: js.Array[Double]): Unit = js.native + + /** Loads a a scalar integer into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the scalar to bind to. + */ def uniform1i(location: WebGLUniformLocation, x: Int): Unit = js.native - /** - * Loads a a scalar integer into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v an `Int32Array` to bind to - */ - def uniform1iv(location: WebGLUniformLocation, - v: Int32Array): Unit = js.native - - /** - * Loads a a scalar integer into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to - */ - def uniform1iv(location: WebGLUniformLocation, - v: js.Array[Int]): Unit = js.native - - /** - * Loads a a 2-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the first float component - * @param y the second float component - */ - def uniform2f(location: WebGLUniformLocation, x: Double, - y: Double): Unit = js.native - - /** - * Loads a a 2-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a `Float32Array` to bind to - */ - def uniform2fv(location: WebGLUniformLocation, - v: Float32Array): Unit = js.native - - /** - * Loads a a 2-vector of floats - * - * @param location the location to bind into a [[WebGLUniformLocation]]. - * @param v a js.Array to bind to. - */ - def uniform2fv(location: WebGLUniformLocation, - v: js.Array[Double]): Unit = js.native - - /** - * Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the first integer component - * @param y the second integer component - */ - def uniform2i(location: WebGLUniformLocation, x: Int, - y: Int): Unit = js.native - - /** - * Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v an `Int32Array` to bind to - */ - def uniform2iv(location: WebGLUniformLocation, - v: Int32Array): Unit = js.native - - /** - * Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to - */ - def uniform2iv(location: WebGLUniformLocation, - v: js.Array[Int]): Unit = js.native - - /** - * Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the first float component. - * @param y the second float component. - * @param z the third float component. - */ - def uniform3f(location: WebGLUniformLocation, x: Double, y: Double, - z: Double): Unit = js.native - - /** - * Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a `Float32Array` to bind to - */ - def uniform3fv(location: WebGLUniformLocation, - v: Float32Array): Unit = js.native - - /** - * Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to. - */ - def uniform3fv(location: WebGLUniformLocation, - v: js.Array[Double]): Unit = js.native - - /** - * Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the first integer component - * @param y the second integer component - * @param z the third integer component - */ - def uniform3i(location: WebGLUniformLocation, x: Int, y: Int, - z: Int): Unit = js.native - - /** - * Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v an `Int32Array` to bind to - */ - def uniform3iv(location: WebGLUniformLocation, - v: Int32Array): Unit = js.native - - /** - * Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to - */ - def uniform3iv(location: WebGLUniformLocation, - v: js.Array[Int]): Unit = js.native - - /** - * Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the first float component. - * @param y the second float component. - * @param z the third float component. - * @param w the fourth float component. - */ - def uniform4f(location: WebGLUniformLocation, x: Double, y: Double, - z: Double, w: Double): Unit = js.native - - /** - * Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a `Float32Array` to bind to - */ - def uniform4fv(location: WebGLUniformLocation, - v: Float32Array): Unit = js.native - - /** - * Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to. - */ - def uniform4fv(location: WebGLUniformLocation, - v: js.Array[Double]): Unit = js.native - - /** - * Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param x the first integer component - * @param y the second integer component - * @param z the third integer component - * @param w the third integer component - */ - def uniform4i(location: WebGLUniformLocation, x: Int, y: Int, z: Int, - w: Int): Unit = js.native - - /** - * Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v an `Int32Array` to bind to - */ - def uniform4iv(location: WebGLUniformLocation, - v: Int32Array): Unit = js.native - - /** - * Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param v a js.Array to bind to - */ - def uniform4iv(location: WebGLUniformLocation, - v: js.Array[Int]): Unit = js.native - - /** - * Loads a a 4x2 matrix into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param transpose if `true`, the matrix will loaded into the uniform transposed. - * @param value the source `Float32Array` containing the matrix data. - */ - def uniformMatrix2fv(location: WebGLUniformLocation, transpose: Boolean, - value: Float32Array): Unit = js.native - - /** - * Loads a a 4x2 matrix into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param transpose if `true`, the matrix will loaded into the uniform transposed. - * @param value the source `js.Array` containing the matrix data. - */ - def uniformMatrix2fv(location: WebGLUniformLocation, transpose: Boolean, - value: js.Array[Double]): Unit = js.native - - /** - * Loads a a 4x3 matrix into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param transpose if `true`, the matrix will loaded into the uniform transposed. - * @param value the source `Float32Array` containing the matrix data. - */ - def uniformMatrix3fv(location: WebGLUniformLocation, transpose: Boolean, - value: Float32Array): Unit = js.native - - /** - * Loads a a 4x3 matrix into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param transpose if `true`, the matrix will loaded into the uniform transposed. - * @param value the source `js.Array` containing the matrix data. - */ - def uniformMatrix3fv(location: WebGLUniformLocation, transpose: Boolean, - value: js.Array[Double]): Unit = js.native - - /** - * Loads a a 4x4 matrix into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param transpose if `true`, the matrix will loaded into the uniform transposed. - * @param value the source `Float32Array` containing the matrix data. - */ - def uniformMatrix4fv(location: WebGLUniformLocation, transpose: Boolean, - value: Float32Array): Unit = js.native - - /** - * Loads a a 4x4 matrix into a [[WebGLUniformLocation]]. - * - * @param location the location to bind. - * @param transpose if `true`, the matrix will loaded into the uniform transposed. - * @param value the source `js.Array` containing the matrix data. - */ - def uniformMatrix4fv(location: WebGLUniformLocation, transpose: Boolean, - value: js.Array[Double]): Unit = js.native - - /** - * Makes a [[WebGLProgram]] become the active program. - */ + /** Loads a a scalar integer into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * an `Int32Array` to bind to + */ + def uniform1iv(location: WebGLUniformLocation, v: Int32Array): Unit = js.native + + /** Loads a a scalar integer into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to + */ + def uniform1iv(location: WebGLUniformLocation, v: js.Array[Int]): Unit = js.native + + /** Loads a a 2-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the first float component + * @param y + * the second float component + */ + def uniform2f(location: WebGLUniformLocation, x: Double, y: Double): Unit = js.native + + /** Loads a a 2-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a `Float32Array` to bind to + */ + def uniform2fv(location: WebGLUniformLocation, v: Float32Array): Unit = js.native + + /** Loads a a 2-vector of floats + * + * @param location + * the location to bind into a [[WebGLUniformLocation]]. + * @param v + * a js.Array to bind to. + */ + def uniform2fv(location: WebGLUniformLocation, v: js.Array[Double]): Unit = js.native + + /** Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the first integer component + * @param y + * the second integer component + */ + def uniform2i(location: WebGLUniformLocation, x: Int, y: Int): Unit = js.native + + /** Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * an `Int32Array` to bind to + */ + def uniform2iv(location: WebGLUniformLocation, v: Int32Array): Unit = js.native + + /** Loads a a 2-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to + */ + def uniform2iv(location: WebGLUniformLocation, v: js.Array[Int]): Unit = js.native + + /** Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the first float component. + * @param y + * the second float component. + * @param z + * the third float component. + */ + def uniform3f(location: WebGLUniformLocation, x: Double, y: Double, z: Double): Unit = js.native + + /** Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a `Float32Array` to bind to + */ + def uniform3fv(location: WebGLUniformLocation, v: Float32Array): Unit = js.native + + /** Loads a a 3-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to. + */ + def uniform3fv(location: WebGLUniformLocation, v: js.Array[Double]): Unit = js.native + + /** Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the first integer component + * @param y + * the second integer component + * @param z + * the third integer component + */ + def uniform3i(location: WebGLUniformLocation, x: Int, y: Int, z: Int): Unit = js.native + + /** Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * an `Int32Array` to bind to + */ + def uniform3iv(location: WebGLUniformLocation, v: Int32Array): Unit = js.native + + /** Loads a a 3-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to + */ + def uniform3iv(location: WebGLUniformLocation, v: js.Array[Int]): Unit = js.native + + /** Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the first float component. + * @param y + * the second float component. + * @param z + * the third float component. + * @param w + * the fourth float component. + */ + def uniform4f(location: WebGLUniformLocation, x: Double, y: Double, z: Double, w: Double): Unit = js.native + + /** Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a `Float32Array` to bind to + */ + def uniform4fv(location: WebGLUniformLocation, v: Float32Array): Unit = js.native + + /** Loads a a 4-vector of floats into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to. + */ + def uniform4fv(location: WebGLUniformLocation, v: js.Array[Double]): Unit = js.native + + /** Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param x + * the first integer component + * @param y + * the second integer component + * @param z + * the third integer component + * @param w + * the third integer component + */ + def uniform4i(location: WebGLUniformLocation, x: Int, y: Int, z: Int, w: Int): Unit = js.native + + /** Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * an `Int32Array` to bind to + */ + def uniform4iv(location: WebGLUniformLocation, v: Int32Array): Unit = js.native + + /** Loads a a 4-vector of integers into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param v + * a js.Array to bind to + */ + def uniform4iv(location: WebGLUniformLocation, v: js.Array[Int]): Unit = js.native + + /** Loads a a 4x2 matrix into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param transpose + * if `true`, the matrix will loaded into the uniform transposed. + * @param value + * the source `Float32Array` containing the matrix data. + */ + def uniformMatrix2fv(location: WebGLUniformLocation, transpose: Boolean, value: Float32Array): Unit = js.native + + /** Loads a a 4x2 matrix into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param transpose + * if `true`, the matrix will loaded into the uniform transposed. + * @param value + * the source `js.Array` containing the matrix data. + */ + def uniformMatrix2fv(location: WebGLUniformLocation, transpose: Boolean, value: js.Array[Double]): Unit = js.native + + /** Loads a a 4x3 matrix into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param transpose + * if `true`, the matrix will loaded into the uniform transposed. + * @param value + * the source `Float32Array` containing the matrix data. + */ + def uniformMatrix3fv(location: WebGLUniformLocation, transpose: Boolean, value: Float32Array): Unit = js.native + + /** Loads a a 4x3 matrix into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param transpose + * if `true`, the matrix will loaded into the uniform transposed. + * @param value + * the source `js.Array` containing the matrix data. + */ + def uniformMatrix3fv(location: WebGLUniformLocation, transpose: Boolean, value: js.Array[Double]): Unit = js.native + + /** Loads a a 4x4 matrix into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param transpose + * if `true`, the matrix will loaded into the uniform transposed. + * @param value + * the source `Float32Array` containing the matrix data. + */ + def uniformMatrix4fv(location: WebGLUniformLocation, transpose: Boolean, value: Float32Array): Unit = js.native + + /** Loads a a 4x4 matrix into a [[WebGLUniformLocation]]. + * + * @param location + * the location to bind. + * @param transpose + * if `true`, the matrix will loaded into the uniform transposed. + * @param value + * the source `js.Array` containing the matrix data. + */ + def uniformMatrix4fv(location: WebGLUniformLocation, transpose: Boolean, value: js.Array[Double]): Unit = js.native + + /** Makes a [[WebGLProgram]] become the active program. + */ def useProgram(program: WebGLProgram): Unit = js.native - /** - * Validates a [[WebGLProgram]]. - */ + /** Validates a [[WebGLProgram]]. + */ def validateProgram(program: WebGLProgram): Unit = js.native - /** - * Loads a scalar into a vertex attribute. - * - * @param indx the index of the attribute. - * @param x the scalar to load. - */ + /** Loads a scalar into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param x + * the scalar to load. + */ def vertexAttrib1f(indx: Int, x: Double): Unit = js.native - /** - * Loads a scalar into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a scalar into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib1fv(indx: Int, values: Float32Array): Unit = js.native - /** - * Loads a scalar into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a scalar into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib1fv(indx: Int, values: js.Array[Double]): Unit = js.native - /** - * Loads a 2-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param x the first component. - * @param y the second component. - */ + /** Loads a 2-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param x + * the first component. + * @param y + * the second component. + */ def vertexAttrib2f(indx: Int, x: Double, y: Double): Unit = js.native - /** - * Loads a 2-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a 2-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib2fv(indx: Int, values: Float32Array): Unit = js.native - /** - * Loads a 2-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a 2-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib2fv(indx: Int, values: js.Array[Double]): Unit = js.native - /** - * Loads a 3-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param x the first component. - * @param y the second component. - * @param z the third component. - */ - def vertexAttrib3f(indx: Int, x: Double, y: Double, - z: Double): Unit = js.native - - /** - * Loads a 3-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a 3-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param x + * the first component. + * @param y + * the second component. + * @param z + * the third component. + */ + def vertexAttrib3f(indx: Int, x: Double, y: Double, z: Double): Unit = js.native + + /** Loads a 3-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib3fv(indx: Int, values: Float32Array): Unit = js.native - /** - * Loads a 3-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a 3-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib3fv(indx: Int, values: js.Array[Double]): Unit = js.native - /** - * Loads a 4-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param x the first component. - * @param y the second component. - * @param z the third component. - * @param w the fourth component. - */ - def vertexAttrib4f(indx: Int, x: Double, y: Double, z: Double, - w: Double): Unit = js.native - - /** - * Loads a 4-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a 4-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param x + * the first component. + * @param y + * the second component. + * @param z + * the third component. + * @param w + * the fourth component. + */ + def vertexAttrib4f(indx: Int, x: Double, y: Double, z: Double, w: Double): Unit = js.native + + /** Loads a 4-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib4fv(indx: Int, values: Float32Array): Unit = js.native - /** - * Loads a 4-vector into a vertex attribute. - * - * @param indx the index of the attribute. - * @param values the source array for the attribute. - */ + /** Loads a 4-vector into a vertex attribute. + * + * @param indx + * the index of the attribute. + * @param values + * the source array for the attribute. + */ def vertexAttrib4fv(indx: Int, values: js.Array[Double]): Unit = js.native - /** - * Defines an array of generic vertex attribute data. - * - * @param indx the index of the attribute - * @param size the number of components per attribute. Must be 1..4 - * @param type the datatype for each component, may be [[WebGLRenderingContext.BYTE]], [[WebGLRenderingContext.UNSIGNED_BYTE]], - * [[WebGLRenderingContext.SHORT]], [[WebGLRenderingContext.UNSIGNED_SHORT]], or - * [[WebGLRenderingContext.FLOAT]]. - * @param normalized if `true`, values are normalized on access, otherwise they are converted to fixed point values on access. - * @param stride the gap between attributes. 0 would be packed together. - * @param offset the offset to the first component in the array. - */ - def vertexAttribPointer(indx: Int, size: Int, `type`: Int, - normalized: Boolean, stride: Int, offset: Int): Unit = js.native + /** Defines an array of generic vertex attribute data. + * + * @param indx + * the index of the attribute + * @param size + * the number of components per attribute. Must be 1..4 + * @param type + * the datatype for each component, may be [[WebGLRenderingContext.BYTE]], [[WebGLRenderingContext.UNSIGNED_BYTE]], + * [[WebGLRenderingContext.SHORT]], [[WebGLRenderingContext.UNSIGNED_SHORT]], or [[WebGLRenderingContext.FLOAT]]. + * @param normalized + * if `true`, values are normalized on access, otherwise they are converted to fixed point values on access. + * @param stride + * the gap between attributes. 0 would be packed together. + * @param offset + * the offset to the first component in the array. + */ + def vertexAttribPointer(indx: Int, size: Int, `type`: Int, normalized: Boolean, stride: Int, + offset: Int): Unit = js.native - /** - * Sets the OpenGL viewport to render within. - */ - def viewport(x: Double, y: Double, width: Double, - height: Double): Unit = js.native + /** Sets the OpenGL viewport to render within. + */ + def viewport(x: Double, y: Double, width: Double, height: Double): Unit = js.native } diff --git a/src/main/scala/org/scalajs/dom/WebWorkerTypes.scala b/src/main/scala/org/scalajs/dom/WebWorkerTypes.scala index 4e5e7a499..1d10422ad 100644 --- a/src/main/scala/org/scalajs/dom/WebWorkerTypes.scala +++ b/src/main/scala/org/scalajs/dom/WebWorkerTypes.scala @@ -3,351 +3,275 @@ package org.scalajs.dom import scala.scalajs.js import scala.scalajs.js.annotation._ -/** - * The AbstractWorker interface abstracts properties and methods common to all - * kind of workers, being Worker or SharedWorker. - * - * MDN - */ +/** The AbstractWorker interface abstracts properties and methods common to all kind of workers, being Worker or + * SharedWorker. + * + * MDN + */ @js.native trait AbstractWorker extends EventTarget { - /** - * The AbstractWorker.onerror property represents an EventHandler, that is a - * function to be called when the error event occurs and bubbles through the - * Worker. - * - * MDN - */ + /** The AbstractWorker.onerror property represents an EventHandler, that is a function to be called when the error + * event occurs and bubbles through the Worker. + * + * MDN + */ var onerror: js.Function1[ErrorEvent, _] = js.native } -/** - * The Worker interface represents a background task that can be easily created - * and can send messages back to their creators. Creating a worker is as simple - * as calling the Worker() constructor, specifying a script to be run in the - * worker thread. - * - * Of note is the fact that workers may in turn spawn new workers as long as - * those workers are hosted within the same origin as the parent page. In - * addition, workers may use XMLHttpRequest for network I/O, with the exception - * that the responseXML and channel attributes on XMLHttpRequest always return - * null. - * - * MDN - */ +/** The Worker interface represents a background task that can be easily created and can send messages back to their + * creators. Creating a worker is as simple as calling the Worker() constructor, specifying a script to be run in the + * worker thread. + * + * Of note is the fact that workers may in turn spawn new workers as long as those workers are hosted within the same + * origin as the parent page. In addition, workers may use XMLHttpRequest for network I/O, with the exception that the + * responseXML and channel attributes on XMLHttpRequest always return null. + * + * MDN + */ @js.native @JSGlobal class Worker(stringUrl: String) extends AbstractWorker { - /** - * The Worker.onmessage property represents an EventHandler, that is a - * function to be called when the message event occurs. These events are of - * type MessageEvent and will be called when the worker calls its own - * postMessage() method: it is the way that a Worker has to give back - * information to the thread that created it. - * - * MDN - */ + /** The Worker.onmessage property represents an EventHandler, that is a function to be called when the message event + * occurs. These events are of type MessageEvent and will be called when the worker calls its own postMessage() + * method: it is the way that a Worker has to give back information to the thread that created it. + * + * MDN + */ var onmessage: js.Function1[MessageEvent, _] = js.native - /** - * The postMessage() method of the Worker interface sends a message to the - * worker's inner scope. This accepts a single parameter, which is the data to - * send to the worker. The data may be any value or JavaScript object handled - * by the structured clone algorithm, which includes cyclical references. - * - * The Worker can send back information to the thread that spawned it using - * the DedicatedWorkerGlobalScope.postMessage method. - * - * MDN - * - * @param aMessage The object to deliver to the worker; this will be in the - * data field in the event delivered to the - * DedicatedWorkerGlobalScope.onmessage handler. This may be - * any value or JavaScript object handled by the structured - * clone algorithm, which includes cyclical references. - * - * @param transferList An optional array of Transferable objects to transfer - * ownership of. If the ownership of an object is - * transferred, it becomes unusable (neutered) in the - * context it was sent from and it becomes available only - * to the main thread it was sent to. - * - * Only MessagePort and ArrayBuffer objects can be - * transferred. null is not an acceptable value for the - * transferList. - */ - def postMessage(aMessage: js.Any, - transferList: js.UndefOr[ - js.Array[Transferable]] = js.native): Unit = js.native - - /** - * The Worker.terminate() method immediately terminates the Worker. This does - * not offer the worker an opportunity to finish its operations; it is simply - * stopped at once. - * - * MDN - */ + /** The postMessage() method of the Worker interface sends a message to the worker's inner scope. This accepts a + * single parameter, which is the data to send to the worker. The data may be any value or JavaScript object handled + * by the structured clone algorithm, which includes cyclical references. + * + * The Worker can send back information to the thread that spawned it using the + * DedicatedWorkerGlobalScope.postMessage method. + * + * MDN + * + * @param aMessage + * The object to deliver to the worker; this will be in the data field in the event delivered to the + * DedicatedWorkerGlobalScope.onmessage handler. This may be any value or JavaScript object handled by the + * structured clone algorithm, which includes cyclical references. + * + * @param transferList + * An optional array of Transferable objects to transfer ownership of. If the ownership of an object is + * transferred, it becomes unusable (neutered) in the context it was sent from and it becomes available only to the + * main thread it was sent to. + * + * Only MessagePort and ArrayBuffer objects can be transferred. null is not an acceptable value for the transferList. + */ + def postMessage(aMessage: js.Any, transferList: js.UndefOr[js.Array[Transferable]] = js.native): Unit = js.native + + /** The Worker.terminate() method immediately terminates the Worker. This does not offer the worker an opportunity to + * finish its operations; it is simply stopped at once. + * + * MDN + */ def terminate(): Unit = js.native } -/** - * The WorkerGlobalScope interface of the Web Workers API is an interface - * representing the scope of any worker. Workers have no browsing context; - * this scope contains the information usually conveyed by Window objects — - * in this case event handlers, the console or the associated WorkerNavigator - * object. Each WorkerGlobalScope has its own event loop. - * - * This interface is usually specialized by each worker type: - * [[DedicatedWorkerGlobalScope]] for dedicated workers, SharedWorkerGlobalScope - * for shared workers, and ServiceWorkerGlobalScope for ServiceWorker. - * The self property returns the specialized scope for each context. - * - * MDN - */ +/** The WorkerGlobalScope interface of the Web Workers API is an interface representing the scope of any worker. Workers + * have no browsing context; this scope contains the information usually conveyed by Window objects — in this case + * event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. + * + * This interface is usually specialized by each worker type: [[DedicatedWorkerGlobalScope]] for dedicated workers, + * SharedWorkerGlobalScope for shared workers, and ServiceWorkerGlobalScope for ServiceWorker. The self property + * returns the specialized scope for each context. + * + * MDN + */ @js.native trait WorkerGlobalScope extends EventTarget with WindowOrWorkerGlobalScope { - /** - * The self read-only property of the WorkerGlobalScope interface returns a - * reference to the WorkerGlobalScope itself. Most of the time it is a specific - * scope like DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, - * or ServiceWorkerGlobalScope. - * - * MDN - */ + /** The self read-only property of the WorkerGlobalScope interface returns a reference to the WorkerGlobalScope + * itself. Most of the time it is a specific scope like DedicatedWorkerGlobalScope, SharedWorkerGlobalScope, or + * ServiceWorkerGlobalScope. + * + * MDN + */ def self: this.type = js.native - /** - * The location read-only property of the WorkerGlobalScope interface returns - * the WorkerLocation associated with the worker. It is a specific location - * object, mostly a subset of the Location for browsing scopes, - * but adapted to workers. - * - * MDN - */ + /** The location read-only property of the WorkerGlobalScope interface returns the WorkerLocation associated with the + * worker. It is a specific location object, mostly a subset of the Location for browsing scopes, but adapted to + * workers. + * + * MDN + */ def location: WorkerLocation = js.native - /** - * The navigator read-only property of the WorkerGlobalScope interface returns - * the WorkerNavigator associated with the worker. It is a specific navigator - * object, mostly a subset of the Navigator for browsing scopes, - * but adapted to workers. - * - * MDN - */ + /** The navigator read-only property of the WorkerGlobalScope interface returns the WorkerNavigator associated with + * the worker. It is a specific navigator object, mostly a subset of the Navigator for browsing scopes, but adapted + * to workers. + * + * MDN + */ def navigator: WorkerNavigator = js.native - /** - * The importScripts() method of the WorkerGlobalScope interface imports - * one or more scripts into the worker's scope. - * - * MDN - */ + /** The importScripts() method of the WorkerGlobalScope interface imports one or more scripts into the worker's scope. + * + * MDN + */ def importScripts(urls: js.Array[String]): Unit = js.native - /** - * The close() method of the WorkerGlobalScope interface discards any tasks - * queued in the WorkerGlobalScope's event loop, effectively closing this - * particular scope. - * - * MDN - */ + /** The close() method of the WorkerGlobalScope interface discards any tasks queued in the WorkerGlobalScope's event + * loop, effectively closing this particular scope. + * + * MDN + */ def close(): Unit = js.native - /** - * The onerror property of the WorkerGlobalScope interface represents an - * EventHandler to be called when the error event occurs and bubbles through - * the Worker. - * - * MDN - */ + /** The onerror property of the WorkerGlobalScope interface represents an EventHandler to be called when the error + * event occurs and bubbles through the Worker. + * + * MDN + */ var onError: js.Function1[ErrorEvent, _] = js.native - /** - * The onlanguagechange property of the WorkerGlobalScope interface represents - * an EventHandler to be called when the languagechange event occurs and - * bubbles through the Worker. - * - * MDN - */ + /** The onlanguagechange property of the WorkerGlobalScope interface represents an EventHandler to be called when the + * languagechange event occurs and bubbles through the Worker. + * + * MDN + */ var onlanguagechange: js.Function1[Event, _] = js.native - /** - * The onoffline property of the WorkerGlobalScope interface represents an - * EventHandler to be called when the offline event occurs and bubbles through - * the Worker. - * - * MDN - */ + /** The onoffline property of the WorkerGlobalScope interface represents an EventHandler to be called when the offline + * event occurs and bubbles through the Worker. + * + * MDN + */ var onoffline: js.Function1[Event, _] = js.native - /** - * The ononline property of the WorkerGlobalScope interface represents an - * EventHandler to be called when the online event occurs and bubbles through - * the Worker. - * - * MDN - */ + /** The ononline property of the WorkerGlobalScope interface represents an EventHandler to be called when the online + * event occurs and bubbles through the Worker. + * + * MDN + */ var ononline: js.Function1[Event, _] = js.native } -/** - * The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible - * through the self keyword. Some additional global functions, namespaces - * objects, and constructors, not typically associated with the worker global - * scope, but available on it, are listed in the JavaScript Reference. See also: - * Functions available to workers. - * - * MDN - */ +/** The DedicatedWorkerGlobalScope object (the Worker global scope) is accessible through the self keyword. Some + * additional global functions, namespaces objects, and constructors, not typically associated with the worker global + * scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. + * + * MDN + */ @js.native trait DedicatedWorkerGlobalScope extends WorkerGlobalScope { - /** - * The onmessage property of the DedicatedWorkerGlobalScope interface - * represents an EventHandler to be called when the message event occurs and - * bubbles through the Worker — i.e. when a message is sent to the worker - * using the Worker.postMessage method. - * - * MDN - */ + /** The onmessage property of the DedicatedWorkerGlobalScope interface represents an EventHandler to be called when + * the message event occurs and bubbles through the Worker — i.e. when a message is sent to the worker using the + * Worker.postMessage method. + * + * MDN + */ var onmessage: js.Function1[MessageEvent, _] = js.native - /** - * The postMessage() method of the DedicatedWorkerGlobalScope interface sends - * a message to the main thread that spawned it. This accepts a single - * parameter, which is the data to send to the worker. The data may be any - * value or JavaScript object handled by the structured clone algorithm, - * which includes cyclical references. - * - * The main scope that spawned the worker can send back information to the - * thread that spawned it using the Worker.postMessage method. - * - * MDN - * - * @param aMessage The object to deliver to the main thread; this will be in - * the data field in the event delivered to the Worker.onmessage - * handler. This may be any value or JavaScript object handled - * by the structured clone algorithm, which includes cyclical - * references. - * @param transferList An optional array of Transferable objects to transfer - * ownership of. If the ownership of an object is - * transferred, it becomes unusable (neutered) in the - * context it was sent from and it becomes available only - * to the main thread it was sent to. - * - */ - def postMessage(aMessage: js.Any, - transferList: js.UndefOr[ - js.Array[Transferable]] = js.native): Unit = js.native + /** The postMessage() method of the DedicatedWorkerGlobalScope interface sends a message to the main thread that + * spawned it. This accepts a single parameter, which is the data to send to the worker. The data may be any value or + * JavaScript object handled by the structured clone algorithm, which includes cyclical references. + * + * The main scope that spawned the worker can send back information to the thread that spawned it using the + * Worker.postMessage method. + * + * MDN + * + * @param aMessage + * The object to deliver to the main thread; this will be in the data field in the event delivered to the + * Worker.onmessage handler. This may be any value or JavaScript object handled by the structured clone algorithm, + * which includes cyclical references. + * @param transferList + * An optional array of Transferable objects to transfer ownership of. If the ownership of an object is + * transferred, it becomes unusable (neutered) in the context it was sent from and it becomes available only to the + * main thread it was sent to. + */ + def postMessage(aMessage: js.Any, transferList: js.UndefOr[js.Array[Transferable]] = js.native): Unit = js.native } @js.native @JSGlobalScope object DedicatedWorkerGlobalScope extends js.Object { - /** - * Returns an object reference to the DedicatedWorkerGlobalScope object itself. - * - * MDN - */ + /** Returns an object reference to the DedicatedWorkerGlobalScope object itself. + * + * MDN + */ def self: DedicatedWorkerGlobalScope = js.native } -/** - * The WorkerNavigator interface represents a subset of the [[Navigator]] - * interface allowed to be accessed from a Worker. Such an object is - * initialized for each worker and is available via the - * WorkerGlobalScope.navigator property obtained by calling - * window.self.navigator - * - * MDN - */ +/** The WorkerNavigator interface represents a subset of the [[Navigator]] interface allowed to be accessed from a + * Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property + * obtained by calling window.self.navigator + * + * MDN + */ @js.native -trait WorkerNavigator - extends NavigatorID with NavigatorOnLine with NavigatorLanguage - -/** - * The WorkerLocation interface defines the absolute location of the script - * executed by the Worker. Such an object is initialized for each worker - * and is available via the WorkerGlobalScope.location property obtained - * by calling window.self.location. - * - * MDN - */ +trait WorkerNavigator extends NavigatorID with NavigatorOnLine with NavigatorLanguage + +/** The WorkerLocation interface defines the absolute location of the script executed by the Worker. Such an object is + * initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling + * window.self.location. + * + * MDN + */ @js.native trait WorkerLocation extends js.Object { - /** - * Is a DOMString containing a '#' followed by the fragment identifier of the - * URL. - * - * MDN - */ + /** Is a DOMString containing a '#' followed by the fragment identifier of the URL. + * + * MDN + */ def hash: String = js.native - /** - * Is a DOMString containing the protocol scheme of the URL, including the - * final ':'. - * - * MDN - */ + /** Is a DOMString containing the protocol scheme of the URL, including the final ':'. + * + * MDN + */ def protocol: String = js.native - /** - * Is a DOMString containing a '?' followed by the parameters of the URL. - * - * MDN - */ + /** Is a DOMString containing a '?' followed by the parameters of the URL. + * + * MDN + */ def search: String = js.native - /** - * Is a DOMString containing the whole URL. - * - * MDN - */ + /** Is a DOMString containing the whole URL. + * + * MDN + */ def href: String = js.native - /** - * Is a DOMString containing the domain of the URL. - * - * MDN - */ + /** Is a DOMString containing the domain of the URL. + * + * MDN + */ def hostname: String = js.native - /** - * Is a DOMString containing the port number of the URL. - * - * MDN - */ + /** Is a DOMString containing the port number of the URL. + * + * MDN + */ def port: String = js.native - /** - * Is a DOMString containing an initial '/' followed by the path of the URL. - * - * MDN - */ + /** Is a DOMString containing an initial '/' followed by the path of the URL. + * + * MDN + */ def pathname: String = js.native - /** - * Is a DOMString containing the host, that is the hostname, a ':', and the - * port of the URL. - * - * MDN - */ + /** Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL. + * + * MDN + */ def host: String = js.native - /** - * The origin read-only property is a String containing the Unicode - * serialization of the origin of the represented URL, that is, for http and - * https, the scheme followed by '://', followed by the domain, followed by - * ':', followed by the port (the default port, 80 and 443 respectively, - * if explicitly specified). For URL using file: scheme, the value is browser - * dependant. - * - * MDN - */ + /** The origin read-only property is a String containing the Unicode serialization of the origin of the represented + * URL, that is, for http and https, the scheme followed by '://', followed by the domain, followed by ':', followed + * by the port (the default port, 80 and 443 respectively, if explicitly specified). For URL using file: scheme, the + * value is browser dependant. + * + * MDN + */ def origin: String = js.native } diff --git a/src/main/scala/org/scalajs/dom/WindowOrWorkerGlobalScope.scala b/src/main/scala/org/scalajs/dom/WindowOrWorkerGlobalScope.scala index 78add46ab..1cee8a328 100644 --- a/src/main/scala/org/scalajs/dom/WindowOrWorkerGlobalScope.scala +++ b/src/main/scala/org/scalajs/dom/WindowOrWorkerGlobalScope.scala @@ -4,122 +4,97 @@ import org.scalajs.dom.experimental.cachestorage.CacheStorage import scala.scalajs.js import scala.scalajs.js.| -/** - * The WindowOrWorkerGlobalScope mixin describes several features common to the - * Window and WorkerGlobalScope interfaces. - * - * Note: WindowOrWorkerGlobalScope is a mixin and not an interface; you can't - * actually create an object of type WindowOrWorkerGlobalScope. - * - * MDN - */ +/** The WindowOrWorkerGlobalScope mixin describes several features common to the Window and WorkerGlobalScope + * interfaces. + * + * Note: WindowOrWorkerGlobalScope is a mixin and not an interface; you can't actually create an object of type + * WindowOrWorkerGlobalScope. + * + * MDN + */ @js.native trait WindowOrWorkerGlobalScope extends WindowBase64 with WindowTimers { import WindowOrWorkerGlobalScope._ - /** - * Returns the CacheStorage object associated with the current context. - * This object enables functionality such as storing assets for offline use, - * and generating custom responses to requests. - * - * MDN - */ + /** Returns the CacheStorage object associated with the current context. This object enables functionality such as + * storing assets for offline use, and generating custom responses to requests. + * + * MDN + */ def caches: js.UndefOr[CacheStorage] = js.native - /** - * Returns a boolean value that indicates whether a SharedArrayBuffer can be - * sent via a Window.postMessage() call. - * - * MDN - */ + /** Returns a boolean value that indicates whether a SharedArrayBuffer can be sent via a Window.postMessage() call. + * + * MDN + */ def crossOriginIsolated: Boolean = js.native - /** - * Provides a mechanism for applications to asynchronously access - * capabilities of indexed databases. - * - * MDN - */ + /** Provides a mechanism for applications to asynchronously access capabilities of indexed databases. + * + * MDN + */ def indexedDB: js.UndefOr[IDBFactory] = js.native - /** - * Returns a boolean indicating whether the current context is secure or not. - * - * MDN - */ + /** Returns a boolean indicating whether the current context is secure or not. + * + * MDN + */ def isSecureContext: Boolean = js.native - /** - * Returns the origin of the global scope, serialized as a string. - * - * MDN - */ + /** Returns the origin of the global scope, serialized as a string. + * + * MDN + */ def origin: String = js.native //should be USVString - /** - * Starts the process of fetching a resource from the network. - * - * MDN - */ - def fetch(info: RequestInfo, - init: RequestInit = null): js.Promise[Response] = js.native - - /** - * Enqueues a microtask—a short function to be executed after execution of - * the JavaScript code completes and control isn't being returned to a - * JavaScript caller, but before handling callbacks and other tasks. - * - * This lets your code run without interfering with other, possibly higher - * priority, code, but before the browser runtime regains control, - * potentially depending upon the work you need to complete. - * - * MDN - */ + /** Starts the process of fetching a resource from the network. + * + * MDN + */ + def fetch(info: RequestInfo, init: RequestInit = null): js.Promise[Response] = js.native + + /** Enqueues a microtask—a short function to be executed after execution of the JavaScript code completes and control + * isn't being returned to a JavaScript caller, but before handling callbacks and other tasks. + * + * This lets your code run without interfering with other, possibly higher priority, code, but before the browser + * runtime regains control, potentially depending upon the work you need to complete. + * + * MDN + */ def queueMicrotask(function: js.Function0[Any]): Unit = js.native - /** - * Accepts a variety of different image sources, and returns a Promise which - * resolves to an ImageBitmap. - * Optionally the source is cropped to the rectangle of pixels originating at - * (sx, sy) with width sw, and height sh. - * - * MDN - */ - def createImageBitmap( - image: CreateImageBitmapInput): js.Promise[ImageBitmap] = js.native + /** Accepts a variety of different image sources, and returns a Promise which resolves to an ImageBitmap. Optionally + * the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh. + * + * MDN + */ + def createImageBitmap(image: CreateImageBitmapInput): js.Promise[ImageBitmap] = js.native def createImageBitmap(image: CreateImageBitmapInput, options: CreateImageBitmapOptions): js.Promise[ImageBitmap] = js.native - def createImageBitmap(image: CreateImageBitmapInput, sx: Double, sy: Double, - sw: Double, sh: Double): js.Promise[ImageBitmap] = js.native + def createImageBitmap(image: CreateImageBitmapInput, sx: Double, sy: Double, sw: Double, + sh: Double): js.Promise[ImageBitmap] = js.native - def createImageBitmap(image: CreateImageBitmapInput, sx: Double, sy: Double, - sw: Double, sh: Double, + def createImageBitmap(image: CreateImageBitmapInput, sx: Double, sy: Double, sw: Double, sh: Double, options: CreateImageBitmapOptions): js.Promise[ImageBitmap] = js.native } -/** - * The ImageBitmap interface represents a bitmap image which can be drawn to a - * <canvas> without undue latency. - * It can be created from a variety of source objects using the - * createImageBitmap() factory method. - * ImageBitmap provides an asynchronous and resource efficient pathway to - * prepare textures for rendering in WebGL. - * - * MDN - */ +/** The ImageBitmap interface represents a bitmap image which can be drawn to a <canvas> without undue latency. It + * can be created from a variety of source objects using the createImageBitmap() factory method. ImageBitmap provides + * an asynchronous and resource efficient pathway to prepare textures for rendering in WebGL. + * + * MDN + */ @js.native trait ImageBitmap extends js.Object { - /** - * An unsigned long representing the height, in CSS pixels, of the ImageData. - */ + /** An unsigned long representing the height, in CSS pixels, of the ImageData. + */ def height: Double = js.native - /** - * An unsigned long representing the width, in CSS pixels, of the ImageData. - */ + /** An unsigned long representing the width, in CSS pixels, of the ImageData. + */ def width: Double = js.native } diff --git a/src/main/scala/org/scalajs/dom/crypto/Crypto.scala b/src/main/scala/org/scalajs/dom/crypto/Crypto.scala index 833cd70fe..16d9a5175 100644 --- a/src/main/scala/org/scalajs/dom/crypto/Crypto.scala +++ b/src/main/scala/org/scalajs/dom/crypto/Crypto.scala @@ -12,29 +12,25 @@ object GlobalCrypto extends js.Object { val crypto: Crypto = js.native } -/** - * The Crypto interface represents basic cryptography features available in the - * current context. It allows access to a cryptographically strong random - * number generator and to cryptographic primitives. - * - * MDN - */ +/** The Crypto interface represents basic cryptography features available in the current context. It allows access to a + * cryptographically strong random number generator and to cryptographic primitives. + * + * MDN + */ @js.native trait Crypto extends js.Object { - /** - * Returns a SubtleCrypto object providing access to common cryptographic - * primitives, like hashing, signing, encryption or decryption. - * - * MDN - */ + /** Returns a SubtleCrypto object providing access to common cryptographic primitives, like hashing, signing, + * encryption or decryption. + * + * MDN + */ val subtle: SubtleCrypto = js.native - /** - * Fills the passed TypedArray with cryptographically sound random values. - * - * MDN - */ + /** Fills the passed TypedArray with cryptographically sound random values. + * + * MDN + */ def getRandomValues(array: ArrayBufferView): ArrayBufferView = js.native } @@ -43,23 +39,17 @@ trait Algorithm extends js.Object { var name: String = js.native } -/** - * The KeyAlgorithm dictionary represents information about the contents of a - * given CryptoKey object. - * - * See [[http://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary ¶12 KeyAlgorithm dictionary]] - * in w3c spec. - */ +/** The KeyAlgorithm dictionary represents information about the contents of a given CryptoKey object. + * + * See [[http://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary ¶12 KeyAlgorithm dictionary]] in w3c spec. + */ @js.native trait KeyAlgorithm extends Algorithm -/** - * A HashAlgorithm type is not defined in the - * [[http://www.w3.org/TR/WebCryptoAPI/ W3C Web Crypto API]], even though - * a [[http://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary KeyAlgorithm dictionary]] - * type is. There are nevertheless a number of indications that HashAlgorithm's - * are a type of their own, as searching the spec will show. - */ +/** A HashAlgorithm type is not defined in the [[http://www.w3.org/TR/WebCryptoAPI/ W3C Web Crypto API]], even though a + * [[http://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary KeyAlgorithm dictionary]] type is. There are + * nevertheless a number of indications that HashAlgorithm's are a type of their own, as searching the spec will show. + */ @js.native trait HashAlgorithm extends Algorithm @@ -74,12 +64,10 @@ object HashAlgorithm { val `SHA-512` = named("SHA-512") } -/** - * The CryptoKey object represents an opaque reference to keying material that - * is managed by the user agent. - * - * defined at [[http://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface ¶13 The CryptoKey Interface]] - */ +/** The CryptoKey object represents an opaque reference to keying material that is managed by the user agent. + * + * defined at [[http://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface ¶13 The CryptoKey Interface]] + */ @js.native trait CryptoKey extends js.Object { val `type`: String = js.native @@ -91,12 +79,9 @@ trait CryptoKey extends js.Object { val usages: js.Array[KeyUsage] = js.native } -/** - * The CryptoKeyPair dictionary represents an asymmetric key pair that is comprised - * of both public and private keys. - * defined at [[http://www.w3.org/TR/WebCryptoAPI/#keypair ¶17 CryptoKeyPair dictionary]] - * of spec - */ +/** The CryptoKeyPair dictionary represents an asymmetric key pair that is comprised of both public and private keys. + * defined at [[http://www.w3.org/TR/WebCryptoAPI/#keypair ¶17 CryptoKeyPair dictionary]] of spec + */ @js.native trait CryptoKeyPair extends js.Object { val publicKey: CryptoKey = js.native @@ -151,173 +136,128 @@ trait JsonWebKey extends js.Object { var k: String = js.native } -/** - * [[http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface w3c ¶14 Subtle Crytpo interface]] - * - * The SubtleCrypto interface represents a set of cryptographic primitives. - * It is available via the Crypto.subtle properties available in a window - * context (via Window.crypto). - * - * MDN - */ +/** [[http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface w3c ¶14 Subtle Crytpo interface]] + * + * The SubtleCrypto interface represents a set of cryptographic primitives. It is available via the Crypto.subtle + * properties available in a window context (via Window.crypto). + * + * MDN + */ @js.native trait SubtleCrypto extends js.Object { - /** - * Returns a Promise of the encrypted data corresponding to the clear text, - * algorithm and key given as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt ¶14.3.1 The encrypt method]] - */ - def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, + /** Returns a Promise of the encrypted data corresponding to the clear text, algorithm and key given as parameters. + * MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt ¶14.3.1 The encrypt method]] + */ + def encrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any] = js.native + + /** Returns a Promise of the clear data corresponding to the encrypted text, algorithm and key given as parameters. + * MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt ¶14.3.2 The decrypt method]] + */ + def decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any] = js.native + + /** Returns a Promise of the signature corresponding to the text, algorithm and key given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-sign ¶14.3.3 The sign method]] + */ + def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: BufferSource): js.Promise[js.Any] = js.native + + /** Returns a Promise of a Boolean value indicating if the signature given as parameter matches the text, algorithm + * and key also given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify ¶14.3.4 The verify method]] + */ + def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, signature: BufferSource, data: BufferSource): js.Promise[js.Any] = js.native - /** - * Returns a Promise of the clear data corresponding to the encrypted text, - * algorithm and key given as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt ¶14.3.2 The decrypt method]] - */ - def decrypt(algorithm: AlgorithmIdentifier, key: CryptoKey, - data: BufferSource): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of the signature corresponding to the text, algorithm - * and key given as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-sign ¶14.3.3 The sign method]] - */ - def sign(algorithm: AlgorithmIdentifier, key: CryptoKey, - data: BufferSource): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of a Boolean value indicating if the signature given as - * parameter matches the text, algorithm and key also given as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify ¶14.3.4 The verify method]] - */ - def verify(algorithm: AlgorithmIdentifier, key: CryptoKey, - signature: BufferSource, - data: BufferSource): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of a digest generated from the algorithm and text given - * as parameters. MDN - * - * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-digest ¶14.3.5 The digest method]] - * We are a bit more precise than the official definition by requiring a HashAlgorithmIdentifier - * rather than an AlgorithmIdentifier for the algorithm parameter. - */ - def digest(algorithm: HashAlgorithmIdentifier, - data: BufferSource): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of a newly generated CryptoKey, for symmetrical - * algorithms, or a CryptoKeyPair, containing two newly generated keys, for - * asymmetrical algorithm, that matches the algorithm, the usages and the - * extractability given as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey ¶14.3.6 The generateKey method]] - * - * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier - * rather than an AlgorithmIdentifier for the algorithm field. - * - */ + /** Returns a Promise of a digest generated from the algorithm and text given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-digest ¶14.3.5 The digest method]] We are a + * bit more precise than the official definition by requiring a HashAlgorithmIdentifier rather than an + * AlgorithmIdentifier for the algorithm parameter. + */ + def digest(algorithm: HashAlgorithmIdentifier, data: BufferSource): js.Promise[js.Any] = js.native + + /** Returns a Promise of a newly generated CryptoKey, for symmetrical algorithms, or a CryptoKeyPair, containing two + * newly generated keys, for asymmetrical algorithm, that matches the algorithm, the usages and the extractability + * given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey ¶14.3.6 The generateKey method]] + * + * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an + * AlgorithmIdentifier for the algorithm field. + */ def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native - /** - * Returns a Promise of a newly generated CryptoKey derivated from a master - * key and a specific algorithm given as parameters. MDF - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveKey ¶14.3.7 The deriveKey method]] - * - * We are being a bit more precise than the official definition by requiring KeyAlgorithmIdentifier for derivedKeyType - */ - def deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, - derivedKeyType: KeyAlgorithmIdentifier, extractable: Boolean, - keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of a newly generated buffer of pseudo-random bits - * derivated from a master key and a specific algorithm given as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveBits ¶14.3.8 The deriveBits method]] - */ - def deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, - length: Double): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of a CryptoKey corresponding to the format, the - * algorithm, the raw key data, the usages and the extractability given - * as parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey ¶14.3.9 The importKey method]] - * - * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier - * rather than an AlgorithmIdentifier for the algorithm field. - */ - def importKey(format: KeyFormat, keyData: BufferSource, - algorithm: KeyAlgorithmIdentifier, extractable: Boolean, + /** Returns a Promise of a newly generated CryptoKey derivated from a master key and a specific algorithm given as + * parameters. MDF + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveKey ¶14.3.7 The deriveKey method]] + * + * We are being a bit more precise than the official definition by requiring KeyAlgorithmIdentifier for + * derivedKeyType + */ + def deriveKey(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, derivedKeyType: KeyAlgorithmIdentifier, + extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native + + /** Returns a Promise of a newly generated buffer of pseudo-random bits derivated from a master key and a specific + * algorithm given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveBits ¶14.3.8 The deriveBits method]] + */ + def deriveBits(algorithm: AlgorithmIdentifier, baseKey: CryptoKey, length: Double): js.Promise[js.Any] = js.native + + /** Returns a Promise of a CryptoKey corresponding to the format, the algorithm, the raw key data, the usages and the + * extractability given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey ¶14.3.9 The importKey method]] + * + * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an + * AlgorithmIdentifier for the algorithm field. + */ + def importKey(format: KeyFormat, keyData: BufferSource, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey] = js.native - /** - * Returns a Promise of a CryptoKey corresponding to the format, the - * algorithm, the raw key data, the usages and the extractability given as - * parameters. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey ¶14.3.9 The importKey method]] - * - * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier - * rather than an AlgorithmIdentifier for the algorithm field. - */ - def importKey(format: KeyFormat, keyData: JsonWebKey, - algorithm: KeyAlgorithmIdentifier, extractable: Boolean, + /** Returns a Promise of a CryptoKey corresponding to the format, the algorithm, the raw key data, the usages and the + * extractability given as parameters. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey ¶14.3.9 The importKey method]] + * + * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an + * AlgorithmIdentifier for the algorithm field. + */ + def importKey(format: KeyFormat, keyData: JsonWebKey, algorithm: KeyAlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[CryptoKey] = js.native - /** - * Returns a Promise of a buffer containing the key in the format requested. - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-exportKey ¶14.3.10 The exportKey method]] - */ - def exportKey(format: KeyFormat, - key: CryptoKey): js.Promise[js.Any] = js.native - - /** - * Returns a Promise of a wrapped symmetric key for usage (transfer, storage) - * in unsecure environments. The wrapped buffer returned is in the format - * given in parameters, and contained the key wrapped by the give wrapping - * key with the given algorithm. - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey ¶14.3.11 The wrapKey method]] - */ + /** Returns a Promise of a buffer containing the key in the format requested. + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-exportKey ¶14.3.10 The exportKey method]] + */ + def exportKey(format: KeyFormat, key: CryptoKey): js.Promise[js.Any] = js.native + + /** Returns a Promise of a wrapped symmetric key for usage (transfer, storage) in unsecure environments. The wrapped + * buffer returned is in the format given in parameters, and contained the key wrapped by the give wrapping key with + * the given algorithm. + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey ¶14.3.11 The wrapKey method]] + */ def wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): js.Promise[js.Any] = js.native - /** - * Returns a Promise of a CryptoKey corresponding to the wrapped key given in - * parameter. MDN - * - * Defined at - * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-unwrapKey ¶14.3.12 The unwrapKey method]] - * - * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier - * rather than an AlgorithmIdentifier. - */ - def unwrapKey(format: String, wrappedKey: BufferSource, - unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, - unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Boolean, + /** Returns a Promise of a CryptoKey corresponding to the wrapped key given in parameter. MDN + * + * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-unwrapKey ¶14.3.12 The unwrapKey method]] + * + * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier rather than an + * AlgorithmIdentifier. + */ + def unwrapKey(format: String, wrappedKey: BufferSource, unwrappingKey: CryptoKey, + unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: Boolean, keyUsages: js.Array[KeyUsage]): js.Promise[js.Any] = js.native } @@ -331,12 +271,11 @@ trait RsaKeyGenParams extends KeyAlgorithm { } object RsaKeyGenParams { + @inline - def apply(name: String, modulusLength: Long, - publicExponent: BigInteger): RsaKeyGenParams = { + def apply(name: String, modulusLength: Long, publicExponent: BigInteger): RsaKeyGenParams = { js.Dynamic - .literal(name = name, modulusLength = modulusLength.toDouble, - publicExponent = publicExponent) + .literal(name = name, modulusLength = modulusLength.toDouble, publicExponent = publicExponent) .asInstanceOf[RsaKeyGenParams] } } @@ -347,12 +286,13 @@ trait RsaHashedKeyGenParams extends RsaKeyGenParams { } object RsaHashedKeyGenParams { + @inline def apply(name: String, modulusLength: Long, publicExponent: BigInteger, hash: HashAlgorithmIdentifier): RsaHashedKeyGenParams = { js.Dynamic - .literal(name = name, modulusLength = modulusLength.toDouble, - publicExponent = publicExponent, hash = hash.asInstanceOf[js.Any]) + .literal(name = name, modulusLength = modulusLength.toDouble, publicExponent = publicExponent, + hash = hash.asInstanceOf[js.Any]) .asInstanceOf[RsaHashedKeyGenParams] } } @@ -365,59 +305,55 @@ trait RsaKeyAlgorithm extends KeyAlgorithm { } object RsaKeyAlgorithm { + @inline - def apply(name: String, modulusLength: Long, - publicExponent: BigInteger): RsaKeyAlgorithm = { + def apply(name: String, modulusLength: Long, publicExponent: BigInteger): RsaKeyAlgorithm = { js.Dynamic - .literal(name = name, modulusLength = modulusLength.toDouble, - publicExponent = publicExponent) + .literal(name = name, modulusLength = modulusLength.toDouble, publicExponent = publicExponent) .asInstanceOf[RsaKeyAlgorithm] } } -/** - * see W3C doc [[http://www.w3.org/TR/WebCryptoAPI/#RsaHashedKeyAlgorithm-dictionary 20.6. RsaHashedKeyAlgorithm dictionary]] - */ +/** see W3C doc + * [[http://www.w3.org/TR/WebCryptoAPI/#RsaHashedKeyAlgorithm-dictionary 20.6. RsaHashedKeyAlgorithm dictionary]] + */ @js.native trait RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { - /** - * Note that section [[http://www.w3.org/TR/WebCryptoAPI/#RsaHashedKeyAlgorithm-dictionary 20.6. RsaHashedKeyAlgorithm dictionary]] - * of the W3C documentation uses a KeyAlgorithm here, and not what seems more correct a - * HashAlgorithmIdentifier. - */ + /** Note that section + * [[http://www.w3.org/TR/WebCryptoAPI/#RsaHashedKeyAlgorithm-dictionary 20.6. RsaHashedKeyAlgorithm dictionary]] of + * the W3C documentation uses a KeyAlgorithm here, and not what seems more correct a HashAlgorithmIdentifier. + */ var hash: HashAlgorithmIdentifier = js.native } object RsaHashedKeyAlgorithm { + @inline def apply(name: String, modulusLength: Long, publicExponent: BigInteger, hash: HashAlgorithmIdentifier): RsaHashedKeyAlgorithm = { js.Dynamic - .literal(name = name, modulusLength = modulusLength.toDouble, - publicExponent = publicExponent, hash = hash.asInstanceOf[js.Any]) + .literal(name = name, modulusLength = modulusLength.toDouble, publicExponent = publicExponent, + hash = hash.asInstanceOf[js.Any]) .asInstanceOf[RsaHashedKeyAlgorithm] } - /** - * see [[http://www.w3.org/TR/WebCryptoAPI/#rsassa-pkcs1 ¶20. RSASSA-PKCS1-v1_5]] of w3c spec - */ + /** see [[http://www.w3.org/TR/WebCryptoAPI/#rsassa-pkcs1 ¶20. RSASSA-PKCS1-v1_5]] of w3c spec + */ def `RSASSA-PKCS1-v1_5`(modulusLength: Long, publicExponent: BigInteger, hash: HashAlgorithmIdentifier): RsaHashedKeyAlgorithm = { apply("RSASSA-PKCS1-v1_5", modulusLength, publicExponent, hash) } - /** - * see [[http://www.w3.org/TR/WebCryptoAPI/#rsa-pss ¶21. RSA-PSS]] of w3c spec - */ + /** see [[http://www.w3.org/TR/WebCryptoAPI/#rsa-pss ¶21. RSA-PSS]] of w3c spec + */ def `RSA-PSS`(modulusLength: Long, publicExponent: BigInteger, hash: HashAlgorithmIdentifier): RsaHashedKeyAlgorithm = { apply("RSA-PSS", modulusLength, publicExponent, hash) } - /** - * see [[http://www.w3.org/TR/WebCryptoAPI/#rsa-pss ¶21. RSA-OAEP]] of w3c spec - */ + /** see [[http://www.w3.org/TR/WebCryptoAPI/#rsa-pss ¶21. RSA-OAEP]] of w3c spec + */ def `RSA-OAEP`(modulusLength: Long, publicExponent: BigInteger, hash: HashAlgorithmIdentifier): RsaHashedKeyAlgorithm = { apply("RSA-OAEP", modulusLength, publicExponent, hash) @@ -430,9 +366,9 @@ trait RsaHashedImportParams extends KeyAlgorithm { } object RsaHashedImportParams { + @inline - def apply(name: String, - hash: HashAlgorithmIdentifier): RsaHashedImportParams = { + def apply(name: String, hash: HashAlgorithmIdentifier): RsaHashedImportParams = { js.Dynamic .literal(name = name, hash = hash.asInstanceOf[js.Any]) .asInstanceOf[RsaHashedImportParams] @@ -447,6 +383,7 @@ trait RsaPssParams extends Algorithm { } object RsaPssParams { + @inline def apply(name: String, saltLength: Long): RsaPssParams = { js.Dynamic @@ -463,6 +400,7 @@ trait RsaOaepParams extends Algorithm { } object RsaOaepParams { + @inline def apply(name: String, label: BufferSource): RsaOaepParams = { js.Dynamic @@ -479,6 +417,7 @@ trait EcdsaParams extends Algorithm { } object EcdsaParams { + @inline def apply(name: String, hash: HashAlgorithmIdentifier): EcdsaParams = { js.Dynamic @@ -493,6 +432,7 @@ trait EcKeyGenParams extends Algorithm { } object EcKeyGenParams { + @inline def apply(name: String, namedCurve: String): EcKeyGenParams = { js.Dynamic @@ -507,6 +447,7 @@ trait EcKeyAlgorithm extends KeyAlgorithm { } object EcKeyAlgorithm { + @inline def apply(name: String, namedCurve: String): EcKeyAlgorithm = { js.Dynamic @@ -521,6 +462,7 @@ trait EcKeyImportParams extends KeyAlgorithm { } object EcKeyImportParams { + @inline def apply(name: String, namedCurve: String): EcKeyImportParams = { js.Dynamic @@ -537,6 +479,7 @@ trait EcdhKeyDeriveParams extends KeyAlgorithm { } object EcdhKeyDeriveParams { + @inline def apply(name: String, `public`: CryptoKey): EcdhKeyDeriveParams = { js.Dynamic @@ -555,12 +498,11 @@ trait AesCtrParams extends Algorithm { } object AesCtrParams { + @inline - def apply(name: String, counter: BufferSource, - length: Short): AesCtrParams = { + def apply(name: String, counter: BufferSource, length: Short): AesCtrParams = { js.Dynamic - .literal(name = name, counter = counter.asInstanceOf[js.Any], - length = length) + .literal(name = name, counter = counter.asInstanceOf[js.Any], length = length) .asInstanceOf[AesCtrParams] } } @@ -571,6 +513,7 @@ trait AesKeyAlgorithm extends KeyAlgorithm { } object AesKeyAlgorithm { + @inline def apply(name: String, length: Short): AesKeyAlgorithm = { js.Dynamic @@ -585,6 +528,7 @@ trait AesKeyGenParams extends KeyAlgorithm { } object AesKeyGenParams { + @inline def apply(name: String, length: Short): AesKeyGenParams = { js.Dynamic @@ -599,6 +543,7 @@ trait AesDerivedKeyParams extends KeyAlgorithm { } object AesDerivedKeyParams { + @inline def apply(name: String, length: Short): AesDerivedKeyParams = { js.Dynamic @@ -615,6 +560,7 @@ trait AesCbcParams extends Algorithm { } object AesCbcParams { + @inline def apply(name: String, iv: BufferSource): AesCbcParams = { js.Dynamic @@ -631,6 +577,7 @@ trait AesCmacParams extends Algorithm { } object AesCmacParams { + @inline def apply(name: String, length: Int): AesCmacParams = { js.Dynamic @@ -651,12 +598,11 @@ trait AesGcmParams extends Algorithm { } object AesGcmParams { + @inline - def apply(name: String, iv: BufferSource, additionalData: BufferSource, - tagLength: Short): AesGcmParams = { + def apply(name: String, iv: BufferSource, additionalData: BufferSource, tagLength: Short): AesGcmParams = { js.Dynamic - .literal(name = name, iv = iv.asInstanceOf[js.Any], - additionalData = additionalData.asInstanceOf[js.Any], + .literal(name = name, iv = iv.asInstanceOf[js.Any], additionalData = additionalData.asInstanceOf[js.Any], tagLength = tagLength) .asInstanceOf[AesGcmParams] } @@ -670,6 +616,7 @@ trait AesCfbParams extends Algorithm { } object AesCfbParams { + @inline def apply(name: String, iv: BufferSource): AesCfbParams = js.Dynamic @@ -689,12 +636,11 @@ trait HmacImportParams extends Algorithm { } object HmacImportParams { + @inline - def apply(name: String, hash: HashAlgorithmIdentifier, - length: Long): HmacImportParams = { + def apply(name: String, hash: HashAlgorithmIdentifier, length: Long): HmacImportParams = { js.Dynamic - .literal(name = name, hash = hash.asInstanceOf[js.Any], - length = length.toDouble) + .literal(name = name, hash = hash.asInstanceOf[js.Any], length = length.toDouble) .asInstanceOf[HmacImportParams] } } @@ -707,12 +653,11 @@ trait HmacKeyAlgorithm extends KeyAlgorithm { } object HmacKeyAlgorithm { + @inline - def apply(name: String, hash: HashAlgorithmIdentifier, - length: Long): HmacKeyAlgorithm = { + def apply(name: String, hash: HashAlgorithmIdentifier, length: Long): HmacKeyAlgorithm = { js.Dynamic - .literal(name = name, hash = hash.asInstanceOf[js.Any], - length = length.toDouble) + .literal(name = name, hash = hash.asInstanceOf[js.Any], length = length.toDouble) .asInstanceOf[HmacKeyAlgorithm] } } @@ -725,12 +670,11 @@ trait HmacKeyGenParams extends KeyAlgorithm { } object HmacKeyGenParams { + @inline - def apply(name: String, hash: HashAlgorithmIdentifier, - length: Long): HmacKeyGenParams = { + def apply(name: String, hash: HashAlgorithmIdentifier, length: Long): HmacKeyGenParams = { js.Dynamic - .literal(name = name, hash = hash.asInstanceOf[js.Any], - length = length.toDouble) + .literal(name = name, hash = hash.asInstanceOf[js.Any], length = length.toDouble) .asInstanceOf[HmacKeyGenParams] } } @@ -745,9 +689,9 @@ trait DhKeyGenParams extends Algorithm { } object DhKeyGenParams { + @inline - def apply(name: String, prime: BigInteger, - generator: BigInteger): DhKeyGenParams = { + def apply(name: String, prime: BigInteger, generator: BigInteger): DhKeyGenParams = { js.Dynamic .literal(name = name, prime = prime, generator = generator) .asInstanceOf[DhKeyGenParams] @@ -762,9 +706,9 @@ trait DhKeyAlgorithm extends KeyAlgorithm { } object DhKeyAlgorithm { + @inline - def apply(name: String, prime: BigInteger, - generator: BigInteger): DhKeyAlgorithm = { + def apply(name: String, prime: BigInteger, generator: BigInteger): DhKeyAlgorithm = { js.Dynamic .literal(name = name, prime = prime, generator = generator) .asInstanceOf[DhKeyAlgorithm] @@ -777,6 +721,7 @@ trait DhKeyDeriveParams extends Algorithm { } object DhKeyDeriveParams { + @inline def apply(name: String, public: CryptoKey): DhKeyDeriveParams = { js.Dynamic @@ -793,9 +738,9 @@ trait DhImportKeyParams extends Algorithm { } object DhImportKeyParams { + @inline - def apply(name: String, prime: BigInteger, - generator: BigInteger): DhImportKeyParams = { + def apply(name: String, prime: BigInteger, generator: BigInteger): DhImportKeyParams = { js.Dynamic .literal(name = name, prime = prime, generator = generator) .asInstanceOf[DhImportKeyParams] @@ -820,18 +765,14 @@ trait ConcatParams extends Algorithm { } object ConcatParams { + @inline - def apply(name: String, hash: HashAlgorithmIdentifier, - algorithmId: BufferSource, partyUInfo: BufferSource, - partyVInfo: BufferSource, publicInfo: BufferSource, - privateInfo: BufferSource): ConcatParams = { + def apply(name: String, hash: HashAlgorithmIdentifier, algorithmId: BufferSource, partyUInfo: BufferSource, + partyVInfo: BufferSource, publicInfo: BufferSource, privateInfo: BufferSource): ConcatParams = { js.Dynamic - .literal(name = name, hash = hash.asInstanceOf[js.Any], - algorithmId = algorithmId.asInstanceOf[js.Any], - partyUInfo = partyUInfo.asInstanceOf[js.Any], - partyVInfo = partyVInfo.asInstanceOf[js.Any], - publicInfo = publicInfo.asInstanceOf[js.Any], - privateInfo = privateInfo.asInstanceOf[js.Any]) + .literal(name = name, hash = hash.asInstanceOf[js.Any], algorithmId = algorithmId.asInstanceOf[js.Any], + partyUInfo = partyUInfo.asInstanceOf[js.Any], partyVInfo = partyVInfo.asInstanceOf[js.Any], + publicInfo = publicInfo.asInstanceOf[js.Any], privateInfo = privateInfo.asInstanceOf[js.Any]) .asInstanceOf[ConcatParams] } } @@ -848,12 +789,11 @@ trait HkdfCtrParams extends Algorithm { } object HkdfCtrParams { + @inline - def apply(name: String, hash: HashAlgorithmIdentifier, label: BufferSource, - context: BufferSource): HkdfCtrParams = { + def apply(name: String, hash: HashAlgorithmIdentifier, label: BufferSource, context: BufferSource): HkdfCtrParams = { js.Dynamic - .literal(name = name, hash = hash.asInstanceOf[js.Any], - label = label.asInstanceOf[js.Any], + .literal(name = name, hash = hash.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], context = context.asInstanceOf[js.Any]) .asInstanceOf[HkdfCtrParams] } @@ -871,19 +811,18 @@ trait Pbkdf2Params extends HashAlgorithm { } object Pbkdf2Params { + @inline - def apply(name: String, salt: BufferSource, iterations: Long, - hash: HashAlgorithmIdentifier): Pbkdf2Params = { + def apply(name: String, salt: BufferSource, iterations: Long, hash: HashAlgorithmIdentifier): Pbkdf2Params = { js.Dynamic - .literal(name = name, salt = salt.asInstanceOf[js.Any], - iterations = iterations.toDouble, hash = hash.asInstanceOf[js.Any]) + .literal(name = name, salt = salt.asInstanceOf[js.Any], iterations = iterations.toDouble, + hash = hash.asInstanceOf[js.Any]) .asInstanceOf[Pbkdf2Params] } } -/** - * See [[http://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface ¶ 13. CryptoKey Interface]] of w3c spec - */ +/** See [[http://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface ¶ 13. CryptoKey Interface]] of w3c spec + */ @js.native trait KeyUsage extends js.Any @@ -898,9 +837,8 @@ object KeyUsage { val unwrapKey = "unwrapKey".asInstanceOf[KeyUsage] } -/** - * see [[http://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface ¶13 CryptoKey interface]] in W3C doc - */ +/** see [[http://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface ¶13 CryptoKey interface]] in W3C doc + */ @js.native trait KeyType extends js.Any @@ -910,9 +848,8 @@ object KeyType { val secret = "secret".asInstanceOf[KeyType] } -/** - * see [[http://www.w3.org/TR/WebCryptoAPI/#dfn-KeyFormat ¶14.2 Data Types]] in W3C spec - */ +/** see [[http://www.w3.org/TR/WebCryptoAPI/#dfn-KeyFormat ¶14.2 Data Types]] in W3C spec + */ @js.native trait KeyFormat extends js.Any @@ -936,10 +873,8 @@ object KeyFormat { // http://tools.ietf.org/html/rfc7517 // -/** - * see example http://tools.ietf.org/html/rfc7517#appendix-A.1 - * //todo: where is the specification of n and e? - */ +/** see example http://tools.ietf.org/html/rfc7517#appendix-A.1 //todo: where is the specification of n and e? + */ @js.native trait RSAPublicKey extends js.Object { diff --git a/src/main/scala/org/scalajs/dom/crypto/package.scala b/src/main/scala/org/scalajs/dom/crypto/package.scala index 317909bb1..eeda81eee 100644 --- a/src/main/scala/org/scalajs/dom/crypto/package.scala +++ b/src/main/scala/org/scalajs/dom/crypto/package.scala @@ -6,31 +6,28 @@ import scala.scalajs.js.typedarray.Uint8Array import scala.scalajs.js.| package object crypto { + @js.native @JSGlobal("crypto") val crypto: Crypto = js.native type BigInteger = Uint8Array - /** - * According to [[http://www.w3.org/TR/WebCryptoAPI/#algorithm-dictionary ¶11 Algorithm Identifier]] - * of the WebCryptoAPI an AlgorithmIdentifier is an `object or DOMString`. We make this more precise - * here and specify an Algorithm. - * note: it may be that we can do only with KeyAlgorithmIdentifier and HashAlgorithmIdentifier - */ + /** According to [[http://www.w3.org/TR/WebCryptoAPI/#algorithm-dictionary ¶11 Algorithm Identifier]] of the + * WebCryptoAPI an AlgorithmIdentifier is an `object or DOMString`. We make this more precise here and specify an + * Algorithm. note: it may be that we can do only with KeyAlgorithmIdentifier and HashAlgorithmIdentifier + */ type AlgorithmIdentifier = Algorithm | String - /** - * According to [[http://www.w3.org/TR/WebCryptoAPI/#algorithm-dictionary ¶11 Algorithm Identifier]] - * of the WebCryptoAPI an AlgorithmIdentifier is an `object or DOMString`. We make this more precise - * here and distinguish the non overlapping classes of Key and Hash Algorithms. - */ + /** According to [[http://www.w3.org/TR/WebCryptoAPI/#algorithm-dictionary ¶11 Algorithm Identifier]] of the + * WebCryptoAPI an AlgorithmIdentifier is an `object or DOMString`. We make this more precise here and distinguish + * the non overlapping classes of Key and Hash Algorithms. + */ type KeyAlgorithmIdentifier = KeyAlgorithm | String - /** - * According to [[http://www.w3.org/TR/WebCryptoAPI/#algorithm-dictionary ¶11 Algorithm Identifier]] - * a HashAlgorithmIdentifier is an AlgorithmIdentifier. Here we distinguish between Hash and Key - * Algorithm Identifiers. At the JS layer these have the same structure. - */ + /** According to [[http://www.w3.org/TR/WebCryptoAPI/#algorithm-dictionary ¶11 Algorithm Identifier]] a + * HashAlgorithmIdentifier is an AlgorithmIdentifier. Here we distinguish between Hash and Key Algorithm Identifiers. + * At the JS layer these have the same structure. + */ type HashAlgorithmIdentifier = HashAlgorithm | String } diff --git a/src/main/scala/org/scalajs/dom/experimental/FileReaderSync.scala b/src/main/scala/org/scalajs/dom/experimental/FileReaderSync.scala index 3123b2df6..ce1ef8cd5 100644 --- a/src/main/scala/org/scalajs/dom/experimental/FileReaderSync.scala +++ b/src/main/scala/org/scalajs/dom/experimental/FileReaderSync.scala @@ -6,43 +6,37 @@ import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.typedarray.ArrayBuffer -/** - * The FileReaderSync interface allows to read File or Blob objects synchronously. - * - * This interface is only available in workers as it enables synchronous I/O that could potentially block. - * - * MDN - */ +/** The FileReaderSync interface allows to read File or Blob objects synchronously. + * + * This interface is only available in workers as it enables synchronous I/O that could potentially block. + * + * MDN + */ @js.native @JSGlobal class FileReaderSync() extends js.Object { - /** - * The readAsArrayBuffer method is used to starts reading the contents of the - * specified Blob or File. When the read operation is finished, the readyState - * becomes DONE, and the loadend is triggered. At that time, the result attribute - * contains an ArrayBuffer representing the file's data. - * - * MDN - */ + /** The readAsArrayBuffer method is used to starts reading the contents of the specified Blob or File. When the read + * operation is finished, the readyState becomes DONE, and the loadend is triggered. At that time, the result + * attribute contains an ArrayBuffer representing the file's data. + * + * MDN + */ def readAsArrayBuffer(blob: Blob): ArrayBuffer = js.native - /** - * The readAsDataURL method is used to starts reading the contents of the specified - * Blob or File. When the read operation is finished, the readyState becomes DONE, and - * the loadend is triggered. At that time, the result attribute contains a data: URL - * representing the file's data as base64 encoded string. - * - * MDN - */ + /** The readAsDataURL method is used to starts reading the contents of the specified Blob or File. When the read + * operation is finished, the readyState becomes DONE, and the loadend is triggered. At that time, the result + * attribute contains a data: URL representing the file's data as base64 encoded string. + * + * MDN + */ def readAsDataURL(blob: Blob): dom.URL = js.native - /** - * The readAsText method is used to read the contents of the specified Blob or File. - * When the read operation is complete, the readyState is changed to DONE, the loadend - * is triggered, and the result attribute contains the contents of the file as a text string. - * - * MDN - */ + /** The readAsText method is used to read the contents of the specified Blob or File. When the read operation is + * complete, the readyState is changed to DONE, the loadend is triggered, and the result attribute contains the + * contents of the file as a text string. + * + * MDN + */ def readAsText(blob: Blob, encoding: String = js.native): String = js.native } diff --git a/src/main/scala/org/scalajs/dom/experimental/Fullscreen.scala b/src/main/scala/org/scalajs/dom/experimental/Fullscreen.scala index f77b8bd3d..02f75fb15 100644 --- a/src/main/scala/org/scalajs/dom/experimental/Fullscreen.scala +++ b/src/main/scala/org/scalajs/dom/experimental/Fullscreen.scala @@ -1,6 +1,4 @@ package org.scalajs.dom.experimental -@deprecated( - "the extensions provided by Fullscreen are now available by default", - "2.0.0") +@deprecated("the extensions provided by Fullscreen are now available by default", "2.0.0") object Fullscreen diff --git a/src/main/scala/org/scalajs/dom/experimental/PointerLock.scala b/src/main/scala/org/scalajs/dom/experimental/PointerLock.scala index 83d7f8758..34af990e1 100644 --- a/src/main/scala/org/scalajs/dom/experimental/PointerLock.scala +++ b/src/main/scala/org/scalajs/dom/experimental/PointerLock.scala @@ -4,11 +4,11 @@ import org.scalajs.dom.{Document, Element, Event, MouseEvent} import scala.language.implicitConversions import scala.scalajs.js -/** - * Pointer Lock API - * - * @see [[https://www.w3.org/TR/2013/CR-pointerlock-20131217/ Pointer Lock W3C Candidate Recommendation]] - */ +/** Pointer Lock API + * + * @see + * [[https://www.w3.org/TR/2013/CR-pointerlock-20131217/ Pointer Lock W3C Candidate Recommendation]] + */ object PointerLock { implicit def toPointerLockDocument(document: Document): PointerLockDocument = @@ -23,84 +23,69 @@ object PointerLock { @js.native trait PointerLockDocument extends js.Object { - /** - * When the Pointer lock state changes—for example, when calling - * requestPointerLock, exitPointerLock, the user pressing the ESC key, - * etc.—the pointerlockchange event is dispatched to the document. - * This is a simple event and contains no extra data. - * - * MDN - */ + /** When the Pointer lock state changes—for example, when calling requestPointerLock, exitPointerLock, the user + * pressing the ESC key, etc.—the pointerlockchange event is dispatched to the document. This is a simple event and + * contains no extra data. + * + * MDN + */ var onpointerlockchange: js.Function1[Event, _] = js.native - /** - * When there is an error caused by calling requestPointerLock or - * exitPointerLock, the pointerlockerror event is dispatched to the document. - * This is a simple event and contains no extra data. - * - * MDN - */ + /** When there is an error caused by calling requestPointerLock or exitPointerLock, the pointerlockerror event is + * dispatched to the document. This is a simple event and contains no extra data. + * + * MDN + */ var onpointerlockerror: js.Function1[Event, _] = js.native - /** - * The pointerLockElement property provides the element set as the target - * for mouse events while the pointer is locked. - * It is `null` if lock is pending, pointer is unlocked, or the target is - * in another document. - * - * MDN - */ + /** The pointerLockElement property provides the element set as the target for mouse events while the pointer is + * locked. It is `null` if lock is pending, pointer is unlocked, or the target is in another document. + * + * MDN + */ def pointerLockElement: Element = js.native - /** - * The exitPointerLock asynchronously releases a pointer lock previously - * requested through Element.requestPointerLock. - * - * To track the success or failure of the request, it is necessary to listen - * for the pointerlockchange and pointerlockerror events. - * - * MDN - */ + /** The exitPointerLock asynchronously releases a pointer lock previously requested through + * Element.requestPointerLock. + * + * To track the success or failure of the request, it is necessary to listen for the pointerlockchange and + * pointerlockerror events. + * + * MDN + */ def exitPointerLock(): Unit = js.native } @js.native trait PointerLockElement extends js.Object { - /** - * The Element.requestPointerLock() method allows to asynchronously ask for - * the pointer to be locked on the given element. - * - * To track the success or failure of the request, it is necessary to listen - * for the pointerlockchange and pointerlockerror events at the Document - * level. - * - * MDN - */ + /** The Element.requestPointerLock() method allows to asynchronously ask for the pointer to be locked on the given + * element. + * + * To track the success or failure of the request, it is necessary to listen for the pointerlockchange and + * pointerlockerror events at the Document level. + * + * MDN + */ def requestPointerLock(): Unit = js.native } - /** - * Two new parameters to mouse events—movementX and movementY—provide the - * change in mouse positions. The values of the parameters are the same as - * the difference between the values of MouseEvent properties, screenX and - * screenY, which are stored in two subsequent mousemove events, eNow and - * ePrevious. In other words, the Pointer lock parameter - * `movementX = eNow.screenX - ePrevious.screenX`. - * - * When Pointer lock is enabled, the standard MouseEvent properties clientX, - * clientY, screenX, and screenY are held constant, as if the mouse is not - * moving. The movementX and movementY properties continue to provide the - * mouse's change in position. There is no limit to movementX and movementY - * values if the mouse is continuously moving in a single direction. - * The concept of the mouse cursor does not exist and the cursor cannot move - * off the window or be clamped by a screen edge. - * - * The parameters movementX and movementY are valid regardless of the mouse - * lock state, and are available even when unlocked for convenience. - * - * MDN - */ + /** Two new parameters to mouse events—movementX and movementY—provide the change in mouse positions. The values of + * the parameters are the same as the difference between the values of MouseEvent properties, screenX and screenY, + * which are stored in two subsequent mousemove events, eNow and ePrevious. In other words, the Pointer lock + * parameter `movementX = eNow.screenX - ePrevious.screenX`. + * + * When Pointer lock is enabled, the standard MouseEvent properties clientX, clientY, screenX, and screenY are held + * constant, as if the mouse is not moving. The movementX and movementY properties continue to provide the mouse's + * change in position. There is no limit to movementX and movementY values if the mouse is continuously moving in a + * single direction. The concept of the mouse cursor does not exist and the cursor cannot move off the window or be + * clamped by a screen edge. + * + * The parameters movementX and movementY are valid regardless of the mouse lock state, and are available even when + * unlocked for convenience. + * + * MDN + */ @js.native trait PointerLockMouseEvent extends js.Object { def movementX: Double = js.native diff --git a/src/main/scala/org/scalajs/dom/experimental/Vibration.scala b/src/main/scala/org/scalajs/dom/experimental/Vibration.scala index 025fd9907..2bb1b18ec 100644 --- a/src/main/scala/org/scalajs/dom/experimental/Vibration.scala +++ b/src/main/scala/org/scalajs/dom/experimental/Vibration.scala @@ -1,5 +1,4 @@ package org.scalajs.dom.experimental -@deprecated("the extensions of Vibration are now available by default", - "2.0.0") +@deprecated("the extensions of Vibration are now available by default", "2.0.0") object Vibration diff --git a/src/main/scala/org/scalajs/dom/experimental/beacon/package.scala b/src/main/scala/org/scalajs/dom/experimental/beacon/package.scala index 58bc10944..8bf55db4b 100644 --- a/src/main/scala/org/scalajs/dom/experimental/beacon/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/beacon/package.scala @@ -5,59 +5,56 @@ import org.scalajs.dom.{Navigator, WorkerNavigator} import scala.language.implicitConversions import scala.scalajs.js -/** - * The Beacon interface is used to schedule an asynchronous and non-blocking - * request to a web server. Beacon requests use the HTTP PUT method and requests - * typically do not require a response. Requests are guaranteed to be initiated - * before a page is unloaded and they are run to completion without requiring a - * blocking request (for example XMLHttpRequest). - * - * MDN - * - * @see [[https://www.w3.org/TR/2016/WD-beacon-20160204/ Beacon W3C Working Draft]] - * @see [[https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API MDN Beacon API]] - */ +/** The Beacon interface is used to schedule an asynchronous and non-blocking request to a web server. Beacon requests + * use the HTTP PUT method and requests typically do not require a response. Requests are guaranteed to be initiated + * before a page is unloaded and they are run to completion without requiring a blocking request (for example + * XMLHttpRequest). + * + * MDN + * + * @see + * [[https://www.w3.org/TR/2016/WD-beacon-20160204/ Beacon W3C Working Draft]] + * @see + * [[https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API MDN Beacon API]] + */ package object beacon { implicit def toBeaconNavigator(n: Navigator): BeaconNavigator = n.asInstanceOf[BeaconNavigator] - implicit def toBeaconWorkerNavigator( - n: WorkerNavigator): BeaconWorkerNavigator = { + implicit def toBeaconWorkerNavigator(n: WorkerNavigator): BeaconWorkerNavigator = { n.asInstanceOf[BeaconWorkerNavigator] } @js.native trait BeaconNavigator extends js.Object { - /** - * The navigator.sendBeacon() method can be used to asynchronously transfer - * small HTTP data from the User Agent to a web server. - * - * MDN - * - * @param url The url parameter indicates the resolved URL where the data - * is to be transmitted. - * @param data The data parameter is the ArrayBufferView, Blob, DOMString, - * or FormData data that is to be transmitted. - */ + /** The navigator.sendBeacon() method can be used to asynchronously transfer small HTTP data from the User Agent to + * a web server. + * + * MDN + * + * @param url + * The url parameter indicates the resolved URL where the data is to be transmitted. + * @param data + * The data parameter is the ArrayBufferView, Blob, DOMString, or FormData data that is to be transmitted. + */ def sendBeacon(url: String, data: dom.BodyInit = null): Boolean = js.native } @js.native trait BeaconWorkerNavigator extends js.Object { - /** - * The navigator.sendBeacon() method can be used to asynchronously transfer - * small HTTP data from the User Agent to a web server. - * - * MDN - * - * @param url The url parameter indicates the resolved URL where the data - * is to be transmitted. - * @param data The data parameter is the ArrayBufferView, Blob, DOMString, - * or FormData data that is to be transmitted. - */ + /** The navigator.sendBeacon() method can be used to asynchronously transfer small HTTP data from the User Agent to + * a web server. + * + * MDN + * + * @param url + * The url parameter indicates the resolved URL where the data is to be transmitted. + * @param data + * The data parameter is the ArrayBufferView, Blob, DOMString, or FormData data that is to be transmitted. + */ def sendBeacon(url: String, data: dom.BodyInit = null): Boolean = js.native } } diff --git a/src/main/scala/org/scalajs/dom/experimental/cachestorage/CacheStorage.scala b/src/main/scala/org/scalajs/dom/experimental/cachestorage/CacheStorage.scala index 8a17befb2..339da48e7 100644 --- a/src/main/scala/org/scalajs/dom/experimental/cachestorage/CacheStorage.scala +++ b/src/main/scala/org/scalajs/dom/experimental/cachestorage/CacheStorage.scala @@ -4,10 +4,9 @@ import org.scalajs.dom._ import scala.scalajs.js import scala.scalajs.js.annotation._ -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] - * of ServiceWorker whatwg spec. - */ +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] of ServiceWorker whatwg + * spec. + */ @js.native trait CacheQueryOptions extends js.Object { var ignoreSearch: Boolean = js.native // false @@ -19,14 +18,12 @@ trait CacheQueryOptions extends js.Object { var cacheName: String = js.native } -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache-storage ¶5.5 cache]] - * of ServiceWorker whatwg spec. - */ +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache-storage ¶5.5 cache]] of ServiceWorker + * whatwg spec. + */ @js.native trait CacheStorage extends js.Object { - def `match`(request: RequestInfo, - options: CacheQueryOptions = js.native): js.Promise[js.Any] = js.native + def `match`(request: RequestInfo, options: CacheQueryOptions = js.native): js.Promise[js.Any] = js.native def has(cacheName: String): js.Promise[Boolean] = js.native @@ -37,33 +34,27 @@ trait CacheStorage extends js.Object { def keys(): js.Promise[js.Array[String]] = js.native } -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] - * of ServiceWorker whatwg spec. - */ +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] of ServiceWorker whatwg + * spec. + */ @js.native @JSGlobal abstract class Cache extends js.Object { + def `match`(request: RequestInfo, - options: js.UndefOr[ - CacheQueryOptions] = js.native): js.Promise[js.UndefOr[Response]] = js.native + options: js.UndefOr[CacheQueryOptions] = js.native): js.Promise[js.UndefOr[Response]] = js.native def matchAll(request: RequestInfo = js.native, - options: js.UndefOr[ - CacheQueryOptions] = js.native): js.Promise[js.Array[Response]] = js.native + options: js.UndefOr[CacheQueryOptions] = js.native): js.Promise[js.Array[Response]] = js.native def add(request: RequestInfo): js.Promise[Unit] = js.native def addAll(requests: js.Array[RequestInfo]): js.Promise[Unit] = js.native - def put(request: RequestInfo, - response: Response): js.Promise[Unit] = js.native + def put(request: RequestInfo, response: Response): js.Promise[Unit] = js.native - def delete(request: RequestInfo, - options: js.UndefOr[ - CacheQueryOptions] = js.native): js.Promise[Boolean] = js.native + def delete(request: RequestInfo, options: js.UndefOr[CacheQueryOptions] = js.native): js.Promise[Boolean] = js.native def keys(request: js.UndefOr[RequestInfo] = js.native, - options: js.UndefOr[ - CacheQueryOptions] = js.native): js.Promise[js.Array[Request]] + options: js.UndefOr[CacheQueryOptions] = js.native): js.Promise[js.Array[Request]] } diff --git a/src/main/scala/org/scalajs/dom/experimental/deviceorientation/DeviceOrientation.scala b/src/main/scala/org/scalajs/dom/experimental/deviceorientation/DeviceOrientation.scala index 3692c8cb8..ab5db33da 100644 --- a/src/main/scala/org/scalajs/dom/experimental/deviceorientation/DeviceOrientation.scala +++ b/src/main/scala/org/scalajs/dom/experimental/deviceorientation/DeviceOrientation.scala @@ -7,8 +7,7 @@ import scala.scalajs.js.annotation._ @js.native @JSGlobal -class DeviceOrientationEvent(typeArg: String, - init: js.UndefOr[DeviceOrientationEventInit]) +class DeviceOrientationEvent(typeArg: String, init: js.UndefOr[DeviceOrientationEventInit]) extends dom.Event(typeArg, init) { /** Z-Axis rotation in degrees. */ @@ -20,11 +19,9 @@ class DeviceOrientationEvent(typeArg: String, /** Y-Axis rotation in degrees. */ val gamma: Double = js.native - /** - * If true, this event data is has been produced using sensor fusion from - * the magnometer and other sensors. When false- only the gyroscope has - * been used. - */ + /** If true, this event data is has been produced using sensor fusion from the magnometer and other sensors. When + * false- only the gyroscope has been used. + */ val absolute: Boolean = js.native } @@ -39,11 +36,9 @@ trait DeviceOrientationEventInit extends EventInit { /** Y-Axis rotation in degrees. */ var gamma: js.UndefOr[Double] = js.undefined - /** - * If true, this event data is has been produced using sensor fusion from - * the magnometer and other sensors. When false- only the gyroscope has - * been used. - */ + /** If true, this event data is has been produced using sensor fusion from the magnometer and other sensors. When + * false- only the gyroscope has been used. + */ var absolute: js.UndefOr[Boolean] = js.undefined } @@ -73,8 +68,7 @@ trait DeviceRotationRate extends js.Any { @js.native @JSGlobal -class DeviceMotionEvent(typeArg: String, - init: js.UndefOr[DeviceMotionEventInit] = js.undefined) +class DeviceMotionEvent(typeArg: String, init: js.UndefOr[DeviceMotionEventInit] = js.undefined) extends dom.Event(typeArg, init) { /** Device acceleration with gravity removed. */ diff --git a/src/main/scala/org/scalajs/dom/experimental/deviceorientation/package.scala b/src/main/scala/org/scalajs/dom/experimental/deviceorientation/package.scala index 9d0febc65..ef2e26948 100644 --- a/src/main/scala/org/scalajs/dom/experimental/deviceorientation/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/deviceorientation/package.scala @@ -1,9 +1,7 @@ package org.scalajs.dom.experimental -/** - * Implements the Device Orientation API, - * Editor's draft, 26 February 2016. - * - * [[http://w3c.github.io/deviceorientation/spec-source-orientation.html]] - */ +/** Implements the Device Orientation API, Editor's draft, 26 February 2016. + * + * [[http://w3c.github.io/deviceorientation/spec-source-orientation.html]] + */ package object deviceorientation diff --git a/src/main/scala/org/scalajs/dom/experimental/domparser/DOMParser.scala b/src/main/scala/org/scalajs/dom/experimental/domparser/DOMParser.scala index ff9dddabe..e39b16c0e 100644 --- a/src/main/scala/org/scalajs/dom/experimental/domparser/DOMParser.scala +++ b/src/main/scala/org/scalajs/dom/experimental/domparser/DOMParser.scala @@ -4,26 +4,22 @@ import org.scalajs.dom.Document import scala.scalajs.js import scala.scalajs.js.annotation._ -/** - * DOMParser can parse XML or HTML source stored in a string into a DOM Document. - * - * MDN - */ +/** DOMParser can parse XML or HTML source stored in a string into a DOM Document. + * + * MDN + */ @js.native @JSGlobal class DOMParser extends js.Object { - /** - * The DOMParser can also be used to parse a SVG document or a HTML document. - * There are three different results possible, selected by the MIME type given. - * If the MIME type is text/xml, the resulting object will be an XMLDocument, - * if the MIME type is image/svg+xml, it will be an SVGDocument and - * if the MIME type is text/html, it will be an HTMLDocument. - * - * MDN - */ - def parseFromString(string: String, - supportedType: SupportedType): Document = js.native + /** The DOMParser can also be used to parse a SVG document or a HTML document. There are three different results + * possible, selected by the MIME type given. If the MIME type is text/xml, the resulting object will be an + * XMLDocument, if the MIME type is image/svg+xml, it will be an SVGDocument and if the MIME type is text/html, it + * will be an HTMLDocument. + * + * MDN + */ + def parseFromString(string: String, supportedType: SupportedType): Document = js.native } @js.native @@ -33,6 +29,7 @@ object SupportedType { val `text/html` = "text/html".asInstanceOf[SupportedType] val `text/xml` = "text/xml".asInstanceOf[SupportedType] val `application/xml` = "application/xml".asInstanceOf[SupportedType] + val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[SupportedType] val `image/svg+xml` = "image/svg+xml".asInstanceOf[SupportedType] diff --git a/src/main/scala/org/scalajs/dom/experimental/gamepad/Gamepad.scala b/src/main/scala/org/scalajs/dom/experimental/gamepad/Gamepad.scala index 19f70fe1e..eb3ea572f 100644 --- a/src/main/scala/org/scalajs/dom/experimental/gamepad/Gamepad.scala +++ b/src/main/scala/org/scalajs/dom/experimental/gamepad/Gamepad.scala @@ -14,26 +14,21 @@ import scala.scalajs.js.annotation._ @js.native trait GamepadMappingType extends js.Any -/** - * Represents the state of a button. - */ +/** Represents the state of a button. + */ trait GamepadButton extends js.Any { - /** - * True if the button is pressed, false otherwise. - */ + /** True if the button is pressed, false otherwise. + */ val pressed: Boolean - /** - * The value of this gamepad button, 0 is fully unpressed, 1 is - * fully pressed. - */ + /** The value of this gamepad button, 0 is fully unpressed, 1 is fully pressed. + */ val value: Double } -/** - * Represents the state of a connected gamepad device. - */ +/** Represents the state of a connected gamepad device. + */ trait Gamepad extends js.Any { /** The identification string for the gamepad. */ @@ -48,20 +43,17 @@ trait Gamepad extends js.Any { /** Last time the data for this gamepad was updated. */ val timestamp: Double - /** - * An array containing the state of all of the gamepad's axes, from - * -1 .. 1. - */ + /** An array containing the state of all of the gamepad's axes, from + * -1 .. 1. + */ val axes: js.Array[Double] - /** - * The current state of all the gamepad's buttons. - */ + /** The current state of all the gamepad's buttons. + */ val buttons: js.Array[GamepadButton] - /** - * The layout of the gamepad. Either "standard" or unknown (""). - */ + /** The layout of the gamepad. Either "standard" or unknown (""). + */ val mapping: GamepadMappingType } @@ -71,8 +63,7 @@ trait GamepadEventInit extends EventInit { @JSGlobal("GamepadEvent") @js.native -class GamepadEvent(typeArg: String, - init: js.UndefOr[GamepadEventInit] = js.undefined) +class GamepadEvent(typeArg: String, init: js.UndefOr[GamepadEventInit] = js.undefined) extends dom.Event(typeArg, init) { val gamepad: Gamepad = js.native } diff --git a/src/main/scala/org/scalajs/dom/experimental/gamepad/package.scala b/src/main/scala/org/scalajs/dom/experimental/gamepad/package.scala index 647d01e82..487eaed6a 100644 --- a/src/main/scala/org/scalajs/dom/experimental/gamepad/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/gamepad/package.scala @@ -3,12 +3,12 @@ package org.scalajs.dom.experimental import org.scalajs.dom import scala.language.implicitConversions -/** - * Implements the Gamepad API. - * - * [[https://www.w3.org/TR/2015/WD-gamepad-20151217/ W3C Working Draft]] - */ +/** Implements the Gamepad API. + * + * [[https://www.w3.org/TR/2015/WD-gamepad-20151217/ W3C Working Draft]] + */ package object gamepad { + implicit def toGamepad(navigator: dom.Navigator): GamepadNavigator = navigator.asInstanceOf[GamepadNavigator] diff --git a/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala b/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala index afd81617d..9574d7c3c 100644 --- a/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala +++ b/src/main/scala/org/scalajs/dom/experimental/intl/Intl.scala @@ -10,12 +10,10 @@ import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.| -/** - * The Intl.Collator object is a constructor for collators, objects that enable language - * sensitive string comparison. - * - * MDN - */ +/** The Intl.Collator object is a constructor for collators, objects that enable language sensitive string comparison. + * + * MDN + */ @js.native @JSGlobal("Intl.Collator") class Collator(locales: js.UndefOr[String | js.Array[String]] = js.undefined, @@ -23,44 +21,35 @@ class Collator(locales: js.UndefOr[String | js.Array[String]] = js.undefined, extends js.Object { def compare(string1: String, string2: String): Double = js.native def resolvedOptions(): CollatorOptions = js.native - def supportedLocalesOf(locales: String | js.Array[String], - options: js.Any): js.Array[String] = js.native + def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] = js.native } -/** - * The Intl.DateTimeFormat object is a constructor for objects that enable language sensitive - * date and time formatting. - * - * MDN - */ +/** The Intl.DateTimeFormat object is a constructor for objects that enable language sensitive date and time formatting. + * + * MDN + */ @js.native @JSGlobal("Intl.DateTimeFormat") -class DateTimeFormat( - locales: js.UndefOr[String | js.Array[String]] = js.undefined, +class DateTimeFormat(locales: js.UndefOr[String | js.Array[String]] = js.undefined, options: js.UndefOr[DateTimeFormatOptions] = js.undefined) extends js.Object { def format(date: js.Date): String = js.native def resolvedOptions(): DateTimeFormatOptions = js.native - def supportedLocalesOf(locales: String | js.Array[String], - options: js.Any): js.Array[String] = js.native + def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] = js.native } -/** - * The Intl.NumberFormat object is a constructor for objects that enable language sensitive - * number formatting. - * - * MDN - */ +/** The Intl.NumberFormat object is a constructor for objects that enable language sensitive number formatting. + * + * MDN + */ @js.native @JSGlobal("Intl.NumberFormat") -class NumberFormat( - locales: js.UndefOr[String | js.Array[String]] = js.undefined, +class NumberFormat(locales: js.UndefOr[String | js.Array[String]] = js.undefined, options: js.UndefOr[NumberFormatOptions] = js.undefined) extends js.Object { def format(number: Double): String = js.native def resolvedOptions(): NumberFormatOptions = js.native - def supportedLocalesOf(locales: String | js.Array[String], - options: js.Any): js.Array[String] = js.native + def supportedLocalesOf(locales: String | js.Array[String], options: js.Any): js.Array[String] = js.native } @js.native @@ -75,51 +64,39 @@ trait CollatorOptions extends js.Object { object CollatorOptions { - /** - * @param localeMatcher The locale matching algorithm to use. Possible values are "lookup" - * and "best fit"; the default is "best fit". For information about - * this option, see the Intl page. - * @param usage Whether the comparison is for sorting or for searching for matching - * strings. Possible values are "sort" and "search"; the default is "sort". - * @param sensitivity Which differences in the strings should lead to non-zero result values. - * Possible values are: - * - "base": Only strings that differ in base letters compare as unequal. - * Examples: a ≠ b, a = á, a = A. - * - "accent": Only strings that differ in base letters or accents and - * other diacritic marks compare as unequal. - * Examples: a ≠ b, a ≠ á, a = A. - * - "case": Only strings that differ in base letters or case compare - * as unequal. Examples: a ≠ b, a = á, a ≠ A. - * - "variant": Strings that differ in base letters, accents and other - * diacritic marks, or case compare as unequal. Other differences - * may also be taken into consideration. - * Examples: a ≠ b, a ≠ á, a ≠ A. - * The default is "variant" for usage "sort"; it's locale dependent for - * usage "search". - * @param ignorePunctuation Whether punctuation should be ignored. Possible values are true - * and false; the default is false. - * @param numeric Whether numeric collation should be used, such that "1" < "2" < "10". - * Possible values are true and false; the default is false. - * This option can be set through an options property or through a - * Unicode extension key; if both are provided, the options property - * takes precedence. - * Implementations are not required to support this property. - * @param caseFirst Whether upper case or lower case should sort first. Possible values - * are "upper", "lower", or "false" (use the locale's default); the - * default is "false". This option can be set through an options - * property or through a Unicode extension key; if both are provided, - * the options property takes precedence. Implementations are not - * required to support this property. - * - * MDN - */ + /** @param localeMatcher + * The locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". + * For information about this option, see the Intl page. + * @param usage + * Whether the comparison is for sorting or for searching for matching strings. Possible values are "sort" and + * "search"; the default is "sort". + * @param sensitivity + * Which differences in the strings should lead to non-zero result values. Possible values are: + * - "base": Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A. + * - "accent": Only strings that differ in base letters or accents and other diacritic marks compare as unequal. + * Examples: a ≠ b, a ≠ á, a = A. + * - "case": Only strings that differ in base letters or case compare as unequal. Examples: a ≠ b, a = á, a ≠ A. + * - "variant": Strings that differ in base letters, accents and other diacritic marks, or case compare as unequal. + * Other differences may also be taken into consideration. Examples: a ≠ b, a ≠ á, a ≠ A. The default is + * "variant" for usage "sort"; it's locale dependent for usage "search". + * @param ignorePunctuation + * Whether punctuation should be ignored. Possible values are true and false; the default is false. + * @param numeric + * Whether numeric collation should be used, such that "1" < "2" < "10". Possible values are true and false; the + * default is false. This option can be set through an options property or through a Unicode extension key; if both + * are provided, the options property takes precedence. Implementations are not required to support this property. + * @param caseFirst + * Whether upper case or lower case should sort first. Possible values are "upper", "lower", or "false" (use the + * locale's default); the default is "false". This option can be set through an options property or through a + * Unicode extension key; if both are provided, the options property takes precedence. Implementations are not + * required to support this property. + * + * MDN + */ def apply( - localeMatcher: js.UndefOr[String] = js.undefined, - usage: js.UndefOr[String] = js.undefined, - sensitivity: js.UndefOr[String] = js.undefined, - ignorePunctuation: js.UndefOr[Boolean] = js.undefined, - numeric: js.UndefOr[Boolean] = js.undefined, - caseFirst: js.UndefOr[String] = js.undefined + localeMatcher: js.UndefOr[String] = js.undefined, usage: js.UndefOr[String] = js.undefined, + sensitivity: js.UndefOr[String] = js.undefined, ignorePunctuation: js.UndefOr[Boolean] = js.undefined, + numeric: js.UndefOr[Boolean] = js.undefined, caseFirst: js.UndefOr[String] = js.undefined ): CollatorOptions = { js.Dynamic .literal( @@ -154,47 +131,47 @@ trait DateTimeFormatOptions extends js.Object { object DateTimeFormatOptions { - /** - * @param localeMatcher The locale matching algorithm to use. Possible values are "lookup" and - * "best fit"; the default is "best fit". - * For information about this option, see the Intl page. - * @param timeZone The time zone to use. The only value implementations must recognize is - * "UTC"; the default is the runtime's default time zone. Implementations - * may also recognize the time zone names of the IANA time zone database, - * such as "Asia/Shanghai", "Asia/Kolkata", "America/New_York". - * @param hour12 Whether to use 12-hour time (as opposed to 24-hour time). Possible - * values are true and false; the default is locale dependent. - * @param formatMatcher The format matching algorithm to use. Possible values are "basic" and - * "best fit"; the default is "best fit". See the following paragraphs for - * information about the use of this property. - * @param weekday The representation of the weekday. Possible values are "narrow", - * "short", "long". - * @param era The representation of the era. Possible values are "narrow", "short", - * "long". - * @param year The representation of the year. Possible values are "numeric", "2-digit". - * @param month The representation of the month. Possible values are "numeric", - * "2-digit", "narrow", "short", "long". - * @param day The representation of the day. Possible values are "numeric", "2-digit". - * @param hour The representation of the hour. Possible values are "numeric", "2-digit". - * @param minute The representation of the minute. Possible values are "numeric", "2-digit". - * @param second The representation of the second. Possible values are "numeric", "2-digit". - * @param timeZoneName The representation of the time zone name. Possible values are "short", "long". - * - * MDN - */ + /** @param localeMatcher + * The locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". + * For information about this option, see the Intl page. + * @param timeZone + * The time zone to use. The only value implementations must recognize is "UTC"; the default is the runtime's + * default time zone. Implementations may also recognize the time zone names of the IANA time zone database, such + * as "Asia/Shanghai", "Asia/Kolkata", "America/New_York". + * @param hour12 + * Whether to use 12-hour time (as opposed to 24-hour time). Possible values are true and false; the default is + * locale dependent. + * @param formatMatcher + * The format matching algorithm to use. Possible values are "basic" and "best fit"; the default is "best fit". See + * the following paragraphs for information about the use of this property. + * @param weekday + * The representation of the weekday. Possible values are "narrow", "short", "long". + * @param era + * The representation of the era. Possible values are "narrow", "short", "long". + * @param year + * The representation of the year. Possible values are "numeric", "2-digit". + * @param month + * The representation of the month. Possible values are "numeric", "2-digit", "narrow", "short", "long". + * @param day + * The representation of the day. Possible values are "numeric", "2-digit". + * @param hour + * The representation of the hour. Possible values are "numeric", "2-digit". + * @param minute + * The representation of the minute. Possible values are "numeric", "2-digit". + * @param second + * The representation of the second. Possible values are "numeric", "2-digit". + * @param timeZoneName + * The representation of the time zone name. Possible values are "short", "long". + * + * MDN + */ def apply( - localeMatcher: js.UndefOr[String] = js.undefined, - timeZone: js.UndefOr[String] = js.undefined, - hour12: js.UndefOr[Boolean] = js.undefined, - formatMatcher: js.UndefOr[String] = js.undefined, - weekday: js.UndefOr[String] = js.undefined, - era: js.UndefOr[String] = js.undefined, - year: js.UndefOr[String] = js.undefined, - month: js.UndefOr[String] = js.undefined, - day: js.UndefOr[String] = js.undefined, - hour: js.UndefOr[String] = js.undefined, - minute: js.UndefOr[String] = js.undefined, - second: js.UndefOr[String] = js.undefined, + localeMatcher: js.UndefOr[String] = js.undefined, timeZone: js.UndefOr[String] = js.undefined, + hour12: js.UndefOr[Boolean] = js.undefined, formatMatcher: js.UndefOr[String] = js.undefined, + weekday: js.UndefOr[String] = js.undefined, era: js.UndefOr[String] = js.undefined, + year: js.UndefOr[String] = js.undefined, month: js.UndefOr[String] = js.undefined, + day: js.UndefOr[String] = js.undefined, hour: js.UndefOr[String] = js.undefined, + minute: js.UndefOr[String] = js.undefined, second: js.UndefOr[String] = js.undefined, timeZoneName: js.UndefOr[String] = js.undefined ): DateTimeFormatOptions = { // format: off @@ -237,62 +214,52 @@ trait NumberFormatOptions extends js.Object { object NumberFormatOptions { - /** - * The following properties fall into two groups: - * - minimumIntegerDigits, minimumFractionDigits, and maximumFractionDigits in one group, - * - minimumSignificantDigits and maximumSignificantDigits in the other. - * If at least one property from the second group is defined, then the first group is ignored. - * - * @param localeMatcher The locale matching algorithm to use. Possible values are - * "lookup" and "best fit"; the default is "best fit". - * For information about this option, see the Intl page. - * @param style The formatting style to use. Possible values are "decimal" - * for plain number formatting, "currency" for currency - * formatting, and "percent" for percent formatting; the default - * is "decimal". - * @param currency The currency to use in currency formatting. Possible values - * are the ISO 4217 currency codes, such as "USD" for the US - * dollar, "EUR" for the euro, or "CNY" for the Chinese RMB — - * see the Current currency & funds code list. - * There is no default value; if the style is "currency", the - * currency property must be provided. - * @param currencyDisplay How to display the currency in currency formatting. Possible - * values are "symbol" to use a localized currency symbol such - * as €, "code" to use the ISO currency code, "name" to use a - * localized currency name such as "dollar"; the default is - * "symbol". - * @param useGrouping Whether to use grouping separators, such as thousands - * separators or thousand/lakh/crore separators. Possible values - * are true and false; the default is true. - * @param minimumIntegerDigits The minimum number of integer digits to use. Possible values - * are from 1 to 21; the default is 1. - * @param minimumFractionDigits The minimum number of fraction digits to use. Possible values - * are from 0 to 20; the default for plain number and percent - * formatting is 0; the default for currency formatting is the - * number of minor unit digits provided by the ISO 4217 currency - * code list (2 if the list doesn't provide that information). - * @param maximumFractionDigits The maximum number of fraction digits to use. Possible values - * are from 0 to 20; the default for plain number formatting is - * the larger of minimumFractionDigits and 3; the default for - * currency formatting is the larger of minimumFractionDigits - * and the number of minor unit digits provided by the ISO 4217 - * currency code list (2 if the list doesn't provide that - * information); the default for percent formatting is the - * larger of minimumFractionDigits and 0. - * @param minimumSignificantDigits The minimum number of significant digits to use. Possible - * values are from 1 to 21; the default is 1. - * @param maximumSignificantDigits The maximum number of significant digits to use. Possible - * values are from 1 to 21; the default is minimumSignificantDigits. - * - * MDN - */ + /** The following properties fall into two groups: + * - minimumIntegerDigits, minimumFractionDigits, and maximumFractionDigits in one group, + * - minimumSignificantDigits and maximumSignificantDigits in the other. If at least one property from the second + * group is defined, then the first group is ignored. + * + * @param localeMatcher + * The locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". + * For information about this option, see the Intl page. + * @param style + * The formatting style to use. Possible values are "decimal" for plain number formatting, "currency" for currency + * formatting, and "percent" for percent formatting; the default is "decimal". + * @param currency + * The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for + * the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB — see the Current currency & funds code list. + * There is no default value; if the style is "currency", the currency property must be provided. + * @param currencyDisplay + * How to display the currency in currency formatting. Possible values are "symbol" to use a localized currency + * symbol such as €, "code" to use the ISO currency code, "name" to use a localized currency name such as "dollar"; + * the default is "symbol". + * @param useGrouping + * Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. Possible + * values are true and false; the default is true. + * @param minimumIntegerDigits + * The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1. + * @param minimumFractionDigits + * The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and + * percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the + * ISO 4217 currency code list (2 if the list doesn't provide that information). + * @param maximumFractionDigits + * The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number + * formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of + * minimumFractionDigits and the number of minor unit digits provided by the ISO 4217 currency code list (2 if the + * list doesn't provide that information); the default for percent formatting is the larger of + * minimumFractionDigits and 0. + * @param minimumSignificantDigits + * The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1. + * @param maximumSignificantDigits + * The maximum number of significant digits to use. Possible values are from 1 to 21; the default is + * minimumSignificantDigits. + * + * MDN + */ def apply( - localeMatcher: js.UndefOr[String] = js.undefined, - style: js.UndefOr[String] = js.undefined, - currency: js.UndefOr[String] = js.undefined, - currencyDisplay: js.UndefOr[String] = js.undefined, - useGrouping: js.UndefOr[Boolean] = js.undefined, - minimumIntegerDigits: js.UndefOr[Double] = js.undefined, + localeMatcher: js.UndefOr[String] = js.undefined, style: js.UndefOr[String] = js.undefined, + currency: js.UndefOr[String] = js.undefined, currencyDisplay: js.UndefOr[String] = js.undefined, + useGrouping: js.UndefOr[Boolean] = js.undefined, minimumIntegerDigits: js.UndefOr[Double] = js.undefined, minimumFractionDigits: js.UndefOr[Double] = js.undefined, maximumFractionDigits: js.UndefOr[Double] = js.undefined, minimumSignificantDigits: js.UndefOr[Double] = js.undefined, diff --git a/src/main/scala/org/scalajs/dom/experimental/intl/package.scala b/src/main/scala/org/scalajs/dom/experimental/intl/package.scala index 49f4b41b0..55822fdc6 100644 --- a/src/main/scala/org/scalajs/dom/experimental/intl/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/intl/package.scala @@ -1,13 +1,12 @@ package org.scalajs.dom.experimental -/** - * The Intl object is the namespace for the ECMAScript Internationalization API, which provides - * language sensitive string comparison, number formatting, and date and time formatting. - * - * The constructors for Collator, NumberFormat, and DateTimeFormat objects are properties of the - * Intl object. This page documents these properties as well as functionality common to the - * internationalization constructors and other language sensitive functions. - * - * MDN - */ +/** The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive + * string comparison, number formatting, and date and time formatting. + * + * The constructors for Collator, NumberFormat, and DateTimeFormat objects are properties of the Intl object. This page + * documents these properties as well as functionality common to the internationalization constructors and other + * language sensitive functions. + * + * MDN + */ package object intl diff --git a/src/main/scala/org/scalajs/dom/experimental/mediastream/MediaStream.scala b/src/main/scala/org/scalajs/dom/experimental/mediastream/MediaStream.scala index 7d7b0d02c..69ca4abbc 100644 --- a/src/main/scala/org/scalajs/dom/experimental/mediastream/MediaStream.scala +++ b/src/main/scala/org/scalajs/dom/experimental/mediastream/MediaStream.scala @@ -1,6 +1,5 @@ -/** - * https://www.w3.org/TR/2016/CR-mediacapture-streams-20160519/ - */ +/** https://www.w3.org/TR/2016/CR-mediacapture-streams-20160519/ + */ package org.scalajs.dom.experimental.mediastream import org.scalajs.dom.{Event, EventInit, EventTarget, TimeRanges} @@ -8,320 +7,255 @@ import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.| -/** - * The MediaStream - * - * https://www.w3.org/TR/2016/CR-mediacapture-streams-20160519/ - * - * MDN - * - */ +/** The MediaStream + * + * https://www.w3.org/TR/2016/CR-mediacapture-streams-20160519/ + * + * MDN + */ @js.native @JSGlobal class MediaStream() extends EventTarget { - /** - * A Boolean value that returns true if the MediaStream is active, or false otherwise. - * - * MDN - */ + /** A Boolean value that returns true if the MediaStream is active, or false otherwise. + * + * MDN + */ val active: Boolean = js.native - /** - * Is a DOMString containing 36 characters denoting a universally - * unique identifier (UUID) for the object. - * - * MDN - */ + /** Is a DOMString containing 36 characters denoting a universally unique identifier (UUID) for the object. + * + * MDN + */ val id: String = js.native - /** - * Is an EventHandler containing the action to perform when an addtrack event - * is fired when a new MediaStreamTrack object is added. - * - * MDN - */ + /** Is an EventHandler containing the action to perform when an addtrack event is fired when a new MediaStreamTrack + * object is added. + * + * MDN + */ var onaddtrack: js.Function1[Event, Any] = js.native - /** - * Is an EventHandler containing the action to perform when an removetrack - * event is fired when a MediaStreamTrack object is removed from it. - * - * MDN - */ + /** Is an EventHandler containing the action to perform when an removetrack event is fired when a MediaStreamTrack + * object is removed from it. + * + * MDN + */ var onremovetrack: js.Function1[Event, Any] = js.native - /** - * Stores a copy of the MediaStreamTrack given as argument. If the track has - * already been added to the MediaStream object, nothing happens; if the - * track is in the finished state - that is, has already reached its end - - * the exception INVALID_STATE_RAISE is raised. - * - * MDN - */ + /** Stores a copy of the MediaStreamTrack given as argument. If the track has already been added to the MediaStream + * object, nothing happens; if the track is in the finished state - that is, has already reached its end - the + * exception INVALID_STATE_RAISE is raised. + * + * MDN + */ def addTrack(track: MediaStreamTrack): Unit = js.native - /** - * Returns a list of the MediaStreamTrack objects stored in the MediaStream - * object that have their kind attribute set to "audio". The order is not - * defined, and may not only vary from one browser to another, but also from - * one call to another.. - * - * MDN - */ + /** Returns a list of the MediaStreamTrack objects stored in the MediaStream object that have their kind attribute set + * to "audio". The order is not defined, and may not only vary from one browser to another, but also from one call to + * another.. + * + * MDN + */ def getAudioTracks(): js.Array[MediaStreamTrack] = js.native - /** - * Returns the track whose ID corresponds to the one given in parameters, - * trackid. If no parameter is given, or if no track with that ID does exist, - * it returns null. If several tracks have the same ID, it returns the first - * one. - * - * MDN - */ + /** Returns the track whose ID corresponds to the one given in parameters, trackid. If no parameter is given, or if no + * track with that ID does exist, it returns null. If several tracks have the same ID, it returns the first one. + * + * MDN + */ def getTrackById(trackId: String): MediaStreamTrack = js.native - /** - * Returns a list of all MediaStreamTrack objects stored in the MediaStream object, - * regardless of the value of the kind attribute. The order is not defined, and may - * not only vary from one browser to another, but also from one call to another. - * - * MDN - */ + /** Returns a list of all MediaStreamTrack objects stored in the MediaStream object, regardless of the value of the + * kind attribute. The order is not defined, and may not only vary from one browser to another, but also from one + * call to another. + * + * MDN + */ def getTracks(): js.Array[MediaStreamTrack] = js.native - /** - * Returns a list of the MediaStreamTrack objects stored in the MediaStream - * object that have their kind attribute set to "video". The order is not - * defined, and may not only vary from one browser to another, but also from - * one call to another. - * - * MDN - */ + /** Returns a list of the MediaStreamTrack objects stored in the MediaStream object that have their kind attribute set + * to "video". The order is not defined, and may not only vary from one browser to another, but also from one call to + * another. + * + * MDN + */ def getVideoTracks(): js.Array[MediaStreamTrack] = js.native - /** - * Removes the MediaStreamTrack given as argument. If the track is not part - * of the MediaStream object, nothing happens; if the track is in the - * finished state - that is, it has already reached its end - the exception - * INVALID_STATE_RAISE is raised. - * - * MDN - */ + /** Removes the MediaStreamTrack given as argument. If the track is not part of the MediaStream object, nothing + * happens; if the track is in the finished state - that is, it has already reached its end - the exception + * INVALID_STATE_RAISE is raised. + * + * MDN + */ def removeTrack(track: MediaStreamTrack): Unit = js.native - /** - * Clones the given MediaStream and all its tracks. - * When the clone() method is invoked, the user agent must run the following - * steps: - * 1) Let streamClone be a newly constructed MediaStream object. - * 2) Initialize streamClone's id attribute to a newly generated value. - * 3) Let trackSetClone be a list that contains the result of running - * MediaStreamTrack.clone() on all the tracks in this stream. - * - * Let trackSetClone be streamClone's track set. - * - * MDN - */ + /** Clones the given MediaStream and all its tracks. When the clone() method is invoked, the user agent must run the + * following steps: 1) Let streamClone be a newly constructed MediaStream object. 2) Initialize streamClone's id + * attribute to a newly generated value. 3) Let trackSetClone be a list that contains the result of running + * MediaStreamTrack.clone() on all the tracks in this stream. + * + * Let trackSetClone be streamClone's track set. + * + * MDN + */ override def clone(): MediaStream = js.native } -/** - * see [[https://www.w3.org/TR/2013/WD-mediacapture-streams-20130903/#widl-MediaStream-onended]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2013/WD-mediacapture-streams-20130903/#widl-MediaStream-onended]] in W3C spec + */ @js.native trait MediaStreamTrackState extends js.Any object MediaStreamTrackState { - /** The track is active (the track's underlying media source is making a best-effort - * attempt to provide data in real time). - * The output of a track in the live state can be switched on and off with the - * enabled attribute. - */ + /** The track is active (the track's underlying media source is making a best-effort attempt to provide data in real + * time). The output of a track in the live state can be switched on and off with the enabled attribute. + */ val live = "live".asInstanceOf[MediaStreamTrackState] - /** The track has ended (the track's underlying media source is no longer providing - * data, and will never provide more data for this track). Once a track enters this - * state, it never exits it. - * - * For example, a video track in a MediaStream ends if the user unplugs the USB web - * camera that acts as the track's media source. - */ + /** The track has ended (the track's underlying media source is no longer providing data, and will never provide more + * data for this track). Once a track enters this state, it never exits it. + * + * For example, a video track in a MediaStream ends if the user unplugs the USB web camera that acts as the track's + * media source. + */ val ended = "ended".asInstanceOf[MediaStreamTrackState] } @js.native trait MediaStreamTrack extends EventTarget { - /** - * Is a Boolean value with a value of true if the track is enabled, that is - * allowed to render the media source stream; or false if it is disabled, - * that is not rendering the media source stream but silence and blackness. - * If the track has been disconnected, this value can be changed but has no - * more effect. - * - * MDN - */ + /** Is a Boolean value with a value of true if the track is enabled, that is allowed to render the media source + * stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. If + * the track has been disconnected, this value can be changed but has no more effect. + * + * MDN + */ var enabled: Boolean = js.native - /** - * Returns a DOMString containing a unique identifier (GUID) for the - * track; it is generated by the browser. - * - * MDN - */ + /** Returns a DOMString containing a unique identifier (GUID) for the track; it is generated by the browser. + * + * MDN + */ val id: String = js.native - /** - * Returns a DOMString set to "audio" if the track is an audio track - * and to "video", if it is a video track. It doesn't change if the track is - * deassociated from its source. - * - * MDN - */ + /** Returns a DOMString set to "audio" if the track is an audio track and to "video", if it is a video track. It + * doesn't change if the track is deassociated from its source. + * + * MDN + */ val kind: String = js.native - /** - * Returns a DOMString containing a user agent-assigned label that - * identifies the track source, as in "internal microphone". The string may - * be left empty and is empty as long as no source has been connected. When - * the track is deassociated from its source, the label is not changed. - * - * MDN - */ + /** Returns a DOMString containing a user agent-assigned label that identifies the track source, as in "internal + * microphone". The string may be left empty and is empty as long as no source has been connected. When the track is + * deassociated from its source, the label is not changed. + * + * MDN + */ val label: String = js.native - /** - * Returns a Boolean value with a value of true if the track is - * muted, false otherwise. - * - * MDN - */ + /** Returns a Boolean value with a value of true if the track is muted, false otherwise. + * + * MDN + */ val muted: Boolean = js.native - /** - * Returns a Boolean value with a value of true if the track is - * (such a video file source or a camera that settings can't be - * modified),false otherwise. - * - * MDN - */ + /** Returns a Boolean value with a value of true if the track is (such a video file source or a camera that settings + * can't be modified),false otherwise. + * + * MDN + */ val readonly: Boolean = js.native - /** - * Returns an enumerated value giving the status of the track.It - * takes one of the following values: - * - * "live" which indicates that an input is connected and does its - * best-effort in providing real-time data. In that case, the output of - * data can be switched on or off using the MediaStreamTrack.enabled - * attribute. - * - * "ended" which indicates that the input is not giving any more data - * and will never provide new data. - * - * MDN - */ + /** Returns an enumerated value giving the status of the track.It takes one of the following values: + * + * "live" which indicates that an input is connected and does its best-effort in providing real-time data. In that + * case, the output of data can be switched on or off using the MediaStreamTrack.enabled attribute. + * + * "ended" which indicates that the input is not giving any more data and will never provide new data. + * + * MDN + */ val readyState: MediaStreamTrackState = js.native - /** - * Returns a boolean value with a value of true if the track is - * sourced by a RTCPeerConnection, false otherwise. - * - * MDN - */ + /** Returns a boolean value with a value of true if the track is sourced by a RTCPeerConnection, false otherwise. + * + * MDN + */ val remote: Boolean = js.native - /** - * Is a EventHandler containing the action to perform when an started event - * is fired on the object, that is when a new MediaStreamTrack object is - * added. - * - * MDN - */ + /** Is a EventHandler containing the action to perform when an started event is fired on the object, that is when a + * new MediaStreamTrack object is added. + * + * MDN + */ var onstarted: js.Function1[Event, Any] = js.native - /** - * Is a EventHandler containing the action to perform when an mute event is - * fired on the object, that is when the streaming is terminating. - * - * MDN - */ + /** Is a EventHandler containing the action to perform when an mute event is fired on the object, that is when the + * streaming is terminating. + * + * MDN + */ var onmute: js.Function1[Event, Any] = js.native - /** - * Is a EventHandler containing the action to perform when an unmute event - * is fired on the object, that is when a MediaStreamTrack object is removed - * from it. - * - * MDN - */ + /** Is a EventHandler containing the action to perform when an unmute event is fired on the object, that is when a + * MediaStreamTrack object is removed from it. + * + * MDN + */ var onunmute: js.Function1[Event, Any] = js.native - /** - * Is a EventHandler containing the action to perform when an overconstrained - * event is fired on the object, that is when a MediaStreamTrack object is - * removed from it. - * - * MDN - */ + /** Is a EventHandler containing the action to perform when an overconstrained event is fired on the object, that is + * when a MediaStreamTrack object is removed from it. + * + * MDN + */ var onoverconstrained: js.Function1[Event, Any] = js.native - /** - * Is a EventHandler containing the action to perform when an ended event is - * fired on the object, that is when a MediaStreamTrack object is removed - * from it. - * - * MDN - */ + /** Is a EventHandler containing the action to perform when an ended event is fired on the object, that is when a + * MediaStreamTrack object is removed from it. + * + * MDN + */ var onended: js.Function1[Event, Any] = js.native - /** - * Returns a MediaTrackConstraints object containing the currently - * set constraints for the track; the returned value matches the - * constraints last set using applyConstraints(). - * - * MDN - */ + /** Returns a MediaTrackConstraints object containing the currently set constraints for the track; the returned value + * matches the constraints last set using applyConstraints(). + * + * MDN + */ def getConstraints(): MediaTrackConstraints = js.native - /** - * Returns the a list of constrainable properties available for the - * MediaStreamTrack. - * - * MDN - */ + /** Returns the a list of constrainable properties available for the MediaStreamTrack. + * + * MDN + */ def getCapabilities(): js.Any = js.native - /** - * Returns a duplicate of the MediaStreamTrack. - * - * MDN - */ + /** Returns a duplicate of the MediaStreamTrack. + * + * MDN + */ override def clone(): MediaStreamTrack = js.native - /** - * Lets the application specify the ideal and/or ranges of acceptable values - * for any number of the available constrainable properties of the MediaStreamTrack. - */ - def applyConstraints( - constraints: MediaTrackConstraints): js.Promise[Unit] = js.native - - /** - * Returns a MediaTrackSettings object containing the current values of - * each of the MediaStreamTrack's constrainable properties. - * - * MDN - */ + /** Lets the application specify the ideal and/or ranges of acceptable values for any number of the available + * constrainable properties of the MediaStreamTrack. + */ + def applyConstraints(constraints: MediaTrackConstraints): js.Promise[Unit] = js.native + + /** Returns a MediaTrackSettings object containing the current values of each of the MediaStreamTrack's constrainable + * properties. + * + * MDN + */ def getSettings(): js.Any = js.native - /** - * Stops playing the source associated to the track, both the source and the - * track are deassociated. The track state is set to ended. - * - * MDN - */ + /** Stops playing the source associated to the track, both the source and the track are deassociated. The track state + * is set to ended. + * + * MDN + */ def stop(): Unit = js.native } @@ -357,18 +291,14 @@ trait MediaTrackConstraintSet extends js.Object { } object MediaTrackConstraintSet { + @inline def apply( - width: js.UndefOr[Double] = js.undefined, - height: js.UndefOr[Double] = js.undefined, - aspectRatio: js.UndefOr[Double] = js.undefined, - frameRate: js.UndefOr[Double] = js.undefined, - facingMode: js.UndefOr[String] = js.undefined, - volume: js.UndefOr[Double] = js.undefined, - sampleRate: js.UndefOr[Double] = js.undefined, - sampleSize: js.UndefOr[Double] = js.undefined, - echoCancellation: js.UndefOr[Boolean] = js.undefined, - deviceId: js.UndefOr[String] = js.undefined, + width: js.UndefOr[Double] = js.undefined, height: js.UndefOr[Double] = js.undefined, + aspectRatio: js.UndefOr[Double] = js.undefined, frameRate: js.UndefOr[Double] = js.undefined, + facingMode: js.UndefOr[String] = js.undefined, volume: js.UndefOr[Double] = js.undefined, + sampleRate: js.UndefOr[Double] = js.undefined, sampleSize: js.UndefOr[Double] = js.undefined, + echoCancellation: js.UndefOr[Boolean] = js.undefined, deviceId: js.UndefOr[String] = js.undefined, groupId: js.UndefOr[String] = js.undefined ): MediaTrackConstraintSet = { val result = js.Dynamic.literal() @@ -393,6 +323,7 @@ trait MediaTrackConstraints extends MediaTrackConstraintSet { } object MediaTrackConstraints { + @inline def apply( advanced: js.UndefOr[js.Array[MediaTrackConstraintSet]] = js.undefined @@ -407,16 +338,11 @@ object MediaStreamTrack { @inline def apply( - enabled: js.UndefOr[Boolean] = js.undefined, - id: js.UndefOr[String] = js.undefined, - kind: js.UndefOr[String] = js.undefined, - label: js.UndefOr[String] = js.undefined, - muted: js.UndefOr[Boolean] = js.undefined, - readonly: js.UndefOr[Boolean] = js.undefined, - readyState: js.UndefOr[String] = js.undefined, - remote: js.UndefOr[Boolean] = js.undefined, - onstarted: js.UndefOr[js.Function0[Any]] = js.undefined, - onmute: js.UndefOr[js.Function0[Any]] = js.undefined, + enabled: js.UndefOr[Boolean] = js.undefined, id: js.UndefOr[String] = js.undefined, + kind: js.UndefOr[String] = js.undefined, label: js.UndefOr[String] = js.undefined, + muted: js.UndefOr[Boolean] = js.undefined, readonly: js.UndefOr[Boolean] = js.undefined, + readyState: js.UndefOr[String] = js.undefined, remote: js.UndefOr[Boolean] = js.undefined, + onstarted: js.UndefOr[js.Function0[Any]] = js.undefined, onmute: js.UndefOr[js.Function0[Any]] = js.undefined, onunmute: js.UndefOr[js.Function0[Any]] = js.undefined, onoverconstrained: js.UndefOr[js.Function0[Any]] = js.undefined, oneended: js.UndefOr[js.Function0[Any]] = js.undefined @@ -447,11 +373,11 @@ trait MediaStreamConstraints extends js.Object { } object MediaStreamConstraints { + @inline def apply( video: js.UndefOr[Boolean | MediaTrackConstraints] = js.undefined, - audio: js.UndefOr[Boolean | MediaTrackConstraints] = js.undefined, - peerIdentity: js.UndefOr[String] = js.undefined + audio: js.UndefOr[Boolean | MediaTrackConstraints] = js.undefined, peerIdentity: js.UndefOr[String] = js.undefined ): MediaStreamConstraints = { val result = js.Dynamic.literal() video.foreach(v => result.video = v.asInstanceOf[js.Any]) @@ -467,82 +393,68 @@ trait MediaStreamTrackEventInit extends EventInit { @js.native @JSGlobal -class MediaStreamTrackEvent(typeArg: String, - init: js.UndefOr[MediaStreamTrackEventInit]) - extends Event(typeArg, init) { +class MediaStreamTrackEvent(typeArg: String, init: js.UndefOr[MediaStreamTrackEventInit]) extends Event(typeArg, init) { val track: MediaStreamTrack = js.native } -/** - * see [[https://www.w3.org/TR/2016/CR-mediacapture-streams-20160519/#idl-def-MediaDeviceKind]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2016/CR-mediacapture-streams-20160519/#idl-def-MediaDeviceKind]] in W3C spec + */ @js.native trait MediaDeviceKind extends js.Any object MediaDeviceKind { /** Represents an audio input device; for example a microphone. - */ + */ val audioinput = "audioinput".asInstanceOf[MediaDeviceKind] /** Represents an audio output device; for example a pair of headphones. - */ + */ val audiooutput = "audiooutput".asInstanceOf[MediaDeviceKind] /** Represents a video input device; for example a webcam. - */ + */ val videoinput = "videoinput".asInstanceOf[MediaDeviceKind] } @js.native trait MediaDeviceInfo extends js.Object { - /** - * Returns a DOMString that is an identifier for the represented device - * that is persisted across sessions. It is un-guessable by other - * applications and unique to the origin of the calling application. It is - * reset when the user clears cookies (for Private Browsing, a different - * identifier is used that is not persisted across sessions). - * - * MDN - */ + /** Returns a DOMString that is an identifier for the represented device that is persisted across sessions. It is + * un-guessable by other applications and unique to the origin of the calling application. It is reset when the user + * clears cookies (for Private Browsing, a different identifier is used that is not persisted across sessions). + * + * MDN + */ val deviceId: String = js.native - /** - * Returns a DOMString that is a group identifier. Two devices have the same - * group identifier if they belong to the same physical device; for example - * a monitor with both a built-in camera and microphone. - * - * MDN - */ + /** Returns a DOMString that is a group identifier. Two devices have the same group identifier if they belong to the + * same physical device; for example a monitor with both a built-in camera and microphone. + * + * MDN + */ val groupId: String = js.native - /** - * enum MediaDevicesInfoKind - * Returns an enumerated value that is either "videoinput", "audioinput" - * or "audiooutput". - * - * MDN - */ + /** enum MediaDevicesInfoKind Returns an enumerated value that is either "videoinput", "audioinput" or "audiooutput". + * + * MDN + */ val kind: MediaDeviceKind = js.native - /** - * Returns a DOMString that is a label describing this device (for example - * "External USB Webcam"). Only available during active MediaStream use or - * when persistent permissions have been granted. - * - * MDN - */ + /** Returns a DOMString that is a label describing this device (for example "External USB Webcam"). Only available + * during active MediaStream use or when persistent permissions have been granted. + * + * MDN + */ val label: String = js.native } object MediaDeviceInfo { + @inline def apply( - deviceId: js.UndefOr[String] = js.undefined, - groupId: js.UndefOr[String] = js.undefined, - kind: js.UndefOr[String] = js.undefined, - label: js.UndefOr[String] = js.undefined + deviceId: js.UndefOr[String] = js.undefined, groupId: js.UndefOr[String] = js.undefined, + kind: js.UndefOr[String] = js.undefined, label: js.UndefOr[String] = js.undefined ): MediaDeviceInfo = { val result = js.Dynamic.literal() deviceId.foreach(result.deviceId = _) @@ -553,64 +465,50 @@ object MediaDeviceInfo { } } -/** - * The MediaDevices interface provides access to connected media input devices - * like cameras and microphones, as well as screen sharing. In essence, it - * lets you obtain access to any hardware source of media data. - * - * MDN - */ +/** The MediaDevices interface provides access to connected media input devices like cameras and microphones, as well as + * screen sharing. In essence, it lets you obtain access to any hardware source of media data. + * + * MDN + */ @js.native trait MediaDevices extends EventTarget { - /** - * The event handler for the devicechange event. This event is - * delivered to the MediaDevices object when a media input or - * output device is attached to or removed from the user's computer. - * - * MDN - */ + /** The event handler for the devicechange event. This event is delivered to the MediaDevices object when a media + * input or output device is attached to or removed from the user's computer. + * + * MDN + */ var ondevicechange: js.Function1[Event, Any] = js.native - /** - * Obtains an array of information about the media input and output devices - * available on the system. - * - * MDN - */ + /** Obtains an array of information about the media input and output devices available on the system. + * + * MDN + */ def enumerateDevices(): js.Promise[js.Array[MediaDeviceInfo]] = js.native - /** - * Returns an object conforming to MediaTrackSupportedConstraints indicating - * which constrainable properties are supported on the MediaStreamTrack - * interface. See "Capabilities and constraints" in Media Capture and - * Streams API (Media Streams) to learn more about constraints and how to use them. - * - * MDN - */ + /** Returns an object conforming to MediaTrackSupportedConstraints indicating which constrainable properties are + * supported on the MediaStreamTrack interface. See "Capabilities and constraints" in Media Capture and Streams API + * (Media Streams) to learn more about constraints and how to use them. + * + * MDN + */ def getSupportedConstraints(): MediaTrackSupportedConstraints = js.native - /** - * With the user's permission through a prompt, turns on a camera or - * screensharing and/or a microphone on the system and provides a - * MediaStream containing a video track and/or an audio track with - * the input. - * - * MDN - */ - def getUserMedia( - constraints: MediaStreamConstraints): js.Promise[MediaStream] = js.native + /** With the user's permission through a prompt, turns on a camera or screensharing and/or a microphone on the system + * and provides a MediaStream containing a video track and/or an audio track with the input. + * + * MDN + */ + def getUserMedia(constraints: MediaStreamConstraints): js.Promise[MediaStream] = js.native } -/** - * The MediaTrackSupportedConstraints dictionary establishes the list of constrainable properties - * recognized by the user agent or browser in its implementation of the MediaStreamTrack object. - * An object conforming to MediaTrackSupportedConstraints is returned by - * MediaDevices.getSupportedConstraints(). - * - * MDN - */ +/** The MediaTrackSupportedConstraints dictionary establishes the list of constrainable properties recognized by the + * user agent or browser in its implementation of the MediaStreamTrack object. An object conforming to + * MediaTrackSupportedConstraints is returned by MediaDevices.getSupportedConstraints(). + * + * MDN + */ trait MediaTrackSupportedConstraints extends js.Object { var width: js.UndefOr[Boolean] = js.undefined var height: js.UndefOr[Boolean] = js.undefined @@ -627,11 +525,10 @@ trait MediaTrackSupportedConstraints extends js.Object { var groupId: js.UndefOr[Boolean] = js.undefined } -/** - * Represents a source of media data for an HTMLMediaElement object. - * - * A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent. - */ +/** Represents a source of media data for an HTMLMediaElement object. + * + * A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent. + */ @js.native @JSGlobal class MediaSource extends EventTarget { @@ -639,11 +536,10 @@ class MediaSource extends EventTarget { def activeSourceBuffers: SourceBufferList = js.native def readyState: ReadyState = js.native - /** - * Allows the web application to set the presentation duration. - * - * The duration is initially set to NaN when the MediaSource object is created. - */ + /** Allows the web application to set the presentation duration. + * + * The duration is initially set to NaN when the MediaSource object is created. + */ var duration: Double = js.native var onsourceopen: js.Function1[Event, Any] = js.native diff --git a/src/main/scala/org/scalajs/dom/experimental/package.scala b/src/main/scala/org/scalajs/dom/experimental/package.scala index c9d195112..7f2c53ae9 100644 --- a/src/main/scala/org/scalajs/dom/experimental/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/package.scala @@ -38,10 +38,10 @@ package object experimental { @deprecated("use dom.fetch instead", "2.0.0") object Fetch { + @js.native @JSGlobal("fetch") - def fetch(info: RequestInfo, - init: RequestInit = null): js.Promise[Response] = js.native + def fetch(info: RequestInfo, init: RequestInit = null): js.Promise[Response] = js.native } @deprecated("use dom.Request instead", "2.0.0") @@ -61,6 +61,7 @@ package object experimental { @deprecated("use new dom.ResponseInit { ... } instead", "2.0.0") object ResponseInit { + def apply(_status: Int = 200, _statusText: ByteString = "OK", _headers: HeadersInit = js.Dictionary[String]()): ResponseInit = { new ResponseInit { diff --git a/src/main/scala/org/scalajs/dom/experimental/permissions/package.scala b/src/main/scala/org/scalajs/dom/experimental/permissions/package.scala index ea719b65e..5ec7869d6 100644 --- a/src/main/scala/org/scalajs/dom/experimental/permissions/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/permissions/package.scala @@ -4,11 +4,10 @@ import org.scalajs.dom import scala.language.implicitConversions import scala.scalajs.js -/** - * Implements the Permissions API. - * - * [[https://www.w3.org/TR/permissions/ W3C Working Draft]] - */ +/** Implements the Permissions API. + * + * [[https://www.w3.org/TR/permissions/ W3C Working Draft]] + */ package object permissions { @js.native @@ -33,6 +32,7 @@ package object permissions { val midi = "midi".asInstanceOf[PermissionName] val notifications = "notifications".asInstanceOf[PermissionName] val push = "push".asInstanceOf[PermissionName] + val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName] } @@ -42,6 +42,7 @@ package object permissions { } object PermissionDescriptor { + @inline def apply(permissionName: PermissionName): PermissionDescriptor = { new PermissionDescriptor { @@ -55,6 +56,7 @@ package object permissions { } object PushPermissionDescriptor { + @inline def apply(permissionUserVisibleOnly: Boolean): PushPermissionDescriptor = { new PushPermissionDescriptor { @@ -65,8 +67,7 @@ package object permissions { } trait Permissions extends js.Object { - def query( - permissionDescriptor: PermissionDescriptor): js.Promise[PermissionStatus] + def query(permissionDescriptor: PermissionDescriptor): js.Promise[PermissionStatus] } trait PermissionsNavigator extends js.Object { diff --git a/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala b/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala index 5d92f2a97..d8b94859e 100644 --- a/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala +++ b/src/main/scala/org/scalajs/dom/experimental/push/PushManager.scala @@ -5,268 +5,230 @@ import org.scalajs.dom.experimental.serviceworkers.ExtendableEvent import scala.scalajs.js import scala.scalajs.js.typedarray.{ArrayBuffer, Uint8Array} -/** - * The PushManager interface of the Push API provides a way to receive notifications - * from third-party servers as well as request URLs for push notifications. - * - * This interface is accessed via the ServiceWorkerRegistration.pushManager property. - * - * MDN - * - * The Push API is currently specified here: [[https://www.w3.org/TR/2018/WD-push-api-20181026/]] - */ +/** The PushManager interface of the Push API provides a way to receive notifications from third-party servers as well + * as request URLs for push notifications. + * + * This interface is accessed via the ServiceWorkerRegistration.pushManager property. + * + * MDN + * + * The Push API is currently specified here: [[https://www.w3.org/TR/2018/WD-push-api-20181026/]] + */ @js.native trait PushManager extends js.Object { - /** - * Retrieves an existing push subscription. It returns a Promise that resolves to a - * PushSubscription object containing details of an existing subscription. If no - * existing subscription exists, this resolves to a null value. - * - * MDN - */ + /** Retrieves an existing push subscription. It returns a Promise that resolves to a PushSubscription object + * containing details of an existing subscription. If no existing subscription exists, this resolves to a null value. + * + * MDN + */ def getSubscription(): js.Promise[PushSubscription] = js.native - /** - * The permissionState() method of the PushManager interface returns a Promise that - * resolves to a DOMString indicating the permission state of the push manager. - * Possible values are 'prompt', 'denied', or 'granted'. - * - * @param options An object containing optional configuration parameters. It can have - * the following properties: - * - userVisibleOnly: A boolean indicating that the returned push subscription will only - * be used for messages whose effect is made visible to the user. - * - * MDN - */ - def permissionState( - options: PushSubscriptionOptions = js.native): js.Promise[PushPermissionState] = js.native - - /** - * The subscribe() method of the PushManager interface subscribes to a push service. - * - * It returns a Promise that resolves to a PushSubscription object containing details of a - * push subscription. A new push subscription is created if the current service worker - * does not have an existing subscription. - * - * MDN - */ - def subscribe( - options: PushSubscriptionOptions = js.native): js.Promise[PushSubscription] = js.native + /** The permissionState() method of the PushManager interface returns a Promise that resolves to a DOMString + * indicating the permission state of the push manager. Possible values are 'prompt', 'denied', or 'granted'. + * + * @param options + * An object containing optional configuration parameters. It can have the following properties: + * - userVisibleOnly: A boolean indicating that the returned push subscription will only be used for messages whose + * effect is made visible to the user. + * + * MDN + */ + def permissionState(options: PushSubscriptionOptions = js.native): js.Promise[PushPermissionState] = js.native + + /** The subscribe() method of the PushManager interface subscribes to a push service. + * + * It returns a Promise that resolves to a PushSubscription object containing details of a push subscription. A new + * push subscription is created if the current service worker does not have an existing subscription. + * + * MDN + */ + def subscribe(options: PushSubscriptionOptions = js.native): js.Promise[PushSubscription] = js.native } -/** - * The PushSubscription interface of the Push API provides a subcription's URL endpoint - * and allows unsubscription from a push service. - * - * An instance of this interface can be serialized. - * - * MDN - */ +/** The PushSubscription interface of the Push API provides a subcription's URL endpoint and allows unsubscription from + * a push service. + * + * An instance of this interface can be serialized. + * + * MDN + */ @js.native trait PushSubscription extends js.Object { - /** - * The endpoint read-only property of the PushSubscription interface returns a USVString - * containing the endpoint associated with the push subscription. The endpoint takes the - * form of a custom URL pointing to a push server, which can be used to send a push message - * to the particular service worker instance that subscribed to the push service. For this - * reason, it is a good idea to keep your endPoint a secret, so others do not hijack it and - * abuse the push functionality. - * - * MDN - */ + /** The endpoint read-only property of the PushSubscription interface returns a USVString containing the endpoint + * associated with the push subscription. The endpoint takes the form of a custom URL pointing to a push server, + * which can be used to send a push message to the particular service worker instance that subscribed to the push + * service. For this reason, it is a good idea to keep your endPoint a secret, so others do not hijack it and abuse + * the push functionality. + * + * MDN + */ val endpoint: String = js.native - /** - * The expirationTime read-only property of the PushSubscription interface returns a - * DOMHighResTimeStamp of the subscription expiration time associated with the push - * subscription, if there is one, or null otherwise. - * - * MDN - */ + /** The expirationTime read-only property of the PushSubscription interface returns a DOMHighResTimeStamp of the + * subscription expiration time associated with the push subscription, if there is one, or null otherwise. + * + * MDN + */ val expirationTime: java.lang.Double = js.native - /** - * The options read-only property of the PushSubscription interface is an object containing - * containing the options used to create the subscription. - * - * MDN - */ + /** The options read-only property of the PushSubscription interface is an object containing containing the options + * used to create the subscription. + * + * MDN + */ val options: PushSubscriptionOptions = js.native - /** - * The getKey method retrieves keying material that can be used for encrypting and authenticating messages. - */ + /** The getKey method retrieves keying material that can be used for encrypting and authenticating messages. + */ def getKey(name: PushEncryptionKeyName): ArrayBuffer = js.native - /** - * The unsubscribe() method of the PushSubscription interface returns a Promise that - * resolves to a Boolean when the current subscription is successfully unsubscribed. - * - * MDN - */ + /** The unsubscribe() method of the PushSubscription interface returns a Promise that resolves to a Boolean when the + * current subscription is successfully unsubscribed. + * + * MDN + */ def unsubscribe(): js.Promise[Boolean] = js.native - /** - * The toJSON() method of the PushSubscription interface is a standard serializer: it returns - * a JSON representation of the subscription properties, providing a useful shortcut. - * - * MDN - */ + /** The toJSON() method of the PushSubscription interface is a standard serializer: it returns a JSON representation + * of the subscription properties, providing a useful shortcut. + * + * MDN + */ def toJSON(): PushSubscriptionJSON = js.native } -/** - * A PushSubscriptionJSON dictionary represents the JSON type of a PushSubscription. In ECMAScript this can - * be converted into a JSON string through the JSON.stringify function. - * - * MDN - */ +/** A PushSubscriptionJSON dictionary represents the JSON type of a PushSubscription. In ECMAScript this can be + * converted into a JSON string through the JSON.stringify function. + * + * MDN + */ @js.native trait PushSubscriptionJSON extends js.Object { - /** - * The endpoint contains the underlying value of the endpoint attribute. - * - * MDN - */ + /** The endpoint contains the underlying value of the endpoint attribute. + * + * MDN + */ val endpoint: String = js.native - /** - * The endpoint contains the underlying value of the endpoint attribute. - * - * MDN - */ + /** The endpoint contains the underlying value of the endpoint attribute. + * + * MDN + */ val expirationTime: java.lang.Double = js.native - /** - * The keys record contains an entry for each of the supported PushEncryptionKeyName entries to the URL-safe - * base64 encoded representation [RFC4648] of its value. - * - * MDN - */ + /** The keys record contains an entry for each of the supported PushEncryptionKeyName entries to the URL-safe base64 + * encoded representation [RFC4648] of its value. + * + * MDN + */ val keys: js.Dictionary[String] = js.native } -/** - * The PushEvent interface of the Push API represents a push message that has been received. - * This event is sent to the global scope of a ServiceWorker. It contains the information - * sent from an application server to a PushSubscription. - * - * MDN - */ +/** The PushEvent interface of the Push API represents a push message that has been received. This event is sent to the + * global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. + * + * MDN + */ @js.native trait PushEvent extends ExtendableEvent { - /** - * Returns a reference to a PushMessageData object containing data sent to the PushSubscription. - * Read-only. - * - * MDN - */ + /** Returns a reference to a PushMessageData object containing data sent to the PushSubscription. Read-only. + * + * MDN + */ val data: PushMessageData = js.native } -/** - * The PushMessageData interface of the Push API provides methods which let you retrieve the - * push data sent by a server in various formats. - * - * Unlike the similar methods in the Fetch API, which only allow the method to be invoked once, - * these methods can be called multiple times. - * - * MDN - */ +/** The PushMessageData interface of the Push API provides methods which let you retrieve the push data sent by a server + * in various formats. + * + * Unlike the similar methods in the Fetch API, which only allow the method to be invoked once, these methods can be + * called multiple times. + * + * MDN + */ @js.native trait PushMessageData extends js.Object { - /** - * Extracts the data as an ArrayBuffer object. - * - * MDN - */ + /** Extracts the data as an ArrayBuffer object. + * + * MDN + */ def arrayBuffer(): ArrayBuffer = js.native - /** - * Extracts the data as a Blob object. - * - * MDN - */ + /** Extracts the data as a Blob object. + * + * MDN + */ def blob(): Blob = js.native - /** - * Extracts the data as a JSON object. - * - * MDN - */ + /** Extracts the data as a JSON object. + * + * MDN + */ def json(): js.Any = js.native - /** - * Extracts the data as a plain text string. - * - * MDN - */ + /** Extracts the data as a plain text string. + * + * MDN + */ def text(): String = js.native } -/** - * A PushSubscriptionOptions object represents additional options associated with a push subscription. - * - * The userVisibleOnly option, when set to true, indicates that the push subscription will only be used - * for push messages whose effect is made visible to the user, for example by displaying a Web Notification. - * - * The applicationServerKey option defines the public key your application server uses for sending messages to clients via a push server endpoint. - */ +/** A PushSubscriptionOptions object represents additional options associated with a push subscription. + * + * The userVisibleOnly option, when set to true, indicates that the push subscription will only be used for push + * messages whose effect is made visible to the user, for example by displaying a Web Notification. + * + * The applicationServerKey option defines the public key your application server uses for sending messages to clients + * via a push server endpoint. + */ trait PushSubscriptionOptions extends js.Object { var userVisibleOnly: js.UndefOr[Boolean] = js.undefined var applicationServerKey: js.UndefOr[Uint8Array] = js.undefined } -/** - * This represents a JavaScript enumeration describing the state of permissions for - * pushing described here: [[http://www.w3.org/TR/push-api/#idl-def-PushPermissionState]] - */ +/** This represents a JavaScript enumeration describing the state of permissions for pushing described here: + * [[http://www.w3.org/TR/push-api/#idl-def-PushPermissionState]] + */ @js.native sealed trait PushPermissionState extends js.Any /** Static definitions for [[PushPermissionState]] */ object PushPermissionState { - /** - * The webapp has permission to use the Push API. - */ + /** The webapp has permission to use the Push API. + */ val granted = "granted".asInstanceOf[PushPermissionState] - /** - * The webapp has been denied permission to use the Push API. - */ + /** The webapp has been denied permission to use the Push API. + */ val denied = "denied".asInstanceOf[PushPermissionState] - /** - * The webapp needs to ask for permission in order to use the Push API. - */ + /** The webapp needs to ask for permission in order to use the Push API. + */ val prompt = "prompt".asInstanceOf[PushPermissionState] } -/** - * This represents a JavaScript enumeration representing the various keys you an request from a - * [[PushSubscription]] as described here: [[http://www.w3.org/TR/push-api/#idl-def-PushEncryptionKeyName]] - */ +/** This represents a JavaScript enumeration representing the various keys you an request from a [[PushSubscription]] as + * described here: [[http://www.w3.org/TR/push-api/#idl-def-PushEncryptionKeyName]] + */ @js.native sealed trait PushEncryptionKeyName extends js.Any /** Static definitions for [[PushEncryptionKeyName]] */ object PushEncryptionKeyName { - /** - * used to retrieve the P-256 ECDH Diffie-Hellman public key described here: - * [[https://tools.ietf.org/html/draft-ietf-webpush-encryption-01]] - */ + /** used to retrieve the P-256 ECDH Diffie-Hellman public key described here: + * [[https://tools.ietf.org/html/draft-ietf-webpush-encryption-01]] + */ val p256dh = "p256dh".asInstanceOf[PushEncryptionKeyName] - /** - * used to retrieve the authentication secret described here: - * [[https://tools.ietf.org/html/draft-ietf-webpush-encryption-01]] - */ + /** used to retrieve the authentication secret described here: + * [[https://tools.ietf.org/html/draft-ietf-webpush-encryption-01]] + */ val auth = "auth".asInstanceOf[PushEncryptionKeyName] } diff --git a/src/main/scala/org/scalajs/dom/experimental/push/package.scala b/src/main/scala/org/scalajs/dom/experimental/push/package.scala index e4b098e23..48716b3aa 100644 --- a/src/main/scala/org/scalajs/dom/experimental/push/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/push/package.scala @@ -1,74 +1,58 @@ package org.scalajs.dom.experimental -import org.scalajs.dom.experimental.serviceworkers.{ - ServiceWorkerGlobalScope, ServiceWorkerRegistration -} +import org.scalajs.dom.experimental.serviceworkers.{ServiceWorkerGlobalScope, ServiceWorkerRegistration} import scala.language.implicitConversions import scala.scalajs.js -/** - * The Push API is currently specified here: [[http://www.w3.org/TR/2015/WD-push-api-20151215/]] - */ +/** The Push API is currently specified here: [[http://www.w3.org/TR/2015/WD-push-api-20151215/]] + */ package object push { - /** - * Implicit function for patching Push API support onto ServiceWorkerRegistration. - */ - implicit def pushServiceWorkerRegistration( - swr: ServiceWorkerRegistration): PushServiceWorkerRegistration = { + /** Implicit function for patching Push API support onto ServiceWorkerRegistration. + */ + implicit def pushServiceWorkerRegistration(swr: ServiceWorkerRegistration): PushServiceWorkerRegistration = { swr.asInstanceOf[PushServiceWorkerRegistration] } - /** - * Implicit function for patching Push API support onto ServiceWorkerGlobalScope - */ - implicit def pushServiceWorkerGlobalScope( - swgs: ServiceWorkerGlobalScope): PushServiceWorkerGlobalScope = { + /** Implicit function for patching Push API support onto ServiceWorkerGlobalScope + */ + implicit def pushServiceWorkerGlobalScope(swgs: ServiceWorkerGlobalScope): PushServiceWorkerGlobalScope = { swgs.asInstanceOf[PushServiceWorkerGlobalScope] } - /** - * A trait used for patching Push API support onto ServiceWorkerRegistration. - */ + /** A trait used for patching Push API support onto ServiceWorkerRegistration. + */ @js.native trait PushServiceWorkerRegistration extends js.Any { - /** - * The pushManager property of the ServiceWorkerRegistration interface returns - * a reference to the PushManager interface for managing push subscriptions; - * this includes support for subscribing, getting an active subscription, and - * accessing push permission status. - * - * MDN - */ + /** The pushManager property of the ServiceWorkerRegistration interface returns a reference to the PushManager + * interface for managing push subscriptions; this includes support for subscribing, getting an active + * subscription, and accessing push permission status. + * + * MDN + */ val pushManager: PushManager = js.native } - /** - * A trait used for patching Push API support onto ServiceWorkerGlobalScope. - */ + /** A trait used for patching Push API support onto ServiceWorkerGlobalScope. + */ @js.native trait PushServiceWorkerGlobalScope extends js.Any { - /** - * The ServiceWorkerGlobalScope.onpush event of the ServiceWorkerGlobalScope - * interface is fired whenever a push message is received by a service worker - * via a push server. - * - * MDN - */ + /** The ServiceWorkerGlobalScope.onpush event of the ServiceWorkerGlobalScope interface is fired whenever a push + * message is received by a service worker via a push server. + * + * MDN + */ var onpush: js.Function1[PushEvent, _] = js.native - /** - * The ServiceWorkerGlobalScope.onpushsubscriptionchange event of the - * ServiceWorkerGlobalScope interface is fired whenever a push subscription has - * been invalidated (or is about to become so). This offers an opportunity to - * resubscribe in order to continue receiving push messages, if desired. This - * might happen if, for example, the push service sets an expiration time a - * subscription. - * - * MDN - */ + /** The ServiceWorkerGlobalScope.onpushsubscriptionchange event of the ServiceWorkerGlobalScope interface is fired + * whenever a push subscription has been invalidated (or is about to become so). This offers an opportunity to + * resubscribe in order to continue receiving push messages, if desired. This might happen if, for example, the + * push service sets an expiration time a subscription. + * + * MDN + */ var onpushsubscriptionchange: js.Function1[PushEvent, _] = js.native } } diff --git a/src/main/scala/org/scalajs/dom/experimental/serviceworkers/ServiceWorkers.scala b/src/main/scala/org/scalajs/dom/experimental/serviceworkers/ServiceWorkers.scala index 321063a0f..5c33b9500 100644 --- a/src/main/scala/org/scalajs/dom/experimental/serviceworkers/ServiceWorkers.scala +++ b/src/main/scala/org/scalajs/dom/experimental/serviceworkers/ServiceWorkers.scala @@ -9,67 +9,53 @@ import scala.scalajs.js.| @js.native sealed trait FrameType extends js.Any -/** - * part of ServiceWorker - * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client-frametype ¶4.2.2 frameType]] - * of serviceWorker spec - */ +/** part of ServiceWorker + * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client-frametype ¶4.2.2 frameType]] of + * serviceWorker spec + */ object FrameType { - /** - * The window client's global object's browsing context is an auxiliary - * browsing context. - */ + /** The window client's global object's browsing context is an auxiliary browsing context. + */ val auxiliary = "auxiliary".asInstanceOf[FrameType] - /** - * The window client's global object's browsing context is a top-level - * browsing context. */ + /** The window client's global object's browsing context is a top-level browsing context. + */ val `top-level` = "top-level".asInstanceOf[FrameType] - /** - * The window client's global object's browsing context is a nested - * browsing context. - **/ + /** The window client's global object's browsing context is a nested browsing context. + */ val nested = "nested".asInstanceOf[FrameType] val none = "none".asInstanceOf[FrameType] } -/** - * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client ¶4.2 Client]] - * of Service Workers 1 spec. - */ +/** [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client ¶4.2 Client]] of Service Workers 1 spec. + */ @js.native trait Client extends js.Object { - /** - * The url attribute must return the context object's associated service worker - * client's serialized creation url. - */ + /** The url attribute must return the context object's associated service worker client's serialized creation url. + */ def url: String = js.native def frameType: FrameType = js.native - /** - * The id attribute must return its associated service worker client's id. - */ + /** The id attribute must return its associated service worker client's id. + */ def id: String = js.native - /** - * - * @param message the spec says this is of type any (?!) - * @param transfer https://html.spec.whatwg.org/multipage/infrastructure.html#transferable-objects - * - */ - def postMessage(message: Any, - transfer: Sequence[Transferable] = null): Unit = js.native + /** @param message + * the spec says this is of type any (?!) + * @param transfer + * https://html.spec.whatwg.org/multipage/infrastructure.html#transferable-objects + */ + def postMessage(message: Any, transfer: Sequence[Transferable] = null): Unit = js.native } -/** - * see [[https://html.spec.whatwg.org/multipage/scripting.html#canvasproxy ¶4.12.4.1 Proxying canvases to workers]] - * in whatwg html spec. - */ +/** see [[https://html.spec.whatwg.org/multipage/scripting.html#canvasproxy ¶4.12.4.1 Proxying canvases to workers]] in + * whatwg html spec. + */ @js.native trait CanvasProxy extends js.Any { def setContext(context: RenderingContext): Unit = js.native @@ -81,28 +67,23 @@ trait FetchEventInit extends ExtendableEventInit { var clientId: js.UndefOr[String] = js.undefined } -/** - * See [[https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent FetchEvent]] on MDN - * - * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#fetch-event-section ¶4.5 FetchEvent]] - * on whatwg ServiceWorker spec. - */ +/** See [[https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent FetchEvent]] on MDN + * + * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#fetch-event-section ¶4.5 FetchEvent]] on whatwg + * ServiceWorker spec. + */ @js.native @JSGlobal -class FetchEvent(typeArg: String, init: js.UndefOr[FetchEventInit]) - extends ExtendableEvent(typeArg, init) { +class FetchEvent(typeArg: String, init: js.UndefOr[FetchEventInit]) extends ExtendableEvent(typeArg, init) { - /** - * Boolean that is true if the event was dispatched with the user's - * intention for the page to reload, and false otherwise. Typically, - * pressing the refresh button in a browser is a reload, while clicking a - * link and pressing the back button is not. - */ + /** Boolean that is true if the event was dispatched with the user's intention for the page to reload, and false + * otherwise. Typically, pressing the refresh button in a browser is a reload, while clicking a link and pressing the + * back button is not. + */ def isReload: Boolean = js.native - /** - * The Request that triggered the event handler. - */ + /** The Request that triggered the event handler. + */ def request: Request = js.native def preloadResponse: js.Promise[js.UndefOr[Response]] = js.native @@ -113,292 +94,227 @@ class FetchEvent(typeArg: String, init: js.UndefOr[FetchEventInit]) def resultingClientId: String = js.native - /** - * See [[https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith respondWith]] - * page on MDN. - * - * The respondWith() method of the FetchEvent interface is intended for - * containing code that generates custom responses to the requests coming - * from the controlled page. This code will resolve by returning a Response - * or network error to Fetch. - * - * Renderer-side security checks about tainting for cross-origin content are - * tied to the transparency (or opacity) of the Response body, not URLs. If - * the request is a top-level navigation and the return value is a Response - * whose type attribute is opaque (i.e. an opaque response body), a network - * error is returned to Fetch. The final URL of all successful (non - * network-error) responses is the requested URL. - */ - def respondWith( - promisedResponse: Response | js.Promise[Response]): Unit = js.native + /** See [[https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith respondWith]] page on MDN. + * + * The respondWith() method of the FetchEvent interface is intended for containing code that generates custom + * responses to the requests coming from the controlled page. This code will resolve by returning a Response or + * network error to Fetch. + * + * Renderer-side security checks about tainting for cross-origin content are tied to the transparency (or opacity) of + * the Response body, not URLs. If the request is a top-level navigation and the return value is a Response whose + * type attribute is opaque (i.e. an opaque response body), a network error is returned to Fetch. The final URL of + * all successful (non network-error) responses is the requested URL. + */ + def respondWith(promisedResponse: Response | js.Promise[Response]): Unit = js.native } -/** - * The ServiceWorker interface of the ServiceWorker API provides a reference to - * a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can - * be associated with the same service worker, each through a unique - * ServiceWorker object. - * - * MDN - */ +/** The ServiceWorker interface of the ServiceWorker API provides a reference to a service worker. Multiple browsing + * contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique + * ServiceWorker object. + * + * MDN + */ @js.native trait ServiceWorker extends EventTarget { - /** - * Returns the ServiceWorker serialized script URL defined as part of - * ServiceWorkerRegistration. Must be on the same origin as the document that - * registers the ServiceWorker. - * - * MDN - */ + /** Returns the ServiceWorker serialized script URL defined as part of ServiceWorkerRegistration. Must be on the same + * origin as the document that registers the ServiceWorker. + * + * MDN + */ def scriptURL: String = js.native - /** - * The state read-only property of the ServiceWorker interface returns a - * string representing the current state of the service worker. - * It can be one of the following values: installing, installed, activating, - * activated, or redundant. - * - * MDN - */ + /** The state read-only property of the ServiceWorker interface returns a string representing the current state of the + * service worker. It can be one of the following values: installing, installed, activating, activated, or redundant. + * + * MDN + */ def state: String = js.native - /** - * An EventListener property called whenever an event of type statechange is - * fired; it is basically fired anytime the ServiceWorker.state changes. - * - * MDN - */ + /** An EventListener property called whenever an event of type statechange is fired; it is basically fired anytime the + * ServiceWorker.state changes. + * + * MDN + */ var onstatechange: js.Function1[Event, _] = js.native - /** - * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#service-worker-postmessage ¶3.1.3 postMessage]] - * on whatwg ServiceWorker spec. - */ - def postMessage(message: js.Any, - transfer: js.Array[Transferable] = js.native): Unit = js.native + /** [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#service-worker-postmessage ¶3.1.3 postMessage]] + * on whatwg ServiceWorker spec. + */ + def postMessage(message: js.Any, transfer: js.Array[Transferable] = js.native): Unit = js.native } -/** - * The ServiceWorkerRegistion interface of the ServiceWorker API represents - * the service worker registration. You register a service worker to control - * one or more pages that share the same origin. - * - * MDN - */ +/** The ServiceWorkerRegistion interface of the ServiceWorker API represents the service worker registration. You + * register a service worker to control one or more pages that share the same origin. + * + * MDN + */ @js.native trait ServiceWorkerRegistration extends EventTarget { - /** - * The installing property of the ServiceWorkerRegistration interface returns - * a service worker whose ServiceWorker.state is installing. - * This property is initially set to null. - * - * MDN - */ + /** The installing property of the ServiceWorkerRegistration interface returns a service worker whose + * ServiceWorker.state is installing. This property is initially set to null. + * + * MDN + */ var installing: ServiceWorker = js.native - /** - * The waiting property of the ServiceWorkerRegistration interface returns a - * service worker whose ServiceWorker.state is installed. - * This property is initially set to null. - * - * MDN - */ + /** The waiting property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state + * is installed. This property is initially set to null. + * + * MDN + */ var waiting: ServiceWorker = js.native - /** - * The active property of the ServiceWorkerRegistration interface returns a - * service worker whose ServiceWorker.state is activating or activated. - * This property is initially set to null. - * - * MDN - */ + /** The active property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state + * is activating or activated. This property is initially set to null. + * + * MDN + */ var active: ServiceWorker = js.native - /** - * The scope read-only property of the ServiceWorkerRegistration interface - * returns a unique identifier for a service worker registration. - * The service worker must be on the same origin as the document that - * registers the ServiceWorker. - * - * MDN - */ + /** The scope read-only property of the ServiceWorkerRegistration interface returns a unique identifier for a service + * worker registration. The service worker must be on the same origin as the document that registers the + * ServiceWorker. + * + * MDN + */ var scope: String = js.native - /** - * The update method of the ServiceWorkerRegistration interface allows you - * to ping the server for an updated service worker script. - * If you don't explicitly call this, the UA will do this automatically - * once every 24 hours. - * - * MDN - */ + /** The update method of the ServiceWorkerRegistration interface allows you to ping the server for an updated service + * worker script. If you don't explicitly call this, the UA will do this automatically once every 24 hours. + * + * MDN + */ def update(): js.Promise[Unit] = js.native - /** - * The unregister method of the ServiceWorkerRegistration interface - * unregisters the service worker registration and returns a Promise. - * The promise will resolve to false if no registration was found, otherwise - * it resolves to true irrespective of whether unregistration happened or not - * (it may not unregister if someone else just called - * ServiceWorkerContainer.register with the same scope.) The service worker - * will finish any ongoing operations before it is unregistered. - * - * MDN - */ + /** The unregister method of the ServiceWorkerRegistration interface unregisters the service worker registration and + * returns a Promise. The promise will resolve to false if no registration was found, otherwise it resolves to true + * irrespective of whether unregistration happened or not (it may not unregister if someone else just called + * ServiceWorkerContainer.register with the same scope.) The service worker will finish any ongoing operations before + * it is unregistered. + * + * MDN + */ def unregister(): js.Promise[Boolean] = js.native - /** - * The onupdatefound property of the ServiceWorkerRegistration interface is - * an EventListener property called whenever an event of type statechange - * is fired; it is fired any time the ServiceWorkerRegistration. - * installing property acquires a new service worker. - * - * MDN - */ + /** The onupdatefound property of the ServiceWorkerRegistration interface is an EventListener property called whenever + * an event of type statechange is fired; it is fired any time the ServiceWorkerRegistration. installing property + * acquires a new service worker. + * + * MDN + */ var onupdatefound: js.Function1[Event, _] = js.native - /** - * The getNotifications() method of the ServiceWorkerRegistration interface - * returns a list of the notifications in the order that they were created - * from the current origin via the current service worker registration. - * Origins can have many active but differently-scoped service worker - * registrations. Notifications created by one service worker on the same - * origin will not be available to other active services workers on that same - * origin. - * - * MDN - */ - def getNotifications( - options: GetNotificationOptions = ???): js.Promise[Sequence[Notification]] = js.native - - /** - * The showNotification() method of the ServiceWorkerRegistration interface - * creates a notification on an active service worker. - * - * MDN - */ - def showNotification(title: String, - options: NotificationOptions = ???): js.Promise[Unit] = js.native + /** The getNotifications() method of the ServiceWorkerRegistration interface returns a list of the notifications in + * the order that they were created from the current origin via the current service worker registration. Origins can + * have many active but differently-scoped service worker registrations. Notifications created by one service worker + * on the same origin will not be available to other active services workers on that same origin. + * + * MDN + */ + def getNotifications(options: GetNotificationOptions = ???): js.Promise[Sequence[Notification]] = js.native + + /** The showNotification() method of the ServiceWorkerRegistration interface creates a notification on an active + * service worker. + * + * MDN + */ + def showNotification(title: String, options: NotificationOptions = ???): js.Promise[Unit] = js.native } -/** - * An object containing options to filter the notifications returned. - * - * MDN - */ +/** An object containing options to filter the notifications returned. + * + * MDN + */ trait GetNotificationOptions extends js.Object { - /** - * A DOMString representing a notification tag. If specified, only - * notifications that have this tag will be returned. - * - * MDN - */ + /** A DOMString representing a notification tag. If specified, only notifications that have this tag will be returned. + * + * MDN + */ var tag: js.UndefOr[String] = js.undefined } -/** - * The ServiceWorkerContainer interface of the ServiceWorker API exposes the - * ServiceWorkerContainer. register(scriptURL, scope[, base]) method used to - * register service workers, and the ServiceWorkerContainer. - * controller property used to determine whether or not the current page is - * actively controlled. - * - * MDN - */ +/** The ServiceWorkerContainer interface of the ServiceWorker API exposes the ServiceWorkerContainer. + * register(scriptURL, scope[, base]) method used to register service workers, and the ServiceWorkerContainer. + * controller property used to determine whether or not the current page is actively controlled. + * + * MDN + */ @js.native trait ServiceWorkerContainer extends EventTarget { - /** - * Creates or updates a ServiceWorkerRegistration for the given scriptURL. - * If successful, a service worker registration ties the provided script URL - * to a scope, which is subsequently used for navigation matching. - * If the method can't return a ServiceWorkerRegistration, it returns a Promise. - * You can call this method unconditionally from the controlled page, i.e., - * you don't need to first check whether there's an active registration. - * - * MDN - */ + /** Creates or updates a ServiceWorkerRegistration for the given scriptURL. If successful, a service worker + * registration ties the provided script URL to a scope, which is subsequently used for navigation matching. If the + * method can't return a ServiceWorkerRegistration, it returns a Promise. You can call this method unconditionally + * from the controlled page, i.e., you don't need to first check whether there's an active registration. + * + * MDN + */ def register(scriptURL: String, options: js.Object = new js.Object()): js.Promise[ServiceWorkerRegistration] = js.native - /** - * The ServiceWorkerContainer.controller read-only property of the - * ServiceWorkerContainer interface returns the ServiceWorker whose state is - * activated (the same object returned by ServiceWorkerRegistration.active). - * This property returns null if the request is a force refresh - * (Shift + refresh) or if there is no active worker. - * - * MDN - */ + /** The ServiceWorkerContainer.controller read-only property of the ServiceWorkerContainer interface returns the + * ServiceWorker whose state is activated (the same object returned by ServiceWorkerRegistration.active). This + * property returns null if the request is a force refresh (Shift + refresh) or if there is no active worker. + * + * MDN + */ def controller: ServiceWorker = js.native - /** - * Gets a ServiceWorkerRegistration object whose scope URL matches the - * document URL. - * If the method can't return a ServiceWorkerRegistration, it returns a Promise. - * - * MDN - */ - def getRegistration( - scope: String = ""): js.Promise[js.UndefOr[ServiceWorkerRegistration]] = js.native - - /** - * The getRegistrations() method of the ServiceWorkerContainer interface - * returns all ServiceWorkerRegistrations associated with a - * ServiceWorkerContainer in an array. If the method can't return - * ServiceWorkerRegistrations, it returns a Promise. - * - * MDN - */ + /** Gets a ServiceWorkerRegistration object whose scope URL matches the document URL. If the method can't return a + * ServiceWorkerRegistration, it returns a Promise. + * + * MDN + */ + def getRegistration(scope: String = ""): js.Promise[js.UndefOr[ServiceWorkerRegistration]] = js.native + + /** The getRegistrations() method of the ServiceWorkerContainer interface returns all ServiceWorkerRegistrations + * associated with a ServiceWorkerContainer in an array. If the method can't return ServiceWorkerRegistrations, it + * returns a Promise. + * + * MDN + */ def getRegistrations(): js.Promise[js.Array[ServiceWorkerRegistration]] = js.native - /** - * The ready read-only property of the ServiceWorkerContainer interface - * defines whether a service worker is ready to control a page or not. It - * returns a Promise that will never reject, which resolves to a - * ServiceWorkerRegistration with an ServiceWorkerRegistration.active worker. - * - * MDN - */ + /** The ready read-only property of the ServiceWorkerContainer interface defines whether a service worker is ready to + * control a page or not. It returns a Promise that will never reject, which resolves to a ServiceWorkerRegistration + * with an ServiceWorkerRegistration.active worker. + * + * MDN + */ def ready: js.Promise[ServiceWorkerRegistration] = js.native - /** - * The oncontrollerchange property of the ServiceWorkerContainer interface - * is an event handler fired whenever a controllerchange event occurs — - * when the document's associated ServiceWorkerRegistratin acquires a new - * ServiceWorkerRegistration.active worker. - * - * MDN - */ + /** The oncontrollerchange property of the ServiceWorkerContainer interface is an event handler fired whenever a + * controllerchange event occurs — when the document's associated ServiceWorkerRegistratin acquires a new + * ServiceWorkerRegistration.active worker. + * + * MDN + */ var oncontrollerchange: js.Function1[Event, _] = js.native - /** - * The onmessage property of the ServiceWorkerContainer interface is an event - * handler fired whenever a message event occurs — when incoming messages are - * received to the ServiceWorkerContainer object (e.g., via a - * MessagePort.postMessage() call). - * - * MDN - */ + /** The onmessage property of the ServiceWorkerContainer interface is an event handler fired whenever a message event + * occurs — when incoming messages are received to the ServiceWorkerContainer object (e.g., via a + * MessagePort.postMessage() call). + * + * MDN + */ var onmessage: js.Function1[MessageEvent, _] = js.native } trait ExtendableEventInit extends EventInit {} -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#extendable-event-interface ¶4.4 ExtendableEvent]] - * of whatwg ServiceWorker spec. - * - * An ExtendableEvent object has an associated extend lifetime promises (an - * array of promises). It is initially set to null. - */ +/** See + * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#extendable-event-interface ¶4.4 ExtendableEvent]] + * of whatwg ServiceWorker spec. + * + * An ExtendableEvent object has an associated extend lifetime promises (an array of promises). It is initially set to + * null. + */ @js.native @JSGlobal -class ExtendableEvent(typeArg: String, init: js.UndefOr[ExtendableEventInit]) - extends Event(typeArg, init) { +class ExtendableEvent(typeArg: String, init: js.UndefOr[ExtendableEventInit]) extends Event(typeArg, init) { def waitUntil(promise: js.Promise[Any]): Unit = js.native } @@ -414,41 +330,35 @@ trait ExtendableMessageEventInit extends ExtendableEventInit { var ports: js.UndefOr[js.Array[MessagePort]] = js.undefined } -/** - * Service workers define the extendable message event that extends the - * message event defined in HTML to allow extending the lifetime of the event. - * - * MDN - */ +/** Service workers define the extendable message event that extends the message event defined in HTML to allow + * extending the lifetime of the event. + * + * MDN + */ @js.native @JSGlobal -class ExtendableMessageEvent(typeArg: String, - init: js.UndefOr[ExtendableMessageEventInit]) +class ExtendableMessageEvent(typeArg: String, init: js.UndefOr[ExtendableMessageEventInit]) extends ExtendableEvent(typeArg, init) { - /** - * Returns the event's data. It can be any data type. - */ + /** Returns the event's data. It can be any data type. + */ val data: Any = js.native - /** - * Returns the origin of the service worker's environment settings object. - */ + /** Returns the origin of the service worker's environment settings object. + */ val origin: String = js.native - /** - * Represents, in server-sent events, the last event ID of the event source. - */ + /** Represents, in server-sent events, the last event ID of the event source. + */ val lastEventId: String = js.native - /** - * @return a reference to the service worker that sent the message or `null`. - */ + /** @return + * a reference to the service worker that sent the message or `null`. + */ def source: ServiceWorker | MessagePort = js.native - /** - * It represents the MessagePort array being sent, if any. - */ + /** It represents the MessagePort array being sent, if any. + */ def ports: js.Array[MessagePort] = js.native } @@ -460,49 +370,38 @@ trait ServiceWorkerMessageEventInit extends EventInit { var ports: js.UndefOr[js.Array[MessagePort]] = js.undefined } -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#service-worker-obj ¶3.1 ServiceWorker]] - * of ServiceWorker whatwg spec. - */ +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#service-worker-obj ¶3.1 ServiceWorker]] of + * ServiceWorker whatwg spec. + */ @js.native sealed trait ServiceWorkerState extends js.Any object ServiceWorkerState { - /** - * The service worker in this state is considered an installing worker. - * During this state, event.waitUntil(f) can be called inside the oninstall - * event handler to extend the life of the installing worker until the - * passed promise resolves successfully. This is primarily used to ensure - * that the service worker is not active until all of the core caches are - * populated. - */ + /** The service worker in this state is considered an installing worker. During this state, event.waitUntil(f) can be + * called inside the oninstall event handler to extend the life of the installing worker until the passed promise + * resolves successfully. This is primarily used to ensure that the service worker is not active until all of the + * core caches are populated. + */ val installing = "installing".asInstanceOf[ServiceWorkerState] - /** - * The service worker in this state is considered a waiting worker. - */ + /** The service worker in this state is considered a waiting worker. + */ val installed = "installed".asInstanceOf[ServiceWorkerState] - /** - * The service worker in this state is considered an active worker. During - * this state, event.waitUntil(f) can be called inside the onactivate event - * handler to extend the life of the active worker until the passed promise - * resolves successfully. No functional events are dispatched until the - * state becomes activated. - */ + /** The service worker in this state is considered an active worker. During this state, event.waitUntil(f) can be + * called inside the onactivate event handler to extend the life of the active worker until the passed promise + * resolves successfully. No functional events are dispatched until the state becomes activated. + */ val activating = "activating".asInstanceOf[ServiceWorkerState] - /** - * The service worker in this state is considered an active worker ready to - * handle functional events. - */ + /** The service worker in this state is considered an active worker ready to handle functional events. + */ val activated = "activated".asInstanceOf[ServiceWorkerState] - /** - * A new service worker is replacing the current service worker, or the - * current service worker is being discarded due to an install failure. - */ + /** A new service worker is replacing the current service worker, or the current service worker is being discarded due + * to an install failure. + */ val redundant = "redundant".asInstanceOf[ServiceWorkerState] } @@ -519,10 +418,8 @@ object ClientType { val all = "all".asInstanceOf[ClientType] } -/** - * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client ¶4.2 Client]] - * of Service Workers 1 spec. - */ +/** [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client ¶4.2 Client]] of Service Workers 1 spec. + */ @js.native trait ClientQueryOptions extends js.Object { var includeUncontrolled: Boolean = js.native @@ -530,151 +427,123 @@ trait ClientQueryOptions extends js.Object { var `type`: ClientType = js.native } -/** - * The WindowClient interface of the ServiceWorker API represents the scope of - * a service worker client that is a document in a browser context, controlled - * by an active worker. The service worker client independently selects and uses - * a service worker for its own loading and sub-resources. - * - * MDN - */ +/** The WindowClient interface of the ServiceWorker API represents the scope of a service worker client that is a + * document in a browser context, controlled by an active worker. The service worker client independently selects and + * uses a service worker for its own loading and sub-resources. + * + * MDN + */ @js.native trait WindowClient extends Client { - /** - * The visibilityState read-only property of the WindowClient interface - * indicates the visibility of the current client. This value can be one of - * hidden, visible, prerender, or unloaded. - * - * MDN - */ + /** The visibilityState read-only property of the WindowClient interface indicates the visibility of the current + * client. This value can be one of hidden, visible, prerender, or unloaded. + * + * MDN + */ //todo: stubs for https://www.w3.org/TR/page-visibility/#dom-document-visibilitystate def visibilityState: String = js.native - /** - * The focused read-only property of the WindowClient interface is a Boolean - * that indicates whether the current client has focus. - * - * MDN - */ + /** The focused read-only property of the WindowClient interface is a Boolean that indicates whether the current + * client has focus. + * + * MDN + */ def focused: Boolean = js.native - /** - * Gives user input focus to the current client and returns a Promise that - * resolves to the existing WindowClient. - * - * MDN - */ + /** Gives user input focus to the current client and returns a Promise that resolves to the existing WindowClient. + * + * MDN + */ def focus(): js.Promise[WindowClient] - /** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client-navigate-method ¶4.2.8 navigate(url)]] - * of ServiceWorker whatwg spec. - * - * @return Promse[WindowClient] or `null` - */ + /** See + * [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#client-navigate-method ¶4.2.8 navigate(url)]] + * of ServiceWorker whatwg spec. + * + * @return + * Promse[WindowClient] or `null` + */ def navigate(url: String): js.Promise[WindowClient] = js.native } -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#clients ¶4.3 clients]] - * of ServiceWorker whatwg spec. - */ +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#clients ¶4.3 clients]] of ServiceWorker + * whatwg spec. + */ @js.native trait Clients extends js.Object { def get(id: String): js.Promise[js.UndefOr[Client]] = js.native - def matchAll( - options: js.UndefOr[ - ClientQueryOptions] = js.native): js.Promise[js.Array[Client]] = js.native + def matchAll(options: js.UndefOr[ClientQueryOptions] = js.native): js.Promise[js.Array[Client]] = js.native def openWindow(url: String): js.Promise[WindowClient] = js.native def claim(): js.Promise[Unit] = js.native } -/** - * The ServiceWorkerGlobalScope interface of the ServiceWorker API represents - * the global execution context of a service worker. - * - * Developers should keep in mind that the ServiceWorker.state is not persisted - * across the termination/restart cycle, so each event handler should assume - * it's being invoked with a bare, default global state. - * - * Once successfully registered, a service worker can and will be terminated - * when idle to conserve memory and processor power. An active service worker - * is automatically restarted to respond to events, such as - * ServiceWorkerGlobalScope.onfetch or ServiceWorkerGlobalScope.onmessage. - * - * Additionally, synchronous requests are not allowed from within a service - * worker — only asynchronous requests, like those initiated via the fetch() - * method, can be used. - * - * MDN - */ +/** The ServiceWorkerGlobalScope interface of the ServiceWorker API represents the global execution context of a service + * worker. + * + * Developers should keep in mind that the ServiceWorker.state is not persisted across the termination/restart cycle, + * so each event handler should assume it's being invoked with a bare, default global state. + * + * Once successfully registered, a service worker can and will be terminated when idle to conserve memory and processor + * power. An active service worker is automatically restarted to respond to events, such as + * ServiceWorkerGlobalScope.onfetch or ServiceWorkerGlobalScope.onmessage. + * + * Additionally, synchronous requests are not allowed from within a service worker — only asynchronous requests, like + * those initiated via the fetch() method, can be used. + * + * MDN + */ @js.native trait ServiceWorkerGlobalScope extends WorkerGlobalScope { - /** - * Returns the Clients object associated with the service worker. - * - * MDN - */ + /** Returns the Clients object associated with the service worker. + * + * MDN + */ def clients: Clients = js.native - /** - * The registration read-only property of the ServiceWorkerGlobalScope - * interface returns a reference to the ServiceWorkerRegistration object, - * which represents the service worker's registration. - */ + /** The registration read-only property of the ServiceWorkerGlobalScope interface returns a reference to the + * ServiceWorkerRegistration object, which represents the service worker's registration. + */ def registration: ServiceWorkerRegistration = js.native - /** - * An event handler fired whenever an activate event occurs (when the service - * worker activates). - * This happens after installation, when the page to be controlled by the - * service worker refreshes. - * - * MDN - */ + /** An event handler fired whenever an activate event occurs (when the service worker activates). This happens after + * installation, when the page to be controlled by the service worker refreshes. + * + * MDN + */ var onactivate: js.Function1[ExtendableEvent, _] = js.native - /** - * An event handler fired whenever a fetch event occurs — when a fetch() is - * called. - * - * MDN - */ + /** An event handler fired whenever a fetch event occurs — when a fetch() is called. + * + * MDN + */ var onfetch: js.Function1[FetchEvent, _] = js.native - /** - * An event handler fired whenever an install event occurs — when a - * ServiceWorkerRegistration acquires a new - * ServiceWorkerRegistration.installing worker. - * - * MDN - */ + /** An event handler fired whenever an install event occurs — when a ServiceWorkerRegistration acquires a new + * ServiceWorkerRegistration.installing worker. + * + * MDN + */ var oninstall: js.Function1[ExtendableEvent, _] = js.native - /** - * An event handler fired whenever a message event occurs — when incoming - * messages are received. Controlled pages can use the MessagePort.postMessage - * method to send messages to service workers. - * The service worker can optionally send a response back via the MessagePort - * exposed in event.data.port, corresponding to the controlled page. - * - * MDN - */ + /** An event handler fired whenever a message event occurs — when incoming messages are received. Controlled pages can + * use the MessagePort.postMessage method to send messages to service workers. The service worker can optionally send + * a response back via the MessagePort exposed in event.data.port, corresponding to the controlled page. + * + * MDN + */ var onmessage: js.Function1[MessageEvent, _] = js.native - /** - * Forces the waiting service worker to become the active service worker. - * This method can be used with [[Clients.claim]] to ensure that updates to - * the underlying service worker take effect immediately for both the current - * client and all other active clients. - * - * MDN - */ + /** Forces the waiting service worker to become the active service worker. This method can be used with + * [[Clients.claim]] to ensure that updates to the underlying service worker take effect immediately for both the + * current client and all other active clients. + * + * MDN + */ def skipWaiting(): js.Promise[Unit] = js.native } @@ -684,31 +553,24 @@ object ServiceWorkerGlobalScope extends js.Object { def self: ServiceWorkerGlobalScope = js.native } -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] - * of ServiceWorker whatwg spec. - */ +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] of ServiceWorker whatwg + * spec. + */ @deprecated("Use org.scalajs.dom.experimental.cachestorage.Cache", "1.2.0") @js.native @JSGlobal abstract class Cache extends org.scalajs.dom.experimental.cachestorage.Cache -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] - * of ServiceWorker whatwg spec. - */ -@deprecated("Use org.scalajs.dom.experimental.cachestorage.CacheQueryOptions", - "1.2.0") +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache ¶5.4 cache]] of ServiceWorker whatwg + * spec. + */ +@deprecated("Use org.scalajs.dom.experimental.cachestorage.CacheQueryOptions", "1.2.0") @js.native -trait CacheQueryOptions - extends org.scalajs.dom.experimental.cachestorage.CacheQueryOptions - -/** - * See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache-storage ¶5.5 cache]] - * of ServiceWorker whatwg spec. - */ -@deprecated("Use org.scalajs.dom.experimental.cachestorage.CacheStorage", - "1.2.0") +trait CacheQueryOptions extends org.scalajs.dom.experimental.cachestorage.CacheQueryOptions + +/** See [[https://slightlyoff.github.io/ServiceWorker/spec/service_worker_1/#cache-storage ¶5.5 cache]] of ServiceWorker + * whatwg spec. + */ +@deprecated("Use org.scalajs.dom.experimental.cachestorage.CacheStorage", "1.2.0") @js.native -trait CacheStorage - extends org.scalajs.dom.experimental.cachestorage.CacheStorage +trait CacheStorage extends org.scalajs.dom.experimental.cachestorage.CacheStorage diff --git a/src/main/scala/org/scalajs/dom/experimental/serviceworkers/package.scala b/src/main/scala/org/scalajs/dom/experimental/serviceworkers/package.scala index 01a195803..cb699e260 100644 --- a/src/main/scala/org/scalajs/dom/experimental/serviceworkers/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/serviceworkers/package.scala @@ -5,17 +5,16 @@ import scala.language.implicitConversions import scala.scalajs.js import scala.scalajs.js.| -/** - * Service Workers - * - * @see [[https://www.w3.org/TR/2015/WD-service-workers-20150625/ Service Workers W3C Working Draft]] - */ +/** Service Workers + * + * @see + * [[https://www.w3.org/TR/2015/WD-service-workers-20150625/ Service Workers W3C Working Draft]] + */ package object serviceworkers { - /** - * [[https://html.spec.whatwg.org/multipage/infrastructure.html#transferable ¶2.7.4 Transferable Objects]] - * in whatwg html spec. - */ + /** [[https://html.spec.whatwg.org/multipage/infrastructure.html#transferable ¶2.7.4 Transferable Objects]] in whatwg + * html spec. + */ type Transferable = org.scalajs.dom.Transferable | CanvasProxy implicit def toServiceWorkerNavigator(n: Navigator): ServiceWorkerNavigator = @@ -24,14 +23,11 @@ package object serviceworkers { @js.native trait ServiceWorkerNavigator extends js.Any { - /** - * The Navigator.serviceWorker read-only property returns a - * ServiceWorkerContainer object, which provides access to registration, - * removal, upgrade, and communication with the ServiceWorker objects for - * the associated document. - * - * MDN - */ + /** The Navigator.serviceWorker read-only property returns a ServiceWorkerContainer object, which provides access to + * registration, removal, upgrade, and communication with the ServiceWorker objects for the associated document. + * + * MDN + */ val serviceWorker: ServiceWorkerContainer = js.native } } diff --git a/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorker.scala b/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorker.scala index d7d326974..b1a254e59 100644 --- a/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorker.scala +++ b/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorker.scala @@ -4,38 +4,33 @@ import org.scalajs.dom.{AbstractWorker, MessagePort} import scala.scalajs.js import scala.scalajs.js.annotation._ -/** - * The SharedWorker interface represents a specific kind of worker that can be - * accessed from several browsing contexts, such as several windows, iframes or - * even workers. They implement an interface different than dedicated workers - * and have a different global scope, SharedWorkerGlobalScope. - * - * MDN - * @constructor The SharedWorker constructor creates a SharedWorker object that - * executes the script at the specified URL.This script must obey - * the same-origin policy. - * - * If the URL has an invalid syntax or if the same-origin - * policy is violated, a DOMException of type SECURITY_ERR is thrown. - * @example - * {{{var myWorker = new SharedWorker("aURL", name);}}} - * @param stringUrl A DOMString representing the URL of the script the worker - * will execute. It must obey the same-origin policy. - * @param name An optional argument that specifies an existing - * SharedWorkerGlobalScope.name — if this is specified then that - * SharedWorkerGlobalScope will be used as the scope for this - * shared worker. - */ +/** The SharedWorker interface represents a specific kind of worker that can be accessed from several browsing contexts, + * such as several windows, iframes or even workers. They implement an interface different than dedicated workers and + * have a different global scope, SharedWorkerGlobalScope. + * + * MDN + * @constructor + * The SharedWorker constructor creates a SharedWorker object that executes the script at the specified URL.This + * script must obey the same-origin policy. + * + * If the URL has an invalid syntax or if the same-origin policy is violated, a DOMException of type SECURITY_ERR is + * thrown. + * @example + * {{{var myWorker = new SharedWorker("aURL", name);}}} + * @param stringUrl + * A DOMString representing the URL of the script the worker will execute. It must obey the same-origin policy. + * @param name + * An optional argument that specifies an existing SharedWorkerGlobalScope.name — if this is specified then that + * SharedWorkerGlobalScope will be used as the scope for this shared worker. + */ @js.native @JSGlobal -class SharedWorker(stringUrl: String, name: js.UndefOr[String] = js.native) - extends AbstractWorker { +class SharedWorker(stringUrl: String, name: js.UndefOr[String] = js.native) extends AbstractWorker { - /** - * The port property of the SharedWorker interface returns a [[MessagePort]] - * object used to communicate and control the shared worker. - * - * MDN - */ + /** The port property of the SharedWorker interface returns a [[MessagePort]] object used to communicate and control + * the shared worker. + * + * MDN + */ def port: MessagePort = js.native } diff --git a/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorkerGlobalScope.scala b/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorkerGlobalScope.scala index 0491d31d9..747b3cd58 100644 --- a/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorkerGlobalScope.scala +++ b/src/main/scala/org/scalajs/dom/experimental/sharedworkers/SharedWorkerGlobalScope.scala @@ -5,43 +5,34 @@ import org.scalajs.dom.{ApplicationCache, WorkerGlobalScope} import scala.scalajs.js import scala.scalajs.js.annotation._ -/** - * The SharedWorkerGlobalScope object (the SharedWorker global scope) is - * accessible through the self keyword. Some additional global functions, - * namespaces objects, and constructors, not typically associated with the - * worker global scope, but available on it, are listed in the JavaScript - * Reference. See the complete list of functions available to workers. - * - * MDN - */ +/** The SharedWorkerGlobalScope object (the SharedWorker global scope) is accessible through the self keyword. Some + * additional global functions, namespaces objects, and constructors, not typically associated with the worker global + * scope, but available on it, are listed in the JavaScript Reference. See the complete list of functions available to + * workers. + * + * MDN + */ @js.native trait SharedWorkerGlobalScope extends WorkerGlobalScope { - /** - * Returns the name that the SharedWorker was (optionally) given - * when it was created. This is the name that the [[SharedWorker]] - * constructor can pass to get a reference to the - * SharedWorkerGlobalScope. - * - * MDN - */ + /** Returns the name that the SharedWorker was (optionally) given when it was created. This is the name that the + * [[SharedWorker]] constructor can pass to get a reference to the SharedWorkerGlobalScope. + * + * MDN + */ def name: String = js.native - /** - * Returns the ApplicationCache object for the worker - * (see Using the application cache). - * - * MDN - */ + /** Returns the ApplicationCache object for the worker (see Using the application cache). + * + * MDN + */ def applicationCache: ApplicationCache = js.native - /** - * An EventHandler representing the code to be called when the connect - * event is raised — that is, when a MessagePort connection is opened - * between the associated SharedWorker and the main thread. - * - * MDN - */ + /** An EventHandler representing the code to be called when the connect event is raised — that is, when a MessagePort + * connection is opened between the associated SharedWorker and the main thread. + * + * MDN + */ var onconnect: js.Function1[ExtendableMessageEvent, _] = js.native } diff --git a/src/main/scala/org/scalajs/dom/experimental/storage/package.scala b/src/main/scala/org/scalajs/dom/experimental/storage/package.scala index 53bcfeb98..52a8b4e1d 100644 --- a/src/main/scala/org/scalajs/dom/experimental/storage/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/storage/package.scala @@ -4,10 +4,10 @@ import org.scalajs.dom import scala.language.implicitConversions import scala.scalajs.js -/** - * https://storage.spec.whatwg.org/ - */ +/** https://storage.spec.whatwg.org/ + */ package object storage { + implicit def toNavigatorStorage(navigator: dom.Navigator): NavigatorStorage = navigator.asInstanceOf[NavigatorStorage] diff --git a/src/main/scala/org/scalajs/dom/experimental/webgl/WebGLExtensions.scala b/src/main/scala/org/scalajs/dom/experimental/webgl/WebGLExtensions.scala index 07fe7e9cf..8034dc5bf 100644 --- a/src/main/scala/org/scalajs/dom/experimental/webgl/WebGLExtensions.scala +++ b/src/main/scala/org/scalajs/dom/experimental/webgl/WebGLExtensions.scala @@ -1,257 +1,199 @@ package org.scalajs.dom.experimental.webgl -/** - * Abstract class that maps a string enum onto a WebGL extension type - * - * @param value the string enum to pass the underlying `getExtension` - * @tparam T the type that will be returned by the `getExtension` - */ +/** Abstract class that maps a string enum onto a WebGL extension type + * + * @param value + * the string enum to pass the underlying `getExtension` + * @tparam T + * the type that will be returned by the `getExtension` + */ abstract class WebGLExtensionIdentifier[T](val value: String) -/** - * Provides 32-bit floating point texture support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ - */ -object OES_texture_float - extends WebGLExtensionIdentifier[extensions.OESTextureFloat]( - "OES_texture_float") - -/** - * Provides 16-bit floating point texture support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/ - */ -object OES_texture_half_float - extends WebGLExtensionIdentifier[extensions.OESTextureHalfFloat]( - "OES_texture_half_float") - -/** - * Allows simulation of losing the WebGL context to aid debugging. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/ - */ -object WEBGL_lose_context - extends WebGLExtensionIdentifier[extensions.WebGLLoseContext]( - "WEBGL_lose_context") - -/** - * Provides additional first derivative information in fragment shaders. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/ - */ +/** Provides 32-bit floating point texture support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ + */ +object OES_texture_float extends WebGLExtensionIdentifier[extensions.OESTextureFloat]("OES_texture_float") + +/** Provides 16-bit floating point texture support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/ + */ +object OES_texture_half_float extends WebGLExtensionIdentifier[extensions.OESTextureHalfFloat]("OES_texture_half_float") + +/** Allows simulation of losing the WebGL context to aid debugging. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/ + */ +object WEBGL_lose_context extends WebGLExtensionIdentifier[extensions.WebGLLoseContext]("WEBGL_lose_context") + +/** Provides additional first derivative information in fragment shaders. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/ + */ object OES_standard_derivatives - extends WebGLExtensionIdentifier[extensions.OESStandardDerivatives]( - "OES_standard_derivatives") + extends WebGLExtensionIdentifier[extensions.OESStandardDerivatives]("OES_standard_derivatives") -/** - * Provides Vertex Array Objects (VAOs). - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ - */ +/** Provides Vertex Array Objects (VAOs). (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ + */ object OES_vertex_array_object - extends WebGLExtensionIdentifier[extensions.OESVertexArrayObject]( - "OES_vertex_array_object") + extends WebGLExtensionIdentifier[extensions.OESVertexArrayObject]("OES_vertex_array_object") -/** - * Provides additional driver and renderer information. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/ - */ +/** Provides additional driver and renderer information. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/ + */ object WEBGL_debug_renderer_info - extends WebGLExtensionIdentifier[extensions.WebGLDebugRendererInfo]( - "WEBGL_debug_renderer_info") - -/** - * Inspect the transpilation output of GLSL onto the underlying shader language. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/ - */ -object WEBGL_debug_shaders - extends WebGLExtensionIdentifier[extensions.WebGLDebugShaders]( - "WEBGL_debug_shaders") - -/** - * Provides S3TC texture compression support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ - */ + extends WebGLExtensionIdentifier[extensions.WebGLDebugRendererInfo]("WEBGL_debug_renderer_info") + +/** Inspect the transpilation output of GLSL onto the underlying shader language. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/ + */ +object WEBGL_debug_shaders extends WebGLExtensionIdentifier[extensions.WebGLDebugShaders]("WEBGL_debug_shaders") + +/** Provides S3TC texture compression support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ + */ object WEBGL_compressed_texture_s3tc - extends WebGLExtensionIdentifier[extensions.WebGLCompressedTextureS3TC]( - "WEBGL_compressed_texture_s3tc") - -/** - * Provides depth and stencil texture support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ - */ -object WEBGL_depth_texture - extends WebGLExtensionIdentifier[extensions.WebGLDepthTexture]( - "WEBGL_depth_texture") - -/** - * Extends `drawElements` to support the type `UNSIGNED_INT`. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ - */ -object OES_element_index_uint - extends WebGLExtensionIdentifier[extensions.OESElementIndexUint]( - "OES_element_index_uint") - -/** - * Adds anisotropic texture filtering support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/ - */ + extends WebGLExtensionIdentifier[extensions.WebGLCompressedTextureS3TC]("WEBGL_compressed_texture_s3tc") + +/** Provides depth and stencil texture support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ + */ +object WEBGL_depth_texture extends WebGLExtensionIdentifier[extensions.WebGLDepthTexture]("WEBGL_depth_texture") + +/** Extends `drawElements` to support the type `UNSIGNED_INT`. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ + */ +object OES_element_index_uint extends WebGLExtensionIdentifier[extensions.OESElementIndexUint]("OES_element_index_uint") + +/** Adds anisotropic texture filtering support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/ + */ object EXT_texture_filter_anisotropic - extends WebGLExtensionIdentifier[extensions.EXTTextureFilterAnisotropic]( - "EXT_texture_filter_anisotropic") - -/** - * Extends GLSL to support assigning the fragments depth via `gl_FragDepthEXT`. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/ - */ -object EXT_frag_depth - extends WebGLExtensionIdentifier[extensions.EXTFragDepth]("EXT_frag_depth") - -/** - * Enables multiple draw buffer support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/ - */ -object WEBGL_draw_buffers - extends WebGLExtensionIdentifier[extensions.WEBGLDrawBuffers]( - "WEBGL_draw_buffers") - -/** - * Enables array instancing - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/ - */ + extends WebGLExtensionIdentifier[extensions.EXTTextureFilterAnisotropic]("EXT_texture_filter_anisotropic") + +/** Extends GLSL to support assigning the fragments depth via `gl_FragDepthEXT`. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/ + */ +object EXT_frag_depth extends WebGLExtensionIdentifier[extensions.EXTFragDepth]("EXT_frag_depth") + +/** Enables multiple draw buffer support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/ + */ +object WEBGL_draw_buffers extends WebGLExtensionIdentifier[extensions.WEBGLDrawBuffers]("WEBGL_draw_buffers") + +/** Enables array instancing (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/ + */ object ANGLE_instanced_arrays - extends WebGLExtensionIdentifier[extensions.ANGLEInstancedArrays]( - "ANGLE_instanced_arrays") + extends WebGLExtensionIdentifier[extensions.ANGLEInstancedArrays]("ANGLE_instanced_arrays") -/** - * Extends OES_texture_float to support linear and mipmap minification filters. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt - */ +/** Extends OES_texture_float to support linear and mipmap minification filters. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt + */ object OES_texture_float_linear - extends WebGLExtensionIdentifier[extensions.OESTextureFloatLinear]( - "OES_texture_float_linear") + extends WebGLExtensionIdentifier[extensions.OESTextureFloatLinear]("OES_texture_float_linear") -/** - * Extends OES_texture_half_float to support linear and mipmap minification filters. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt - */ +/** Extends OES_texture_half_float to support linear and mipmap minification filters. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt + */ object OES_texture_half_float_linear - extends WebGLExtensionIdentifier[extensions.OESTextureHalfFloatLinear]( - "OES_texture_half_float_linear") - -/** - * Extends `blendEquation` to support `MIN_EXT` and `MAX_EXT`. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/ - */ -object EXT_blend_minmax - extends WebGLExtensionIdentifier[extensions.EXTBlendMinmax]( - "EXT_blend_minmax") - -/** - * Provides fragment shaders with explicit LOD control for texture reads. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/ - */ -object EXT_shader_texture_lod - extends WebGLExtensionIdentifier[extensions.EXTShaderTextureLOD]( - "EXT_shader_texture_lod") - -/** - * Provides ATC texture compression support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/ - */ + extends WebGLExtensionIdentifier[extensions.OESTextureHalfFloatLinear]("OES_texture_half_float_linear") + +/** Extends `blendEquation` to support `MIN_EXT` and `MAX_EXT`. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/ + */ +object EXT_blend_minmax extends WebGLExtensionIdentifier[extensions.EXTBlendMinmax]("EXT_blend_minmax") + +/** Provides fragment shaders with explicit LOD control for texture reads. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/ + */ +object EXT_shader_texture_lod extends WebGLExtensionIdentifier[extensions.EXTShaderTextureLOD]("EXT_shader_texture_lod") + +/** Provides ATC texture compression support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/ + */ object WEBGL_compressed_texture_atc - extends WebGLExtensionIdentifier[extensions.WebGLCompressedTextureATC]( - "WEBGL_compressed_texture_atc") + extends WebGLExtensionIdentifier[extensions.WebGLCompressedTextureATC]("WEBGL_compressed_texture_atc") -/** - * Provides PVRTC texture compression support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ - */ +/** Provides PVRTC texture compression support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ + */ object WEBGL_compressed_texture_pvrtc - extends WebGLExtensionIdentifier[extensions.WebGLCompressedTexturePVRTC]( - "WEBGL_compressed_texture_pvrtc") + extends WebGLExtensionIdentifier[extensions.WebGLCompressedTexturePVRTC]("WEBGL_compressed_texture_pvrtc") -/** - * Enables 16-bit float colour buffer support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/ - */ +/** Enables 16-bit float colour buffer support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/ + */ object EXT_color_buffer_half_float - extends WebGLExtensionIdentifier[extensions.EXTColorBufferHalfFloat]( - "EXT_color_buffer_half_float") + extends WebGLExtensionIdentifier[extensions.EXTColorBufferHalfFloat]("EXT_color_buffer_half_float") -/** - * Enables 32-bit float colour buffer support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/ - */ +/** Enables 32-bit float colour buffer support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/ + */ object WEBGL_color_buffer_float - extends WebGLExtensionIdentifier[extensions.WEBGLColorBufferFloat]( - "WEBGL_color_buffer_float") - -/** - * Enables nonlinear sRGB blending over framebuffers. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/ - */ -object EXT_sRGB - extends WebGLExtensionIdentifier[extensions.EXTsRGB]("EXT_sRGB") - -/** - * Provides ETC1 texture compression support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ - */ + extends WebGLExtensionIdentifier[extensions.WEBGLColorBufferFloat]("WEBGL_color_buffer_float") + +/** Enables nonlinear sRGB blending over framebuffers. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/ + */ +object EXT_sRGB extends WebGLExtensionIdentifier[extensions.EXTsRGB]("EXT_sRGB") + +/** Provides ETC1 texture compression support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ + */ object WEBGL_compressed_texture_etc1 - extends WebGLExtensionIdentifier[extensions.WEBGLCompressedTextureETC1]( - "WEBGL_compressed_texture_etc1") + extends WebGLExtensionIdentifier[extensions.WEBGLCompressedTextureETC1]("WEBGL_compressed_texture_etc1") -/** - * Provides timing support to enable profiling of GL calls. - * (Community Extension) - * - * @see https://www.khronos.org/registry/gles/extensions/EXT/EXT_disjoint_timer_query.txt - */ +/** Provides timing support to enable profiling of GL calls. (Community Extension) + * + * @see + * https://www.khronos.org/registry/gles/extensions/EXT/EXT_disjoint_timer_query.txt + */ object EXT_disjoint_timer_query - extends WebGLExtensionIdentifier[extensions.EXTDisjointTimerQuery]( - "EXT_disjoint_timer_query") + extends WebGLExtensionIdentifier[extensions.EXTDisjointTimerQuery]("EXT_disjoint_timer_query") diff --git a/src/main/scala/org/scalajs/dom/experimental/webgl/extensions/Extensions.scala b/src/main/scala/org/scalajs/dom/experimental/webgl/extensions/Extensions.scala index 958321b4d..4c8076d26 100644 --- a/src/main/scala/org/scalajs/dom/experimental/webgl/extensions/Extensions.scala +++ b/src/main/scala/org/scalajs/dom/experimental/webgl/extensions/Extensions.scala @@ -3,32 +3,29 @@ package org.scalajs.dom.experimental.webgl.extensions import org.scalajs.dom.WebGLShader import scala.scalajs.js -/** - * Provides 32-bit floating point texture support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ - */ +/** Provides 32-bit floating point texture support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ + */ @js.native trait OESTextureFloat extends js.Object -/** - * Provides 32-bit floating point texture support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ - */ +/** Provides 32-bit floating point texture support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_texture_float/ + */ @js.native trait OESTextureHalfFloat extends js.Object { val HALF_FLOAT_OES: Int = js.native } -/** - * Allows simulation of losing the WebGL context to aid debugging. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/ - */ +/** Allows simulation of losing the WebGL context to aid debugging. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/ + */ @js.native trait WebGLLoseContext extends js.Object { def loseContext(): Unit = js.native @@ -36,70 +33,61 @@ trait WebGLLoseContext extends js.Object { def restoreContext(): Unit = js.native } -/** - * Provides additional first derivative information in fragment shaders. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/ - */ +/** Provides additional first derivative information in fragment shaders. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/ + */ @js.native trait OESStandardDerivatives extends js.Object { val FRAGMENT_SHADER_DERIVATIVE_HINT_OES: Int = js.native } -/** - * A vertex array object, as used by `OES_vertex_array_object`. - */ +/** A vertex array object, as used by `OES_vertex_array_object`. + */ @js.native trait WebGLVertexArrayObjectOES extends js.Object -/** - * Provides Vertex Array Objects (VAOs). - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ - */ +/** Provides Vertex Array Objects (VAOs). (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/ + */ @js.native trait OESVertexArrayObject extends js.Object { val VERTEX_ARRAY_BINDING_OES: Int = js.native def createVertexArrayOES(): WebGLVertexArrayObjectOES = js.native - def deleteVertexArrayOES( - arrayObject: WebGLVertexArrayObjectOES): Unit = js.native - def isVertexArrayOES( - arrayObject: WebGLVertexArrayObjectOES): Boolean = js.native - def bindVertexArrayOES( - arrayObject: WebGLVertexArrayObjectOES): Unit = js.native + def deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): Unit = js.native + def isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): Boolean = js.native + def bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): Unit = js.native } -/** - * Provides additional driver and renderer information. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/ - */ +/** Provides additional driver and renderer information. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/ + */ @js.native trait WebGLDebugRendererInfo extends js.Object { val UNMASKED_VENDOR_WEBGL: Int = js.native val UNMASKED_RENDERER_WEBGL: Int = js.native } -/** - * Inspect the transpilation output of GLSL onto the underlying shader language. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/ - */ +/** Inspect the transpilation output of GLSL onto the underlying shader language. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/ + */ @js.native trait WebGLDebugShaders extends js.Object { def getTranslatedShaderSource(shader: WebGLShader): String = js.native } -/** - * Provides S3TC texture compression support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ - */ +/** Provides S3TC texture compression support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/ + */ @js.native trait WebGLCompressedTextureS3TC extends js.Object { val COMPRESSED_RGB_S3TC_DXT1_EXT: Int = js.native @@ -108,53 +96,48 @@ trait WebGLCompressedTextureS3TC extends js.Object { val COMPRESSED_RGBA_S3TC_DXT5_EXT: Int = js.native } -/** - * Provides depth and stencil texture support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ - */ +/** Provides depth and stencil texture support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ + */ @js.native trait WebGLDepthTexture extends js.Object { val UNSIGNED_INT_24_8_WEBGL: Int = js.native } -/** - * Adds anisotropic texture filtering support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/ - */ +/** Adds anisotropic texture filtering support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/ + */ @js.native trait EXTTextureFilterAnisotropic extends js.Object { val TEXTURE_MAX_ANISOTROPY_EXT: Int = js.native val MAX_TEXTURE_MAX_ANISOTROPY_EXT: Int = js.native } -/** - * Extends `drawElements` to support the type `UNSIGNED_INT`. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ - */ +/** Extends `drawElements` to support the type `UNSIGNED_INT`. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ + */ @js.native trait OESElementIndexUint extends js.Object -/** - * Extends GLSL to support assigning the fragments depth via `gl_FragDepthEXT`. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/ - */ +/** Extends GLSL to support assigning the fragments depth via `gl_FragDepthEXT`. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/ + */ @js.native trait EXTFragDepth extends js.Object -/** - * Enables multiple draw buffer support. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/ - */ +/** Enables multiple draw buffer support. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/ + */ @js.native trait WEBGLDrawBuffers extends js.Object { val COLOR_ATTACHMENT0_WEBGL: Int = js.native @@ -197,70 +180,62 @@ trait WEBGLDrawBuffers extends js.Object { def drawBuffersWEBGL(buffers: js.Array[Int]): Unit = js.native } -/** - * Enables array instancing - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/ - */ +/** Enables array instancing (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/ + */ @js.native trait ANGLEInstancedArrays extends js.Object { val VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: Int = js.native - def drawArraysInstancedANGLE(mode: Int, first: Int, count: Int, - primcount: Int): Unit = js.native + def drawArraysInstancedANGLE(mode: Int, first: Int, count: Int, primcount: Int): Unit = js.native - def drawElementsInstancedANGLE(mode: Int, count: Int, `type`: Int, - offset: Int, primcount: Int): Unit = js.native + def drawElementsInstancedANGLE(mode: Int, count: Int, `type`: Int, offset: Int, primcount: Int): Unit = js.native def vertexAttribDivisorANGLE(index: Int, divisor: Int): Unit = js.native } -/** - * Extends OES_texture_float to support linear and mipmap minification filters. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt - */ +/** Extends OES_texture_float to support linear and mipmap minification filters. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt + */ @js.native trait OESTextureFloatLinear extends js.Object -/** - * Extends OES_texture_half_float to support linear and mipmap minification filters. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt - */ +/** Extends OES_texture_half_float to support linear and mipmap minification filters. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt + */ @js.native trait OESTextureHalfFloatLinear extends js.Object -/** - * Extends `blendEquation` to support `MIN_EXT` and `MAX_EXT`. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/ - */ +/** Extends `blendEquation` to support `MIN_EXT` and `MAX_EXT`. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/ + */ @js.native trait EXTBlendMinmax extends js.Object { val MIN_EXT: Int = js.native val MAX_EXT: Int = js.native } -/** - * Provides fragment shaders with explicit LOD control for texture reads. - * (Khronos Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/ - */ +/** Provides fragment shaders with explicit LOD control for texture reads. (Khronos Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/ + */ @js.native trait EXTShaderTextureLOD extends js.Object -/** - * Provides ATC texture compression support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/ - */ +/** Provides ATC texture compression support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/ + */ @js.native trait WebGLCompressedTextureATC extends js.Object { val COMPRESSED_RGB_ATC_WEBGL: Int = js.native @@ -268,12 +243,11 @@ trait WebGLCompressedTextureATC extends js.Object { val COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: Int = js.native } -/** - * Provides PVRTC texture compression support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ - */ +/** Provides PVRTC texture compression support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ + */ @js.native trait WebGLCompressedTexturePVRTC extends js.Object { val COMPRESSED_RGB_PVRTC_4BPPV1_IMG: Int = js.native @@ -282,12 +256,11 @@ trait WebGLCompressedTexturePVRTC extends js.Object { val COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: Int = js.native } -/** - * Enables 16-bit float colour buffer support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/ - */ +/** Enables 16-bit float colour buffer support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/ + */ @js.native trait EXTColorBufferHalfFloat extends js.Object { val RGBA16F_EXT: Int = js.native @@ -296,12 +269,11 @@ trait EXTColorBufferHalfFloat extends js.Object { val UNSIGNED_NORMALIZED_EXT: Int = js.native } -/** - * Enables 32-bit float colour buffer support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/ - */ +/** Enables 32-bit float colour buffer support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/ + */ @js.native trait WEBGLColorBufferFloat extends js.Object { val RGBA32F_EXT: Int = js.native @@ -309,12 +281,11 @@ trait WEBGLColorBufferFloat extends js.Object { val UNSIGNED_NORMALIZED_EXT: Int = js.native } -/** - * Enables nonlinear sRGB blending over framebuffers. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/ - */ +/** Enables nonlinear sRGB blending over framebuffers. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/ + */ @js.native trait EXTsRGB extends js.Object { val SRGB_EXT: Int = js.native @@ -323,12 +294,11 @@ trait EXTsRGB extends js.Object { val FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: Int = js.native } -/** - * Provides ETC1 texture compression support. - * (Community Extension) - * - * @see https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ - */ +/** Provides ETC1 texture compression support. (Community Extension) + * + * @see + * https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/ + */ @js.native trait WEBGLCompressedTextureETC1 extends js.Object { val COMPRESSED_RGB_ETC1_WEBGL: Int = js.native @@ -338,12 +308,11 @@ trait WEBGLCompressedTextureETC1 extends js.Object { @js.native trait WebGLTimerQueryEXT extends js.Object -/** - * Provides timing support to enable profiling of GL calls. - * (Community Extension) - * - * @see https://www.khronos.org/registry/gles/extensions/EXT/EXT_disjoint_timer_query.txt - */ +/** Provides timing support to enable profiling of GL calls. (Community Extension) + * + * @see + * https://www.khronos.org/registry/gles/extensions/EXT/EXT_disjoint_timer_query.txt + */ @js.native trait EXTDisjointTimerQuery extends js.Object { val QUERY_COUNTER_BITS_EXT: Int = js.native diff --git a/src/main/scala/org/scalajs/dom/experimental/webgl/package.scala b/src/main/scala/org/scalajs/dom/experimental/webgl/package.scala index e6fb55ad2..7c6e2803d 100644 --- a/src/main/scala/org/scalajs/dom/experimental/webgl/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/webgl/package.scala @@ -4,16 +4,18 @@ import org.scalajs.dom.WebGLRenderingContext import scala.scalajs.js package object webgl { - implicit class WebGLRenderingContextOps(val webGL: WebGLRenderingContext) - extends AnyVal { - /** - * Returns the WebGL extension for the given identifier, if present on this browser. - * - * @param id the identifier singleton. - * @tparam T The type of the result for this extension. - * @return `Some(extension)` or `None` - */ + implicit class WebGLRenderingContextOps(val webGL: WebGLRenderingContext) extends AnyVal { + + /** Returns the WebGL extension for the given identifier, if present on this browser. + * + * @param id + * the identifier singleton. + * @tparam T + * The type of the result for this extension. + * @return + * `Some(extension)` or `None` + */ def getExtension[T](id: WebGLExtensionIdentifier[T]): js.UndefOr[T] = webGL.getExtension(id.value).asInstanceOf[js.UndefOr[T]] } diff --git a/src/main/scala/org/scalajs/dom/experimental/webrtc/WebRTC.scala b/src/main/scala/org/scalajs/dom/experimental/webrtc/WebRTC.scala index 7f3fd9f68..39fe6e3d0 100644 --- a/src/main/scala/org/scalajs/dom/experimental/webrtc/WebRTC.scala +++ b/src/main/scala/org/scalajs/dom/experimental/webrtc/WebRTC.scala @@ -1,12 +1,9 @@ -/** - * http://www.w3.org/TR/2015/WD-webrtc-20150210/ - */ +/** http://www.w3.org/TR/2015/WD-webrtc-20150210/ + */ package org.scalajs.dom.experimental.webrtc import org.scalajs.dom.experimental.mediastream._ -import org.scalajs.dom.{ - Blob, DOMException, Event, EventInit, EventTarget, MessageEvent -} +import org.scalajs.dom.{Blob, DOMException, Event, EventInit, EventTarget, MessageEvent} import scala.scalajs.js import scala.scalajs.js.annotation._ import scala.scalajs.js.typedarray.{ArrayBuffer, ArrayBufferView} @@ -19,10 +16,10 @@ trait RTCIdentityAssertion extends js.Object { } object RTCIdentityAssertion { + @inline def apply( - idp: js.UndefOr[String] = js.undefined, - name: js.UndefOr[String] = js.undefined + idp: js.UndefOr[String] = js.undefined, name: js.UndefOr[String] = js.undefined ): RTCIdentityAssertion = { val result = js.Dynamic.literal() idp.foreach(result.idp = _) @@ -34,60 +31,42 @@ object RTCIdentityAssertion { @js.native trait RTCOfferOptions extends js.Object { - /** - * When the value of this dictionary member is true, the generated - * description will have ICE credentials that are different from the current - * credentials (as visible in the localDescription attribute's SDP). Applying - * the generated description will restart ICE. - * - * When the value of this dictionary member is false, and the localDescription - * attribute has valid ICE credentials, the generated description will have - * the same ICE credentials as the current value from the localDescription - * attribute. - * - */ + /** When the value of this dictionary member is true, the generated description will have ICE credentials that are + * different from the current credentials (as visible in the localDescription attribute's SDP). Applying the + * generated description will restart ICE. + * + * When the value of this dictionary member is false, and the localDescription attribute has valid ICE credentials, + * the generated description will have the same ICE credentials as the current value from the localDescription + * attribute. + */ var iceRestart: Boolean = js.native - /** - * In some cases, an RTCPeerConnection may wish to receive audio but not send - * any audio. The RTCPeerConnection needs to know if it should signal to the - * remote side whether it wishes to receive audio. This option allows an - * application to indicate its preferences for the number of audio streams - * to receive when creating an offer. - * - */ + /** In some cases, an RTCPeerConnection may wish to receive audio but not send any audio. The RTCPeerConnection needs + * to know if it should signal to the remote side whether it wishes to receive audio. This option allows an + * application to indicate its preferences for the number of audio streams to receive when creating an offer. + */ var offerToReceiveAudio: Double = js.native - /** - * In some cases, an RTCPeerConnection may wish to receive video but not send - * any video. The RTCPeerConnection needs to know if it should signal to the - * remote side whether it wishes to receive video or not. This option allows - * an application to indicate its preferences for the number of video streams - * to receive when creating an offer. - * - */ + /** In some cases, an RTCPeerConnection may wish to receive video but not send any video. The RTCPeerConnection needs + * to know if it should signal to the remote side whether it wishes to receive video or not. This option allows an + * application to indicate its preferences for the number of video streams to receive when creating an offer. + */ var offerToReceiveVideo: Double = js.native - /** - * default: true - * Many codecs and system are capable of detecting "silence" and changing - * their behavior in this case by doing things such as not transmitting any - * media. In many cases, such as when dealing with emergency calling or - * sounds other than spoken voice, it is desirable to be able to turn off - * this behavior. This option allows the application to provide information - * about whether it wishes this type of processing enabled or disabled. - * - */ + /** default: true Many codecs and system are capable of detecting "silence" and changing their behavior in this case + * by doing things such as not transmitting any media. In many cases, such as when dealing with emergency calling or + * sounds other than spoken voice, it is desirable to be able to turn off this behavior. This option allows the + * application to provide information about whether it wishes this type of processing enabled or disabled. + */ var voiceActivityDetection: Boolean = js.native } object RTCOfferOptions { + @inline def apply( - iceRestart: js.UndefOr[Boolean] = js.undefined, - offerToReceiveAudio: js.UndefOr[Double] = js.undefined, - offerToReceiveVideo: js.UndefOr[Double] = js.undefined, - voiceActivityDetection: js.UndefOr[Boolean] = js.undefined + iceRestart: js.UndefOr[Boolean] = js.undefined, offerToReceiveAudio: js.UndefOr[Double] = js.undefined, + offerToReceiveVideo: js.UndefOr[Double] = js.undefined, voiceActivityDetection: js.UndefOr[Boolean] = js.undefined ): RTCOfferOptions = { val result = js.Dynamic.literal() iceRestart.foreach(result.iceRestart = _) @@ -106,9 +85,9 @@ trait RTCIceServer extends js.Object { } object RTCIceServer { + @inline - def apply(urls: js.UndefOr[String | js.Array[String]] = js.undefined, - username: js.UndefOr[String] = js.undefined, + def apply(urls: js.UndefOr[String | js.Array[String]] = js.undefined, username: js.UndefOr[String] = js.undefined, credential: js.UndefOr[String] = js.undefined): RTCIceServer = { val result = js.Dynamic.literal() urls.foreach(v => result.urls = v.asInstanceOf[js.Any]) @@ -118,89 +97,73 @@ object RTCIceServer { } } -/** - * see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCIceTransportPolicy]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCIceTransportPolicy]] in W3C spec + */ @js.native trait RTCIceTransportPolicy extends js.Any object RTCIceTransportPolicy { /** The ICE engine must not send or receive any packets at this point. - */ + */ val none = "none".asInstanceOf[RTCIceTransportPolicy] - /** The ICE engine must only use media relay candidates such as candidates - * passing through a TURN server. This can be used to reduce leakage of IP - * addresses in certain use cases. - */ + /** The ICE engine must only use media relay candidates such as candidates passing through a TURN server. This can be + * used to reduce leakage of IP addresses in certain use cases. + */ val relay = "relay".asInstanceOf[RTCIceTransportPolicy] - /** The ICE engine may use any type of candidates when this value is - * specified. - */ + /** The ICE engine may use any type of candidates when this value is specified. + */ val all = "all".asInstanceOf[RTCIceTransportPolicy] } -/** - * see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCBundlePolicy]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCBundlePolicy]] in W3C spec + */ @js.native trait RTCBundlePolicy extends js.Any object RTCBundlePolicy { - /** Gather ICE candidates for each media type in use (audio, video, and - * data). If the remote endpoint is not BUNDLE-aware, negotiate only - * one audio and video track on separate transports. - */ + /** Gather ICE candidates for each media type in use (audio, video, and data). If the remote endpoint is not + * BUNDLE-aware, negotiate only one audio and video track on separate transports. + */ val balanced = "balanced".asInstanceOf[RTCBundlePolicy] - /** Gather ICE candidates for each track. If the remote endpoint is not - * BUNDLE-aware, negotiate all media tracks on separate transports. - */ + /** Gather ICE candidates for each track. If the remote endpoint is not BUNDLE-aware, negotiate all media tracks on + * separate transports. + */ val `max-compat` = "max-compat".asInstanceOf[RTCBundlePolicy] - /** Gather ICE candidates for only one track. If the remote endpoint is - * not BUNDLE-aware, negotiate only one media track. - */ + /** Gather ICE candidates for only one track. If the remote endpoint is not BUNDLE-aware, negotiate only one media + * track. + */ val `max-bundle` = "max-bundle".asInstanceOf[RTCBundlePolicy] } @js.native trait RTCConfiguration extends js.Object { - /** - * An array containing URIs of servers available to be used by ICE, such - * as STUN and TURN server. - * - */ + /** An array containing URIs of servers available to be used by ICE, such as STUN and TURN server. + */ var iceServers: js.Array[RTCIceServer] = js.native - /** - * defaulting to "all" - * Indicates which candidates the ICE engine is allowed to use. - * - */ + /** defaulting to "all" Indicates which candidates the ICE engine is allowed to use. + */ var iceTransportPolicy: RTCIceTransportPolicy = js.native - /** - * defaulting to "balanced" - * Indicates which BundlePolicy to use. - * - */ + /** defaulting to "balanced" Indicates which BundlePolicy to use. + */ var bundlePolicy: RTCBundlePolicy = js.native - /** - * Sets the target peer identity for the RTCPeerConnection. The - * RTCPeerConnection will establish a connection to a remote peer unless - * it can be successfully authenticated with the provided name. - * - */ + /** Sets the target peer identity for the RTCPeerConnection. The RTCPeerConnection will establish a connection to a + * remote peer unless it can be successfully authenticated with the provided name. + */ var peerIdentity: String = js.native } object RTCConfiguration { + @inline def apply(iceServers: js.UndefOr[js.Array[RTCIceServer]] = js.undefined, iceTransportPolicy: js.UndefOr[RTCIceTransportPolicy] = js.undefined, @@ -215,32 +178,27 @@ object RTCConfiguration { } } -/** - * see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCSdpType]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCSdpType]] in W3C spec + */ @js.native trait RTCSdpType extends js.Any object RTCSdpType { - /** An RTCSdpType of "offer" indicates that a description should be treated - * as an [SDP] offer. - */ + /** An RTCSdpType of "offer" indicates that a description should be treated as an [SDP] offer. + */ val offer = "offer".asInstanceOf[RTCSdpType] - /** An RTCSdpType of "pranswer" indicates that a description should be - * treated as an [SDP] answer, but not a final answer. A description used - * as an SDP "pranswer" may be applied as a response to a SDP offer, or an - * update to a previously sent SDP "pranswer". - */ + /** An RTCSdpType of "pranswer" indicates that a description should be treated as an [SDP] answer, but not a final + * answer. A description used as an SDP "pranswer" may be applied as a response to a SDP offer, or an update to a + * previously sent SDP "pranswer". + */ val pranswer = "pranswer".asInstanceOf[RTCSdpType] - /** An RTCSdpType of "answer" indicates that a description should be treated - * as an [SDP] final answer, and the offer-answer exchange should be - * considered complete. A description used as an SDP answer may be applied - * as a response to an SDP offer or as an update to a previously sent SDP - * "pranswer". - */ + /** An RTCSdpType of "answer" indicates that a description should be treated as an [SDP] final answer, and the + * offer-answer exchange should be considered complete. A description used as an SDP answer may be applied as a + * response to an SDP offer or as an update to a previously sent SDP "pranswer". + */ val answer = "answer".asInstanceOf[RTCSdpType] } @@ -251,6 +209,7 @@ trait RTCSessionDescriptionInit extends js.Object { } object RTCSessionDescriptionInit { + @inline def apply(`type`: js.UndefOr[RTCSdpType] = js.undefined, sdp: js.UndefOr[String] = js.undefined): RTCSessionDescriptionInit = { @@ -263,22 +222,19 @@ object RTCSessionDescriptionInit { @js.native @JSGlobal -class RTCSessionDescription( - descriptionInitDict: js.UndefOr[RTCSessionDescriptionInit] = js.undefined) +class RTCSessionDescription(descriptionInitDict: js.UndefOr[RTCSessionDescriptionInit] = js.undefined) extends js.Object { - /** - * An enum of type RTCSdpType describing the session description's type. - * - * MDN - */ + /** An enum of type RTCSdpType describing the session description's type. + * + * MDN + */ var `type`: RTCSdpType = js.native - /** - * A DOMString containing the SDP format describing the session. - * - * MDN - */ + /** A DOMString containing the SDP format describing the session. + * + * MDN + */ var sdp: String = js.native } @@ -290,10 +246,10 @@ trait RTCIceCandidateInit extends js.Object { } object RTCIceCandidateInit { + @inline def apply( - candidate: js.UndefOr[String] = js.undefined, - sdpMid: js.UndefOr[String] = js.undefined, + candidate: js.UndefOr[String] = js.undefined, sdpMid: js.UndefOr[String] = js.undefined, sdpMLineIndex: js.UndefOr[Double] = js.undefined ): RTCIceCandidateInit = { val result = js.Dynamic.literal() @@ -304,178 +260,147 @@ object RTCIceCandidateInit { } } -/** - * The RTCIceCandidate interface of the the WebRTC API represents a candidate - * internet connectivity establishment (ICE) server for establishing an - * RTCPeerConnection. - * - * MDN - */ +/** The RTCIceCandidate interface of the the WebRTC API represents a candidate internet connectivity establishment (ICE) + * server for establishing an RTCPeerConnection. + * + * MDN + */ @js.native @JSGlobal -class RTCIceCandidate(candidateInitDict: RTCIceCandidateInit) - extends js.Object { +class RTCIceCandidate(candidateInitDict: RTCIceCandidateInit) extends js.Object { - /** - * Returns a transport address for the candidate that can be used for - * connectivity checks. The format of this address is a candidate-attribute - * as defined in RFC 5245. - * - * MDN - */ + /** Returns a transport address for the candidate that can be used for connectivity checks. The format of this address + * is a candidate-attribute as defined in RFC 5245. + * + * MDN + */ var candidate: String = js.native - /** - * If not null, this contains the identifier of the - * "media stream identification" (as defined in RFC 5888) for the media - * component this candidate is associated with. - * - * MDN - */ + /** If not null, this contains the identifier of the "media stream identification" (as defined in RFC 5888) for the + * media component this candidate is associated with. + * + * MDN + */ var sdpMid: String = js.native - /** - * If not null, this indicates the index (starting at zero) of the media - * description (as defined in RFC 4566) in the SDP this candidate is - * associated with. - * - * MDN - */ + /** If not null, this indicates the index (starting at zero) of the media description (as defined in RFC 4566) in the + * SDP this candidate is associated with. + * + * MDN + */ var sdpMLineIndex: Double = js.native } -/** - * see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCDataChannelState]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCDataChannelState]] in W3C spec + */ @js.native trait RTCDataChannelState extends js.Any object RTCDataChannelState { - /** The user agent is attempting to establish the underlying data transport. - * This is the initial state of a RTCDataChannel object created with - * createDataChannel(). - */ + /** The user agent is attempting to establish the underlying data transport. This is the initial state of a + * RTCDataChannel object created with createDataChannel(). + */ val connecting = "connecting".asInstanceOf[RTCDataChannelState] - /** The underlying data transport is established and communication is possible. - * This is the initial state of a RTCDataChannel object dispatched as a part of - * a RTCDataChannelEvent. - */ + /** The underlying data transport is established and communication is possible. This is the initial state of a + * RTCDataChannel object dispatched as a part of a RTCDataChannelEvent. + */ val open = "open".asInstanceOf[RTCDataChannelState] /** The procedure to close down the underlying data transport has started. - */ + */ val closing = "closing".asInstanceOf[RTCDataChannelState] /** The underlying data transport has been closed or could not be established. - */ + */ val closed = "closed".asInstanceOf[RTCDataChannelState] } -/** - * The RTCDataChannel interface represents a bi-directional data channel between - * two peers of a connection. - * - * MDN - */ +/** The RTCDataChannel interface represents a bi-directional data channel between two peers of a connection. + * + * MDN + */ @js.native trait RTCDataChannel extends EventTarget { - /** - * Returns a DOMString containing a name describing the data channel. - * There is no constraint of uniqueness about it. - * - * MDN - */ + /** Returns a DOMString containing a name describing the data channel. There is no constraint of uniqueness about it. + * + * MDN + */ val label: String = js.native - /** - * The read-only property RTCDataChannel.ordered returns a Boolean indicating - * if the order of delivery of the messages is guaranteed or not. - * - * MDN - */ + /** The read-only property RTCDataChannel.ordered returns a Boolean indicating if the order of delivery of the + * messages is guaranteed or not. + * + * MDN + */ val ordered: Boolean = js.native val maxPacketLifeTime: Double = js.native val maxRetransmits: Double = js.native - /** - * Returns a DOMString containing the name of the subprotocol in use. - * If none, it returns "". - * - * MDN - */ + /** Returns a DOMString containing the name of the subprotocol in use. If none, it returns "". + * + * MDN + */ val protocol: String = js.native val negotiated: Boolean = js.native - /** - * Returns an unsigned short being a unique id for the channel. - * It is set at the creation of the RTCDataChannel object. - * - * MDN - */ + /** Returns an unsigned short being a unique id for the channel. It is set at the creation of the RTCDataChannel + * object. + * + * MDN + */ val id: Double = js.native - /** - * Returns an enum of the type RTCDataChannelState representing the state of - * the underlying data connection. - * - * MDN - */ + /** Returns an enum of the type RTCDataChannelState representing the state of the underlying data connection. + * + * MDN + */ def readyState: RTCDataChannelState = js.native - /** - * Returns an unsigned long containing the amount of bytes that have been - * queued for sending: that is the amount of data requested to be transmitted - * via RTCDataChannel.send() that has not been sent yet. Note that if the - * channel state, as given by RTCDataChannel.readyState is "closed", - * the buffering continues. - * - * MDN - */ + /** Returns an unsigned long containing the amount of bytes that have been queued for sending: that is the amount of + * data requested to be transmitted via RTCDataChannel.send() that has not been sent yet. Note that if the channel + * state, as given by RTCDataChannel.readyState is "closed", the buffering continues. + * + * MDN + */ def bufferedAmount: Double = js.native var onopen: js.Function1[Event, Any] = js.native var onerror: js.Function1[Event, Any] = js.native - /** - * Is the event handler called when the close event is received. - * Such an event is sent when the underlying data transport has been closed. - * - * MDN - */ + /** Is the event handler called when the close event is received. Such an event is sent when the underlying data + * transport has been closed. + * + * MDN + */ var onclose: js.Function1[Event, Any] = js.native def close(): Unit = js.native - /** - * Is the event handler called when the message event is received. - * Such an event is sent when a message is available on the data connection. - * - * MDN - */ + /** Is the event handler called when the message event is received. Such an event is sent when a message is available + * on the data connection. + * + * MDN + */ var onmessage: js.Function1[MessageEvent, Any] = js.native - /** - * Returns a DOMString indicating the type of binary data transmitted by the - * connection. This should be either "blob" if Blob objects are being used or - * "arraybuffer" if ArrayBuffer objects are being used. - * Initially it is set to "blob". - * - * It controls the type of the MessageEvent.data property passed in the - * parameter of message targetting this RTCDataChannel. - * - * MDN - */ + /** Returns a DOMString indicating the type of binary data transmitted by the connection. This should be either "blob" + * if Blob objects are being used or "arraybuffer" if ArrayBuffer objects are being used. Initially it is set to + * "blob". + * + * It controls the type of the MessageEvent.data property passed in the parameter of message targetting this + * RTCDataChannel. + * + * MDN + */ var binaryType: String = js.native - /** - * Sends the data in parameter over the channel. The data can be a DOMString, - * a Blob, an ArrayBuffer or an ArrayBufferView. - * - * MDN - */ - def send( - data: String | Blob | ArrayBuffer | ArrayBufferView): Unit = js.native + /** Sends the data in parameter over the channel. The data can be a DOMString, a Blob, an ArrayBuffer or an + * ArrayBufferView. + * + * MDN + */ + def send(data: String | Blob | ArrayBuffer | ArrayBufferView): Unit = js.native } //https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCDataChannelInit @@ -489,26 +414,20 @@ trait RTCDataChannelInit extends js.Object { var id: Double = js.native } -/** - * The RTCDataChannelEvent interface represents events that occur while - * attaching a RTCDataChannel to a RTCPeerConnection. The only event sent with - * this interface is datachannel. - * - * MDN - */ +/** The RTCDataChannelEvent interface represents events that occur while attaching a RTCDataChannel to a + * RTCPeerConnection. The only event sent with this interface is datachannel. + * + * MDN + */ @js.native @JSGlobal -class RTCDataChannelEvent(typeArg: String, - init: js.UndefOr[RTCDataChannelEventInit]) - extends Event(typeArg, init) { +class RTCDataChannelEvent(typeArg: String, init: js.UndefOr[RTCDataChannelEventInit]) extends Event(typeArg, init) { def this(init: RTCDataChannelEventInit) = this("datachannel", init) - /** - * Contains the RTCDataChannel containing the data channel associated with - * the event. - * - * MDN - */ + /** Contains the RTCDataChannel containing the data channel associated with the event. + * + * MDN + */ val channel: RTCDataChannel = js.native } @@ -517,14 +436,12 @@ trait RTCDataChannelEventInit extends EventInit { } object RTCDataChannelInit { + @inline def apply( - ordered: js.UndefOr[Boolean] = js.undefined, - maxPacketLifeTime: js.UndefOr[Double] = js.undefined, - maxRetransmits: js.UndefOr[Double] = js.undefined, - protocol: js.UndefOr[String] = js.undefined, - negotiated: js.UndefOr[Boolean] = js.undefined, - id: js.UndefOr[Double] = js.undefined + ordered: js.UndefOr[Boolean] = js.undefined, maxPacketLifeTime: js.UndefOr[Double] = js.undefined, + maxRetransmits: js.UndefOr[Double] = js.undefined, protocol: js.UndefOr[String] = js.undefined, + negotiated: js.UndefOr[Boolean] = js.undefined, id: js.UndefOr[Double] = js.undefined ): RTCDataChannelInit = { val result = js.Dynamic.literal() ordered.foreach(result.ordered = _) @@ -541,75 +458,55 @@ object RTCDataChannelInit { @js.native trait RTCDTMFSender extends js.Object { - /** - * The canInsertDTMF attribute must indicate if the RTCDTMFSender is capable - * of sending DTMF. - */ + /** The canInsertDTMF attribute must indicate if the RTCDTMFSender is capable of sending DTMF. + */ val canInsertDTMF: Boolean = js.native - /** - * - * An RTCDTMFSender object's insertDTMF() method is used to send DTMF tones. - * The tones parameter is treated as a series of characters. The characters 0 - * through 9, A through D, #, and * generate the associated DTMF tones. The - * characters a to d are equivalent to A to D. The character ',' indicates a - * delay of 2 seconds before processing the next character in the tones - * parameter. All other characters must be considered unrecognized. - * - * The duration parameter indicates the duration in ms to use for each character - * passed in the tones parameters. The duration cannot be more than 6000 ms or - * less than 40 ms. The default duration is 100 ms for each tone. - * - * The interToneGap parameter indicates the gap between tones. It must be at - * least 30 ms. The default value is 70 ms. - * - * The browser may increase the duration and interToneGap times to cause the - * times that DTMF start and stop to align with the boundaries of RTP packets - * but it must not increase either of them by more than the duration of a - * single RTP audio packet. - */ + /** An RTCDTMFSender object's insertDTMF() method is used to send DTMF tones. The tones parameter is treated as a + * series of characters. The characters 0 through 9, A through D, #, and * generate the associated DTMF tones. The + * characters a to d are equivalent to A to D. The character ',' indicates a delay of 2 seconds before processing the + * next character in the tones parameter. All other characters must be considered unrecognized. + * + * The duration parameter indicates the duration in ms to use for each character passed in the tones parameters. The + * duration cannot be more than 6000 ms or less than 40 ms. The default duration is 100 ms for each tone. + * + * The interToneGap parameter indicates the gap between tones. It must be at least 30 ms. The default value is 70 ms. + * + * The browser may increase the duration and interToneGap times to cause the times that DTMF start and stop to align + * with the boundaries of RTP packets but it must not increase either of them by more than the duration of a single + * RTP audio packet. + */ def insertDTMF(tones: String = js.native, duration: Double = js.native, interToneGap: Double = js.native): Unit = js.native - /** - * The track attribute must return the MediaStreamTrack given as argument to - * the createDTMFSender() method. - */ + /** The track attribute must return the MediaStreamTrack given as argument to the createDTMFSender() method. + */ val track: MediaStreamTrack = js.native - /** - * This event handler uses the RTCDTMFToneChangeEvent interface to return - * the character for each tone as it is played out. See RTCDTMFToneChangeEvent - * for details. - */ + /** This event handler uses the RTCDTMFToneChangeEvent interface to return the character for each tone as it is played + * out. See RTCDTMFToneChangeEvent for details. + */ var ontonechange: js.Function1[Event, Any] = js.native - /** - * The toneBuffer attribute must return a list of the tones remaining to be - * played out. For the syntax, content, and interpretation of this list, see insertDTMF. - */ + /** The toneBuffer attribute must return a list of the tones remaining to be played out. For the syntax, content, and + * interpretation of this list, see insertDTMF. + */ val toneBuffer: String = js.native - /** - * The duration attribute must return the current tone duration value. This - * value will be the value last set via the insertDTMF() method, or the - * default value of 100 ms if insertDTMF() was called without specifying - * the duration. - */ + /** The duration attribute must return the current tone duration value. This value will be the value last set via the + * insertDTMF() method, or the default value of 100 ms if insertDTMF() was called without specifying the duration. + */ val duration: Double = js.native - /** - * The interToneGap attribute must return the current value of the - * between-tone gap. This value will be the value last set via the - * insertDTMF() method, or the default value of 70 ms if insertDTMF() was - * called without specifying the interToneGap. - */ + /** The interToneGap attribute must return the current value of the between-tone gap. This value will be the value + * last set via the insertDTMF() method, or the default value of 70 ms if insertDTMF() was called without specifying + * the interToneGap. + */ val interToneGap: Double = js.native } -/** - * see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCStatsType]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#idl-def-RTCStatsType]] in W3C spec + */ @js.native trait RTCStatsType extends js.Any @@ -639,73 +536,61 @@ trait RTCPeerConnectionIceEventInit extends EventInit { var candidate: js.UndefOr[RTCIceCandidate] = js.undefined } -/** - * The RTCPeerConnectionIceEvent interface represents events that occurs in - * relation to ICE candidates with the target, usually an RTCPeerConnection. - * Only one event is of this type: icecandidate. - * - * MDN - */ +/** The RTCPeerConnectionIceEvent interface represents events that occurs in relation to ICE candidates with the target, + * usually an RTCPeerConnection. Only one event is of this type: icecandidate. + * + * MDN + */ @js.native @JSGlobal -class RTCPeerConnectionIceEvent(typeArg: String, - init: js.UndefOr[RTCPeerConnectionIceEventInit]) +class RTCPeerConnectionIceEvent(typeArg: String, init: js.UndefOr[RTCPeerConnectionIceEventInit]) extends Event(typeArg, init) { - /** - * Contains the RTCIceCandidate containing the candidate associated with - * the event. - * - * MDN - */ + /** Contains the RTCIceCandidate containing the candidate associated with the event. + * + * MDN + */ var candidate: RTCIceCandidate = js.native } -/** - * see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#rtciceconnectionstate-enum]] in W3C spec - */ +/** see [[https://www.w3.org/TR/2015/WD-webrtc-20150210/#rtciceconnectionstate-enum]] in W3C spec + */ @js.native trait RTCIceConnectionState extends js.Any object RTCIceConnectionState { - /** The ICE Agent is gathering addresses and/or waiting for remote candidates - * to be supplied. - */ + /** The ICE Agent is gathering addresses and/or waiting for remote candidates to be supplied. + */ val `new` = "new".asInstanceOf[RTCIceConnectionState] - /** The ICE Agent has received remote candidates on at least one component, - * and is checking candidate pairs but has not yet found a connection. In - * addition to checking, it may also still be gathering. - */ + /** The ICE Agent has received remote candidates on at least one component, and is checking candidate pairs but has + * not yet found a connection. In addition to checking, it may also still be gathering. + */ val checking = "checking".asInstanceOf[RTCIceConnectionState] - /** The ICE Agent has found a usable connection for all components but is - * still checking other candidate pairs to see if there is a better - * connection. It may also still be gathering. - */ + /** The ICE Agent has found a usable connection for all components but is still checking other candidate pairs to see + * if there is a better connection. It may also still be gathering. + */ val connected = "connected".asInstanceOf[RTCIceConnectionState] - /** The ICE Agent has finished gathering and checking and found a connection - * for all components. Open issue: it is not clear how the non controlling - * ICE side knows it is in the state. - */ + /** The ICE Agent has finished gathering and checking and found a connection for all components. Open issue: it is not + * clear how the non controlling ICE side knows it is in the state. + */ val completed = "completed".asInstanceOf[RTCIceConnectionState] - /** The ICE Agent is finished checking all candidate pairs and failed to find - * a connection for at least one component. Connections may have been found - * for some components. - */ + /** The ICE Agent is finished checking all candidate pairs and failed to find a connection for at least one component. + * Connections may have been found for some components. + */ val failed = "failed".asInstanceOf[RTCIceConnectionState] - /** Liveness checks have failed for one or more components. This is more - * aggressive than failed, and may trigger intermittently (and resolve itself - * without action) on a flaky network. - */ + /** Liveness checks have failed for one or more components. This is more aggressive than failed, and may trigger + * intermittently (and resolve itself without action) on a flaky network. + */ val disconnected = "disconnected".asInstanceOf[RTCIceConnectionState] /** The ICE Agent has shut down and is no longer responding to STUN requests. - */ + */ val closed = "closed".asInstanceOf[RTCIceConnectionState] } @@ -714,33 +599,33 @@ trait RTCSignalingState extends js.Any object RTCSignalingState { - /** There is no offer­answer exchange in progress. This is also the initial - * state in which case the local and remote descriptions are empty. - */ + /** There is no offer­answer exchange in progress. This is also the initial state in which case the local and remote + * descriptions are empty. + */ val stable = "stable".asInstanceOf[RTCSignalingState] /** A local description, of type "offer", has been successfully applied. - */ + */ val `have-local-offer` = "have-local-offer".asInstanceOf[RTCSignalingState] /** A remote description, of type "offer", has been successfully applied. - */ + */ val `have-remote-offer` = "have-remote-offer".asInstanceOf[RTCSignalingState] - /** A remote description of type "offer" has been successfully applied and - * a local description of type "pranswer" has been successfully applied. - */ + /** A remote description of type "offer" has been successfully applied and a local description of type "pranswer" has + * been successfully applied. + */ val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState] - /** A local description of type "offer" has been successfully applied and a - * remote description of type "pranswer" has been successfully applied. - */ + /** A local description of type "offer" has been successfully applied and a remote description of type "pranswer" has + * been successfully applied. + */ val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState] /** The connection is closed. - */ + */ val closed = "closed".asInstanceOf[RTCSignalingState] } @@ -750,17 +635,16 @@ trait RTCIceGatheringState extends js.Any object RTCIceGatheringState { /** The object was just created, and no networking has occurred yet. - */ + */ val `new` = "new".asInstanceOf[RTCIceGatheringState] - /** The ICE engine is in the process of gathering candidates for this - * RTCPeerConnection. - */ + /** The ICE engine is in the process of gathering candidates for this RTCPeerConnection. + */ val gathering = "gathering".asInstanceOf[RTCIceGatheringState] - /** The ICE engine has completed gathering. Events such as adding a new - * interface or a new TURN server will cause the state to go back to gathering. - */ + /** The ICE engine has completed gathering. Events such as adding a new interface or a new TURN server will cause the + * state to go back to gathering. + */ val complete = "complete".asInstanceOf[RTCIceGatheringState] } @@ -768,414 +652,318 @@ trait MediaStreamEventInit extends EventInit { var stream: js.UndefOr[MediaStream] = js.undefined } -/** - * The RTCPeerConnection interface represents a WebRTC connection between the - * local computer and a remote peer. It is used to handle efficient streaming of - * data between the two peers. - * - * MDN - */ +/** The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It is + * used to handle efficient streaming of data between the two peers. + * + * MDN + */ @js.native @JSGlobal -class RTCPeerConnection( - configuration: js.UndefOr[RTCConfiguration] = js.undefined) - extends EventTarget { - - /** - * Returns an enum of type RTCIceConnectionState that describes the - * ICE connection state for the connection. When this value changes, a - * iceconnectionstatechange event is fired on the object. The possible values - * are: - * - "new": the ICE agent is gathering addresses or waiting for remote - * candidates (or both). - * - * - "checking": the ICE agent has remote candidates, on at least one - * component, and is check them, though it has not found a connection yet. - * At the same time, it may still be gathering candidates. - * - * - "connected": the ICE agent has found a usable connection for each - * component, but is still testing more remote candidates for a better - * connection. At the same time, it may still be gathering candidates. - * - * - "completed": the ICE agent has found a usable connection for each - * component, and is no more testing remote candidates. - * - * - "failed": the ICE agent has checked all the remote candidates and - * didn't find a match for at least one component. Connections may have - * been found for some components. - * - * - "disconnected": liveness check has failed for at least one component. - * This may be a transient state, e. g. on a flaky network, that can - * recover by itself. - * - * - "closed": the ICE agent has shutdown and is not answering to requests. - * - * MDN - */ +class RTCPeerConnection(configuration: js.UndefOr[RTCConfiguration] = js.undefined) extends EventTarget { + + /** Returns an enum of type RTCIceConnectionState that describes the ICE connection state for the connection. When + * this value changes, a iceconnectionstatechange event is fired on the object. The possible values are: + * - "new": the ICE agent is gathering addresses or waiting for remote candidates (or both). + * + * - "checking": the ICE agent has remote candidates, on at least one component, and is check them, though it has + * not found a connection yet. At the same time, it may still be gathering candidates. + * + * - "connected": the ICE agent has found a usable connection for each component, but is still testing more remote + * candidates for a better connection. At the same time, it may still be gathering candidates. + * + * - "completed": the ICE agent has found a usable connection for each component, and is no more testing remote + * candidates. + * + * - "failed": the ICE agent has checked all the remote candidates and didn't find a match for at least one + * component. Connections may have been found for some components. + * + * - "disconnected": liveness check has failed for at least one component. This may be a transient state, e. g. on + * a flaky network, that can recover by itself. + * + * - "closed": the ICE agent has shutdown and is not answering to requests. + * + * MDN + */ def iceConnectionState: RTCIceConnectionState = js.native - /** - * Returns an enum of type RTCIceGatheringState that describes the - * ICE gathering state for the connection. The possible values are: - * - "new": the object was just created, and no networking has occurred yet. - * - * - "gathering": the ICE engine is in the process of gathering candidates - * for this connection. - * - * - "complete": the ICE engine has completed gathering. Events such as - * adding a new interface or a new TURN server will cause the state to - * go back to gathering. - * - * MDN - */ + /** Returns an enum of type RTCIceGatheringState that describes the ICE gathering state for the connection. The + * possible values are: + * - "new": the object was just created, and no networking has occurred yet. + * + * - "gathering": the ICE engine is in the process of gathering candidates for this connection. + * + * - "complete": the ICE engine has completed gathering. Events such as adding a new interface or a new TURN server + * will cause the state to go back to gathering. + * + * MDN + */ def iceGatheringState: RTCIceGatheringState = js.native - /** - * This attribute indicates whether the remote peer is able to accept trickled - * ICE candidates [TRICKLE-ICE]. The value is determined based on whether a - * remote description indicates support for trickle ICE, as defined in Section - * 4.1.9 of [RTCWEB-JSEP]. Prior to the completion of setRemoteDescription, - * this value is null. - */ + /** This attribute indicates whether the remote peer is able to accept trickled ICE candidates [TRICKLE-ICE]. The + * value is determined based on whether a remote description indicates support for trickle ICE, as defined in Section + * 4.1.9 of [RTCWEB-JSEP]. Prior to the completion of setRemoteDescription, this value is null. + */ val canTrickleIceCandidates: js.Any = js.native - /** - * Returns a RTCSessionDescription describing the session for the - * local end of the connection. If it has not yet been set, it can be null. - * - * MDN - */ + /** Returns a RTCSessionDescription describing the session for the local end of the connection. If it has not yet been + * set, it can be null. + * + * MDN + */ def localDescription: RTCSessionDescription = js.native - /** - * Returns a RTCIdentityAssertion, that is a couple of a domain name (idp) - * and a name (name) representing the identity of the remote peer of this - * connection, once set and verified. If no peer has yet been set and - * verified, this property will return null. Once set, via the appropriate - * method, it can't be changed. - * - * MDN - */ + /** Returns a RTCIdentityAssertion, that is a couple of a domain name (idp) and a name (name) representing the + * identity of the remote peer of this connection, once set and verified. If no peer has yet been set and verified, + * this property will return null. Once set, via the appropriate method, it can't be changed. + * + * MDN + */ val peerIdentity: RTCIdentityAssertion = js.native - /** - * Returns a RTCSessionDescription describing the session for the remote end - * of the connection. If it has not yet been set, it can be null. - * - * MDN - */ + /** Returns a RTCSessionDescription describing the session for the remote end of the connection. If it has not yet + * been set, it can be null. + * + * MDN + */ def remoteDescription: RTCSessionDescription = js.native - /** - * Returns an enum of type RTCSignalingState that describes the - * signaling state of the local connection. This state describes the SDP - * offer, that defines the configuration of the connections like the - * description of the locally associated objects of type MediaStream, the - * codec/RTP/RTCP options, the candidates gathered by the ICE Agent. When - * this value changes, a signalingstatechange event is fired on the object. - * The possible values are: - * - * - "stable": there is no SDP offer/answer exchange in progress. This is - * also the initial state of the connection. - * - * - "have-local-offer": the local end of the connection has locally applied - * a SDP offer. - * - * - "have-remote-offer": the remote end of the connection has locally - * applied a SDP offer. - * - * - "have-local-pranswer": a remote SDP offer has been applied, and a SDP - * pranswer applied locally. - * - * - "have-remote-pranswer": a local SDP offer has been applied, and a SDP - * pranswer applied remotely. - * - * - "closed": the connection is closed. - * - * MDN - */ + /** Returns an enum of type RTCSignalingState that describes the signaling state of the local connection. This state + * describes the SDP offer, that defines the configuration of the connections like the description of the locally + * associated objects of type MediaStream, the codec/RTP/RTCP options, the candidates gathered by the ICE Agent. When + * this value changes, a signalingstatechange event is fired on the object. The possible values are: + * + * - "stable": there is no SDP offer/answer exchange in progress. This is also the initial state of the connection. + * + * - "have-local-offer": the local end of the connection has locally applied a SDP offer. + * + * - "have-remote-offer": the remote end of the connection has locally applied a SDP offer. + * + * - "have-local-pranswer": a remote SDP offer has been applied, and a SDP pranswer applied locally. + * + * - "have-remote-pranswer": a local SDP offer has been applied, and a SDP pranswer applied remotely. + * + * - "closed": the connection is closed. + * + * MDN + */ def signalingState: RTCSignalingState = js.native var ontrack: js.Function1[MediaStreamTrackEvent, Any] = js.native - /** - * Is the event handler called when the datachannel event is received. Such - * an event is sent when a RTCDataChannel is added to this connection. - * - * MDN - */ + /** Is the event handler called when the datachannel event is received. Such an event is sent when a RTCDataChannel is + * added to this connection. + * + * MDN + */ var ondatachannel: js.Function1[RTCDataChannelEvent, Any] = js.native - /** - * Is the event handler called when the icecandidate event is received. Such - * an event is sent when a RTCICECandidate object is added to the script. - * - * MDN - */ + /** Is the event handler called when the icecandidate event is received. Such an event is sent when a RTCICECandidate + * object is added to the script. + * + * MDN + */ var onicecandidate: js.Function1[RTCPeerConnectionIceEvent, Any] = js.native - /** - * Is the event handler called when the iceconnectionstatechange event is - * received. Such an event is sent when the value of iceConnectionState - * changes. - * - * MDN - */ + /** Is the event handler called when the iceconnectionstatechange event is received. Such an event is sent when the + * value of iceConnectionState changes. + * + * MDN + */ var oniceconnectionstatechange: js.Function1[Event, Any] = js.native - /** - * Is the event handler called when the identityresult event is received. - * Such an event is sent when an identity assertion is generated, via - * getIdentityAssertion(), or during the creation of an offer or an answer. - * - * MDN - */ + /** Is the event handler called when the identityresult event is received. Such an event is sent when an identity + * assertion is generated, via getIdentityAssertion(), or during the creation of an offer or an answer. + * + * MDN + */ var onidentityresult: js.Function1[Event, Any] = js.native - /** - * Is the event handler called when the idpassertionerror event is received. - * Such an event is sent when the associated identity provider (IdP) - * encounters an error while generating an identity assertion. - * - * MDN - */ + /** Is the event handler called when the idpassertionerror event is received. Such an event is sent when the + * associated identity provider (IdP) encounters an error while generating an identity assertion. + * + * MDN + */ var onidpassertionerror: js.Function1[Event, Any] = js.native - /** - * Is the event handler alled when the idpvalidationerror event is received. - * Such an event is sent when the associated identity provider (IdP) - * encounters an error while validating an identity assertion. - * - * MDN - */ + /** Is the event handler alled when the idpvalidationerror event is received. Such an event is sent when the + * associated identity provider (IdP) encounters an error while validating an identity assertion. + * + * MDN + */ var onidpvalidationerror: js.Function1[Event, Any] = js.native - /** - * Is the event handler called when the negotiationneeded event, sent by the - * browser to inform that negotiation will be required at some point in the - * future, is received. - * - * MDN - */ + /** Is the event handler called when the negotiationneeded event, sent by the browser to inform that negotiation will + * be required at some point in the future, is received. + * + * MDN + */ var onnegotiationneeded: js.Function1[Event, Any] = js.native - /** - * Is the event handler called when the peeridentity event, sent when a peer - * identity has been set and verified on this connection, is received. - * - * MDN - */ + /** Is the event handler called when the peeridentity event, sent when a peer identity has been set and verified on + * this connection, is received. + * + * MDN + */ var onpeeridentity: js.Function1[Event, Any] = js.native var onremovetrack: js.Function1[MediaStreamTrackEvent, Any] = js.native - /** - * Is the event handler called when the signalingstatechange event, sent when - * the value of signalingState changes, is received. - * - * MDN - */ + /** Is the event handler called when the signalingstatechange event, sent when the value of signalingState changes, is + * received. + * + * MDN + */ var onsignalingstatechange: js.Function1[Event, Any] = js.native - /** - * The createOffer() method of the RTCPeerConnection interface initiates the - * creation of an SDP offer for the purpose of starting a new WebRTC connection - * to a remote peer. The SDP offer includes information about any MediaStreamTracks - * already attached to the WebRTC session, codec, and options supported by the - * browser, and any candidates already gathered by the ICE agent, for the purpose - * of being sent over the signaling channel to a potential peer to request a connection - * or to update the configuration of an existing connection. - * - * The return value is a Promise which, when the offer has been created, is resolved - * with a RTCSessionDescription object containing the newly-created offer. - * - * MDN - */ - def createOffer( - options: RTCOfferOptions = js.native): js.Promise[RTCSessionDescription] = js.native - - /** - * The createAnswer() method on the RTCPeerConnection interface creates an SDP answer to - * an offer received from a remote peer during the offer/answer negotiation of a WebRTC - * connection. The answer contains information about any media already attached to the - * session, codecs and options supported by the browser, and any ICE candidates already - * gathered. The answer is delivered to the returned Promise, and should then be sent to - * the source of the offer to continue the negotiation process. - * - * MDN - */ + /** The createOffer() method of the RTCPeerConnection interface initiates the creation of an SDP offer for the purpose + * of starting a new WebRTC connection to a remote peer. The SDP offer includes information about any + * MediaStreamTracks already attached to the WebRTC session, codec, and options supported by the browser, and any + * candidates already gathered by the ICE agent, for the purpose of being sent over the signaling channel to a + * potential peer to request a connection or to update the configuration of an existing connection. + * + * The return value is a Promise which, when the offer has been created, is resolved with a RTCSessionDescription + * object containing the newly-created offer. + * + * MDN + */ + def createOffer(options: RTCOfferOptions = js.native): js.Promise[RTCSessionDescription] = js.native + + /** The createAnswer() method on the RTCPeerConnection interface creates an SDP answer to an offer received from a + * remote peer during the offer/answer negotiation of a WebRTC connection. The answer contains information about any + * media already attached to the session, codecs and options supported by the browser, and any ICE candidates already + * gathered. The answer is delivered to the returned Promise, and should then be sent to the source of the offer to + * continue the negotiation process. + * + * MDN + */ def createAnswer(): js.Promise[RTCSessionDescription] = js.native - /** - * Changes the local description associated with the connection. The - * description defines the properties of the connection like its codec. The - * connection is affected by this change and must be able to support both - * old and new descriptions. The method takes one parameters, a - * RTCSessionDescription object to set, and returns a Promise. - * - * MDN - */ - def setLocalDescription( - description: RTCSessionDescription): js.Promise[Unit] = js.native - - /** - * Changes the remote description associated with the connection. The - * description defines the properties of the connection like its codec. - * The connection is affected by this change and must be able to support - * both old and new descriptions. The method takes one parameters, a - * RTCSessionDescription object to set, and returns a Promise. - * - * MDN - */ - def setRemoteDescription( - description: RTCSessionDescription): js.Promise[Unit] = js.native - - /** - * The updateIce method updates the ICE Agent process of gathering local - * candidates and pinging remote candidates. If there is a mandatory - * constraint called "IceTransports" it will control how the ICE engine - * can act. This can be used to limit the use to TURN candidates by a callee - * to avoid leaking location information prior to the call being accepted. - * This call may result in a change to the state of the ICE Agent, and may - * result in a change to media state if it results in connectivity being - * established - * - * MDN - */ + /** Changes the local description associated with the connection. The description defines the properties of the + * connection like its codec. The connection is affected by this change and must be able to support both old and new + * descriptions. The method takes one parameters, a RTCSessionDescription object to set, and returns a Promise. + * + * MDN + */ + def setLocalDescription(description: RTCSessionDescription): js.Promise[Unit] = js.native + + /** Changes the remote description associated with the connection. The description defines the properties of the + * connection like its codec. The connection is affected by this change and must be able to support both old and new + * descriptions. The method takes one parameters, a RTCSessionDescription object to set, and returns a Promise. + * + * MDN + */ + def setRemoteDescription(description: RTCSessionDescription): js.Promise[Unit] = js.native + + /** The updateIce method updates the ICE Agent process of gathering local candidates and pinging remote candidates. If + * there is a mandatory constraint called "IceTransports" it will control how the ICE engine can act. This can be + * used to limit the use to TURN candidates by a callee to avoid leaking location information prior to the call being + * accepted. This call may result in a change to the state of the ICE Agent, and may result in a change to media + * state if it results in connectivity being established + * + * MDN + */ def updateIce(configuration: RTCConfiguration): Unit = js.native - /** - * The addIceCandidate() method provides a remote candidate to the ICE Agent. - * In addition to being added to the remote description, connectivity checks - * will be sent to the new candidates as long as the "IceTransports" - * constraint is not set to "none". This call will result in a change to the - * connection state of the ICE Agent, and may result in a change to media - * state if it results in different connectivity being established. - * - * MDN - */ + /** The addIceCandidate() method provides a remote candidate to the ICE Agent. In addition to being added to the + * remote description, connectivity checks will be sent to the new candidates as long as the "IceTransports" + * constraint is not set to "none". This call will result in a change to the connection state of the ICE Agent, and + * may result in a change to media state if it results in different connectivity being established. + * + * MDN + */ def addIceCandidate(candidate: RTCIceCandidate): js.Promise[Unit] = js.native def getConfiguration(): RTCConfiguration = js.native - /** - * Returns an array of MediaStream associated with the local end of the - * connection. The array may be empty. - * - * MDN - */ + /** Returns an array of MediaStream associated with the local end of the connection. The array may be empty. + * + * MDN + */ def getLocalStreams(): js.Array[MediaStream] = js.native - /** - * Returns an array of MediaStream associated with the remote end of the - * connection. The array may be empty. - * - * MDN - */ + /** Returns an array of MediaStream associated with the remote end of the connection. The array may be empty. + * + * MDN + */ def getRemoteStreams(): js.Array[MediaStream] = js.native - /** - * Returns the MediaStream with the given id that is associated with local - * or remote end of the connection. If no stream matches, it returns null. - * - * MDN - */ + /** Returns the MediaStream with the given id that is associated with local or remote end of the connection. If no + * stream matches, it returns null. + * + * MDN + */ def getStreamById(id: String): MediaStream = js.native - /** - * Adds a MediaStream as a local source of audio or video. If the - * negotiation already happened, a new one will be needed for the remote - * peer to be able to use it. - * - * MDN - */ + /** Adds a MediaStream as a local source of audio or video. If the negotiation already happened, a new one will be + * needed for the remote peer to be able to use it. + * + * MDN + */ def addStream(stream: MediaStream): Unit = js.native - /** - * Removes a MediaStream as a local source of audio or video. If the - * negotiation already happened, a new one will be needed for the remote - * peer to stop using it. - * - * MDN - */ + /** Removes a MediaStream as a local source of audio or video. If the negotiation already happened, a new one will be + * needed for the remote peer to stop using it. + * + * MDN + */ def removeStream(stream: MediaStream): Unit = js.native - /** - * Abruptly closes a connection. - * - * MDN - */ + /** Abruptly closes a connection. + * + * MDN + */ def close(): Unit = js.native - /** - * Creates a new RTCDataChannel associated with this connection. The method - * takes a dictionary as parameter, with the configuration required for the - * underlying data channel, like its reliability. - * - * MDN - */ - def createDataChannel(label: String, - dataChannelDict: RTCDataChannelInit): RTCDataChannel = js.native - - /** - * Creates a new RTCDTMFSender, associated to a specific MediaStreamTrack, - * that will be able to send DTMF phone signaling over the connection. - * - * MDN - */ + /** Creates a new RTCDataChannel associated with this connection. The method takes a dictionary as parameter, with the + * configuration required for the underlying data channel, like its reliability. + * + * MDN + */ + def createDataChannel(label: String, dataChannelDict: RTCDataChannelInit): RTCDataChannel = js.native + + /** Creates a new RTCDTMFSender, associated to a specific MediaStreamTrack, that will be able to send DTMF phone + * signaling over the connection. + * + * MDN + */ def createDTMFSender(track: MediaStreamTrack): RTCDTMFSender = js.native - /** - * Creates a new RTCStatsReport that contains and allows access to statistics - * regarding the connection. - * - * MDN - */ - def getStats(selector: MediaStreamTrack, - callback: js.Function1[RTCStatsReport, Any], + /** Creates a new RTCStatsReport that contains and allows access to statistics regarding the connection. + * + * MDN + */ + def getStats(selector: MediaStreamTrack, callback: js.Function1[RTCStatsReport, Any], error: js.Function1[DOMException, Any]): RTCStatsReport = js.native - /** - * Sets the identity provider to be used for a given RTCPeerConnection object. - * Applications need not make this call; if the browser is already configured - * for an IdP, then that configured IdP might be used to get an assertion. - * - * When the setIdentityProvider() method is invoked, the user agent must run the - * following steps: - * - If the connection's RTCPeerConnection signalingState is closed, throw - * an InvalidStateError exception and abort these steps. - * - * - Set the current identity provider values to the triplet (provider, - * protocol, usernameHint). - * - * - If any identity provider value has changed, discard any stored identity - * assertion. - * - * - Identity provider information is not used until an identity assertion - * is required, either in response to a call to getIdentityAssertion, or a - * session description is requested with a call to either createOffer or - * createAnswer. - */ + /** Sets the identity provider to be used for a given RTCPeerConnection object. Applications need not make this call; + * if the browser is already configured for an IdP, then that configured IdP might be used to get an assertion. + * + * When the setIdentityProvider() method is invoked, the user agent must run the following steps: + * - If the connection's RTCPeerConnection signalingState is closed, throw an InvalidStateError exception and abort + * these steps. + * + * - Set the current identity provider values to the triplet (provider, protocol, usernameHint). + * + * - If any identity provider value has changed, discard any stored identity assertion. + * + * - Identity provider information is not used until an identity assertion is required, either in response to a + * call to getIdentityAssertion, or a session description is requested with a call to either createOffer or + * createAnswer. + */ def setIdentityProvider(provider: String, protocol: String = js.native, usernameHint: String = js.native): Unit = js.native - /** - * Initiates the process of obtaining an identity assertion. Applications - * need not make this call. It is merely intended to allow them to start the - * process of obtaining identity assertions before a call is initiated. If an - * identity is needed, either because the browser has been configured with a - * default identity provider or because the setIdentityProvider() method was - * called, then an identity will be automatically requested when an offer or - * answer is created. - * - * When getIdentityAssertion is invoked, queue a task to run the following - * steps: - * - * - If the connection's RTCPeerConnection signalingState is closed, abort - * these steps. - * - * - Request an identity assertion from the IdP. - * - */ + /** Initiates the process of obtaining an identity assertion. Applications need not make this call. It is merely + * intended to allow them to start the process of obtaining identity assertions before a call is initiated. If an + * identity is needed, either because the browser has been configured with a default identity provider or because the + * setIdentityProvider() method was called, then an identity will be automatically requested when an offer or answer + * is created. + * + * When getIdentityAssertion is invoked, queue a task to run the following steps: + * + * - If the connection's RTCPeerConnection signalingState is closed, abort these steps. + * + * - Request an identity assertion from the IdP. + */ def getIdentityAssertion(): js.Promise[Unit] = js.native } diff --git a/src/main/scala/org/scalajs/dom/experimental/webrtc/package.scala b/src/main/scala/org/scalajs/dom/experimental/webrtc/package.scala index c5c1dac58..721d583b4 100644 --- a/src/main/scala/org/scalajs/dom/experimental/webrtc/package.scala +++ b/src/main/scala/org/scalajs/dom/experimental/webrtc/package.scala @@ -5,20 +5,21 @@ import scala.language.implicitConversions import scala.scalajs.js package object webrtc { + implicit def toWebRTC(n: org.scalajs.dom.Navigator): NavigatorMediaStream = n.asInstanceOf[NavigatorMediaStream] @js.native trait NavigatorMediaStream extends js.Object { - /** - * The Navigator.mediaDevices read-only property returns a MediaDevices object, which provides access to connected - * media input devices like cameras and microphones, as well as screen sharing. - * - * MDN - * - * @see [[https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices]] - */ + /** The Navigator.mediaDevices read-only property returns a MediaDevices object, which provides access to connected + * media input devices like cameras and microphones, as well as screen sharing. + * + * MDN + * + * @see + * [[https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices]] + */ def mediaDevices: MediaDevices = js.native } } diff --git a/src/main/scala/org/scalajs/dom/ext/Extensions.scala b/src/main/scala/org/scalajs/dom/ext/Extensions.scala index 79ecb9256..56e0942e0 100644 --- a/src/main/scala/org/scalajs/dom/ext/Extensions.scala +++ b/src/main/scala/org/scalajs/dom/ext/Extensions.scala @@ -9,10 +9,9 @@ import scala.scalajs.js import scala.scalajs.js.typedarray.ArrayBufferView import scala.scalajs.js.typedarray.TypedArrayBufferOps._ -/** - * Thrown when `Ajax.get` or `Ajax.post` receives a non-20X response code. - * Contains the XMLHttpRequest that resulted in that response - */ +/** Thrown when `Ajax.get` or `Ajax.post` receives a non-20X response code. Contains the XMLHttpRequest that resulted in + * that response + */ @deprecated("use the dom.fetch API instead", "2.0.0") case class AjaxException(xhr: dom.XMLHttpRequest) extends Exception { def isTimeout = xhr.status == 0 && xhr.readyState == 4 @@ -22,16 +21,13 @@ case class AjaxException(xhr: dom.XMLHttpRequest) extends Exception { @deprecated("use the dom.fetch API instead", "2.0.0") object AjaxException extends (dom.XMLHttpRequest => AjaxException) -/** - * Wraps an XMLHttpRequest to provide an easy one-line way of making - * an Ajax call, returning a Future. - */ +/** Wraps an XMLHttpRequest to provide an easy one-line way of making an Ajax call, returning a Future. + */ @deprecated("use the dom.fetch API instead", "2.0.0") object Ajax { - /** - * Supported data formats for Ajax are implicitly converted to InputData - */ + /** Supported data formats for Ajax are implicitly converted to InputData + */ @js.native sealed trait InputData extends js.Any @@ -61,39 +57,33 @@ object Ajax { } } - def get(url: String, data: InputData = null, timeout: Int = 0, - headers: Map[String, String] = Map.empty, + def get(url: String, data: InputData = null, timeout: Int = 0, headers: Map[String, String] = Map.empty, withCredentials: Boolean = false, responseType: String = "") = { apply("GET", url, data, timeout, headers, withCredentials, responseType) } - def post(url: String, data: InputData = null, timeout: Int = 0, - headers: Map[String, String] = Map.empty, + def post(url: String, data: InputData = null, timeout: Int = 0, headers: Map[String, String] = Map.empty, withCredentials: Boolean = false, responseType: String = "") = { apply("POST", url, data, timeout, headers, withCredentials, responseType) } - def put(url: String, data: InputData = null, timeout: Int = 0, - headers: Map[String, String] = Map.empty, + def put(url: String, data: InputData = null, timeout: Int = 0, headers: Map[String, String] = Map.empty, withCredentials: Boolean = false, responseType: String = "") = { apply("PUT", url, data, timeout, headers, withCredentials, responseType) } - def patch(url: String, data: InputData = null, timeout: Int = 0, - headers: Map[String, String] = Map.empty, + def patch(url: String, data: InputData = null, timeout: Int = 0, headers: Map[String, String] = Map.empty, withCredentials: Boolean = false, responseType: String = "") = { apply("PATCH", url, data, timeout, headers, withCredentials, responseType) } - def delete(url: String, data: InputData = null, timeout: Int = 0, - headers: Map[String, String] = Map.empty, + def delete(url: String, data: InputData = null, timeout: Int = 0, headers: Map[String, String] = Map.empty, withCredentials: Boolean = false, responseType: String = "") = { apply("DELETE", url, data, timeout, headers, withCredentials, responseType) } - def apply(method: String, url: String, data: InputData, timeout: Int, - headers: Map[String, String], withCredentials: Boolean, - responseType: String): Future[dom.XMLHttpRequest] = { + def apply(method: String, url: String, data: InputData, timeout: Int, headers: Map[String, String], + withCredentials: Boolean, responseType: String): Future[dom.XMLHttpRequest] = { val req = new dom.XMLHttpRequest() val promise = Promise[dom.XMLHttpRequest]() diff --git a/src/main/scala/org/scalajs/dom/ext/package.scala b/src/main/scala/org/scalajs/dom/ext/package.scala index e15474da8..c9f1732d4 100644 --- a/src/main/scala/org/scalajs/dom/ext/package.scala +++ b/src/main/scala/org/scalajs/dom/ext/package.scala @@ -3,6 +3,7 @@ package org.scalajs.dom import org.scalajs.dom package object ext { + @deprecated("use dom.KeyValue instead", "2.0.0") val KeyValue: dom.KeyValue.type = dom.KeyValue diff --git a/src/main/scala/org/scalajs/dom/html.scala b/src/main/scala/org/scalajs/dom/html.scala index 254a235a2..0135fa937 100644 --- a/src/main/scala/org/scalajs/dom/html.scala +++ b/src/main/scala/org/scalajs/dom/html.scala @@ -1,8 +1,7 @@ package org.scalajs.dom -/** - * Short aliases of all the dom.HTMLThing classes - */ +/** Short aliases of all the dom.HTMLThing classes + */ object html { type Anchor = HTMLAnchorElement type Audio = HTMLAudioElement diff --git a/src/main/scala/org/scalajs/dom/idb.scala b/src/main/scala/org/scalajs/dom/idb.scala index d33408e70..3ccfabb98 100644 --- a/src/main/scala/org/scalajs/dom/idb.scala +++ b/src/main/scala/org/scalajs/dom/idb.scala @@ -1,8 +1,7 @@ package org.scalajs.dom -/** - * Short aliases of all the dom.IDBThing classes - */ +/** Short aliases of all the dom.IDBThing classes + */ object idb { type Cursor = IDBCursor @inline def CursorDirection = IDBCursorDirection @@ -18,6 +17,7 @@ object idb { type Transaction = IDBTransaction @inline def TransactionMode = IDBTransactionMode type VersionChangeEvent = IDBVersionChangeEvent + @deprecated( "Removed. This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible. See https://developer.mozilla.org/en-US/docs/Web/API/IDBEnvironment", "1.2.0") diff --git a/src/main/scala/org/scalajs/dom/lib.scala b/src/main/scala/org/scalajs/dom/lib.scala index 41694f8c6..469643c46 100644 --- a/src/main/scala/org/scalajs/dom/lib.scala +++ b/src/main/scala/org/scalajs/dom/lib.scala @@ -1,12 +1,9 @@ -/** - * Documentation marked "MDN" is thanks to Mozilla Contributors - * at https://developer.mozilla.org/en-US/docs/Web/API and available - * under the Creative Commons Attribution-ShareAlike v2.5 or later. - * http://creativecommons.org/licenses/by-sa/2.5/ - * - * Everything else is under the MIT License - * http://opensource.org/licenses/MIT - */ +/** Documentation marked "MDN" is thanks to Mozilla Contributors at https://developer.mozilla.org/en-US/docs/Web/API and + * available under the Creative Commons Attribution-ShareAlike v2.5 or later. + * http://creativecommons.org/licenses/by-sa/2.5/ + * + * Everything else is under the MIT License http://opensource.org/licenses/MIT + */ package org.scalajs.dom import scala.collection.mutable @@ -20,89 +17,72 @@ import scala.scalajs.js.| @JSGlobal object XPathResult extends js.Object { - /** - * A result set containing whatever type naturally results from evaluation - * of the expression. Note that if the result is a node-set then - * UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. - * - * MDN - */ + /** A result set containing whatever type naturally results from evaluation of the expression. Note that if the result + * is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. + * + * MDN + */ val ANY_TYPE: Int = js.native - /** - * A result containing a single number. This is useful for example, in an - * XPath expression using the count() function. - * - * MDN - */ + /** A result containing a single number. This is useful for example, in an XPath expression using the count() + * function. + * + * MDN + */ val NUMBER_TYPE: Int = js.native - /** - * A result containing a single string. - * - * MDN - */ + /** A result containing a single string. + * + * MDN + */ val STRING_TYPE: Int = js.native - /** - * A result containing a single boolean value. This is useful for example, - * in an XPath expression using the not() function. - * - * MDN - */ + /** A result containing a single boolean value. This is useful for example, in an XPath expression using the not() + * function. + * + * MDN + */ val BOOLEAN_TYPE: Int = js.native - /** - * A result node-set containing all the nodes matching the expression. The - * nodes may not necessarily be in the same order that they appear in the - * document. - * - * MDN - */ + /** A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same + * order that they appear in the document. + * + * MDN + */ val UNORDERED_NODE_ITERATOR_TYPE: Int = js.native - /** - * A result node-set containing all the nodes matching the expression. The - * nodes in the result set are in the same order that they appear in the - * document. - * - * MDN - */ + /** A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same + * order that they appear in the document. + * + * MDN + */ val ORDERED_NODE_ITERATOR_TYPE: Int = js.native - /** - * A result node-set containing snapshots of all the nodes matching the - * expression. The nodes may not necessarily be in the same order that they - * appear in the document. - * - * MDN - */ + /** A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be + * in the same order that they appear in the document. + * + * MDN + */ val UNORDERED_NODE_SNAPSHOT_TYPE: Int = js.native - /** - * A result node-set containing snapshots of all the nodes matching the - * expression. The nodes in the result set are in the same order that they - * appear in the document. - * - * MDN - */ + /** A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are + * in the same order that they appear in the document. + * + * MDN + */ val ORDERED_NODE_SNAPSHOT_TYPE: Int = js.native - /** - * A result node-set containing any single node that matches the expression. - * The node is not necessarily the first node in the document that matches - * the expression. - * - * MDN - */ + /** A result node-set containing any single node that matches the expression. The node is not necessarily the first + * node in the document that matches the expression. + * + * MDN + */ val ANY_UNORDERED_NODE_TYPE: Int = js.native - /** - * A result node-set containing the first node in the document that matches - * the expression. - * - * MDN - */ + /** A result node-set containing the first node in the document that matches the expression. + * + * MDN + */ val FIRST_ORDERED_NODE_TYPE: Int = js.native } @@ -126,251 +106,203 @@ class XPathNSResolver extends js.Object { def lookupNamespaceURI(prefix: String): String = js.native } -/** - * The PositionOptions interface describes the options to use when calling the - * geolocation backend. The user agent itself doesn't create such an object itself: - * it is the calling script that create it and use it as a parameter of - * Geolocation.getCurrentPosition() and Geolocation.watchPosition(). - * - * MDN - */ +/** The PositionOptions interface describes the options to use when calling the geolocation backend. The user agent + * itself doesn't create such an object itself: it is the calling script that create it and use it as a parameter of + * Geolocation.getCurrentPosition() and Geolocation.watchPosition(). + * + * MDN + */ @js.native @JSGlobal class PositionOptions extends js.Object { - /** - * The PositionOptions.enableHighAccuracy property is a Boolean that indicates - * the application would like to receive the best possible results. If true and if the - * device is able to provide a more accurate position, it will do so. Note that this can - * result in slower response times or increased power consumption (with a GPS chip on a - * mobile device for example). On the other hand, if false (the default value), the - * device can take the liberty to save resources by responding more quickly and/or - * using less power. - * - * MDN - */ + /** The PositionOptions.enableHighAccuracy property is a Boolean that indicates the application would like to receive + * the best possible results. If true and if the device is able to provide a more accurate position, it will do so. + * Note that this can result in slower response times or increased power consumption (with a GPS chip on a mobile + * device for example). On the other hand, if false (the default value), the device can take the liberty to save + * resources by responding more quickly and/or using less power. + * + * MDN + */ var enableHighAccuracy: Boolean = js.native - /** - * The PositionOptions.timeout property is a positive long value representing the - * maximum length of time (in milliseconds) the device is allowed to take in order to - * return a position. The default value is Infinity, meaning that - * getCurrentPosition() won't return until the position is available. - * - * MDN - */ + /** The PositionOptions.timeout property is a positive long value representing the maximum length of time (in + * milliseconds) the device is allowed to take in order to return a position. The default value is Infinity, meaning + * that getCurrentPosition() won't return until the position is available. + * + * MDN + */ var timeout: Int = js.native - /** - * The PositionOptions.maximumAge property is a positive long value indicating the - * maximum age in milliseconds of a possible cached position that is acceptable to - * return. If set to 0, it means that the device cannot use a cached position and must - * attempt to retrieve the real current position. If set to Infinity the device must - * return a cached position regardless of its age. - * - * MDN - */ + /** The PositionOptions.maximumAge property is a positive long value indicating the maximum age in milliseconds of a + * possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached + * position and must attempt to retrieve the real current position. If set to Infinity the device must return a + * cached position regardless of its age. + * + * MDN + */ var maximumAge: Int = js.native } -/** - * The NavigatorID interface contains methods and properties related to the - * identity of the browser. - * - * There is no object of type NavigatorID, but other interfaces, like Navigator - * or WorkerNavigator, implement it. - * - * MDN - */ +/** The NavigatorID interface contains methods and properties related to the identity of the browser. + * + * There is no object of type NavigatorID, but other interfaces, like Navigator or WorkerNavigator, implement it. + * + * MDN + */ @js.native trait NavigatorID extends js.Object { - /** - * Returns the version of the browser as a string. It may be either a plain version - * number, like "5.0", or a version number followed by more detailed information. The - * HTML5 specification also allows any browser to return "4.0" here, for - * compatibility reasons. - * - * MDN - */ + /** Returns the version of the browser as a string. It may be either a plain version number, like "5.0", or a version + * number followed by more detailed information. The HTML5 specification also allows any browser to return "4.0" + * here, for compatibility reasons. + * + * MDN + */ def appVersion: String = js.native - /** - * Returns the name of the browser. The HTML5 specification also allows any browser to - * return "Netscape" here, for compatibility reasons. - * - * MDN - */ + /** Returns the name of the browser. The HTML5 specification also allows any browser to return "Netscape" here, for + * compatibility reasons. + * + * MDN + */ def appName: String = js.native - /** - * Returns the user agent string for the current browser. - * - * MDN - */ + /** Returns the user agent string for the current browser. + * + * MDN + */ def userAgent: String = js.native - /** - * Returns a string representing the platform of the browser. - * - * MDN - */ + /** Returns a string representing the platform of the browser. + * + * MDN + */ def platform: String = js.native } -/** - * The TreeWalker object represents the nodes of a document subtree and a position - * within them. - * - * A TreeWalker can be created using the Document.createTreeWalker() method. - * - * MDN - */ +/** The TreeWalker object represents the nodes of a document subtree and a position within them. + * + * A TreeWalker can be created using the Document.createTreeWalker() method. + * + * MDN + */ @js.native @JSGlobal class TreeWalker extends js.Object { - /** - * Returns an unsigned long being a bitmask made of constants describing the types of - * Node that must to be presented. Non-matching nodes are skipped, but their children - * may be included, if relevant. - * - * MDN - */ + /** Returns an unsigned long being a bitmask made of constants describing the types of Node that must to be presented. + * Non-matching nodes are skipped, but their children may be included, if relevant. + * + * MDN + */ def whatToShow: Int = js.native - /** - * The TreeWalker.filter read-only property returns a NodeFilter that is the - * filtering object associated with the TreeWalker. - * - * MDN - */ + /** The TreeWalker.filter read-only property returns a NodeFilter that is the filtering object associated with the + * TreeWalker. + * + * MDN + */ def filter: NodeFilter = js.native - /** - * The TreeWalker.root read-only property returns the node that is the root of what - * the TreeWalker traverses. - * - * MDN - */ + /** The TreeWalker.root read-only property returns the node that is the root of what the TreeWalker traverses. + * + * MDN + */ def root: Node = js.native - /** - * The TreeWalker.currentNode property represents the Node on which the TreeWalker - * is currently pointing at. - * - * MDN - */ + /** The TreeWalker.currentNode property represents the Node on which the TreeWalker is currently pointing at. + * + * MDN + */ var currentNode: Node = js.native - /** - * The TreeWalker.previousSibling() method moves the current Node to its previous - * sibling, if any, and returns the found sibling. I there is no such node, return null - * and the current node is not changed. - * - * MDN - */ + /** The TreeWalker.previousSibling() method moves the current Node to its previous sibling, if any, and returns the + * found sibling. I there is no such node, return null and the current node is not changed. + * + * MDN + */ def previousSibling(): Node = js.native - /** - * The TreeWalker.lastChild() method moves the current Node to the last visible - * child of the current node, and returns the found child. It also moves the current - * node to this child. If no such child exists, returns null and the current node is not - * changed. - * - * MDN - */ + /** The TreeWalker.lastChild() method moves the current Node to the last visible child of the current node, and + * returns the found child. It also moves the current node to this child. If no such child exists, returns null and + * the current node is not changed. + * + * MDN + */ def lastChild(): Node = js.native - /** - * The TreeWalker.nextSibling() method moves the current Node to its next sibling, - * if any, and returns the found sibling. I there is no such node, return null and the - * current node is not changed. - * - * MDN - */ + /** The TreeWalker.nextSibling() method moves the current Node to its next sibling, if any, and returns the found + * sibling. I there is no such node, return null and the current node is not changed. + * + * MDN + */ def nextSibling(): Node = js.native - /** - * The TreeWalker.nextNode() method moves the current Node to the next visible node - * in the document order, and returns the found node. It also moves the current node to - * this one. If no such node exists, returns null and the current node is not changed. - * - * MDN - */ + /** The TreeWalker.nextNode() method moves the current Node to the next visible node in the document order, and + * returns the found node. It also moves the current node to this one. If no such node exists, returns null and the + * current node is not changed. + * + * MDN + */ def nextNode(): Node = js.native - /** - * The TreeWalker.parentNode() method moves the current Node to the first visible - * ancestor node in the document order, and returns the found node. It also moves the - * current node to this one. If no such node exists, or if it is before that the root node - * defined at the object construction, returns null and the current node is not - * changed. - * - * MDN - */ + /** The TreeWalker.parentNode() method moves the current Node to the first visible ancestor node in the document + * order, and returns the found node. It also moves the current node to this one. If no such node exists, or if it is + * before that the root node defined at the object construction, returns null and the current node is not changed. + * + * MDN + */ def parentNode(): Node = js.native - /** - * The TreeWalker.firstChild() method moves the current Node to the first visible - * child of the current node, and returns the found child. It also moves the current - * node to this child. If no such child exists, returns null and the current node is not - * changed. - * - * MDN - */ + /** The TreeWalker.firstChild() method moves the current Node to the first visible child of the current node, and + * returns the found child. It also moves the current node to this child. If no such child exists, returns null and + * the current node is not changed. + * + * MDN + */ def firstChild(): Node = js.native - /** - * The TreeWalker.previousNode() method moves the current Node to the previous - * visible node in the document order, and returns the found node. It also moves the - * current node to this one. If no such node exists,or if it is before that the root node - * defined at the object construction, returns null and the current node is not - * changed. - * - * MDN - */ + /** The TreeWalker.previousNode() method moves the current Node to the previous visible node in the document order, + * and returns the found node. It also moves the current node to this one. If no such node exists,or if it is before + * that the root node defined at the object construction, returns null and the current node is not changed. + * + * MDN + */ def previousNode(): Node = js.native } -/** - * An object of this type can be obtained by calling the Window.performance read-only - * attribute. - * - * An object of this type can be obtained by calling the Window.performance read-only - * attribute. - * - * MDN - */ +/** An object of this type can be obtained by calling the Window.performance read-only attribute. + * + * An object of this type can be obtained by calling the Window.performance read-only attribute. + * + * MDN + */ @js.native @JSGlobal class Performance extends js.Object { - /** - * The Performance.navigation read-only property returns a - * PerformanceNavigation object representing the type of navigation that occurs in - * the given browsing context, like the amount of redirections needed to fetch the - * resource. - * - * MDN - */ + /** The Performance.navigation read-only property returns a PerformanceNavigation object representing the type of + * navigation that occurs in the given browsing context, like the amount of redirections needed to fetch the + * resource. + * + * MDN + */ def navigation: PerformanceNavigation = js.native - /** - * The Performance.timing read-only property returns a PerformanceTiming object - * containing latency-related performance information. - * - * MDN - */ + /** The Performance.timing read-only property returns a PerformanceTiming object containing latency-related + * performance information. + * + * MDN + */ def timing: PerformanceTiming = js.native def getEntriesByType(entryType: String): js.Dynamic = js.native - /** - * Is a jsonizer returning a json object representing the Performance object. - * - * MDN - */ + /** Is a jsonizer returning a json object representing the Performance object. + * + * MDN + */ def toJSON(): js.Dynamic = js.native def getMeasures(measureName: String = js.native): js.Dynamic = js.native @@ -383,11 +315,9 @@ class Performance extends js.Object { def mark(markName: String): Unit = js.native - def measure(measureName: String, startMarkName: String = js.native, - endMarkName: String = js.native): Unit = js.native + def measure(measureName: String, startMarkName: String = js.native, endMarkName: String = js.native): Unit = js.native - def getEntriesByName(name: String, - entryType: String = js.native): js.Dynamic = js.native + def getEntriesByName(name: String, entryType: String = js.native): js.Dynamic = js.native def getEntries(): js.Dynamic = js.native @@ -395,13 +325,11 @@ class Performance extends js.Object { def setResourceTimingBufferSize(maxSize: Int): Unit = js.native - /** - * Returns a DOMHighResTimeStamp representing the amount of milliseconds elapsed - * since the start of the navigation, as give by PerformanceTiming.navigationStart - * to the call of the method. - * - * MDN - */ + /** Returns a DOMHighResTimeStamp representing the amount of milliseconds elapsed since the start of the navigation, + * as give by PerformanceTiming.navigationStart to the call of the method. + * + * MDN + */ def now(): Double = js.native } @@ -410,121 +338,99 @@ trait CompositionEventInit extends UIEventInit { var locale: js.UndefOr[String] = js.undefined } -/** - * The DOM CompositionEvent represents events that occur due to the user indirectly - * entering text. - * - * MDN - */ +/** The DOM CompositionEvent represents events that occur due to the user indirectly entering text. + * + * MDN + */ @js.native @JSGlobal -class CompositionEvent(typeArg: String, init: js.UndefOr[CompositionEventInit]) - extends UIEvent(typeArg, init) { - - /** - * For compositionstart events, this is the currently selected text that will be - * replaced by the string being composed. This value doesn't change even if content - * changes the selection range; rather, it indicates the string that was selected - * when composition started. For compositionupdate, this is the string as it stands - * currently as editing is ongoing. For compositionend events, this is the string as - * committed to the editor. Read only. - * - * MDN - */ +class CompositionEvent(typeArg: String, init: js.UndefOr[CompositionEventInit]) extends UIEvent(typeArg, init) { + + /** For compositionstart events, this is the currently selected text that will be replaced by the string being + * composed. This value doesn't change even if content changes the selection range; rather, it indicates the string + * that was selected when composition started. For compositionupdate, this is the string as it stands currently as + * editing is ongoing. For compositionend events, this is the string as committed to the editor. Read only. + * + * MDN + */ def data: String = js.native - /** - * The locale of current input method (for example, the keyboard layout locale if the - * composition is associated with IME). Read only. - * - * MDN - */ + /** The locale of current input method (for example, the keyboard layout locale if the composition is associated with + * IME). Read only. + * + * MDN + */ def locale: String = js.native } @js.native trait WindowTimers extends js.Object { - /** - * Clears the delay set by window.setTimeout(). - * - * MDN - */ + /** Clears the delay set by window.setTimeout(). + * + * MDN + */ def clearTimeout(handle: Int): Unit = js.native - /** - * Calls a function or executes a code snippet after a specified delay. - * - * MDN - */ + /** Calls a function or executes a code snippet after a specified delay. + * + * MDN + */ def setTimeout(handler: js.Function0[Any], timeout: Double): Int = js.native - /** - * Cancels repeated action which was set up using setInterval. - * - * MDN - */ + /** Cancels repeated action which was set up using setInterval. + * + * MDN + */ def clearInterval(handle: Int): Unit = js.native - /** - * Calls a function or executes a code snippet repeatedly, with a fixed time - * delay between each call to that function. - * - * MDN - */ + /** Calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that + * function. + * + * MDN + */ def setInterval(handler: js.Function0[Any], timeout: Double): Int = js.native } -/** - * The Navigator interface represents the state and the identity of the user - * agent. It allows scripts to query it and to register themselves to carry - * on some activities. - * - * A Navigator object can be retrieved using the read-only Window.navigator - * property. - * - * MDN - */ +/** The Navigator interface represents the state and the identity of the user agent. It allows scripts to query it and + * to register themselves to carry on some activities. + * + * A Navigator object can be retrieved using the read-only Window.navigator property. + * + * MDN + */ @js.native @JSGlobal class Navigator - extends NavigatorID with NavigatorOnLine with NavigatorContentUtils - with NavigatorGeolocation with NavigatorStorageUtils with NavigatorLanguage - with NavigatorVibration { - - /** - * The Clipboard API adds to the Navigator interface the read-only - * clipboard property, which returns the Clipboard object used to read - * and write the clipboard's contents. The Clipboard API can be used - * to implement cut, copy, and paste features within a web application. - * - * Use of the asynchronous clipboard read and write methods requires - * that the user grant the web site or app permission to access the - * clipboard. This permission must be obtained from the Permissions API - * using the "clipboard-read" and/or "clipboard-write" permissions. - */ + extends NavigatorID with NavigatorOnLine with NavigatorContentUtils with NavigatorGeolocation + with NavigatorStorageUtils with NavigatorLanguage with NavigatorVibration { + + /** The Clipboard API adds to the Navigator interface the read-only clipboard property, which returns the Clipboard + * object used to read and write the clipboard's contents. The Clipboard API can be used to implement cut, copy, and + * paste features within a web application. + * + * Use of the asynchronous clipboard read and write methods requires that the user grant the web site or app + * permission to access the clipboard. This permission must be obtained from the Permissions API using the + * "clipboard-read" and/or "clipboard-write" permissions. + */ def clipboard: Clipboard = js.native } @js.native trait NodeSelector extends js.Object { - /** - * Returns a list of the elements within the document (using depth-first - * pre-order traversal of the document's nodes) that match the specified - * group of selectors. - * - * MDN - */ + /** Returns a list of the elements within the document (using depth-first pre-order traversal of the document's nodes) + * that match the specified group of selectors. + * + * MDN + */ def querySelectorAll(selectors: String): NodeList[Node] = js.native - /** - * Returns the first element within the document (using depth-first pre-order - * traversal of the document's nodes) that matches the specified group of - * selectors. - * - * MDN - */ + /** Returns the first element within the document (using depth-first pre-order traversal of the document's nodes) that + * matches the specified group of selectors. + * + * MDN + */ def querySelector(selectors: String): Element = js.native } @@ -539,508 +445,411 @@ class DOMRect extends js.Object { var height: Double = js.native } -/** - * The DOMImplementation interface represent an object providing methods which are - * not dependent on any particular document. Such an object is returned by the - * Document.implementation property. - * - * MDN - */ +/** The DOMImplementation interface represent an object providing methods which are not dependent on any particular + * document. Such an object is returned by the Document.implementation property. + * + * MDN + */ @js.native @JSGlobal class DOMImplementation extends js.Object { - /** - * « DOM Reference « DOMImplementation - * - * MDN - */ - def createDocumentType(qualifiedName: String, publicId: String, - systemId: String): DocumentType = js.native - - /** - * « DOM Reference « DOMImplementation - * - * MDN - */ - def createDocument(namespaceURI: String, qualifiedName: String, - doctype: DocumentType): Document = js.native + /** « DOM Reference « DOMImplementation + * + * MDN + */ + def createDocumentType(qualifiedName: String, publicId: String, systemId: String): DocumentType = js.native + + /** « DOM Reference « DOMImplementation + * + * MDN + */ + def createDocument(namespaceURI: String, qualifiedName: String, doctype: DocumentType): Document = js.native def hasFeature(feature: String, version: String): Boolean = js.native - /** - * Returns a Boolean indicating if a given feature is supported or not. This function - * is unreliable and kept for compatibility purpose alone: except for SVG-related - * queries, it always returns true. Old browsers are very inconsistent in their - * behavior. - * - * MDN - */ + /** Returns a Boolean indicating if a given feature is supported or not. This function is unreliable and kept for + * compatibility purpose alone: except for SVG-related queries, it always returns true. Old browsers are very + * inconsistent in their behavior. + * + * MDN + */ def hasFeature(feature: String): Boolean = js.native - /** - * Creates and returns an HTML Document. - * - * MDN - */ + /** Creates and returns an HTML Document. + * + * MDN + */ def createHTMLDocument(title: String): Document = js.native } -/** - * The ParentNode interface allows to traverse from an element to its children. - * - * ParentNode is a raw interface and no object of this type can be created; it - * is implemented by Element, Document, and DocumentFragment objects. - * - * MDN - */ +/** The ParentNode interface allows to traverse from an element to its children. + * + * ParentNode is a raw interface and no object of this type can be created; it is implemented by Element, Document, and + * DocumentFragment objects. + * + * MDN + */ @js.native trait ParentNode extends js.Object { - /** - * Returns a live HTMLCollection containing all objects of type Element that are children of the object. - * - * MDN - */ + /** Returns a live HTMLCollection containing all objects of type Element that are children of the object. + * + * MDN + */ def children: HTMLCollection = js.native - /** - * Returns the Element that is the first child of the object, or null if there is none. - * - * MDN - */ + /** Returns the Element that is the first child of the object, or null if there is none. + * + * MDN + */ def firstElementChild: Element = js.native - /** - * Returns the Element that is the last child of the object, or null if there is none. - * - * MDN - */ + /** Returns the Element that is the last child of the object, or null if there is none. + * + * MDN + */ def lastElementChild: Element = js.native - /** - * Returns an unsigned long giving the amount of children that the object has. - * - * MDN - */ + /** Returns an unsigned long giving the amount of children that the object has. + * + * MDN + */ def childElementCount: Int = js.native - /** - * Replaces the existing children of a Node with a specified new set of children. - * - * MDN - */ + /** Replaces the existing children of a Node with a specified new set of children. + * + * MDN + */ def replaceChildren(nodes: (Node | String)*): Unit = js.native } -/** - * The NonDocumentTypeChildNode interface contains methods that are particular to - * Node objects that can have a parent, but not suitable for DocumentType. - * - * NonDocumentTypeChildNode is a raw interface and no object of this type can be - * created; it is implemented by Element, and CharacterData objects. - * - * https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode - */ +/** The NonDocumentTypeChildNode interface contains methods that are particular to Node objects that can have a parent, + * but not suitable for DocumentType. + * + * NonDocumentTypeChildNode is a raw interface and no object of this type can be created; it is implemented by Element, + * and CharacterData objects. + * + * https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode + */ @js.native trait NonDocumentTypeChildNode extends js.Object { - /** - * The previousElementSibling read-only property returns the Element immediately prior - * to the specified one in its parent's children list, or null if the specified element - * is the first one in the list. - * - * MDN - */ + /** The previousElementSibling read-only property returns the Element immediately prior to the specified one in its + * parent's children list, or null if the specified element is the first one in the list. + * + * MDN + */ def previousElementSibling: Element = js.native - /** - * The nextElementSibling read-only property returns the element immediately following - * the specified one in its parent's children list, or null if the specified element is - * the last one in the list. - * - * MDN - */ + /** The nextElementSibling read-only property returns the element immediately following the specified one in its + * parent's children list, or null if the specified element is the last one in the list. + * + * MDN + */ def nextElementSibling: Element = js.native } -/** - * The Element interface represents part of the document. This interface describes - * methods and properties common to each kind of elements. Specific behaviors are - * described in the specific interfaces, inheriting from Element: the HTMLElement - * interface for HTML elements, or the SVGElement interface for SVG elements. - * - * https://developer.mozilla.org/en-US/docs/Web/API/element - */ +/** The Element interface represents part of the document. This interface describes methods and properties common to + * each kind of elements. Specific behaviors are described in the specific interfaces, inheriting from Element: the + * HTMLElement interface for HTML elements, or the SVGElement interface for SVG elements. + * + * https://developer.mozilla.org/en-US/docs/Web/API/element + */ @js.native @JSGlobal -abstract class Element - extends Node with NodeSelector with ParentNode - with NonDocumentTypeChildNode { - - /** - * A DOMString representing the namespace prefix of the element, or null if no - * prefix is specified. - * - * MDN - */ +abstract class Element extends Node with NodeSelector with ParentNode with NonDocumentTypeChildNode { + + /** A DOMString representing the namespace prefix of the element, or null if no prefix is specified. + * + * MDN + */ def prefix: String = js.native - /** - * scrollTop gets or sets the number of pixels that the content of an element is - * scrolled upward. - * - * MDN - */ + /** scrollTop gets or sets the number of pixels that the content of an element is scrolled upward. + * + * MDN + */ var scrollTop: Double = js.native - /** - * The width of the left border of an element in pixels. It includes the width of the - * vertical scrollbar if the text direction of the element is right–to–left and if - * there is an overflow causing a left vertical scrollbar to be rendered. clientLeft - * does not include the left margin or the left padding. clientLeft is read-only. - * - * MDN - */ + /** The width of the left border of an element in pixels. It includes the width of the vertical scrollbar if the text + * direction of the element is right–to–left and if there is an overflow causing a left vertical scrollbar to be + * rendered. clientLeft does not include the left margin or the left padding. clientLeft is read-only. + * + * MDN + */ def clientLeft: Int = js.native - /** - * scrollLeft gets or sets the number of pixels that an element's content is scrolled - * to the left. - * - * MDN - */ + /** scrollLeft gets or sets the number of pixels that an element's content is scrolled to the left. + * + * MDN + */ var scrollLeft: Double = js.native - /** - * In XML (and XML-based languages such as XHTML), tagName preserves case. On - * HTML elements in DOM trees flagged as HTML documents, tagName returns the - * element name in the uppercase form. The value of tagName is the same as that of - * nodeName. - * - * MDN - */ + /** In XML (and XML-based languages such as XHTML), tagName preserves case. On HTML elements in DOM trees flagged as + * HTML documents, tagName returns the element name in the uppercase form. The value of tagName is the same as that + * of nodeName. + * + * MDN + */ def tagName: String = js.native - /** - * clientWidth is the inner width of an element in pixels. It includes padding but not - * the vertical scrollbar (if present, if rendered), border or margin. - * - * MDN - */ + /** clientWidth is the inner width of an element in pixels. It includes padding but not the vertical scrollbar (if + * present, if rendered), border or margin. + * + * MDN + */ def clientWidth: Int = js.native - /** - * scrollWidth is a read–only property that returns either the width in pixels of the - * content of an element or the width of the element itself, whichever is greater. If - * the element is wider than its content area (for example, if there are scroll bars for - * scrolling through the content), the scrollWidth is larger than the clientWidth. - * - * MDN - */ + /** scrollWidth is a read–only property that returns either the width in pixels of the content of an element or the + * width of the element itself, whichever is greater. If the element is wider than its content area (for example, if + * there are scroll bars for scrolling through the content), the scrollWidth is larger than the clientWidth. + * + * MDN + */ def scrollWidth: Int = js.native - /** - * Returns the inner height of an element in pixels, including padding but not - * the horizontal scrollbar height, border, or margin. - * - * clientHeight can be calculated as CSS height + CSS padding - height of - * horizontal scrollbar (if present). - * - * MDN - */ + /** Returns the inner height of an element in pixels, including padding but not the horizontal scrollbar height, + * border, or margin. + * + * clientHeight can be calculated as CSS height + CSS padding - height of horizontal scrollbar (if present). + * + * MDN + */ def clientHeight: Int = js.native - /** - * The width of the top border of an element in pixels. It does not include the top margin - * or padding. clientTop is read-only. - * - * MDN - */ + /** The width of the top border of an element in pixels. It does not include the top margin or padding. clientTop is + * read-only. + * + * MDN + */ def clientTop: Int = js.native - /** - * Height of the scroll view of an element; it includes the element padding but not its - * margin. - * - * MDN - */ + /** Height of the scroll view of an element; it includes the element padding but not its margin. + * + * MDN + */ def scrollHeight: Int = js.native - /** - * Gets the markup of the element including its content. When used as a - * setter, replaces the element with nodes parsed from the given string. - * - * Supported by FF>10, any Opera, any Chrome, any IE, any Safari - */ + /** Gets the markup of the element including its content. When used as a setter, replaces the element with nodes + * parsed from the given string. + * + * Supported by FF>10, any Opera, any Chrome, any IE, any Safari + */ var outerHTML: String = js.native - /** - * innerHTML sets or gets the HTML syntax describing the element's descendants. - * - * Note: If a <div>, <span>, or <noembed> node has a child text node that includes - * the characters (&), (<), or (>), innerHTML returns these characters as &, - * < and > respectively. Use Node.textContent to get a correct copy of these - * text nodes' contents. - */ + /** innerHTML sets or gets the HTML syntax describing the element's descendants. + * + * Note: If a <div>, <span>, or <noembed> node has a child text node that includes the characters + * (&), (<), or (>), innerHTML returns these characters as &, < and > respectively. Use Node.textContent + * to get a correct copy of these text nodes' contents. + */ var innerHTML: String = js.native var id: String = js.native - /** - * The copy event is fired when the user initiates a copy action through the - * browser UI (for example, using the CTRL/Cmd+C keyboard shortcut or - * selecting the "Copy" from the menu) and in response to an allowed - * `document.execCommand("copy")` call. - * - * MDN - */ + /** The copy event is fired when the user initiates a copy action through the browser UI (for example, using the + * CTRL/Cmd+C keyboard shortcut or selecting the "Copy" from the menu) and in response to an allowed + * `document.execCommand("copy")` call. + * + * MDN + */ var oncopy: js.Function1[ClipboardEvent, _] = js.native - /** - * The cut event is fired when a selection has been removed from the document - * and added to the clipboard. - * - * MDN - */ + /** The cut event is fired when a selection has been removed from the document and added to the clipboard. + * + * MDN + */ var oncut: js.Function1[ClipboardEvent, _] = js.native - /** - * The paste event is fired when a selection has been pasted from the - * clipboard to the document. - * - * MDN - */ + /** The paste event is fired when a selection has been pasted from the clipboard to the document. + * + * MDN + */ var onpaste: js.Function1[ClipboardEvent, _] = js.native var accessKey: String = js.native - /** - * Supported by FF>3.6, any Opera, any Chrome, any IE, any Safari - */ + /** Supported by FF>3.6, any Opera, any Chrome, any IE, any Safari + */ var classList: DOMTokenList = js.native def scrollIntoView(top: Boolean = js.native): Unit = js.native - /** - * Supported by FF>8, Opera>7, Chrome>1, IE>4, Safari>4 - */ + /** Supported by FF>8, Opera>7, Chrome>1, IE>4, Safari>4 + */ def insertAdjacentHTML(where: String, html: String): Unit = js.native - /** - * The insertAdjacentElement() method of the Element interface inserts a given - * element node at a given position relative to the element it is invoked upon. - * - * MDN - * - * @param position A DOMString representing the position relative to the - * targetElement; must match (case-insensitively) one of the following strings: - * - `"beforebegin"`: Before the targetElement itself. - * - `"afterbegin"`: Just inside the targetElement, before its first child. - * - `"beforeend"`: Just inside the targetElement, after its last child. - * - `"afterend"`: After the targetElement itself. - * - * @return The element that was inserted, or null, if the insertion failed. - */ - def insertAdjacentElement(position: String, - element: Element): Element = js.native - - /** - * The `matches()` method of the `Element` interface returns `true` if the - * element would be selected by the specified selector string; otherwise, it - * returns `false`. - * - * MDN - */ + /** The insertAdjacentElement() method of the Element interface inserts a given element node at a given position + * relative to the element it is invoked upon. + * + * MDN + * + * @param position + * A DOMString representing the position relative to the targetElement; must match (case-insensitively) one of the + * following strings: + * - `"beforebegin"`: Before the targetElement itself. + * - `"afterbegin"`: Just inside the targetElement, before its first child. + * - `"beforeend"`: Just inside the targetElement, after its last child. + * - `"afterend"`: After the targetElement itself. + * + * @return + * The element that was inserted, or null, if the insertion failed. + */ + def insertAdjacentElement(position: String, element: Element): Element = js.native + + /** The `matches()` method of the `Element` interface returns `true` if the element would be selected by the specified + * selector string; otherwise, it returns `false`. + * + * MDN + */ def matches(selector: String): Boolean = js.native - /** - * getAttribute() returns the value of the named attribute on the specified element. - * If the named attribute does not exist, the value returned will either be null or "" - * (the empty string); see Notes for details. - * - * MDN - */ + /** getAttribute() returns the value of the named attribute on the specified element. If the named attribute does not + * exist, the value returned will either be null or "" (the empty string); see Notes for details. + * + * MDN + */ def getAttribute(name: String): String = js.native - /** - * Returns a list of elements with the given tag name. The subtree underneath the - * specified element is searched, excluding the element itself. The returned list is - * live, meaning that it updates itself with the DOM tree automatically. - * Consequently, there is no need to call several times - * element.getElementsByTagName with the same element and arguments. - * - * MDN - */ + /** Returns a list of elements with the given tag name. The subtree underneath the specified element is searched, + * excluding the element itself. The returned list is live, meaning that it updates itself with the DOM tree + * automatically. Consequently, there is no need to call several times element.getElementsByTagName with the same + * element and arguments. + * + * MDN + */ def getElementsByTagName(name: String): HTMLCollection = js.native - /** - * Returns a list of elements with the given tag name belonging to the given namespace. - * - * MDN - */ - def getElementsByTagNameNS(namespaceURI: String, - localName: String): HTMLCollection = js.native - - /** - * Returns an array-like object of all child elements which have all of the - * given class names. When called on the document object, the complete document - * is searched, including the root node. You may also call getElementsByClassName() - * on any element; it will return only elements which are descendants of the - * specified root element with the given class names. - * - * MDN - */ + /** Returns a list of elements with the given tag name belonging to the given namespace. + * + * MDN + */ + def getElementsByTagNameNS(namespaceURI: String, localName: String): HTMLCollection = js.native + + /** Returns an array-like object of all child elements which have all of the given class names. When called on the + * document object, the complete document is searched, including the root node. You may also call + * getElementsByClassName() on any element; it will return only elements which are descendants of the specified root + * element with the given class names. + * + * MDN + */ def getElementsByClassName(classNames: String): HTMLCollection = js.native - /** - * hasAttributeNS returns a boolean value indicating whether the current element - * has the specified attribute. - * - * MDN - */ - def hasAttributeNS(namespaceURI: String, - localName: String): Boolean = js.native - - /** - * Returns a text rectangle object that encloses a group of text rectangles. - * - * MDN - */ + /** hasAttributeNS returns a boolean value indicating whether the current element has the specified attribute. + * + * MDN + */ + def hasAttributeNS(namespaceURI: String, localName: String): Boolean = js.native + + /** Returns a text rectangle object that encloses a group of text rectangles. + * + * MDN + */ def getBoundingClientRect(): DOMRect = js.native - /** - * getAttributeNS returns the string value of the attribute with the specified - * namespace and name. If the named attribute does not exist, the value returned will - * either be null or "" (the empty string); see Notes for details. - * - * MDN - */ - def getAttributeNS(namespaceURI: String, - localName: String): String = js.native - - /** - * Returns the Attr node for the attribute with the given namespace and name. - * - * MDN - */ - def getAttributeNodeNS(namespaceURI: String, - localName: String): Attr = js.native - - /** - * setAttributeNodeNS adds a new namespaced attribute node to an element. - * - * MDN - */ + /** getAttributeNS returns the string value of the attribute with the specified namespace and name. If the named + * attribute does not exist, the value returned will either be null or "" (the empty string); see Notes for details. + * + * MDN + */ + def getAttributeNS(namespaceURI: String, localName: String): String = js.native + + /** Returns the Attr node for the attribute with the given namespace and name. + * + * MDN + */ + def getAttributeNodeNS(namespaceURI: String, localName: String): Attr = js.native + + /** setAttributeNodeNS adds a new namespaced attribute node to an element. + * + * MDN + */ def setAttributeNodeNS(newAttr: Attr): Attr = js.native - /** - * hasAttribute returns a boolean value indicating whether the specified element - * has the specified attribute or not. - * - * MDN - */ + /** hasAttribute returns a boolean value indicating whether the specified element has the specified attribute or not. + * + * MDN + */ def hasAttribute(name: String): Boolean = js.native - /** - * removeAttribute removes an attribute from the specified element. - * - * MDN - */ + /** removeAttribute removes an attribute from the specified element. + * + * MDN + */ def removeAttribute(name: String): Unit = js.native - /** - * setAttributeNS adds a new attribute or changes the value of an attribute with the - * given namespace and name. - * - * MDN - */ - def setAttributeNS(namespaceURI: String, qualifiedName: String, - value: String): Unit = js.native - - /** - * Returns the specified attribute of the specified element, as an Attr node. - * - * MDN - */ + /** setAttributeNS adds a new attribute or changes the value of an attribute with the given namespace and name. + * + * MDN + */ + def setAttributeNS(namespaceURI: String, qualifiedName: String, value: String): Unit = js.native + + /** Returns the specified attribute of the specified element, as an Attr node. + * + * MDN + */ def getAttributeNode(name: String): Attr = js.native - /** - * Returns a collection of rectangles that indicate the bounding rectangles for each - * box in a client. - * - * MDN - */ + /** Returns a collection of rectangles that indicate the bounding rectangles for each box in a client. + * + * MDN + */ def getClientRects(): DOMRectList = js.native - /** - * setAttributeNode() adds a new Attr node to the specified element. - * - * MDN - */ + /** setAttributeNode() adds a new Attr node to the specified element. + * + * MDN + */ def setAttributeNode(newAttr: Attr): Attr = js.native - /** - * removeAttributeNode removes the specified attribute from the current element. - * - * MDN - */ + /** removeAttributeNode removes the specified attribute from the current element. + * + * MDN + */ def removeAttributeNode(oldAttr: Attr): Attr = js.native - /** - * Adds a new attribute or changes the value of an existing attribute on the - * specified element. - * - * MSN - */ + /** Adds a new attribute or changes the value of an existing attribute on the specified element. + * + * MSN + */ def setAttribute(name: String, value: String): Unit = js.native - /** - * removeAttributeNS removes the specified attribute from an element. - * - * MDN - */ - def removeAttributeNS(namespaceURI: String, - localName: String): Unit = js.native - - /** - * The Element.requestFullscreen() method issues an asynchronous request to - * make the element be displayed in full-screen mode. - * - * It's not guaranteed that the element will be put into full screen mode. - * If permission to enter full screen mode is granted, the returned Promise - * will resolve and the element will receive a fullscreenchange event to let - * it know that it's now in full screen mode. If permission is denied, the - * promise is rejected and the element receives a fullscreenerror event - * instead. If the element has been detached from the original document, then - * the document receives these events instead. - * - * Earlier implementations of the Fullscreen API would always send these - * events to the document rather than the element, and you may need to be - * able to handle that situation. Check Browser compatibility in fullscreen - * for specifics on when each browser made this change. - * - * MDN - */ - def requestFullscreen( - options: FullscreenOptions = js.native): js.Promise[Unit] = js.native - - /** - * The Element interface's onfullscreenchange property is an event handler - * for the fullscreenchange event that is fired when the element has - * transitioned into or out of full-screen mode. - * - * MDN - */ + /** removeAttributeNS removes the specified attribute from an element. + * + * MDN + */ + def removeAttributeNS(namespaceURI: String, localName: String): Unit = js.native + + /** The Element.requestFullscreen() method issues an asynchronous request to make the element be displayed in + * full-screen mode. + * + * It's not guaranteed that the element will be put into full screen mode. If permission to enter full screen mode is + * granted, the returned Promise will resolve and the element will receive a fullscreenchange event to let it know + * that it's now in full screen mode. If permission is denied, the promise is rejected and the element receives a + * fullscreenerror event instead. If the element has been detached from the original document, then the document + * receives these events instead. + * + * Earlier implementations of the Fullscreen API would always send these events to the document rather than the + * element, and you may need to be able to handle that situation. Check Browser compatibility in fullscreen for + * specifics on when each browser made this change. + * + * MDN + */ + def requestFullscreen(options: FullscreenOptions = js.native): js.Promise[Unit] = js.native + + /** The Element interface's onfullscreenchange property is an event handler for the fullscreenchange event that is + * fired when the element has transitioned into or out of full-screen mode. + * + * MDN + */ var onfullscreenchange: js.Function1[Event, _] = js.native - /** - * The Element interface's onfullscreenerror property is an event handler - * for the fullscreenerror event which is sent to the element when an error - * occurs while attempting to transition into or out of full-screen mode. - * - * MDN - */ + /** The Element interface's onfullscreenerror property is an event handler for the fullscreenerror event which is sent + * to the element when an error occurs while attempting to transition into or out of full-screen mode. + * + * MDN + */ var onfullscreenerror: js.Function1[Event, _] = js.native } @@ -1048,295 +857,236 @@ trait FullscreenOptions extends js.Object { var navigationUI: js.UndefOr[String] = js.undefined } -/** - * A Node is an interface from which a number of DOM types inherit, and allows these - * various types to be treated (or tested) similarly. - * - * The following interfaces all inherit from Node its methods and properties: - * Document, Element, CharacterData (which Text, Comment, and CDATASection - * inherit), ProcessingInstruction, DocumentFragment, DocumentType, Notation, - * Entity, EntityReference - * - * These interfaces may return null in particular cases where the methods - * and properties are not relevant. They may throw an exception - for example - * when adding children to a node type for which no children can exist. - * - * MDN - */ +/** A Node is an interface from which a number of DOM types inherit, and allows these various types to be treated (or + * tested) similarly. + * + * The following interfaces all inherit from Node its methods and properties: Document, Element, CharacterData (which + * Text, Comment, and CDATASection inherit), ProcessingInstruction, DocumentFragment, DocumentType, Notation, Entity, + * EntityReference + * + * These interfaces may return null in particular cases where the methods and properties are not relevant. They may + * throw an exception - for example when adding children to a node type for which no children can exist. + * + * MDN + */ @js.native @JSGlobal abstract class Node extends EventTarget { - /** - * The read-only Node.nodeType property returns an unsigned short integer - * representing the type of the node. - * - * MDN - */ + /** The read-only Node.nodeType property returns an unsigned short integer representing the type of the node. + * + * MDN + */ def nodeType: Int = js.native - /** - * Returns the node immediately preceding the specified one in its parent's - * childNodes list, null if the specified node is the first in that list. - * - * MDN - */ + /** Returns the node immediately preceding the specified one in its parent's childNodes list, null if the specified + * node is the first in that list. + * + * MDN + */ def previousSibling: Node = js.native - /** - * Returns a DOMString representing the local part of the qualified name of an - * element. In Firefox 3.5 and earlier, the property upper-cases the local name for - * HTML elements (but not XHTML elements). In later versions, this does not happen, - * so the property is in lower case for both HTML and XHTML. Though the specification - * requires localName to be defined on the Node interface, Gecko-based browsers - * implement it on the Element interface. - * - * MDN - */ + /** Returns a DOMString representing the local part of the qualified name of an element. In Firefox 3.5 and earlier, + * the property upper-cases the local name for HTML elements (but not XHTML elements). In later versions, this does + * not happen, so the property is in lower case for both HTML and XHTML. Though the specification requires localName + * to be defined on the Node interface, Gecko-based browsers implement it on the Element interface. + * + * MDN + */ def localName: String = js.native - /** - * The namespace URI of this node, or null if it is no namespace. In Firefox 3.5 and - * earlier, HTML elements are in no namespace. In later versions, HTML elements are - * in the http://www.w3.org/1999/xhtml namespace in both HTML and XML trees. - * Though the specification requires namespaceURI to be defined on the Node - * interface, Gecko-based browsers implement it on the Element interface. - * - * MDN - */ + /** The namespace URI of this node, or null if it is no namespace. In Firefox 3.5 and earlier, HTML elements are in no + * namespace. In later versions, HTML elements are in the http://www.w3.org/1999/xhtml namespace in both HTML and + * XML trees. Though the specification requires namespaceURI to be defined on the Node interface, Gecko-based + * browsers implement it on the Element interface. + * + * MDN + */ def namespaceURI: String = js.native - /** - * Is a DOMString representing the textual content of an element and all its - * descendants. - * - * MDN - */ + /** Is a DOMString representing the textual content of an element and all its descendants. + * + * MDN + */ var textContent: String = js.native - /** - * Returns a Node that is the parent of this node. If there is no such node, like if this - * node is the top of the tree or if doesn't participate in a tree, this property returns - * null. - * - * MDN - */ + /** Returns a Node that is the parent of this node. If there is no such node, like if this node is the top of the tree + * or if doesn't participate in a tree, this property returns null. + * + * MDN + */ def parentNode: Node = js.native - /** - * Returns the node immediately following the specified one in its parent's - * childNodes list, or null if the specified node is the last node in that list. - * - * MDN - */ + /** Returns the node immediately following the specified one in its parent's childNodes list, or null if the specified + * node is the last node in that list. + * + * MDN + */ def nextSibling: Node = js.native - /** - * Is a DOMString representing the value of an object. For most Node type, this returns - * null and any set operation is ignored. For nodes of type TEXT_NODE (Text objects), - * COMMENT_NODE (Comment objects), and PROCESSING_INSTRUCTION_NODE - * (ProcessingInstruction objects), the value corresponds to the text data - * contained in the object. - * - * MDN - */ + /** Is a DOMString representing the value of an object. For most Node type, this returns null and any set operation is + * ignored. For nodes of type TEXT_NODE (Text objects), COMMENT_NODE (Comment objects), and + * PROCESSING_INSTRUCTION_NODE (ProcessingInstruction objects), the value corresponds to the text data contained in + * the object. + * + * MDN + */ var nodeValue: String = js.native - /** - * Returns a Node representing the last direct child node of the node, or null if the - * node has no child. - * - * MDN - */ + /** Returns a Node representing the last direct child node of the node, or null if the node has no child. + * + * MDN + */ def lastChild: Node = js.native - /** - * Returns a live NodeList containing all the children of this node. NodeList being - * live means that if the children of the Node change, the NodeList object is - * automatically updated. - * - * MDN - */ + /** Returns a live NodeList containing all the children of this node. NodeList being live means that if the children + * of the Node change, the NodeList object is automatically updated. + * + * MDN + */ def childNodes: NodeList[Node] = js.native - /** - * Returns a DOMString containing the name of the Node. The structure of the name will - * differ with the name type. E.g. An HTMLElement will contain the name of the - * corresponding tag, like 'audio' for an HTMLAudioElement, a Text node will have the - * '#text' string, or a Document node will have the '#document' string. - * - * MDN - */ + /** Returns a DOMString containing the name of the Node. The structure of the name will differ with the name type. + * E.g. An HTMLElement will contain the name of the corresponding tag, like 'audio' for an HTMLAudioElement, a Text + * node will have the '#text' string, or a Document node will have the '#document' string. + * + * MDN + */ def nodeName: String = js.native - /** - * Returns the Document that this node belongs to. If no document is associated with - * it, returns null. - * - * MDN - */ + /** Returns the Document that this node belongs to. If no document is associated with it, returns null. + * + * MDN + */ def ownerDocument: Document = js.native - /** - * .attributes is a collection of all attribute nodes registered to the specified - * node. It is a NamedNodeMap,not an Array, so it has no Array methods and the Attr - * nodes' indexes may differ among browsers. To be more specific, attribute is a key - * value pair of strings that represents any information regarding that node; it - * cannot hold Object. Attribute can hold additional data/information that is - * required while processing custom JavaScript. There are many predefined - * attributes for different nodes used for binding events, validations, and - * specifying layout informations that are handled by browser (may vary from browser - * to browser).   - * - * MDN - */ + /** .attributes is a collection of all attribute nodes registered to the specified node. It is a NamedNodeMap,not an + * Array, so it has no Array methods and the Attr nodes' indexes may differ among browsers. To be more specific, + * attribute is a key value pair of strings that represents any information regarding that node; it cannot hold + * Object. Attribute can hold additional data/information that is required while processing custom JavaScript. There + * are many predefined attributes for different nodes used for binding events, validations, and specifying layout + * informations that are handled by browser (may vary from browser to browser). + * + * MDN + */ def attributes: NamedNodeMap = js.native - /** - * Returns the node's first child in the tree, or null if the node is childless. If the - * node is a Document, it returns the first node in the list of its direct children. - * - * MDN - */ + /** Returns the node's first child in the tree, or null if the node is childless. If the node is a Document, it + * returns the first node in the list of its direct children. + * + * MDN + */ def firstChild: Node = js.native - /** - * Removes a child node from the current element, which must be a child of the current - * node. - * - * MDN - */ + /** Removes a child node from the current element, which must be a child of the current node. + * + * MDN + */ def removeChild(oldChild: Node): Node = js.native - /** - * Adds a node to the end of the list of children of a specified parent node. If the node - * already exists it is removed from current parent node, then added to new parent - * node. - * - * MDN - */ + /** Adds a node to the end of the list of children of a specified parent node. If the node already exists it is + * removed from current parent node, then added to new parent node. + * + * MDN + */ def appendChild(newChild: Node): Node = js.native - /** - * The Node.isSupported()returns a Boolean flag containing the result of a test - * whether the DOM implementation implements a specific feature and this feature is - * supported by the specific node. - * - * MDN - */ + /** The Node.isSupported()returns a Boolean flag containing the result of a test whether the DOM implementation + * implements a specific feature and this feature is supported by the specific node. + * + * MDN + */ def isSupported(feature: String, version: String): Boolean = js.native - /** - * If #targetElm is first div element in document, "true" will be displayed. - * - * MDN - */ + /** If #targetElm is first div element in document, "true" will be displayed. + * + * MDN + */ def isEqualNode(arg: Node): Boolean = js.native - /** - * Returns the prefix for a given namespaceURI if present, and null if not. When - * multiple prefixes are possible, the result is implementation-dependent. - * - * MDN - */ + /** Returns the prefix for a given namespaceURI if present, and null if not. When multiple prefixes are possible, the + * result is implementation-dependent. + * + * MDN + */ def lookupPrefix(namespaceURI: String): String = js.native - /** - * isDefaultNamespace accepts a namespace URI as an argument and returns true if the - * namespace is the default namespace on the given node or false if not. - * - * MDN - */ + /** isDefaultNamespace accepts a namespace URI as an argument and returns true if the namespace is the default + * namespace on the given node or false if not. + * + * MDN + */ def isDefaultNamespace(namespaceURI: String): Boolean = js.native - /** - * Compares the position of the current node against another node in any other - * document. - * - * MDN - */ + /** Compares the position of the current node against another node in any other document. + * + * MDN + */ def compareDocumentPosition(other: Node): Int = js.native - /** - * Puts the specified node and all of its subtree into a "normalized" form. In a - * normalized subtree, no text nodes in the subtree are empty and there are no adjacent - * text nodes. - * - * MDN - */ + /** Puts the specified node and all of its subtree into a "normalized" form. In a normalized subtree, no text nodes in + * the subtree are empty and there are no adjacent text nodes. + * + * MDN + */ def normalize(): Unit = js.native - /** - * Tests whether two nodes are the same, that is they reference the same object. - * - * MDN - */ + /** Tests whether two nodes are the same, that is they reference the same object. + * + * MDN + */ def isSameNode(other: Node): Boolean = js.native - /** - * Returns a Boolean value indicating whether a node is a descendant of a - * given node, i.e. the node itself, one of its direct children (childNodes), - * one of the children's direct children, and so on. - * - * MDN - */ + /** Returns a Boolean value indicating whether a node is a descendant of a given node, i.e. the node itself, one of + * its direct children (childNodes), one of the children's direct children, and so on. + * + * MDN + */ def contains(otherNode: Node): Boolean = js.native - /** - * hasAttributes returns a boolean value of true or false, indicating if the current - * element has any attributes or not. - * - * MDN - */ + /** hasAttributes returns a boolean value of true or false, indicating if the current element has any attributes or + * not. + * + * MDN + */ def hasAttributes(): Boolean = js.native - /** - * Takes a prefix and returns the namespaceURI associated with it on the given node if - * found (and null if not). Supplying null for the prefix will return the default - * namespace. - * - * MDN - */ + /** Takes a prefix and returns the namespaceURI associated with it on the given node if found (and null if not). + * Supplying null for the prefix will return the default namespace. + * + * MDN + */ def lookupNamespaceURI(prefix: String): String = js.native - /** - * Clone a Node, and optionally, all of its contents. By default, it clones the content - * of the node. - * - * MDN - */ + /** Clone a Node, and optionally, all of its contents. By default, it clones the content of the node. + * + * MDN + */ def cloneNode(deep: Boolean = js.native): Node = js.native - /** - * hasChildNodes returns a Boolean value indicating whether the current Node has - * child nodes or not. - * - * MDN - */ + /** hasChildNodes returns a Boolean value indicating whether the current Node has child nodes or not. + * + * MDN + */ def hasChildNodes(): Boolean = js.native - /** - * Replaces one child Node of the current one with the second one given in parameter. - * - * MDN - */ + /** Replaces one child Node of the current one with the second one given in parameter. + * + * MDN + */ def replaceChild(newChild: Node, oldChild: Node): Node = js.native - /** - * Inserts the first Node given in a parameter immediately before the second, child of - * this element, Node. - * - * MDN - */ + /** Inserts the first Node given in a parameter immediately before the second, child of this element, Node. + * + * MDN + */ def insertBefore(newChild: Node, refChild: Node): Node = js.native - /** - * Represents the "rendered" text content of a node and its descendants. - * As a getter, it approximates the text the user would get if they highlighted the - * contents of the element with the cursor and then copied to the clipboard. - * - * MDN - */ + /** Represents the "rendered" text content of a node and its descendants. As a getter, it approximates the text the + * user would get if they highlighted the contents of the element with the cursor and then copied to the clipboard. + * + * MDN + */ var innerText: String = js.native } @@ -1390,61 +1140,49 @@ trait ModifierKeyEventInit extends js.Object { @js.native trait ModifierKeyEvent extends js.Object { - /** - * The metaKey property indicates if the meta key was pressed (true) or not (false) - * when the event occurred. - * - * MDN - */ + /** The metaKey property indicates if the meta key was pressed (true) or not (false) when the event occurred. + * + * MDN + */ def metaKey: Boolean = js.native - /** - * The altKey property indicates if the alt key was pressed (true) or not (false) when - * the event occurred. - * - * MDN - */ + /** The altKey property indicates if the alt key was pressed (true) or not (false) when the event occurred. + * + * MDN + */ def altKey: Boolean = js.native - /** - * A Boolean value indicating whether or not the control key was down when the touch - * event was fired. Read only. - * - * MDN - */ + /** A Boolean value indicating whether or not the control key was down when the touch event was fired. Read only. + * + * MDN + */ def ctrlKey: Boolean = js.native - /** - * A Boolean value indicating whether or not the shift key was down when the touch event - * was fired. Read only. - * - * MDN - */ + /** A Boolean value indicating whether or not the shift key was down when the touch event was fired. Read only. + * + * MDN + */ def shiftKey: Boolean = js.native } -/** - * The hashchange event is fired when the fragment identifier of the URL has - * changed (the part of the URL that follows the # symbol, including the # - * symbol). - * - * MDN - */ +/** The hashchange event is fired when the fragment identifier of the URL has changed (the part of the URL that follows + * the # symbol, including the # symbol). + * + * MDN + */ @js.native trait HashChangeEvent extends Event { - /** - * The new URL to which the window is navigating. - * - * MDN - */ + /** The new URL to which the window is navigating. + * + * MDN + */ def newURL: String = js.native - /** - * The previous URL from which the window was navigated. - * - * MDN - */ + /** The previous URL from which the window was navigated. + * + * MDN + */ def oldURL: String = js.native } @@ -1460,329 +1198,272 @@ trait MouseEventInit extends UIEventInit with ModifierKeyEventInit { var clientX: js.UndefOr[Double] = js.undefined } -/** - * The DOM MouseEvent interface represents events that occur due to the user - * interacting with a pointing device (such as a mouse). - * - * Common events using this interface include click, dblclick, mouseup, - * mousedown. The list of all events using this interface is provided in - * the Events reference. - * - * MouseEvent derives from UIEvent, which in turn derives from Event. - * - * MDN - */ +/** The DOM MouseEvent interface represents events that occur due to the user interacting with a pointing device (such + * as a mouse). + * + * Common events using this interface include click, dblclick, mouseup, mousedown. The list of all events using this + * interface is provided in the Events reference. + * + * MouseEvent derives from UIEvent, which in turn derives from Event. + * + * MDN + */ @js.native @JSGlobal class MouseEvent(typeArg: String, init: js.UndefOr[MouseEventInit]) extends UIEvent(typeArg, init) with ModifierKeyEvent { - /** - * The screenX property provides the X coordinate of the mouse pointer in global - * (screen) coordinates. - * - * MDN - */ + /** The screenX property provides the X coordinate of the mouse pointer in global (screen) coordinates. + * + * MDN + */ def screenX: Double = js.native - /** - * The pageX property is an integer value in pixels for the X coordinate of the - * mouse pointer, relative to the whole document, when the mouse event fired. - * This property takes into account any horizontal scrolling of the page. - * - * MDN - */ + /** The pageX property is an integer value in pixels for the X coordinate of the mouse pointer, relative to the whole + * document, when the mouse event fired. This property takes into account any horizontal scrolling of the page. + * + * MDN + */ def pageX: Double = js.native - /** - * The pageY property is an integer value in pixels for the Y coordinate of the - * mouse pointer, relative to the whole document, when the mouse event fired. - * This property takes into account any vertical scrolling of the page. - * - * MDN - */ + /** The pageY property is an integer value in pixels for the Y coordinate of the mouse pointer, relative to the whole + * document, when the mouse event fired. This property takes into account any vertical scrolling of the page. + * + * MDN + */ def pageY: Double = js.native - /** - * The clientY property provides the Y coordinate of the mouse pointer in local (DOM - * content) coordinates. - * - * MDN - */ + /** The clientY property provides the Y coordinate of the mouse pointer in local (DOM content) coordinates. + * + * MDN + */ def clientY: Double = js.native - /** - * The screenY property provides the Y coordinate of the mouse pointer in global - * (screen) coordinates. - * - * MDN - */ + /** The screenY property provides the Y coordinate of the mouse pointer in global (screen) coordinates. + * + * MDN + */ def screenY: Double = js.native - /** - * The relatedTarget property is the secondary target for the event, if there is one. - * - * MDN - */ + /** The relatedTarget property is the secondary target for the event, if there is one. + * + * MDN + */ def relatedTarget: EventTarget = js.native - /** - * The button property indicates which button was pressed on the mouse to trigger the - * event. - * - * MDN - */ + /** The button property indicates which button was pressed on the mouse to trigger the event. + * + * MDN + */ def button: Int = js.native - /** - * The buttons property indicates which buttons were pressed on the mouse to trigger - * the event. - * - * MDN - */ + /** The buttons property indicates which buttons were pressed on the mouse to trigger the event. + * + * MDN + */ def buttons: Int = js.native - /** - * The clientX property provides the X coordinate of the mouse pointer in local (DOM - * content) coordinates. - * - * MDN - */ + /** The clientX property provides the X coordinate of the mouse pointer in local (DOM content) coordinates. + * + * MDN + */ def clientX: Double = js.native - /** - * Returns the current state of the specified modifier key. See the - * KeyboardEvent.getModifierState() documentation for details. - * - * MDN - */ + /** Returns the current state of the specified modifier key. See the KeyboardEvent.getModifierState() documentation + * for details. + * + * MDN + */ def getModifierState(keyArg: String): Boolean = js.native } -/** - * Most of today's web content assumes the user's pointing device will be a mouse. - * However, since many devices support other types of pointing input devices, - * such as pen/stylus and touch surfaces, extensions to the existing pointing device event models - * are needed and pointer events address that need. - * - * Pointer events are DOM events that are fired for a pointing device. - * They are designed to create a single DOM event model to handle pointing input devices such as a mouse, - * pen/stylus or touch (such as one or more fingers). - * The pointer is a hardware-agnostic device that can target a specific set of screen coordinates. - * Having a single event model for pointers can simplify creating Web sites and applications - * and provide a good user experience regardless of the user's hardware. - * However, for scenarios when device-specific handling is desired, - * pointer events defines a property to inspect the device type which produced the event. - * - * The events needed to handle generic pointer input are analogous to mouse events - * (mousedown/pointerdown, mousemove/pointermove, etc.). - * Consequently, pointer event types are intentionally similar to mouse event types. - * Additionally, a pointer event contains the usual properties present in mouse events - * (client coordinates, target element, button states, etc.) - * in addition to new properties for other forms of input: pressure, contact geometry, tilt, etc. - * In fact, the PointerEvent interface inherits all of the MouseEvent's properties thus facilitating - * migrating content from mouse events to pointer events. - * - * MDN - */ +/** Most of today's web content assumes the user's pointing device will be a mouse. However, since many devices support + * other types of pointing input devices, such as pen/stylus and touch surfaces, extensions to the existing pointing + * device event models are needed and pointer events address that need. + * + * Pointer events are DOM events that are fired for a pointing device. They are designed to create a single DOM event + * model to handle pointing input devices such as a mouse, pen/stylus or touch (such as one or more fingers). The + * pointer is a hardware-agnostic device that can target a specific set of screen coordinates. Having a single event + * model for pointers can simplify creating Web sites and applications and provide a good user experience regardless of + * the user's hardware. However, for scenarios when device-specific handling is desired, pointer events defines a + * property to inspect the device type which produced the event. + * + * The events needed to handle generic pointer input are analogous to mouse events (mousedown/pointerdown, + * mousemove/pointermove, etc.). Consequently, pointer event types are intentionally similar to mouse event types. + * Additionally, a pointer event contains the usual properties present in mouse events (client coordinates, target + * element, button states, etc.) in addition to new properties for other forms of input: pressure, contact geometry, + * tilt, etc. In fact, the PointerEvent interface inherits all of the MouseEvent's properties thus facilitating + * migrating content from mouse events to pointer events. + * + * MDN + */ @js.native @JSGlobal -class PointerEvent(typeArg: String, - pointerEventInit: js.UndefOr[PointerEventInit] = js.undefined) +class PointerEvent(typeArg: String, pointerEventInit: js.UndefOr[PointerEventInit] = js.undefined) extends MouseEvent(typeArg, pointerEventInit) { def this(typeArg: String) = this(typeArg, js.native) - /** - * An identifier assigned to a pointer event that is unique from the identifiers - * of all active pointer events at the time. Authors cannot assume values convey - * any particular meaning other than an identifier for the pointer that is unique - * from all other active pointers. - * - * MDN - */ + /** An identifier assigned to a pointer event that is unique from the identifiers of all active pointer events at the + * time. Authors cannot assume values convey any particular meaning other than an identifier for the pointer that is + * unique from all other active pointers. + * + * MDN + */ def pointerId: Double = js.native - /** - * The width read-only property of the PointerEvent interface represents the width of the pointer's - * contact geometry along the x-axis, measured in CSS pixels. Depending on the source of the pointer - * device (such as a finger), for a given pointer, each event may produce a different value. - * - * MDN - */ + /** The width read-only property of the PointerEvent interface represents the width of the pointer's contact geometry + * along the x-axis, measured in CSS pixels. Depending on the source of the pointer device (such as a finger), for a + * given pointer, each event may produce a different value. + * + * MDN + */ def width: Double = js.native - /** - * The height read-only property of the PointerEvent interface represents the height of the pointer's - * contact geometry, along the Y axis (in CSS pixels). Depending on the source of the pointer - * device (for example a finger), for a given pointer, each event may produce a different value. - * - * MDN - */ + /** The height read-only property of the PointerEvent interface represents the height of the pointer's contact + * geometry, along the Y axis (in CSS pixels). Depending on the source of the pointer device (for example a finger), + * for a given pointer, each event may produce a different value. + * + * MDN + */ def height: Double = js.native - /** - * The normalized pressure of the pointer input in the range of 0 to 1, - * where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. - * - * For hardware that does not support pressure, including but not limited to mouse, - * the value MUST be 0.5 when the pointer is active and 0 otherwise. - * - * MDN - */ + /** The normalized pressure of the pointer input in the range of 0 to 1, where 0 and 1 represent the minimum and + * maximum pressure the hardware is capable of detecting, respectively. + * + * For hardware that does not support pressure, including but not limited to mouse, the value MUST be 0.5 when the + * pointer is active and 0 otherwise. + * + * MDN + */ def pressure: Double = js.native - /** - * The tangentialPressure read-only property of the PointerEvent interface - * represents the normalized tangential pressure of the pointer input - * (also known as barrel pressure or cylinder stress) - * in the range -1 to 1, where 0 is the neutral position of the control. - * - * Note that some hardware may only support positive values in the range 0 to 1. - * For hardware that does not support tangential pressure, the value will be 0. - * - * MDN - */ + /** The tangentialPressure read-only property of the PointerEvent interface represents the normalized tangential + * pressure of the pointer input (also known as barrel pressure or cylinder stress) in the range -1 to 1, where 0 is + * the neutral position of the control. + * + * Note that some hardware may only support positive values in the range 0 to 1. For hardware that does not support + * tangential pressure, the value will be 0. + * + * MDN + */ def tangentialPressure: Double = js.native - /** - * This property is the angle (in degrees) between the Y-Z plane of the pointer and the screen. - * This property is typically only useful for a pen/stylus pointer type. - * The range of values is -90 to 90 degrees and a positive value means a tilt to the right. - * For devices that do not support this property, the value is 0. - * - * MDN - */ + /** This property is the angle (in degrees) between the Y-Z plane of the pointer and the screen. This property is + * typically only useful for a pen/stylus pointer type. The range of values is -90 to 90 degrees and a positive value + * means a tilt to the right. For devices that do not support this property, the value is 0. + * + * MDN + */ def tiltX: Double = js.native - /** - * This property is the angle (in degrees) between the X-Z plane of the pointer and the screen. - * This property is typically only useful for a pen/stylus pointer type. - * The range of values is -90 to 90 degrees and a positive value is a tilt toward the user. - * For devices that do not support this property, the value is 0. - * - * MDN - */ + /** This property is the angle (in degrees) between the X-Z plane of the pointer and the screen. This property is + * typically only useful for a pen/stylus pointer type. The range of values is -90 to 90 degrees and a positive value + * is a tilt toward the user. For devices that do not support this property, the value is 0. + * + * MDN + */ def tiltY: Double = js.native - /** - * The twist read-only property of the PointerEvent interface represents the clockwise - * rotation of the transducer (e.g. pen stylus) around its major axis in degrees, - * with a value in the range 0 to 359. - * - * For devices that do not report twist, the value MUST be 0. - * - * MDN - */ + /** The twist read-only property of the PointerEvent interface represents the clockwise rotation of the transducer + * (e.g. pen stylus) around its major axis in degrees, with a value in the range 0 to 359. + * + * For devices that do not report twist, the value MUST be 0. + * + * MDN + */ def twist: Double = js.native - /** - * The pointerType read-only property of the PointerEvent interface indicates the device type that caused the pointer event. The supported values are the following strings: - * - * mouse - * The event was generated by a mouse device. - * - * pen - * The event was generated by a pen or stylus device. - * - * touch - * The event was generated by a touch such as a finger. - * If the device type cannot be detected by the browser, the value can be an empty string (""). If the browser supports pointer device types other than those listed above, the value should be vendor prefixed to avoid conflicting names for different types of devices. - * - * MDN - */ + /** The pointerType read-only property of the PointerEvent interface indicates the device type that caused the pointer + * event. The supported values are the following strings: + * + * mouse The event was generated by a mouse device. + * + * pen The event was generated by a pen or stylus device. + * + * touch The event was generated by a touch such as a finger. If the device type cannot be detected by the browser, + * the value can be an empty string (""). If the browser supports pointer device types other than those listed above, + * the value should be vendor prefixed to avoid conflicting names for different types of devices. + * + * MDN + */ def pointerType: String = js.native - /** - * Indicates if the pointer represents the primary pointer of this pointer type. - * - * In some scenarios there may be multiple pointers (for example a device with both a touchscreen and a mouse) - * or a pointer supports multiple contact points (for example a touchscreen that supports multiple finger touches). - * The application can use the isPrimary property to identify a master pointer - * among the set of active pointers for each pointer type. - * If an application only wants to support a primary pointer, - * it can ignore all pointer events that are not primary. - * - * For mouse there is only one pointer, so it will always be the primary pointer. - * For touch input, a pointer is considered primary if the user touched the screen - * when there were no other active touches. - * For pen and stylus input, a pointer is considered primary if the user's pen - * initially contacted the screenwhen there were no other active pens contacting the screen. - * - * MDN - */ + /** Indicates if the pointer represents the primary pointer of this pointer type. + * + * In some scenarios there may be multiple pointers (for example a device with both a touchscreen and a mouse) or a + * pointer supports multiple contact points (for example a touchscreen that supports multiple finger touches). The + * application can use the isPrimary property to identify a master pointer among the set of active pointers for each + * pointer type. If an application only wants to support a primary pointer, it can ignore all pointer events that are + * not primary. + * + * For mouse there is only one pointer, so it will always be the primary pointer. For touch input, a pointer is + * considered primary if the user touched the screen when there were no other active touches. For pen and stylus + * input, a pointer is considered primary if the user's pen initially contacted the screenwhen there were no other + * active pens contacting the screen. + * + * MDN + */ def isPrimary: Boolean = js.native } trait PointerEventInit extends MouseEventInit { - /** - * Sets value of MouseEvent.pointerId. Defaults to 0. - */ + /** Sets value of MouseEvent.pointerId. Defaults to 0. + */ var pointerId: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.width. Defaults to 1. - */ + /** Sets value of MouseEvent.width. Defaults to 1. + */ var width: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.height. Defaults to 0. - */ + /** Sets value of MouseEvent.height. Defaults to 0. + */ var height: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.pressure. Defaults to 0. - */ + /** Sets value of MouseEvent.pressure. Defaults to 0. + */ var pressure: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.tangentialPressure. Defaults to 0. - */ + /** Sets value of MouseEvent.tangentialPressure. Defaults to 0. + */ var tangentialPressure: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.tiltX. Defaults to 0. - */ + /** Sets value of MouseEvent.tiltX. Defaults to 0. + */ var tiltX: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.tiltY. Defaults to 0. - */ + /** Sets value of MouseEvent.tiltY. Defaults to 0. + */ var tiltY: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.twist. Defaults to 0. - */ + /** Sets value of MouseEvent.twist. Defaults to 0. + */ var twist: js.UndefOr[Double] = js.undefined - /** - * Sets value of MouseEvent.pointerType. Defaults to 0. - */ + /** Sets value of MouseEvent.pointerType. Defaults to 0. + */ var pointerType: js.UndefOr[String] = js.undefined - /** - * Sets value of MouseEvent.isPrimary. Defaults to 0. - */ + /** Sets value of MouseEvent.isPrimary. Defaults to 0. + */ var isPrimary: js.UndefOr[Boolean] = js.undefined } -/** - * The TextMetrics interface represents the dimension of a text in the canvas, as - * created by the CanvasRenderingContext2D.measureText() method. - * - * MDN - */ +/** The TextMetrics interface represents the dimension of a text in the canvas, as created by the + * CanvasRenderingContext2D.measureText() method. + * + * MDN + */ @js.native @JSGlobal class TextMetrics extends js.Object { - /** - * Is a double giving the calculated width of a segment of inline text in CSS pixels. It - * takes into account the current font of the context. - * - * MDN - */ + /** Is a double giving the calculated width of a segment of inline text in CSS pixels. It takes into account the + * current font of the context. + * + * MDN + */ var width: Double = js.native } @@ -1791,17 +1472,14 @@ trait DocumentEvent extends js.Object { def createEvent(eventInterface: String): Event = js.native } -/** - * A CDATA Section can be used within XML to include extended portions of - * unescaped text, such that the symbols < and & do not need escaping as they - * normally do within XML when used as text. - * - * As a CDATASection has no properties or methods unique to itself and only - * directly implements the Text interface, one can refer to Text to find - * its properties and methods. - * - * MDN - */ +/** A CDATA Section can be used within XML to include extended portions of unescaped text, such that the symbols < + * and & do not need escaping as they normally do within XML when used as text. + * + * As a CDATASection has no properties or methods unique to itself and only directly implements the Text interface, one + * can refer to Text to find its properties and methods. + * + * MDN + */ @js.native @JSGlobal abstract class CDATASection extends Text @@ -1813,1169 +1491,958 @@ trait StyleMedia extends js.Object { def matchMedium(mediaquery: String): Boolean = js.native } -/** - * Selection is the class of the object returned by window.getSelection() and other - * methods. It represents the text selection in the greater page, possibly spanning - * multiple elements, when the user drags over static text and other parts of the page. - * For information about text selection in an individual text editing element, see - * Input, TextArea and document.activeElement which typically return the parent - * object returned from window.getSelection(). - * - * MDN - */ +/** Selection is the class of the object returned by window.getSelection() and other methods. It represents the text + * selection in the greater page, possibly spanning multiple elements, when the user drags over static text and other + * parts of the page. For information about text selection in an individual text editing element, see Input, TextArea + * and document.activeElement which typically return the parent object returned from window.getSelection(). + * + * MDN + */ @js.native @JSGlobal class Selection extends js.Object { - /** - * Returns a boolean indicating whether the selection's start and end points are at - * the same position. - * - * MDN - */ + /** Returns a boolean indicating whether the selection's start and end points are at the same position. + * + * MDN + */ def isCollapsed: Boolean = js.native - /** - * Returns the node in which the selection begins. - * - * MDN - */ + /** Returns the node in which the selection begins. + * + * MDN + */ def anchorNode: Node = js.native - /** - * Returns the node in which the selection ends. - * - * MDN - */ + /** Returns the node in which the selection ends. + * + * MDN + */ def focusNode: Node = js.native - /** - * Returns a number representing the offset of the selection's anchor within the - * anchorNode. If anchorNode is a text node, this is the number of characters within - * anchorNode preceding the anchor. If anchorNode is an element, this is the number of - * child nodes of the anchorNode preceding the anchor. - * - * MDN - */ + /** Returns a number representing the offset of the selection's anchor within the anchorNode. If anchorNode is a text + * node, this is the number of characters within anchorNode preceding the anchor. If anchorNode is an element, this + * is the number of child nodes of the anchorNode preceding the anchor. + * + * MDN + */ def anchorOffset: Int = js.native - /** - * Returns a number representing the offset of the selection's anchor within the - * focusNode. If focusNode is a text node, this is the number of characters within - * focusNode preceding the focus. If focusNode is an element, this is the number of - * child nodes of the focusNode preceding the focus. - * - * MDN - */ + /** Returns a number representing the offset of the selection's anchor within the focusNode. If focusNode is a text + * node, this is the number of characters within focusNode preceding the focus. If focusNode is an element, this is + * the number of child nodes of the focusNode preceding the focus. + * + * MDN + */ def focusOffset: Int = js.native - /** - * Returns the number of ranges in the selection. - * - * MDN - */ + /** Returns the number of ranges in the selection. + * + * MDN + */ def rangeCount: Int = js.native - /** - * A range object that will be added to the selection. - * - * MDN - */ + /** A range object that will be added to the selection. + * + * MDN + */ def addRange(range: Range): Unit = js.native - /** - * Collapses the selection to the end of the last range in the selection.  If the - * content the selection is in is focused and editable, the caret will blink there. - * - * MDN - */ + /** Collapses the selection to the end of the last range in the selection.  If the content the selection is in is + * focused and editable, the caret will blink there. + * + * MDN + */ def collapseToEnd(): Unit = js.native - /** - * Adds all the children of the specified node to the selection. Previous selection is - * lost. - * - * MDN - */ + /** Adds all the children of the specified node to the selection. Previous selection is lost. + * + * MDN + */ def selectAllChildren(parentNode: Node): Unit = js.native - /** - * Returns a range object representing one of the ranges currently selected. - * - * MDN - */ + /** Returns a range object representing one of the ranges currently selected. + * + * MDN + */ def getRangeAt(index: Int): Range = js.native - /** - * Collapses the current selection to a single point. The document is not modified. If - * the content is focused and editable, the caret will blink there. - * - * MDN - */ + /** Collapses the current selection to a single point. The document is not modified. If the content is focused and + * editable, the caret will blink there. + * + * MDN + */ def collapse(parentNode: Node, offset: Int): Unit = js.native - /** - * Removes all ranges from the selection, leaving the anchorNode and focusNode - * properties equal to null and leaving nothing selected. - * - * MDN - */ + /** Removes all ranges from the selection, leaving the anchorNode and focusNode properties equal to null and leaving + * nothing selected. + * + * MDN + */ def removeAllRanges(): Unit = js.native - /** - * Collapses the selection to the start of the first range in the selection.  If the - * content of the selection is focused and editable, the caret will blink there. - * - * MDN - */ + /** Collapses the selection to the start of the first range in the selection.  If the content of the selection is + * focused and editable, the caret will blink there. + * + * MDN + */ def collapseToStart(): Unit = js.native - /** - * Deletes the actual text being represented by a selection object from the - * document's DOM. - * - * MDN - */ + /** Deletes the actual text being represented by a selection object from the document's DOM. + * + * MDN + */ def deleteFromDocument(): Unit = js.native - /** - * Removes a range from the selection. - * - * MDN - */ + /** Removes a range from the selection. + * + * MDN + */ def removeRange(range: Range): Unit = js.native - /** - * Indicates if the node is part of the selection - * - * MDN - */ - def containsNode(node: Node, - partialContainment: Boolean = false): Boolean = js.native - - /** - * Moves the focus of the selection to a specified point. The anchor of the selection - * does not move. The selection will be from the anchor to the new focus regardless - * of direction. - * - * MDN - */ + /** Indicates if the node is part of the selection + * + * MDN + */ + def containsNode(node: Node, partialContainment: Boolean = false): Boolean = js.native + + /** Moves the focus of the selection to a specified point. The anchor of the selection does not move. The selection + * will be from the anchor to the new focus regardless of direction. + * + * MDN + */ def extend(node: Node, offset: Int = 0): Unit = js.native } -/** - * The NodeIterator interface represents an iterator over the members of a list of the - * nodes in a subtree of the DOM. The nodes will be returned in document order. - * - * A NodeIterator can be created using the Document.createNodeIterator() method. - * - * MDN - */ +/** The NodeIterator interface represents an iterator over the members of a list of the nodes in a subtree of the DOM. + * The nodes will be returned in document order. + * + * A NodeIterator can be created using the Document.createNodeIterator() method. + * + * MDN + */ @js.native @JSGlobal class NodeIterator extends js.Object { - /** - * Returns an unsigned long being a bitmask made of constants describing the types of - * Node that must to be presented. Non-matching nodes are skipped, but their children - * may be included, if relevant. The possible values are: Constant Numerical value - * Description NodeFilter.SHOW_ALL -1 (that is the max value of unsigned long) Shows - * all nodes. NodeFilter.SHOW_ATTRIBUTE 2 Shows attribute Attr nodes. This is - * meaningful only when creating a NodeIterator with an Attr node as its root; in this - * case, it means that the attribute node will appear in the first position of the - * iteration or traversal. Since attributes are never children of other nodes, they - * do not appear when traversing over the document tree. - * NodeFilter.SHOW_CDATA_SECTION 8 Shows CDATASection nodes. - * NodeFilter.SHOW_COMMENT 128 Shows Comment nodes. NodeFilter.SHOW_DOCUMENT - * 256 Shows Document nodes. NodeFilter.SHOW_DOCUMENT_FRAGMENT 1024 Shows - * DocumentFragment nodes. NodeFilter.SHOW_DOCUMENT_TYPE 512 Shows - * DocumentType nodes. NodeFilter.SHOW_ELEMENT 1 Shows Element nodes. - * NodeFilter.SHOW_ENTITY 32 Shows Entity nodes. This is meaningful only when - * creating a NodeIterator with an Entity node as its root; in this case, it means that - * the Entity node will appear in the first position of the traversal. Since entities - * are not part of the document tree, they do not appear when traversing over the - * document tree. NodeFilter.SHOW_ENTITY_REFERENCE 16 Shows - * EntityReference nodes. NodeFilter.SHOW_NOTATION 2048 Shows Notation nodes. - * This is meaningful only when creating a NodeIterator with a Notation node as its - * root; in this case, it means that the Notation node will appear in the first position - * of the traversal. Since entities are not part of the document tree, they do not - * appear when traversing over the document tree. - * NodeFilter.SHOW_PROCESSING_INSTRUCTION 64 Shows - * ProcessingInstruction nodes. NodeFilter.SHOW_TEXT 4 Shows Text nodes. - * - * MDN - */ + /** Returns an unsigned long being a bitmask made of constants describing the types of Node that must to be presented. + * Non-matching nodes are skipped, but their children may be included, if relevant. The possible values are: Constant + * Numerical value Description NodeFilter.SHOW_ALL -1 (that is the max value of unsigned long) Shows all nodes. + * NodeFilter.SHOW_ATTRIBUTE 2 Shows attribute Attr nodes. This is meaningful only when creating a NodeIterator with + * an Attr node as its root; in this case, it means that the attribute node will appear in the first position of the + * iteration or traversal. Since attributes are never children of other nodes, they do not appear when traversing + * over the document tree. NodeFilter.SHOW_CDATA_SECTION 8 Shows CDATASection nodes. NodeFilter.SHOW_COMMENT 128 + * Shows Comment nodes. NodeFilter.SHOW_DOCUMENT 256 Shows Document nodes. NodeFilter.SHOW_DOCUMENT_FRAGMENT 1024 + * Shows DocumentFragment nodes. NodeFilter.SHOW_DOCUMENT_TYPE 512 Shows DocumentType nodes. NodeFilter.SHOW_ELEMENT + * 1 Shows Element nodes. NodeFilter.SHOW_ENTITY 32 Shows Entity nodes. This is meaningful only when creating a + * NodeIterator with an Entity node as its root; in this case, it means that the Entity node will appear in the first + * position of the traversal. Since entities are not part of the document tree, they do not appear when traversing + * over the document tree. NodeFilter.SHOW_ENTITY_REFERENCE 16 Shows EntityReference nodes. NodeFilter.SHOW_NOTATION + * 2048 Shows Notation nodes. This is meaningful only when creating a NodeIterator with a Notation node as its root; + * in this case, it means that the Notation node will appear in the first position of the traversal. Since entities + * are not part of the document tree, they do not appear when traversing over the document tree. + * NodeFilter.SHOW_PROCESSING_INSTRUCTION 64 Shows ProcessingInstruction nodes. NodeFilter.SHOW_TEXT 4 Shows + * Text nodes. + * + * MDN + */ var whatToShow: Int = js.native - /** - * The NodeIterator.filter read-only method returns a NodeFilter object, that is an - * object implement an acceptNode(node) method, used to screen nodes. - * - * MDN - */ + /** The NodeIterator.filter read-only method returns a NodeFilter object, that is an object implement an + * acceptNode(node) method, used to screen nodes. + * + * MDN + */ def filter: NodeFilter = js.native - /** - * The NodeIterator.root read-only property represents the Node that is the root of - * what the NodeIterator traverses. - * - * MDN - */ + /** The NodeIterator.root read-only property represents the Node that is the root of what the NodeIterator traverses. + * + * MDN + */ def root: Node = js.native - /** - * The NodeIterator.nextNode() method returns the next node in the set represented - * by the NodeIterator and advances the position of the iterator within the set.  The - * first call to nextNode() returns the first node in the set. - * - * MDN - */ + /** The NodeIterator.nextNode() method returns the next node in the set represented by the NodeIterator and advances + * the position of the iterator within the set.  The first call to nextNode() returns the first node in the set. + * + * MDN + */ def nextNode(): Node = js.native - /** - * This operation is a no-op. It doesn't do anything. Previously it was telling the - * engine that the NodeIterator was no more used, but this is now useless. - * - * MDN - */ + /** This operation is a no-op. It doesn't do anything. Previously it was telling the engine that the NodeIterator was + * no more used, but this is now useless. + * + * MDN + */ def detach(): Unit = js.native - /** - * The NodeIterator.previousNode() method returns the previous node in the set - * represented by the NodeIterator and moves the position of the iterator backwards - * within the set. - * - * MDN - */ + /** The NodeIterator.previousNode() method returns the previous node in the set represented by the NodeIterator and + * moves the position of the iterator backwards within the set. + * + * MDN + */ def previousNode(): Node = js.native } @js.native trait WindowSessionStorage extends js.Object { - /** - * This is a global object (sessionStorage) that maintains a storage area that's - * available for the duration of the page session. A page session lasts for as - * long as the browser is open and survives over page reloads and restores. - * Opening a page in a new tab or window will cause a new session to be initiated. - * - * MDN - */ + /** This is a global object (sessionStorage) that maintains a storage area that's available for the duration of the + * page session. A page session lasts for as long as the browser is open and survives over page reloads and restores. + * Opening a page in a new tab or window will cause a new session to be initiated. + * + * MDN + */ def sessionStorage: Storage = js.native } -/** - * The window object represents the window itself. The document property of - * a window points to the DOM document loaded in that window. A window for a - * given document can be obtained using the document.defaultView property. - * - * In a tabbed browser, such as Firefox, each tab contains its own window - * object (and if you're writing an extension, the browser window itself - * is a separate window too - see Working with windows in chrome code for - * more information). That is, the window object is not shared between tabs - * in the same window. Some methods, namely window.resizeTo and window.resizeBy - * apply to the whole window and not to the specific tab the window object - * belongs to. Generally, anything that can't reasonably pertain to a tab - * pertains to the window instead. - * - * MDN - */ +/** The window object represents the window itself. The document property of a window points to the DOM document loaded + * in that window. A window for a given document can be obtained using the document.defaultView property. + * + * In a tabbed browser, such as Firefox, each tab contains its own window object (and if you're writing an extension, + * the browser window itself is a separate window too - see Working with windows in chrome code for more information). + * That is, the window object is not shared between tabs in the same window. Some methods, namely window.resizeTo and + * window.resizeBy apply to the whole window and not to the specific tab the window object belongs to. Generally, + * anything that can't reasonably pertain to a tab pertains to the window instead. + * + * MDN + */ @js.native @JSGlobal class Window - extends EventTarget with WindowLocalStorage with WindowSessionStorage - with WindowOrWorkerGlobalScope with WindowConsole { + extends EventTarget with WindowLocalStorage with WindowSessionStorage with WindowOrWorkerGlobalScope + with WindowConsole { var ondragend: js.Function1[DragEvent, _] = js.native - /** - * An event handler property for keydown events on the window. - * - * MDN - */ + /** An event handler property for keydown events on the window. + * + * MDN + */ var onkeydown: js.Function1[KeyboardEvent, _] = js.native var ondragover: js.Function1[DragEvent, _] = js.native - /** - * An event handler property for keyup events on the window. - * - * MDN - */ + /** An event handler property for keyup events on the window. + * + * MDN + */ var onkeyup: js.Function1[KeyboardEvent, _] = js.native - /** - * An event handler property for reset events on the window. - * - * MDN - */ + /** An event handler property for reset events on the window. + * + * MDN + */ var onreset: js.Function1[Event, _] = js.native - /** - * An event handler property for mouseup events on the window. - * - * MDN - */ + /** An event handler property for mouseup events on the window. + * + * MDN + */ var onmouseup: js.Function1[MouseEvent, _] = js.native var ondragstart: js.Function1[DragEvent, _] = js.native var ondrag: js.Function1[DragEvent, _] = js.native - /** - * Returns the horizontal distance of the left border of the user's browser from the - * left side of the screen. - * - * MDN - */ + /** Returns the horizontal distance of the left border of the user's browser from the left side of the screen. + * + * MDN + */ var screenX: Int = js.native - /** - * An event handler property for mouseover events on the window. - * - * MDN - */ + /** An event handler property for mouseover events on the window. + * + * MDN + */ var onmouseover: js.Function1[MouseEvent, _] = js.native var ondragleave: js.Function1[DragEvent, _] = js.native - /** - * The Window.history read-only property returns a reference to the History object, - * which provides an interface for manipulating the browser session history (pages - * visited in the tab or frame that the current page is loaded in). - * - * MDN - */ + /** The Window.history read-only property returns a reference to the History object, which provides an interface for + * manipulating the browser session history (pages visited in the tab or frame that the current page is loaded in). + * + * MDN + */ def history: History = js.native - /** - * Returns the number of pixels that the document has already been scrolled - * horizontally. - * - * MDN - */ + /** Returns the number of pixels that the document has already been scrolled horizontally. + * + * MDN + */ def pageXOffset: Double = js.native - /** - * The name of the window is used primarily for setting targets for hyperlinks and - * forms. Windows do not need to have names. - * - * MDN - */ + /** The name of the window is used primarily for setting targets for hyperlinks and forms. Windows do not need to have + * names. + * + * MDN + */ var name: String = js.native - /** - * The onafterprint property sets and returns the onafterprint event handler code - * for the current window. - * - * MDN - */ + /** The onafterprint property sets and returns the onafterprint event handler code for the current window. + * + * MDN + */ var onafterprint: js.Function1[Event, _] = js.native var onpause: js.Function1[Event, _] = js.native - /** - * The onbeforeprint property sets and returns the onbeforeprint event handler code - * for the current window. - * - * MDN - */ + /** The onbeforeprint property sets and returns the onbeforeprint event handler code for the current window. + * + * MDN + */ var onbeforeprint: js.Function1[Event, _] = js.native - /** - * Returns a reference to the topmost window in the window hierarchy. This property is - * read only. - * - * MDN - */ + /** Returns a reference to the topmost window in the window hierarchy. This property is read only. + * + * MDN + */ def top: Window = js.native - /** - * An event handler property for mousedown events on the window. - * - * MDN - */ + /** An event handler property for mousedown events on the window. + * + * MDN + */ var onmousedown: js.Function1[MouseEvent, _] = js.native var onseeked: js.Function1[Event, _] = js.native - /** - * Returns a reference to the window that opened this current window. - * - * MDN - */ + /** Returns a reference to the window that opened this current window. + * + * MDN + */ var opener: Window = js.native - /** - * Called when the user clicks the mouse button while the cursor is in the window. This - * event is fired for any mouse button pressed; you can look at the event properties to - * find out which button was pressed and where. - * - * MDN - */ + /** Called when the user clicks the mouse button while the cursor is in the window. This event is fired for any mouse + * button pressed; you can look at the event properties to find out which button was pressed and where. + * + * MDN + */ var onclick: js.Function1[MouseEvent, _] = js.native - /** - * Gets the width of the content area of the browser window including, if rendered, the - * vertical scrollbar. - * - * MDN - */ + /** Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar. + * + * MDN + */ def innerWidth: Double = js.native - /** - * Gets the height of the content area of the browser window including, if rendered, - * the horizontal scrollbar. - * - * MDN - */ + /** Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar. + * + * MDN + */ def innerHeight: Double = js.native var onwaiting: js.Function1[Event, _] = js.native var ononline: js.Function1[Event, _] = js.native var ondurationchange: js.Function1[Event, _] = js.native - /** - * Returns the window itself, which is an array-like object, listing the direct - * sub-frames of the current window. - * - * MDN - */ + /** Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window. + * + * MDN + */ def frames: Window = js.native - /** - * The onblur property can be used to set the blur handler on the window, which is - * triggered when the window loses focus. - * - * MDN - */ + /** The onblur property can be used to set the blur handler on the window, which is triggered when the window loses + * focus. + * + * MDN + */ var onblur: js.Function1[FocusEvent, _] = js.native var onemptied: js.Function1[Event, _] = js.native var onseeking: js.Function1[Event, _] = js.native var oncanplay: js.Function1[Event, _] = js.native - /** - * window.outerWidth gets the width of the outside of the browser window. It - * represents the width of the whole browser window including sidebar (if expanded), - * window chrome and window resizing borders/handles. - * - * MDN - */ + /** window.outerWidth gets the width of the outside of the browser window. It represents the width of the whole + * browser window including sidebar (if expanded), window chrome and window resizing borders/handles. + * + * MDN + */ def outerWidth: Int = js.native var onstalled: js.Function1[Event, _] = js.native - /** - * An event handler property for mousemove events on the window. - * - * MDN - */ + /** An event handler property for mousemove events on the window. + * + * MDN + */ var onmousemove: js.Function1[MouseEvent, _] = js.native var onoffline: js.Function1[Event, _] = js.native - /** - * Returns the number of frames (either frame or iframe elements) in the window. - * - * MDN - */ + /** Returns the number of frames (either frame or iframe elements) in the window. + * + * MDN + */ def length: Int = js.native - /** - * Specifies the height of the screen, in pixels, minus permanent or semipermanent - * user interface features displayed by the operating system, such as the Taskbar on - * Windows. - * - * MDN - */ + /** Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed + * by the operating system, such as the Taskbar on Windows. + * + * MDN + */ def screen: Screen = js.native - /** - * An event that fires when a window is about to unload its resources. The document is - * still visible and the event is still cancelable. - * - * MDN - */ + /** An event that fires when a window is about to unload its resources. The document is still visible and the event is + * still cancelable. + * + * MDN + */ var onbeforeunload: js.Function1[BeforeUnloadEvent, _] = js.native var onratechange: js.Function1[Event, _] = js.native var onstorage: js.Function1[StorageEvent, _] = js.native var onloadstart: js.Function1[Event, _] = js.native - /** - * Called for an element when the mouse pointer first moves over the element while - * something is being dragged. This might be used to change the appearance of the - * element to indicate to the user that the object can be dropped on it. - * - * MDN - */ + /** Called for an element when the mouse pointer first moves over the element while something is being dragged. This + * might be used to change the appearance of the element to indicate to the user that the object can be dropped on + * it. + * + * MDN + */ var ondragenter: js.Function1[DragEvent, _] = js.native - /** - * An event handler property for submits on window forms. - * - * MDN - */ + /** An event handler property for submits on window forms. + * + * MDN + */ var onsubmit: js.Function1[Event, _] = js.native - /** - * Returns an object reference to the window object itself. - * - * MDN - */ + /** Returns an object reference to the window object itself. + * + * MDN + */ def self: Window = js.native - /** - * Returns a reference to the document that the window contains. - * - * MDN - */ + /** Returns a reference to the document that the window contains. + * + * MDN + */ def document: HTMLDocument = js.native var onprogress: js.Function1[js.Any, _] = js.native var ondblclick: js.Function1[MouseEvent, _] = js.native - /** - * Returns the number of pixels that the document has already been scrolled - * vertically. - * - * MDN - */ + /** Returns the number of pixels that the document has already been scrolled vertically. + * + * MDN + */ def pageYOffset: Double = js.native - /** - * An event handler property for right-click events on the window. - * - * MDN - */ + /** An event handler property for right-click events on the window. + * + * MDN + */ var oncontextmenu: js.Function1[MouseEvent, _] = js.native - /** - * An event handler property for change events on the window. - * - * MDN - */ + /** An event handler property for change events on the window. + * + * MDN + */ var onchange: js.Function1[Event, _] = js.native var onloadedmetadata: js.Function1[Event, _] = js.native var onplay: js.Function1[Event, _] = js.native - /** - * An event handler property for errors raised on the window. - * - * MDN - */ + /** An event handler property for errors raised on the window. + * + * MDN + */ var onerror: js.Function5[Event, String, Int, Int, Any, _] = js.native var onplaying: js.Function1[Event, _] = js.native - /** - * Returns a reference to the parent of the current window or subframe. - * - * MDN - */ + /** Returns a reference to the parent of the current window or subframe. + * + * MDN + */ def parent: Window = js.native - /** - * The Window.location property returns a Location object with - * information about the current location of the document. - * - * MDN - */ + /** The Window.location property returns a Location object with information about the current location of the + * document. + * + * MDN + */ var location: Location = js.native var oncanplaythrough: js.Function1[Event, _] = js.native - /** - * An event handler property for abort events on the window. - * - * MDN - */ + /** An event handler property for abort events on the window. + * + * MDN + */ var onabort: js.Function1[UIEvent, _] = js.native var onreadystatechange: js.Function1[Event, _] = js.native - /** - * window.outerHeight gets the height in pixels of the whole browser window. It - * represents the height of the whole browser window including sidebar (if - * expanded), window chrome and window resizing borders/handles. - * - * MDN - */ + /** window.outerHeight gets the height in pixels of the whole browser window. It represents the height of the whole + * browser window including sidebar (if expanded), window chrome and window resizing borders/handles. + * + * MDN + */ def outerHeight: Int = js.native - /** - * An event handler property for keypress events on the window. - * - * MDN - */ + /** An event handler property for keypress events on the window. + * + * MDN + */ var onkeypress: js.Function1[KeyboardEvent, _] = js.native - /** - * Returns the element (such as <iframe> or <object>) in which the window is embedded, - * or null if the window is top-level. - * - * MDN - */ + /** Returns the element (such as <iframe> or <object>) in which the window is embedded, or null if the + * window is top-level. + * + * MDN + */ def frameElement: Element = js.native var onloadeddata: js.Function1[Event, _] = js.native var onsuspend: js.Function1[Event, _] = js.native - /** - * The window property of a window object points to the window object itself. - * - * MDN - */ + /** The window property of a window object points to the window object itself. + * + * MDN + */ def window: Window = js.native - /** - * An event handler property for focus events on the window. - * - * MDN - */ + /** An event handler property for focus events on the window. + * + * MDN + */ var onfocus: js.Function1[FocusEvent, _] = js.native var onmessage: js.Function1[MessageEvent, _] = js.native var ontimeupdate: js.Function1[Event, _] = js.native - /** - * An event handler for the resize event on the window. - * - * MDN - */ + /** An event handler for the resize event on the window. + * + * MDN + */ var onresize: js.Function1[UIEvent, _] = js.native - /** - * An event handler property for window selection. - * - * MDN - */ + /** An event handler property for window selection. + * + * MDN + */ var onselect: js.Function1[UIEvent, _] = js.native - /** - * The Window.navigator read-only property returns a reference to the Navigator - * object, which can be queried for information about the application running the - * script. - * - * MDN - */ + /** The Window.navigator read-only property returns a reference to the Navigator object, which can be queried for + * information about the application running the script. + * + * MDN + */ def navigator: Navigator = js.native def styleMedia: StyleMedia = js.native var ondrop: js.Function1[DragEvent, _] = js.native - /** - * An event handler property for mouseout events on the window. - * - * MDN - */ + /** An event handler property for mouseout events on the window. + * + * MDN + */ var onmouseout: js.Function1[MouseEvent, _] = js.native var onended: js.Function1[Event, _] = js.native - /** - * An event handler property for hash change events on the window; called when the part - * of the URL after the hash mark ("#") changes. - * - * MDN - */ + /** An event handler property for hash change events on the window; called when the part of the URL after the hash + * mark ("#") changes. + * + * MDN + */ var onhashchange: js.Function1[HashChangeEvent, _] = js.native - /** - * The unload event is raised when the window is unloading its content and resources. - * The resources removal is processed  after the unload event occurs. - * - * MDN - */ + /** The unload event is raised when the window is unloading its content and resources. The resources removal is + * processed  after the unload event occurs. + * + * MDN + */ var onunload: js.Function1[Event, _] = js.native - /** - * Specifies the function to be called when the window is scrolled. - * - * MDN - */ + /** Specifies the function to be called when the window is scrolled. + * + * MDN + */ var onscroll: js.Function1[UIEvent, _] = js.native - /** - * Returns the vertical distance of the top border of the user's browser from the top - * edge of the screen. - * - * MDN - */ + /** Returns the vertical distance of the top border of the user's browser from the top edge of the screen. + * + * MDN + */ def screenY: Int = js.native var onmousewheel: js.Function1[WheelEvent, _] = js.native var onwheel: js.Function1[WheelEvent, _] = js.native - /** - * An event handler property for window loading. - * - * MDN - */ + /** An event handler property for window loading. + * + * MDN + */ var onload: js.Function1[Event, _] = js.native var onvolumechange: js.Function1[Event, _] = js.native var oninput: js.Function1[Event, _] = js.native - /** - * The Web Performance API allows web pages access to certain functions for measuring - * the performance of web pages and web applications, including the Navigation - * Timing API and high-resolution time data. - * - * MDN - */ + /** The Web Performance API allows web pages access to certain functions for measuring the performance of web pages + * and web applications, including the Navigation Timing API and high-resolution time data. + * + * MDN + */ def performance: Performance = js.native def alert(message: String): Unit = js.native - /** - * The Window.alert() method displays an alert dialog with the optional specified - * content and an OK button. - * - * MDN - */ + /** The Window.alert() method displays an alert dialog with the optional specified content and an OK button. + * + * MDN + */ def alert(): Unit = js.native - /** - * Scrolls the window to a particular place in the document. - * - * MDN - */ + /** Scrolls the window to a particular place in the document. + * + * MDN + */ def scroll(x: Int, y: Int): Unit = js.native - /** - * Makes a request to bring the window to the front. It may fail due to user settings and - * the window isn't guaranteed to be frontmost before this method returns. - * - * MDN - */ + /** Makes a request to bring the window to the front. It may fail due to user settings and the window isn't guaranteed + * to be frontmost before this method returns. + * + * MDN + */ def focus(): Unit = js.native - /** - * Scrolls to a particular set of coordinates in the document. - * - * MDN - */ + /** Scrolls to a particular set of coordinates in the document. + * + * MDN + */ def scrollTo(x: Int, y: Int): Unit = js.native - /** - * Opens the Print Dialog to print the current document. - * - * MDN - */ + /** Opens the Print Dialog to print the current document. + * + * MDN + */ def print(): Unit = js.native def prompt(message: String, default: String = js.native): String = js.native - /** - * The Window.prompt() displays a dialog with an optional message prompting the user - * to input some text. - * - * MDN - */ + /** The Window.prompt() displays a dialog with an optional message prompting the user to input some text. + * + * MDN + */ def prompt(): String = js.native - /** - * Loads a resource in a new browsing context or an existing one. - * - * MDN - */ - def open(url: String = js.native, target: String = js.native, - features: String = js.native, + /** Loads a resource in a new browsing context or an existing one. + * + * MDN + */ + def open(url: String = js.native, target: String = js.native, features: String = js.native, replace: Boolean = js.native): Window = js.native - /** - * Scrolls the document in the window by the given amount. - * - * MDN - */ + /** Scrolls the document in the window by the given amount. + * + * MDN + */ def scrollBy(x: Int, y: Int): Unit = js.native - /** - * The Window.confirm() method displays a modal dialog with an optional message and - * two buttons, OK and Cancel. - * - * MDN - */ + /** The Window.confirm() method displays a modal dialog with an optional message and two buttons, OK and Cancel. + * + * MDN + */ def confirm(message: String = js.native): Boolean = js.native - /** - * Closes the current window, or a referenced window. - * - * MDN - */ + /** Closes the current window, or a referenced window. + * + * MDN + */ def close(): Unit = js.native def closed: Boolean = js.native - /** - * The window.postMessage method safely enables cross-origin communication. - * Normally, scripts on different pages are allowed to access each other if and only if - * the pages that executed them are at locations with the same protocol (usually both - * http), port number (80 being the default for http), and host (modulo - * document.domain being set by both pages to the same value). window.postMessage - * provides a controlled mechanism to circumvent this restriction in a way which is - * secure when properly used. - * - * MDN - */ - def postMessage(message: js.Any, targetOrigin: String, - transfer: js.Any = js.native): Unit = js.native - - /** - * The Window.showModalDialog() creates and displays a modal dialog box containing - * a specified HTML document. - * - * @param url The URI of the document to display in the dialog box - * @param argument An optional variant the contains values that should be passed to the - * dialog box; these are made available in the `window` object's - * `dialogArguments` property. - * @param options An optional String that specifies window ornamentation - */ + /** The window.postMessage method safely enables cross-origin communication. Normally, scripts on different pages are + * allowed to access each other if and only if the pages that executed them are at locations with the same protocol + * (usually both http), port number (80 being the default for http), and host (modulo document.domain being set by + * both pages to the same value). window.postMessage provides a controlled mechanism to circumvent this restriction + * in a way which is secure when properly used. + * + * MDN + */ + def postMessage(message: js.Any, targetOrigin: String, transfer: js.Any = js.native): Unit = js.native + + /** The Window.showModalDialog() creates and displays a modal dialog box containing a specified HTML document. + * + * @param url + * The URI of the document to display in the dialog box + * @param argument + * An optional variant the contains values that should be passed to the dialog box; these are made available in the + * `window` object's `dialogArguments` property. + * @param options + * An optional String that specifies window ornamentation + */ def showModalDialog(url: String = js.native, argument: js.Any = js.native, options: js.Any = js.native): js.Dynamic = js.native - /** - * The window.blur() method is the programmatic equivalent of the user shifting - * focus away from the current window. - * - * MDN - */ + /** The window.blur() method is the programmatic equivalent of the user shifting focus away from the current window. + * + * MDN + */ def blur(): Unit = js.native - /** - * Returns a selection object representing the range of text selected by the user. - * - * MDN - */ + /** Returns a selection object representing the range of text selected by the user. + * + * MDN + */ def getSelection(): Selection = js.native - def getComputedStyle(elt: Element, - pseudoElt: String = js.native): CSSStyleDeclaration = js.native + def getComputedStyle(elt: Element, pseudoElt: String = js.native): CSSStyleDeclaration = js.native - /** - * An OfflineResourceList object providing access to the offline resources for the - * window. - * - * MDN - */ + /** An OfflineResourceList object providing access to the offline resources for the window. + * + * MDN + */ def applicationCache: ApplicationCache = js.native - /** - * An event handler property for popstate events, which are fired when navigating to a - * session history entry representing a state object. - * - * MDN - */ + /** An event handler property for popstate events, which are fired when navigating to a session history entry + * representing a state object. + * + * MDN + */ var onpopstate: js.Function1[PopStateEvent, _] = js.native - /** - * An event handler property for pagehide events, which are fired when the browser hides - * the current page in the process of presenting a different page from the session's history. - * - * For example, when the user clicks the browser's Back button, the current page receives a - * pagehide event before the previous page is shown. - * - * MDN - */ + /** An event handler property for pagehide events, which are fired when the browser hides the current page in the + * process of presenting a different page from the session's history. + * + * For example, when the user clicks the browser's Back button, the current page receives a pagehide event before the + * previous page is shown. + * + * MDN + */ var onpagehide: js.Function1[PageTransitionEvent, _] = js.native - /** - * An event handler property for pageshow events, which are fired when the browser makes the - * window's document visible due to navigation tasks. This includes the process of initially - * loading the page, navigating to the page from another page within the same window or tab, - * or returning to the page using the browser's forward or back buttons. - * - * When this event is sent during the page load process, it's sent after the load event. - * - * MDN - */ + /** An event handler property for pageshow events, which are fired when the browser makes the window's document + * visible due to navigation tasks. This includes the process of initially loading the page, navigating to the page + * from another page within the same window or tab, or returning to the page using the browser's forward or back + * buttons. + * + * When this event is sent during the page load process, it's sent after the load event. + * + * MDN + */ var onpageshow: js.Function1[PageTransitionEvent, _] = js.native - /** - * Returns a new MediaQueryList object representing the parsed results of the - * specified media query string. - * - * MDN - */ + /** Returns a new MediaQueryList object representing the parsed results of the specified media query string. + * + * MDN + */ def matchMedia(mediaQuery: String): MediaQueryList = js.native - /** - * Cancels an animation frame request previously scheduled through a call to - * window.requestAnimationFrame(). - * - * MDN - */ + /** Cancels an animation frame request previously scheduled through a call to window.requestAnimationFrame(). + * + * MDN + */ def cancelAnimationFrame(handle: Int): Unit = js.native - /** - * The window.requestAnimationFrame() method tells the browser that you wish to - * perform an animation and requests that the browser call a specified function to - * update an animation before the next repaint. The method takes as an argument a - * callback to be invoked before the repaint. - * - * MDN - */ + /** The window.requestAnimationFrame() method tells the browser that you wish to perform an animation and requests + * that the browser call a specified function to update an animation before the next repaint. The method takes as an + * argument a callback to be invoked before the repaint. + * + * MDN + */ def requestAnimationFrame(callback: js.Function1[Double, _]): Int = js.native - /** - * The Window.devicePixelRatio read-only property returns the ratio of the - * (vertical) size of one physical pixel on the current display device to the - * size of one device independent pixel (dips). - * - * MDN - */ + /** The Window.devicePixelRatio read-only property returns the ratio of the (vertical) size of one physical pixel on + * the current display device to the size of one device independent pixel (dips). + * + * MDN + */ def devicePixelRatio: Double = js.native - /** - * fired when a pointing device is moved into an element's hit test boundaries. - * - * MDN - */ + /** fired when a pointing device is moved into an element's hit test boundaries. + * + * MDN + */ var onpointerover: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointing device is moved into the hit test boundaries of an element - * or one of its descendants, including as a result of a pointerdown event - * from a device that does not support hover (see pointerdown). - * - * MDN - */ + /** fired when a pointing device is moved into the hit test boundaries of an element or one of its descendants, + * including as a result of a pointerdown event from a device that does not support hover (see pointerdown). + * + * MDN + */ var onpointerenter: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer becomes active. - * - * MDN - */ + /** fired when a pointer becomes active. + * + * MDN + */ var onpointerdown: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer changes coordinates. - * - * MDN - */ + /** fired when a pointer changes coordinates. + * + * MDN + */ var onpointermove: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointer is no longer active. - * - * MDN - */ + /** fired when a pointer is no longer active. + * + * MDN + */ var onpointerup: js.Function1[PointerEvent, _] = js.native - /** - * a browser fires this event if it concludes the pointer will no longer be able - * to generate events (for example the related device is deactived). - * - * MDN - */ + /** a browser fires this event if it concludes the pointer will no longer be able to generate events (for example the + * related device is deactived). + * + * MDN + */ var onpointercancel: js.Function1[PointerEvent, _] = js.native - /** - * fired for several reasons including: pointing device is moved out of - * the hit test boundaries of an element; - * firing the pointerup event for a device that does not support hover (see pointerup); - * after firing the pointercancel event (see pointercancel); - * when a pen stylus leaves the hover range detectable by the digitizer. - * - * MDN - */ + /** fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing + * the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event + * (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. + * + * MDN + */ var onpointerout: js.Function1[PointerEvent, _] = js.native - /** - * fired when a pointing device is moved out of the hit test boundaries of an element. - * For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. - * - * MDN - */ + /** fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is + * fired when the stylus leaves the hover range detectable by the digitizer. + * + * MDN + */ var onpointerleave: js.Function1[PointerEvent, _] = js.native - /** - * fired when an element receives pointer capture. - * - * MDN - */ + /** fired when an element receives pointer capture. + * + * MDN + */ var gotpointercapture: js.Function1[PointerEvent, _] = js.native - /** - * Fired after pointer capture is released for a pointer. - * - * MDN - */ + /** Fired after pointer capture is released for a pointer. + * + * MDN + */ var lostpointercapture: js.Function1[PointerEvent, _] = js.native - /** - * Moves the window to the specified coordinates. - * - * MDN - */ + /** Moves the window to the specified coordinates. + * + * MDN + */ def moveTo(x: Int, y: Int): Unit = js.native - /** - * Moves the current window by a specified amount. - * - * MDN - */ + /** Moves the current window by a specified amount. + * + * MDN + */ def moveBy(deltaX: Int, deltaY: Int): Unit = js.native - /** - * Dynamically resizes window. - * - * MDN - */ + /** Dynamically resizes window. + * + * MDN + */ def resizeTo(width: Int, height: Int): Unit = js.native - /** - * Resizes the current window by a certain amount. - * - * MDN - */ + /** Resizes the current window by a certain amount. + * + * MDN + */ def resizeBy(deltaX: Int, deltaY: Int): Unit = js.native - /** - * The read-only scrollX property of the Window interface returns the number - * of pixels that the document is currently scrolled horizontally. This value - * is subpixel precise in modern browsers, meaning that it isn't necessarily - * a whole number. You can get the number of pixels the document is scrolled - * vertically from the scrollY property. - * - * MDN - */ + /** The read-only scrollX property of the Window interface returns the number of pixels that the document is currently + * scrolled horizontally. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a + * whole number. You can get the number of pixels the document is scrolled vertically from the scrollY property. + * + * MDN + */ def scrollX: Double = js.native - /** - * The read-only scrollY property of the Window interface returns the number - * of pixels that the document is currently scrolled vertically. This value - * is subpixel precise in modern browsers, meaning that it isn't necessarily - * a whole number. You can get the number of pixels the document is scrolled - * horizontally from the scrollX property. - */ + /** The read-only scrollY property of the Window interface returns the number of pixels that the document is currently + * scrolled vertically. This value is subpixel precise in modern browsers, meaning that it isn't necessarily a whole + * number. You can get the number of pixels the document is scrolled horizontally from the scrollX property. + */ def scrollY: Double = js.native } -/** - * An options object that specifies characteristics about the event listener. - * - * MDN - */ +/** An options object that specifies characteristics about the event listener. + * + * MDN + */ trait EventListenerOptions extends js.Object { - /** - * A Boolean indicating that events of this type - * will be dispatched to the registered listener - * before being dispatched to any EventTarget - * beneath it in the DOM tree. - * - * MDN - */ + /** A Boolean indicating that events of this type will be dispatched to the registered listener before being + * dispatched to any EventTarget beneath it in the DOM tree. + * + * MDN + */ var capture: js.UndefOr[Boolean] = js.undefined - /** - * A Boolean indicating that the listener - * should be invoked at most once after being added. - * If true, the listener would be automatically removed when invoked. - */ + /** A Boolean indicating that the listener should be invoked at most once after being added. If true, the listener + * would be automatically removed when invoked. + */ var once: js.UndefOr[Boolean] = js.undefined - /** - * A Boolean which, if true, indicates - * that the function specified by listener - * will never call preventDefault(). - * If a passive listener does call preventDefault(), - * the user agent will do nothing other - * than generate a console warning. - * See Improving scrolling performance with passive listeners to learn more. - * - * MDN - */ + /** A Boolean which, if true, indicates that the function specified by listener will never call preventDefault(). If a + * passive listener does call preventDefault(), the user agent will do nothing other than generate a console warning. + * See Improving scrolling performance with passive listeners to learn more. + * + * MDN + */ var passive: js.UndefOr[Boolean] = js.undefined } -/** - * EventTarget is a DOM interface implemented by objects - * that can receive DOM events and have listeners for them. - * - * Element, document, and window are the most common event targets, but other - * objects can be event targets too, for example XMLHttpRequest, AudioNode, - * AudioContext and others. - * - * Many event targets (including elements, documents, and windows) also support - * setting event handlers via on... properties and attributes. - * - * MDN - */ +/** EventTarget is a DOM interface implemented by objects that can receive DOM events and have listeners for them. + * + * Element, document, and window are the most common event targets, but other objects can be event targets too, for + * example XMLHttpRequest, AudioNode, AudioContext and others. + * + * Many event targets (including elements, documents, and windows) also support setting event handlers via on... + * properties and attributes. + * + * MDN + */ @js.native @JSGlobal class EventTarget extends js.Object { - /** - * Removes the event listener previously registered with - * EventTarget.addEventListener. - * - * MDN - */ - def removeEventListener[T <: Event](`type`: String, - listener: js.Function1[T, _], + /** Removes the event listener previously registered with EventTarget.addEventListener. + * + * MDN + */ + def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean = js.native): Unit = js.native - /** - * The EventTarget.addEventListener() method registers the specified listener on - * the EventTarget it's called on. The event target may be an Element in a document, the - * Document itself, a Window, or any other object that supports events (such as - * XMLHttpRequest). - * - * MDN - */ - def addEventListener[T <: Event](`type`: String, - listener: js.Function1[T, _], + /** The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The + * event target may be an Element in a document, the Document itself, a Window, or any other object that supports + * events (such as XMLHttpRequest). + * + * MDN + */ + def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean = js.native): Unit = js.native - /** - * Removes the event listener previously registered with - * EventTarget.addEventListener. - * - * This implementation accepts a settings object of type EventListenerOptions. - * - * MDN - */ - def removeEventListener[T <: Event](`type`: String, - listener: js.Function1[T, _], + /** Removes the event listener previously registered with EventTarget.addEventListener. + * + * This implementation accepts a settings object of type EventListenerOptions. + * + * MDN + */ + def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit = js.native - /** - * The EventTarget.addEventListener() method - * registers the specified listener - * on the EventTarget it's called on. - * The event target may be an Element in a document, - * the Document itself, a Window, or any other object that supports events - * (such as XMLHttpRequest). - * - * This implementation accepts a settings object of type EventListenerOptions. - * - * MDN - */ - def addEventListener[T <: Event](`type`: String, - listener: js.Function1[T, _], + /** The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The + * event target may be an Element in a document, the Document itself, a Window, or any other object that supports + * events (such as XMLHttpRequest). + * + * This implementation accepts a settings object of type EventListenerOptions. + * + * MDN + */ + def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit = js.native - /** - * Dispatches an Event at the specified EventTarget, invoking the affected - * EventListeners in the appropriate order. The normal event processing rules - * (including the capturing and optional bubbling phase) apply to events dispatched - * manually with dispatchEvent(). - * - * MDN - */ + /** Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. + * The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched + * manually with dispatchEvent(). + * + * MDN + */ def dispatchEvent(evt: Event): Boolean = js.native } -/** - * The CanvasGradient interface represents an opaque object describing a gradient - * and returned by CanvasRenderingContext2D.createLinearGradient or - * CanvasRenderingContext2D.createRadialGradient methods. - * - * MDN - */ +/** The CanvasGradient interface represents an opaque object describing a gradient and returned by + * CanvasRenderingContext2D.createLinearGradient or CanvasRenderingContext2D.createRadialGradient methods. + * + * MDN + */ @js.native @JSGlobal class CanvasGradient extends js.Object { - /** - * Add a new stop, defined by an offset and a color, to the gradient. If the offset is not - * between 0 and 1 an INDEX_SIZE_ERR is raised, if the color can't be parsed as a CSS - * <color>, a SYNTAX_ERR is raised. - * - * MDN - */ + /** Add a new stop, defined by an offset and a color, to the gradient. If the offset is not between 0 and 1 an + * INDEX_SIZE_ERR is raised, if the color can't be parsed as a CSS <color>, a SYNTAX_ERR is raised. + * + * MDN + */ def addColorStop(offset: Double, color: String): Unit = js.native } @@ -2985,213 +2452,174 @@ trait TouchEventInit extends UIEventInit with ModifierKeyEventInit { var touches: js.UndefOr[TouchList] = js.undefined } -/** - * A TouchEvent represents an event sent when the state of contacts with a - * touch-sensitive surface changes. This surface can be a touch screen or trackpad, - * for example. The event can describe one or more points of contact with the screen and - * includes support for detecting movement, addition and removal of contact points, - * and so forth. - * - * Touches are represented by the Touch object; each touch is described by - * a position, size and shape, amount of pressure, and target element. Lists - * of touches are represented by TouchList objects. - * - * MDN - */ +/** A TouchEvent represents an event sent when the state of contacts with a touch-sensitive surface changes. This + * surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with + * the screen and includes support for detecting movement, addition and removal of contact points, and so forth. + * + * Touches are represented by the Touch object; each touch is described by a position, size and shape, amount of + * pressure, and target element. Lists of touches are represented by TouchList objects. + * + * MDN + */ @js.native @JSGlobal class TouchEvent(typeArg: String, init: js.UndefOr[TouchEventInit]) extends UIEvent(typeArg, init) with ModifierKeyEvent { - /** - * A TouchList of all the Touch objects representing individual points of contact - * whose states changed between the previous touch event and this one. Read only. - * - * MDN - */ + /** A TouchList of all the Touch objects representing individual points of contact whose states changed between the + * previous touch event and this one. Read only. + * + * MDN + */ def changedTouches: TouchList = js.native - /** - * A TouchList listing all the Touch objects for touch points that are still in contact - * with the touch surface and whose touchstart event occurred inside the same target - * element as the current target element. - * - * MDN - */ + /** A TouchList listing all the Touch objects for touch points that are still in contact with the touch surface and + * whose touchstart event occurred inside the same target element as the current target element. + * + * MDN + */ def targetTouches: TouchList = js.native - /** - * A TouchList listing all the Touch objects for touch points that are still in contact - * with the touch surface, regardless of whether or not they've changed or what their - * target was at touchstart time. - * - * MDN - */ + /** A TouchList listing all the Touch objects for touch points that are still in contact with the touch surface, + * regardless of whether or not they've changed or what their target was at touchstart time. + * + * MDN + */ def touches: TouchList = js.native - /** - * The target of the touches associated with this event. This target corresponds to - * the target of all the touches in the targetTouches attribute, but note that other - * touches in this event may have a different target. To be careful, you should use the - * target associated with individual touches. - * - * MDN - */ + /** The target of the touches associated with this event. This target corresponds to the target of all the touches in + * the targetTouches attribute, but note that other touches in this event may have a different target. To be careful, + * you should use the target associated with individual touches. + * + * MDN + */ override def target: EventTarget = js.native } -/** - * A TouchList represents a list of all of the points of contact with a touch surface; - * for example, if the user has three fingers on the screen (or trackpad), the - * corresponding TouchList would have one Touch object for each finger, for a total of - * three entries. - * - * MDN - */ +/** A TouchList represents a list of all of the points of contact with a touch surface; for example, if the user has + * three fingers on the screen (or trackpad), the corresponding TouchList would have one Touch object for each finger, + * for a total of three entries. + * + * MDN + */ @js.native trait TouchList extends DOMList[Touch] { def item(index: Int): Touch = js.native } -/** - * A Touch object represents a single point of contact between the user and a touch-sensitive - * interface device (which may be, for example, a touchscreen or a trackpad). - * - * Note: Many of these values are hardware-dependent; for example, if the device doesn't have a - * way to detect the amount of pressure placed on the surface, the force value will always be 1.0. - * This may also be the case for radiusX and radiusY; if the hardware reports only a single point, - * these values will be 1. - * - * MDN - */ +/** A Touch object represents a single point of contact between the user and a touch-sensitive interface device (which + * may be, for example, a touchscreen or a trackpad). + * + * Note: Many of these values are hardware-dependent; for example, if the device doesn't have a way to detect the + * amount of pressure placed on the surface, the force value will always be 1.0. This may also be the case for radiusX + * and radiusY; if the hardware reports only a single point, these values will be 1. + * + * MDN + */ @js.native @JSGlobal class Touch extends js.Object { - /** - * A unique identifier for this Touch object. A given touch (say, by a finger) will have the same - * identifier for the duration of its movement around the surface. This lets you ensure that you're - * tracking the same touch all the time. Read only. - * - * MDN - */ + /** A unique identifier for this Touch object. A given touch (say, by a finger) will have the same identifier for the + * duration of its movement around the surface. This lets you ensure that you're tracking the same touch all the + * time. Read only. + * + * MDN + */ def identifier: Double = js.native - /** - * The X coordinate of the touch point relative to the left edge of the screen. - * Read only. - * - * MDN - */ + /** The X coordinate of the touch point relative to the left edge of the screen. Read only. + * + * MDN + */ def screenX: Double = js.native - /** - * The Y coordinate of the touch point relative to the top edge of the screen. - * Read only. - * - * MDN - */ + /** The Y coordinate of the touch point relative to the top edge of the screen. Read only. + * + * MDN + */ def screenY: Double = js.native - /** - * The X coordinate of the touch point relative to the left edge of the browser viewport, - * not including any scroll offset. Read only. - * - * MDN - */ + /** The X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll + * offset. Read only. + * + * MDN + */ def clientX: Double = js.native - /** - * The Y coordinate of the touch point relative to the top edge of the browser viewport, - * not including any scroll offset. Read only. - * - * MDN - */ + /** The Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll + * offset. Read only. + * + * MDN + */ def clientY: Double = js.native - /** - * The X coordinate of the touch point relative to the left edge of the document. Unlike clientX, - * this value includes the horizontal scroll offset, if any. - * - * MDN - * Read only. - */ + /** The X coordinate of the touch point relative to the left edge of the document. Unlike clientX, this value includes + * the horizontal scroll offset, if any. + * + * MDN Read only. + */ def pageX: Double = js.native - /** - * The Y coordinate of the touch point relative to the top of the document. Unlike clientY, this value - * includes the vertical scroll offset, if any. - * Read only. - * - * MDN - */ + /** The Y coordinate of the touch point relative to the top of the document. Unlike clientY, this value includes the + * vertical scroll offset, if any. Read only. + * + * MDN + */ def pageY: Double = js.native - /** - * The X radius of the ellipse that most closely circumscribes the area of contact with the screen. - * The value is in pixels of the same scale as screenX. - * Read only. - * - * MDN - */ + /** The X radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in + * pixels of the same scale as screenX. Read only. + * + * MDN + */ def radiusX: Double = js.native - /** - * The Y radius of the ellipse that most closely circumscribes the area of contact with the screen. - * The value is in pixels of the same scale as screenY. - * Read only. - * - * MDN - */ + /** The Y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in + * pixels of the same scale as screenY. Read only. + * + * MDN + */ def radiusY: Double = js.native - /** - * The angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, - * clockwise, to most accurately cover the area of contact between the user and the surface. - * Read only. - * - * MDN - */ + /** The angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most + * accurately cover the area of contact between the user and the surface. Read only. + * + * MDN + */ def rotationAngle: Double = js.native - /** - * The amount of pressure being applied to the surface by the user, as a float - * between 0.0 (no pressure) and 1.0 (maximum pressure). - * Read only. - * - * MDN - */ + /** The amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 + * (maximum pressure). Read only. + * + * MDN + */ def force: Double = js.native - /** - * The Element on which the touch point started when it was first placed on the surface, - * even if the touch point has since moved outside the interactive area of that element or - * even been removed from the document. Note that if the target is removed from the document, - * events will still be targeted at it, and hence won't necessarily bubble up to the window - * or document anymore. If there's any risk of an element being removed while it is being - * touched, best practice is to attach the touch listeners directly to the target. - * Read only. - * - * MDN - */ + /** The Element on which the touch point started when it was first placed on the surface, even if the touch point has + * since moved outside the interactive area of that element or even been removed from the document. Note that if the + * target is removed from the document, events will still be targeted at it, and hence won't necessarily bubble up to + * the window or document anymore. If there's any risk of an element being removed while it is being touched, best + * practice is to attach the touch listeners directly to the target. Read only. + * + * MDN + */ def target: EventTarget = js.native } -/** - * KeyboardEvent objects describe a user interaction with the keyboard. Each event - * describes a key; the event type (keydown, keypress, or keyup) identifies what - * kind of activity was performed. - * - * Note: The KeyboardEvent indicates just what's happening on a key. When you need - * to handle text input, use HTML5 input event instead. For example, if user inputs - * text from hand-writing system like tablet PC, key events may not be fired. - * - * MDN - * - * Warning: keypress event is to be deprecated in favor of beforeinput event eventually - * - * W3C - */ +/** KeyboardEvent objects describe a user interaction with the keyboard. Each event describes a key; the event type + * (keydown, keypress, or keyup) identifies what kind of activity was performed. + * + * Note: The KeyboardEvent indicates just what's happening on a key. When you need to handle text input, use HTML5 + * input event instead. For example, if user inputs text from hand-writing system like tablet PC, key events may not be + * fired. + * + * MDN + * + * Warning: keypress event is to be deprecated in favor of beforeinput event eventually + * + * W3C + */ @js.native @JSGlobal class KeyboardEvent(typeArg: String, init: js.UndefOr[KeyboardEventInit]) @@ -3199,84 +2627,67 @@ class KeyboardEvent(typeArg: String, init: js.UndefOr[KeyboardEventInit]) def this(typeArg: String) = this(typeArg, js.native) - /** - * Returns the Unicode value of a character key pressed during a keypress event. - * - * Note: Required especially in Gecko based browsers - */ + /** Returns the Unicode value of a character key pressed during a keypress event. + * + * Note: Required especially in Gecko based browsers + */ def charCode: Int = js.native - /** - * A system and implementation dependent numerical code identifying the - * unmodified value of the pressed key. This is usually the decimal ASCII - * (RFC 20) or Windows 1252 code corresponding to the key; see Virtual key - * codes for a list of Gecko's keyCode values. If the key can't be identified, - * this value is 0. Read only. - */ + /** A system and implementation dependent numerical code identifying the unmodified value of the pressed key. This is + * usually the decimal ASCII (RFC 20) or Windows 1252 code corresponding to the key; see Virtual key codes for a list + * of Gecko's keyCode values. If the key can't be identified, this value is 0. Read only. + */ def keyCode: Int = js.native - /** - * The location of the key on the keyboard or other input device. - * See the constants in the [[KeyboardEvent]] object. - * - * MDN - */ + /** The location of the key on the keyboard or other input device. See the constants in the [[KeyboardEvent]] object. + * + * MDN + */ def location: Int = js.native - /** - * The key value of the key represented by the event. If the value has a printed - * representation, this attribute's value is the same as the char attribute. - * Otherwise, it's one of the key value strings specified in Key values. If the - * key can't be identified, this is the string "Unidentified". See key names for - * the detail. - * - * MDN - */ + /** The key value of the key represented by the event. If the value has a printed representation, this attribute's + * value is the same as the char attribute. Otherwise, it's one of the key value strings specified in Key values. If + * the key can't be identified, this is the string "Unidentified". See key names for the detail. + * + * MDN + */ def key: String = js.native - /** - * true if the key is being held down such that it is automatically repeating - * - * MDN - */ + /** true if the key is being held down such that it is automatically repeating + * + * MDN + */ def repeat: Boolean = js.native - /** - * Returns the current state of the specified modifier key. - */ + /** Returns the current state of the specified modifier key. + */ def getModifierState(keyArg: String): Boolean = js.native } trait KeyboardEventInit extends UIEventInit with ModifierKeyEventInit { - /** - * Sets value of KeyboardEvent.charCode. Defaults to 0. - */ + /** Sets value of KeyboardEvent.charCode. Defaults to 0. + */ var charCode: js.UndefOr[Int] = js.undefined - /** - * Sets value of KeyboardEvent.keyCode. Defaults to 0. - */ + /** Sets value of KeyboardEvent.keyCode. Defaults to 0. + */ var keyCode: js.UndefOr[Int] = js.undefined - /** - * Sets value of KeyboardEvent.location. Defaults to 0. - */ + /** Sets value of KeyboardEvent.location. Defaults to 0. + */ var location: js.UndefOr[Int] = js.undefined - /** - * Sets value of KeyboardEvent.locale. Defaults to empty string. - */ + /** Sets value of KeyboardEvent.locale. Defaults to empty string. + */ var locale: js.UndefOr[String] = js.undefined - /** - * Sets value of KeyboardEvent.key. Defaults to empty string. - */ + /** Sets value of KeyboardEvent.key. Defaults to empty string. + */ var key: js.UndefOr[String] = js.undefined - /** - * Sets value of KeyboardEvent.repeat. Defaults to false. - */ + /** Sets value of KeyboardEvent.repeat. Defaults to false. + */ var repeat: js.UndefOr[Boolean] = js.undefined } @@ -3284,398 +2695,313 @@ trait KeyboardEventInit extends UIEventInit with ModifierKeyEventInit { @JSGlobal object KeyboardEvent extends js.Object { - /** - * The key has only one version, or can't be distinguished between the left - * and right versions of the key, and was not pressed on the numeric keypad - * or a key that is considered to be part of the keypad. - * - * MDN - */ + /** The key has only one version, or can't be distinguished between the left and right versions of the key, and was + * not pressed on the numeric keypad or a key that is considered to be part of the keypad. + * + * MDN + */ def DOM_KEY_LOCATION_STANDARD: Int = js.native - /** - * The key was the left-hand version of the key; for example, the left-hand - * Control key was pressed on a standard 101 key US keyboard. This value is - * only used for keys that have more that one possible location on the - * keyboard. - * - * MDN - */ + /** The key was the left-hand version of the key; for example, the left-hand Control key was pressed on a standard 101 + * key US keyboard. This value is only used for keys that have more that one possible location on the keyboard. + * + * MDN + */ def DOM_KEY_LOCATION_LEFT: Int = js.native - /** - * The key was the right-hand version of the key; for example, the right-hand - * Control key is pressed on a standard 101 key US keyboard. This value is - * only used for keys that have more that one possible location on the - * keyboard. - * - * MDN - */ + /** The key was the right-hand version of the key; for example, the right-hand Control key is pressed on a standard + * 101 key US keyboard. This value is only used for keys that have more that one possible location on the keyboard. + * + * MDN + */ def DOM_KEY_LOCATION_RIGHT: Int = js.native - /** - * The key was on the numeric keypad, or has a virtual key code that - * corresponds to the numeric keypad. - * - * @note When NumLock is locked, Gecko always returns - * [[DOM_KEY_LOCATION_NUMPAD]] for the keys on the numeric pad. - * Otherwise, when NumLock is unlocked and the keyboard actually has - * a numeric keypad, Gecko always returns [[DOM_KEY_LOCATION_NUMPAD]] - * too. On the other hand, if the keyboard doesn't have a keypad, such - * as on a notebook computer, some keys become Numpad only when NumLock - * is locked. When such keys fires key events, the location attribute - * value depends on the key. That is, it must not be - * [[DOM_KEY_LOCATION_NUMPAD]]. - * @note NumLock key's key events indicate [[DOM_KEY_LOCATION_STANDARD]] both - * on Gecko and Internet Explorer. - * - * MDN - */ + /** The key was on the numeric keypad, or has a virtual key code that corresponds to the numeric keypad. + * + * @note + * When NumLock is locked, Gecko always returns [[DOM_KEY_LOCATION_NUMPAD]] for the keys on the numeric pad. + * Otherwise, when NumLock is unlocked and the keyboard actually has a numeric keypad, Gecko always returns + * [[DOM_KEY_LOCATION_NUMPAD]] too. On the other hand, if the keyboard doesn't have a keypad, such as on a notebook + * computer, some keys become Numpad only when NumLock is locked. When such keys fires key events, the location + * attribute value depends on the key. That is, it must not be [[DOM_KEY_LOCATION_NUMPAD]]. + * @note + * NumLock key's key events indicate [[DOM_KEY_LOCATION_STANDARD]] both on Gecko and Internet Explorer. + * + * MDN + */ def DOM_KEY_LOCATION_NUMPAD: Int = js.native } -/** - * Each web page loaded in the browser has its own document object. The Document - * interface serves as an entry point to the web page's content (the DOM tree, - * including elements such as <body> and <table>) and provides functionality global - * to the document (such as obtaining the page's URL and creating new elements in the - * document). - * - * MDN - */ +/** Each web page loaded in the browser has its own document object. The Document interface serves as an entry point to + * the web page's content (the DOM tree, including elements such as <body> and <table>) and provides + * functionality global to the document (such as obtaining the page's URL and creating new elements in the document). + * + * MDN + */ @js.native @JSGlobal -abstract class Document - extends Node with NodeSelector with DocumentEvent with ParentNode - with PageVisibility { - - /** - * Returns a DOMImplementation object associated with the current document. - * - * MDN - */ +abstract class Document extends Node with NodeSelector with DocumentEvent with ParentNode with PageVisibility { + + /** Returns a DOMImplementation object associated with the current document. + * + * MDN + */ def implementation: DOMImplementation = js.native - /** - * Returns the character encoding of the current document. - * - * MDN - */ + /** Returns the character encoding of the current document. + * + * MDN + */ def characterSet: String = js.native - /** - * Returns the Document Type Declaration (DTD) associated with current document. - * The returned object implements the DocumentType interface. Use - * DOMImplementation.createDocumentType() to create a DocumentType. - * - * MDN - */ + /** Returns the Document Type Declaration (DTD) associated with current document. The returned object implements the + * DocumentType interface. Use DOMImplementation.createDocumentType() to create a DocumentType. + * + * MDN + */ def doctype: DocumentType = js.native - /** - * Returns the Element that is the root element of the document (for example, the - * <html> element for HTML documents). - * - * MDN - */ + /** Returns the Element that is the root element of the document (for example, the <html> element for HTML + * documents). + * + * MDN + */ def documentElement: Element = js.native def documentURI: String = js.native - /** - * Returns a list of StyleSheet objects for stylesheets explicitly linked into or - * embedded in a document. - * - * MDN - */ + /** Returns a list of StyleSheet objects for stylesheets explicitly linked into or embedded in a document. + * + * MDN + */ def styleSheets: StyleSheetList = js.native - /** - * Returns a string containing the date and time on which the current document was last - * modified. - * - * MDN - */ + /** Returns a string containing the date and time on which the current document was last modified. + * + * MDN + */ def lastModified: String = js.native - /** - * Returns an object reference to the identified element. - * - * MDN - */ + /** Returns an object reference to the identified element. + * + * MDN + */ def getElementById(elementId: String): Element = js.native - /** - * Returns a list of elements with a given name in the (X)HTML document. - * - * MDN - */ + /** Returns a list of elements with a given name in the (X)HTML document. + * + * MDN + */ def getElementsByName(elementName: String): NodeList[Node] = js.native - /** - * Returns a HTMLCollection of elements with the given tag name. The complete - * document is searched, including the root node. The returned HTMLCollection is - * live, meaning that it updates itself automatically to stay in sync with the DOM tree - * without having to call document.getElementsByTagName again. - * - * MDN - */ + /** Returns a HTMLCollection of elements with the given tag name. The complete document is searched, including the + * root node. The returned HTMLCollection is live, meaning that it updates itself automatically to stay in sync with + * the DOM tree without having to call document.getElementsByTagName again. + * + * MDN + */ def getElementsByTagName(name: String): HTMLCollection = js.native - /** - * Returns a list of elements with the given tag name belonging to the given namespace. - * The complete document is searched, including the root node. - * - * MDN - */ - def getElementsByTagNameNS(namespaceURI: String, - localName: String): HTMLCollection = js.native - - /** - * Returns a set of elements which have all the given class names. When called on the - * document object, the complete document is searched, including the root node. You - * may also call getElementsByClassName on any element; it will return only elements - * which are descendants of the specified root element with the given class names. - * - * MDN - */ + /** Returns a list of elements with the given tag name belonging to the given namespace. The complete document is + * searched, including the root node. + * + * MDN + */ + def getElementsByTagNameNS(namespaceURI: String, localName: String): HTMLCollection = js.native + + /** Returns a set of elements which have all the given class names. When called on the document object, the complete + * document is searched, including the root node. You may also call getElementsByClassName on any element; it will + * return only elements which are descendants of the specified root element with the given class names. + * + * MDN + */ def getElementsByClassName(classNames: String): HTMLCollection = js.native - /** - * Returns the element from the document whose elementFromPoint method is being - * called which is the topmost element which lies under the given point.  To get an - * element, specify the point via coordinates, in CSS pixels, relative to the - * upper-left-most point in the window or frame containing the document. - * - * MDN - */ + /** Returns the element from the document whose elementFromPoint method is being called which is the topmost element + * which lies under the given point.  To get an element, specify the point via coordinates, in CSS pixels, relative + * to the upper-left-most point in the window or frame containing the document. + * + * MDN + */ def elementFromPoint(x: Double, y: Double): Element = js.native - /** - * Adopts a node from an external document. The node and its subtree is removed from the - * document it's in (if any), and its ownerDocument is changed to the current - * document. The node can then be inserted into the current document. - * - * MDN - */ + /** Adopts a node from an external document. The node and its subtree is removed from the document it's in (if any), + * and its ownerDocument is changed to the current document. The node can then be inserted into the current document. + * + * MDN + */ def adoptNode(source: Node): Node = js.native - /** - * Returns an XPathResult based on an XPath expression and other given - * parameters. - * - * MDN - * - * @param xpathExpression is a string representing the XPath to be - * evaluated. - * @param contextNode specifies the context node for the query (see the - * http://www.w3.org/TR/xpath XPath specification). It's common to pass - * document as the context node. - * @param namespaceResolver an `XPathNSResolver` - * @param resultType is an integer that corresponds to the type of result - * XPathResult to return. Use named constant properties, such as - * XPathResult.ANY_TYPE, of the XPathResult constructor, which - * correspond to integers from 0 to 9. - * @param result is an existing XPathResult to use for the results. null is - * the most common and will create a new XPathResult - */ - def evaluate(xpathExpression: String, contextNode: Node, - namespaceResolver: XPathNSResolver, resultType: Int, - result: XPathResult): XPathResult = js.native - - /** - * Returns an XPathResult based on an XPath expression and other given - * parameters. - * - * MDN - * - * @param xpathExpression is a string representing the XPath to be - * evaluated. - * @param contextNode specifies the context node for the query (see the - * [http://www.w3.org/TR/xpath XPath specification). It's common to pass - * document as the context node. - * @param namespaceResolver is a function that will be passed any namespace - * prefixes and should return a string representing the namespace URI - * associated with that prefix. It will be used to resolve prefixes - * within the XPath itself, so that they can be matched with the - * document. null is common for HTML documents or when no namespace - * prefixes are used. - * @param resultType is an integer that corresponds to the type of result - * XPathResult to return. Use named constant properties, such as - * XPathResult.ANY_TYPE, of the XPathResult constructor, which - * correspond to integers from 0 to 9. - * @param result is an existing XPathResult to use for the results. null is - * the most common and will create a new XPathResult - */ - def evaluate(xpathExpression: String, contextNode: Node, - namespaceResolver: js.Function1[String, String], resultType: Int, + /** Returns an XPathResult based on an XPath expression and other given parameters. + * + * MDN + * + * @param xpathExpression + * is a string representing the XPath to be evaluated. + * @param contextNode + * specifies the context node for the query (see the http://www.w3.org/TR/xpath XPath specification). It's common + * to pass document as the context node. + * @param namespaceResolver + * an `XPathNSResolver` + * @param resultType + * is an integer that corresponds to the type of result XPathResult to return. Use named constant properties, such + * as XPathResult.ANY_TYPE, of the XPathResult constructor, which correspond to integers from 0 to 9. + * @param result + * is an existing XPathResult to use for the results. null is the most common and will create a new XPathResult + */ + def evaluate(xpathExpression: String, contextNode: Node, namespaceResolver: XPathNSResolver, resultType: Int, result: XPathResult): XPathResult = js.native - /** - * Creates an XPathNSResolver which resolves namespaces with respect to the - * definitions in scope for a specified node. - * - * MDN. - */ + /** Returns an XPathResult based on an XPath expression and other given parameters. + * + * MDN + * + * @param xpathExpression + * is a string representing the XPath to be evaluated. + * @param contextNode + * specifies the context node for the query (see the [http://www.w3.org/TR/xpath XPath specification). It's common + * to pass document as the context node. + * @param namespaceResolver + * is a function that will be passed any namespace prefixes and should return a string representing the namespace + * URI associated with that prefix. It will be used to resolve prefixes within the XPath itself, so that they can + * be matched with the document. null is common for HTML documents or when no namespace prefixes are used. + * @param resultType + * is an integer that corresponds to the type of result XPathResult to return. Use named constant properties, such + * as XPathResult.ANY_TYPE, of the XPathResult constructor, which correspond to integers from 0 to 9. + * @param result + * is an existing XPathResult to use for the results. null is the most common and will create a new XPathResult + */ + def evaluate(xpathExpression: String, contextNode: Node, namespaceResolver: js.Function1[String, String], + resultType: Int, result: XPathResult): XPathResult = js.native + + /** Creates an XPathNSResolver which resolves namespaces with respect to the definitions in scope for a specified + * node. + * + * MDN. + */ def createNSResolver(node: Node): XPathNSResolver = js.native - /** - * Creates a copy of a node from an external document that can be inserted into the - * current document. - * - * MDN - */ + /** Creates a copy of a node from an external document that can be inserted into the current document. + * + * MDN + */ def importNode(importedNode: Node, deep: Boolean): Node = js.native - /** - * In an HTML document creates the specified HTML element or HTMLUnknownElement if - * the element is not known. In a XUL document creates the specified XUL element. In - * other documents creates an element with a null namespaceURI. - * - * MDN - */ + /** In an HTML document creates the specified HTML element or HTMLUnknownElement if the element is not known. In a XUL + * document creates the specified XUL element. In other documents creates an element with a null namespaceURI. + * + * MDN + */ def createElement(tagName: String): Element = js.native - /** - * Creates an element with the specified namespace URI and qualified name. - * - * MDN - */ - def createElementNS(namespaceURI: String, - qualifiedName: String): Element = js.native - - /** - * createAttribute creates a new attribute node, and returns it. - * - * MDN - */ + /** Creates an element with the specified namespace URI and qualified name. + * + * MDN + */ + def createElementNS(namespaceURI: String, qualifiedName: String): Element = js.native + + /** createAttribute creates a new attribute node, and returns it. + * + * MDN + */ def createAttribute(name: String): Attr = js.native - /** - * Creates a new attribute node in a given namespace and returns it. - * - * MDN - */ - def createAttributeNS(namespaceURI: String, - qualifiedName: String): Attr = js.native - - /** - * createProcessingInstruction() creates a new processing instruction node, and - * returns it. - * - * MDN - */ - def createProcessingInstruction(target: String, - data: String): ProcessingInstruction = js.native - - /** - * createCDATASection() creates a new CDATA section node, and returns it. - * - * MDN - */ + /** Creates a new attribute node in a given namespace and returns it. + * + * MDN + */ + def createAttributeNS(namespaceURI: String, qualifiedName: String): Attr = js.native + + /** createProcessingInstruction() creates a new processing instruction node, and returns it. + * + * MDN + */ + def createProcessingInstruction(target: String, data: String): ProcessingInstruction = js.native + + /** createCDATASection() creates a new CDATA section node, and returns it. + * + * MDN + */ def createCDATASection(data: String): CDATASection = js.native - /** - * Once a Range is created, you need to set its boundary points before you can make use of - * most of its methods. - * - * MDN - */ + /** Once a Range is created, you need to set its boundary points before you can make use of most of its methods. + * + * MDN + */ def createRange(): Range = js.native - /** - * createComment() creates a new comment node, and returns it. - * - * MDN - */ + /** createComment() creates a new comment node, and returns it. + * + * MDN + */ def createComment(data: String): Comment = js.native - /** - * Creates a new empty DocumentFragment. - * - * MDN - */ + /** Creates a new empty DocumentFragment. + * + * MDN + */ def createDocumentFragment(): DocumentFragment = js.native - def createStyleSheet(href: String = js.native, - index: Int = js.native): CSSStyleSheet = js.native + def createStyleSheet(href: String = js.native, index: Int = js.native): CSSStyleSheet = js.native def createTextNode(data: String): Text = js.native - /** - * Supported in FF 3.5+, Chrome 1+, Opera 9+, Safari 3+, IE9+ - * - * MDN - */ + /** Supported in FF 3.5+, Chrome 1+, Opera 9+, Safari 3+, IE9+ + * + * MDN + */ def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator = js.native - /** - * The Document.createTreeWalker() creator method returns a newly created - * TreeWalker object. - * - * MDN - */ + /** The Document.createTreeWalker() creator method returns a newly created TreeWalker object. + * + * MDN + */ def createTreeWalker(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): TreeWalker = js.native - /** - * The Document method exitFullscreen() requests that the element on this - * document which is currently being presented in full-screen mode be - * taken out of full-screen mode, restoring the previous state of the - * screen. This usually reverses the effects of a previous call to - * Element.requestFullscreen(). - * - * The exception is if another element was already in full-screen mode - * when the current element was placed into full-screen mode using - * requestFullscreen(). In that case, the previous full-screen element is - * restored to full-screen status instead. In essence, a stack of - * full-screen elements is maintained. - * - * MDN - */ + /** The Document method exitFullscreen() requests that the element on this document which is currently being presented + * in full-screen mode be taken out of full-screen mode, restoring the previous state of the screen. This usually + * reverses the effects of a previous call to Element.requestFullscreen(). + * + * The exception is if another element was already in full-screen mode when the current element was placed into + * full-screen mode using requestFullscreen(). In that case, the previous full-screen element is restored to + * full-screen status instead. In essence, a stack of full-screen elements is maintained. + * + * MDN + */ def exitFullscreen(): js.Promise[Unit] = js.native - /** - * The DocumentOrShadowRoot.fullscreenElement read-only property returns the - * Element that is currently being presented in full-screen mode in this - * document, or null if full-screen mode is not currently in use. - * - * Although this property is read-only, it will not throw if it is modified - * (even in strict mode); the setter is a no-operation and it will be ignored. - * - * MDN - */ + /** The DocumentOrShadowRoot.fullscreenElement read-only property returns the Element that is currently being + * presented in full-screen mode in this document, or null if full-screen mode is not currently in use. + * + * Although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a + * no-operation and it will be ignored. + * + * MDN + */ def fullscreenElement: Element = js.native - /** - * The read-only fullscreenEnabled property on the Document interface - * indicates whether or not full-screen mode is available. Full-screen mode - * is available only for a page that has no windowed plug-ins in any of its - * documents, and if all