// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // // API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). // Attributions and copyright licensing by Mozilla Contributors is licensed // under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. // Generated from Web IDL definitions. // ignore_for_file: unintended_html_in_doc_comment @JS() library; import 'dart:js_interop'; import 'battery_status.dart'; import 'clipboard_apis.dart'; import 'credential_management.dart'; import 'css_font_loading.dart'; import 'css_typed_om.dart'; import 'cssom.dart'; import 'cssom_view.dart'; import 'dom.dart'; import 'encrypted_media.dart'; import 'entries_api.dart'; import 'fetch.dart'; import 'fileapi.dart'; import 'gamepad.dart'; import 'geolocation.dart'; import 'geometry.dart'; import 'hr_time.dart'; import 'indexeddb.dart'; import 'media_capabilities.dart'; import 'media_playback_quality.dart'; import 'media_source.dart'; import 'mediacapture_streams.dart'; import 'mediasession.dart'; import 'netinfo.dart'; import 'permissions.dart'; import 'picture_in_picture.dart'; import 'remote_playback.dart'; import 'requestidlecallback.dart'; import 'scheduling_apis.dart'; import 'screen_wake_lock.dart'; import 'selection_api.dart'; import 'service_workers.dart'; import 'speech_api.dart'; import 'storage.dart'; import 'trusted_types.dart'; import 'uievents.dart'; import 'vibration.dart'; import 'video_rvfc.dart'; import 'web_locks.dart'; import 'web_share.dart'; import 'webcryptoapi.dart'; import 'webidl.dart'; import 'webmidi.dart'; import 'xhr.dart'; typedef HTMLOrSVGScriptElement = JSObject; typedef MediaProvider = JSObject; typedef RenderingContext = JSObject; typedef HTMLOrSVGImageElement = JSObject; typedef CanvasImageSource = JSObject; typedef OffscreenRenderingContext = JSObject; typedef EventHandler = EventHandlerNonNull?; typedef OnErrorEventHandler = OnErrorEventHandlerNonNull?; typedef OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull?; typedef TimerHandler = JSAny; typedef ImageBitmapSource = JSObject; typedef MessageEventSource = JSObject; typedef BlobCallback = JSFunction; typedef CustomElementConstructor = JSFunction; typedef FunctionStringCallback = JSFunction; typedef EventHandlerNonNull = JSFunction; typedef OnErrorEventHandlerNonNull = JSFunction; typedef OnBeforeUnloadEventHandlerNonNull = JSFunction; typedef FrameRequestCallback = JSFunction; typedef DocumentReadyState = String; typedef DocumentVisibilityState = String; typedef CanPlayTypeResult = String; typedef TextTrackMode = String; typedef TextTrackKind = String; typedef SelectionMode = String; typedef PredefinedColorSpace = String; typedef CanvasFillRule = String; typedef ImageSmoothingQuality = String; typedef CanvasLineCap = String; typedef CanvasLineJoin = String; typedef CanvasTextAlign = String; typedef CanvasTextBaseline = String; typedef CanvasDirection = String; typedef CanvasFontKerning = String; typedef CanvasFontStretch = String; typedef CanvasFontVariantCaps = String; typedef CanvasTextRendering = String; typedef OffscreenRenderingContextId = String; typedef ScrollRestoration = String; typedef DOMParserSupportedType = String; typedef ImageOrientation = String; typedef PremultiplyAlpha = String; typedef ColorSpaceConversion = String; typedef ResizeQuality = String; typedef WorkerType = String; /// The **`HTMLAllCollection`** interface represents a collection of _all_ of /// the document's elements, accessible by index (like an array) and by the /// element's /// [`id`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). /// It is returned by the [document.all] property. /// /// `HTMLAllCollection` has a very similar shape to [HTMLCollection], but there /// are many subtle behavior differences — for example, `HTMLAllCollection` can /// be called as a function, and its `item()` method can be called with a string /// representing an element's `id` or `name` attribute. /// /// --- /// /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAllCollection). extension type HTMLAllCollection._(JSObject _) implements JSObject { external Element operator [](int index); /// The **`namedItem()`** method of the [HTMLAllCollection] interface returns /// the first [Element] in the collection whose `id` or `name` attribute /// matches the specified name, or `null` if no element matches. external JSObject? namedItem(String name); /// The **`item()`** method of the [HTMLAllCollection] interface returns the /// element located at the specified offset into the collection, or the /// element with the specified value for its `id` or `name` attribute. external JSObject? item([String nameOrIndex]); /// The **`HTMLAllCollection.length`** property returns the number of items in /// this [HTMLAllCollection]. external int get length; } /// The **`HTMLFormControlsCollection`** interface represents a _collection_ of /// HTML _form control elements_, returned by the [HTMLFormElement] interface's /// [HTMLFormElement.elements] property. /// /// This interface replaces one method from [HTMLCollection], on which it is /// based. /// /// --- /// /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormControlsCollection). extension type HTMLFormControlsCollection._(JSObject _) implements HTMLCollection, JSObject { /// The **`HTMLFormControlsCollection.namedItem()`** method returns /// the [RadioNodeList] or the [Element] in the collection whose /// `name` or `id` match the specified name, or `null` if /// no node matches. /// /// Note that this version of `namedItem()` hides the one inherited from /// [HTMLCollection]. Like that one, in JavaScript, using the array bracket /// syntax with a `String`, like `collection["value"]` is /// equivalent to `collection.namedItem("value")`. external JSObject? namedItem(String name); } /// The **`RadioNodeList`** interface represents a collection of elements in a /// `form` returned by a call to [HTMLFormControlsCollection.namedItem]. /// /// --- /// /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/RadioNodeList). extension type RadioNodeList._(JSObject _) implements NodeList, JSObject { /// If the underlying element collection contains radio buttons, the /// **`RadioNodeList.value`** property represents the checked radio /// button. On retrieving the `value` property, the `value` of the /// currently `checked` radio button is returned as a string. If the /// collection /// does not contain any radio buttons or none of the radio buttons in the /// collection is in /// `checked` state, the empty string is returned. On setting the /// `value` property, the first radio button input element whose /// `value` property is equal to the new value will be set to /// `checked`. external String get value; external set value(String value); } /// The **`HTMLOptionsCollection`** interface represents a collection of /// [`