Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 'sourced from mdn docs' line to the MDN sourced dartdoc #198

Merged
merged 5 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
allowed to contain those fields.
- Empty dictionary constructors now create an empty object instead of being
treated like non-object literal `external` constructors.
- Update the docs for generated interface types to reference the MDN Web Docs
project.

## 0.5.1

Expand Down
5 changes: 5 additions & 0 deletions lib/src/dom/angle_instanced_arrays.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import 'webgl1.dart';
/// > hardware supports it and not just on Windows when using the ANGLE library.
/// > "ANGLE" just indicates that this extension has been written by the ANGLE
/// > library authors.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays).
extension type ANGLE_instanced_arrays._(JSObject _) implements JSObject {
external static GLenum get VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE;

Expand Down
15 changes: 15 additions & 0 deletions lib/src/dom/clipboard_apis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ extension type ClipboardEventInit._(JSObject _) implements EventInit, JSObject {
/// represents events providing information related to modification of the
/// clipboard, that is [Element/cut_event], [Element/copy_event], and
/// [Element/paste_event] events.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent).
extension type ClipboardEvent._(JSObject _) implements Event, JSObject {
external factory ClipboardEvent(
String type, [
Expand All @@ -58,6 +63,11 @@ extension type ClipboardEvent._(JSObject _) implements Event, JSObject {
///
/// > **Note:** To work with text see the [Clipboard.readText] and
/// > [Clipboard.writeText] methods of the [Clipboard] interface.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem).
extension type ClipboardItem._(JSObject _) implements JSObject {
external factory ClipboardItem(
JSObject items, [
Expand Down Expand Up @@ -97,6 +107,11 @@ extension type ClipboardItemOptions._(JSObject _) implements JSObject {
/// Additional requirements for using the API are discussed in the
/// [Security consideration](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#security_considerations)
/// section of the API overview topic.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard).
extension type Clipboard._(JSObject _) implements EventTarget, JSObject {
/// The **`read()`** method of the [Clipboard] interface requests a copy of
/// the clipboard's contents, fulfilling the returned `Promise` with the data.
Expand Down
10 changes: 10 additions & 0 deletions lib/src/dom/compression.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ typedef CompressionFormat = String;

/// The **`CompressionStream`** interface of the [Compression Streams API] is an
/// API for compressing a stream of data.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CompressionStream).
extension type CompressionStream._(JSObject _) implements JSObject {
external factory CompressionStream(CompressionFormat format);

Expand All @@ -28,6 +33,11 @@ extension type CompressionStream._(JSObject _) implements JSObject {

/// The **`DecompressionStream`** interface of the [Compression Streams API] is
/// an API for decompressing a stream of data.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream).
extension type DecompressionStream._(JSObject _) implements JSObject {
external factory DecompressionStream(CompressionFormat format);

Expand Down
5 changes: 5 additions & 0 deletions lib/src/dom/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ external $Console get console;
/// > console API, such as the timer methods, may not be outputted in the
/// > console of online IDEs or editors. Always open your browser's DevTools
/// > console to see the logs as shown in this documentation.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/console).
@JS('console')
extension type $Console._(JSObject _) implements JSObject {
@JS('assert')
Expand Down
20 changes: 20 additions & 0 deletions lib/src/dom/credential_management.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ typedef CredentialMediationRequirement = String;
/// - [PasswordCredential]
/// - [PublicKeyCredential]
/// - [OTPCredential]
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Credential).
extension type Credential._(JSObject _) implements JSObject {
external static JSPromise<JSBoolean> isConditionalMediationAvailable();
external String get id;
Expand All @@ -42,6 +47,11 @@ extension type Credential._(JSObject _) implements JSObject {
/// exposes methods to request credentials and notify the user agent when events
/// such as successful sign in or sign out happen. This interface is accessible
/// from [Navigator.credentials].
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer).
extension type CredentialsContainer._(JSObject _) implements JSObject {
/// The **`get()`** method of the [CredentialsContainer] interface returns a
/// `Promise` that fulfills with a single credential instance that matches the
Expand Down Expand Up @@ -177,6 +187,11 @@ extension type CredentialCreationOptions._(JSObject _) implements JSObject {
///
/// > **Note:** This interface is restricted to top-level contexts and cannot be
/// > used from an `iframe`.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PasswordCredential).
extension type PasswordCredential._(JSObject _)
implements Credential, JSObject {
external factory PasswordCredential(JSObject dataOrForm);
Expand Down Expand Up @@ -220,6 +235,11 @@ extension type PasswordCredentialData._(JSObject _)
///
/// In browsers that support it, an instance of this interface may be passed in
/// the `credential` member of the `init` object for global [fetch].
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FederatedCredential).
extension type FederatedCredential._(JSObject _)
implements Credential, JSObject {
external factory FederatedCredential(FederatedCredentialInit data);
Expand Down
10 changes: 10 additions & 0 deletions lib/src/dom/csp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ typedef SecurityPolicyViolationEventDisposition = String;
/// > or
/// > [`report-to`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to)
/// > policy directive of the header.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSPViolationReportBody).
extension type CSPViolationReportBody._(JSObject _)
implements ReportBody, JSObject {
external JSObject toJSON();
Expand All @@ -49,6 +54,11 @@ extension type CSPViolationReportBody._(JSObject _)
/// The **`SecurityPolicyViolationEvent`** interface inherits from [Event], and
/// represents the event object of an event sent on a document or worker when
/// its content security policy is violated.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent).
extension type SecurityPolicyViolationEvent._(JSObject _)
implements Event, JSObject {
external factory SecurityPolicyViolationEvent(
Expand Down
15 changes: 15 additions & 0 deletions lib/src/dom/css_animations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import 'dom.dart';
/// The **`AnimationEvent`** interface represents events providing information
/// related to
/// [animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations/Using_CSS_animations).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent).
extension type AnimationEvent._(JSObject _) implements Event, JSObject {
external factory AnimationEvent(
String type, [
Expand Down Expand Up @@ -51,6 +56,11 @@ extension type AnimationEventInit._(JSObject _) implements EventInit, JSObject {
/// of styles for a given keyframe. It corresponds to the contents of a single
/// keyframe of a
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframeRule).
extension type CSSKeyframeRule._(JSObject _) implements CSSRule, JSObject {
external set keyText(String value);
external String get keyText;
Expand All @@ -61,6 +71,11 @@ extension type CSSKeyframeRule._(JSObject _) implements CSSRule, JSObject {
/// complete set of keyframes for a CSS animation. It corresponds to the
/// contents of a whole
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframesRule).
extension type CSSKeyframesRule._(JSObject _) implements CSSRule, JSObject {
/// The **`appendRule()`** method of the [CSSKeyframeRule] interface appends a
/// [CSSKeyFrameRule] to the end of the rules.
Expand Down
5 changes: 5 additions & 0 deletions lib/src/dom/css_animations_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import 'web_animations.dart';

/// The **`CSSAnimation`** interface of the [Web Animations API] represents an
/// [Animation] object.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSAnimation).
extension type CSSAnimation._(JSObject _) implements Animation, JSObject {
external String get animationName;
}
10 changes: 10 additions & 0 deletions lib/src/dom/css_cascade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import 'cssom.dart';
/// The **`CSSLayerBlockRule`** represents a block rule. It is a grouping
/// at-rule meaning that it can contain other rules, and is associated to a
/// given cascade layer, identified by its _name_.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerBlockRule).
extension type CSSLayerBlockRule._(JSObject _)
implements CSSGroupingRule, JSObject {
external String get name;
Expand All @@ -33,6 +38,11 @@ extension type CSSLayerBlockRule._(JSObject _)
/// statement allows the reader to understand the layer order. It also allows
/// inline and imported layers to be interleaved, which is not possible when
/// using the `CSSLayerBlockRule` syntax.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerStatementRule).
extension type CSSLayerStatementRule._(JSObject _)
implements CSSRule, JSObject {
external JSArray<JSString> get nameList;
Expand Down
15 changes: 15 additions & 0 deletions lib/src/dom/css_conditional.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,33 @@ import 'cssom.dart';
///
/// Three objects derive from `CSSConditionRule`: [CSSMediaRule],
/// [CSSContainerRule] and [CSSSupportsRule].
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule).
extension type CSSConditionRule._(JSObject _)
implements CSSGroupingRule, JSObject {
external String get conditionText;
}

/// The **`CSSMediaRule`** interface represents a single CSS rule.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule).
extension type CSSMediaRule._(JSObject _)
implements CSSConditionRule, JSObject {
external MediaList get media;
}

/// The **`CSSSupportsRule`** interface represents a single CSS
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSSupportsRule).
extension type CSSSupportsRule._(JSObject _)
implements CSSConditionRule, JSObject {}
5 changes: 5 additions & 0 deletions lib/src/dom/css_contain_3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ import 'css_conditional.dart';
/// along with the container name if one is defined.
/// Note that the container name and query together define the "condition text",
/// which can be obtained using [CSSConditionRule.conditionText].
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSContainerRule).
extension type CSSContainerRule._(JSObject _)
implements CSSConditionRule, JSObject {
external String get containerName;
Expand Down
5 changes: 5 additions & 0 deletions lib/src/dom/css_counter_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import 'cssom.dart';

/// The **`CSSCounterStyleRule`** interface represents an
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule).
extension type CSSCounterStyleRule._(JSObject _) implements CSSRule, JSObject {
external set name(String value);
external String get name;
Expand Down
15 changes: 15 additions & 0 deletions lib/src/dom/css_font_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ extension type FontFaceDescriptors._(JSObject _) implements JSObject {
/// `weight`, and so on.
/// For URL font sources it allows authors to trigger when the remote font is
/// fetched and loaded, and to track loading status.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFace).
extension type FontFace._(JSObject _) implements JSObject {
external factory FontFace(
String family,
Expand Down Expand Up @@ -148,6 +153,11 @@ extension type FontFaceSetLoadEventInit._(JSObject _)
/// ([`loadingdone`](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/loadingdone_event))
/// or there is an error loading one of the fonts
/// ([`loadingerror`](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/loadingerror_event)).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSetLoadEvent).
extension type FontFaceSetLoadEvent._(JSObject _) implements Event, JSObject {
external factory FontFaceSetLoadEvent(
String type, [
Expand All @@ -167,6 +177,11 @@ extension type FontFaceSetLoadEvent._(JSObject _) implements Event, JSObject {
///
/// This property is available as [Document.fonts], or `self.fonts` in
/// [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet).
extension type FontFaceSet._(JSObject _) implements EventTarget, JSObject {
external factory FontFaceSet(JSArray<FontFace> initialFaces);

Expand Down
15 changes: 15 additions & 0 deletions lib/src/dom/css_fonts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import 'cssom.dart';

/// The **`CSSFontFaceRule`** interface represents an
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFaceRule).
extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject {
external CSSStyleDeclaration get style;
}
Expand All @@ -25,6 +30,11 @@ extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject {
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule), letting
/// developers assign for each font face a common name to specify features
/// indices to be used in .
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFeatureValuesRule).
extension type CSSFontFeatureValuesRule._(JSObject _)
implements CSSRule, JSObject {
external set fontFamily(String value);
Expand All @@ -45,6 +55,11 @@ extension type CSSFontFeatureValuesMap._(JSObject _) implements JSObject {

/// The **`CSSFontPaletteValuesRule`** interface represents an
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontPaletteValuesRule).
extension type CSSFontPaletteValuesRule._(JSObject _)
implements CSSRule, JSObject {
external String get name;
Expand Down
10 changes: 10 additions & 0 deletions lib/src/dom/css_highlight_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ typedef HighlightType = String;
/// A `Highlight` instance is a
/// [`Set`-like object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_browser_apis)
/// that can hold one or more `Range` objects.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Highlight).
extension type Highlight._(JSObject _) implements JSObject {
external factory Highlight(AbstractRange initialRanges);

Expand All @@ -47,4 +52,9 @@ extension type Highlight._(JSObject _) implements JSObject {
/// [`Map`-like object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#map-like_browser_apis),
/// in which each key is the name string for a custom highlight, and the
/// corresponding value is the associated [Highlight] object.
///
/// ---
///
/// API documentation sourced from
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/HighlightRegistry).
extension type HighlightRegistry._(JSObject _) implements JSObject {}
Loading