Skip to content

Commit 9b7e29d

Browse files
authored
Add a 'sourced from mdn docs' line to the MDN sourced dartdoc (#198)
* add a 'docs from mdn' line to the interface type docs * re-generate package files * update the changelog; link to specific types * review feedback
1 parent 51e594b commit 9b7e29d

File tree

95 files changed

+6300
-2850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+6300
-2850
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
allowed to contain those fields.
55
- Empty dictionary constructors now create an empty object instead of being
66
treated like non-object literal `external` constructors.
7+
- Update the docs for generated interface types to reference the MDN Web Docs
8+
project.
79

810
## 0.5.1
911

lib/src/dom/angle_instanced_arrays.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ import 'webgl1.dart';
3535
/// > hardware supports it and not just on Windows when using the ANGLE library.
3636
/// > "ANGLE" just indicates that this extension has been written by the ANGLE
3737
/// > library authors.
38+
///
39+
/// ---
40+
///
41+
/// API documentation sourced from
42+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ANGLE_instanced_arrays).
3843
extension type ANGLE_instanced_arrays._(JSObject _) implements JSObject {
3944
external static GLenum get VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE;
4045

lib/src/dom/clipboard_apis.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ extension type ClipboardEventInit._(JSObject _) implements EventInit, JSObject {
3838
/// represents events providing information related to modification of the
3939
/// clipboard, that is [Element/cut_event], [Element/copy_event], and
4040
/// [Element/paste_event] events.
41+
///
42+
/// ---
43+
///
44+
/// API documentation sourced from
45+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent).
4146
extension type ClipboardEvent._(JSObject _) implements Event, JSObject {
4247
external factory ClipboardEvent(
4348
String type, [
@@ -58,6 +63,11 @@ extension type ClipboardEvent._(JSObject _) implements Event, JSObject {
5863
///
5964
/// > **Note:** To work with text see the [Clipboard.readText] and
6065
/// > [Clipboard.writeText] methods of the [Clipboard] interface.
66+
///
67+
/// ---
68+
///
69+
/// API documentation sourced from
70+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem).
6171
extension type ClipboardItem._(JSObject _) implements JSObject {
6272
external factory ClipboardItem(
6373
JSObject items, [
@@ -97,6 +107,11 @@ extension type ClipboardItemOptions._(JSObject _) implements JSObject {
97107
/// Additional requirements for using the API are discussed in the
98108
/// [Security consideration](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#security_considerations)
99109
/// section of the API overview topic.
110+
///
111+
/// ---
112+
///
113+
/// API documentation sourced from
114+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard).
100115
extension type Clipboard._(JSObject _) implements EventTarget, JSObject {
101116
/// The **`read()`** method of the [Clipboard] interface requests a copy of
102117
/// the clipboard's contents, fulfilling the returned `Promise` with the data.

lib/src/dom/compression.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ typedef CompressionFormat = String;
1919

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

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

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

lib/src/dom/console.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ external $Console get console;
3939
/// > console API, such as the timer methods, may not be outputted in the
4040
/// > console of online IDEs or editors. Always open your browser's DevTools
4141
/// > console to see the logs as shown in this documentation.
42+
///
43+
/// ---
44+
///
45+
/// API documentation sourced from
46+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/console).
4247
@JS('console')
4348
extension type $Console._(JSObject _) implements JSObject {
4449
@JS('assert')

lib/src/dom/credential_management.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ typedef CredentialMediationRequirement = String;
3131
/// - [PasswordCredential]
3232
/// - [PublicKeyCredential]
3333
/// - [OTPCredential]
34+
///
35+
/// ---
36+
///
37+
/// API documentation sourced from
38+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Credential).
3439
extension type Credential._(JSObject _) implements JSObject {
3540
external static JSPromise<JSBoolean> isConditionalMediationAvailable();
3641
external String get id;
@@ -42,6 +47,11 @@ extension type Credential._(JSObject _) implements JSObject {
4247
/// exposes methods to request credentials and notify the user agent when events
4348
/// such as successful sign in or sign out happen. This interface is accessible
4449
/// from [Navigator.credentials].
50+
///
51+
/// ---
52+
///
53+
/// API documentation sourced from
54+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer).
4555
extension type CredentialsContainer._(JSObject _) implements JSObject {
4656
/// The **`get()`** method of the [CredentialsContainer] interface returns a
4757
/// `Promise` that fulfills with a single credential instance that matches the
@@ -177,6 +187,11 @@ extension type CredentialCreationOptions._(JSObject _) implements JSObject {
177187
///
178188
/// > **Note:** This interface is restricted to top-level contexts and cannot be
179189
/// > used from an `iframe`.
190+
///
191+
/// ---
192+
///
193+
/// API documentation sourced from
194+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/PasswordCredential).
180195
extension type PasswordCredential._(JSObject _)
181196
implements Credential, JSObject {
182197
external factory PasswordCredential(JSObject dataOrForm);
@@ -220,6 +235,11 @@ extension type PasswordCredentialData._(JSObject _)
220235
///
221236
/// In browsers that support it, an instance of this interface may be passed in
222237
/// the `credential` member of the `init` object for global [fetch].
238+
///
239+
/// ---
240+
///
241+
/// API documentation sourced from
242+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FederatedCredential).
223243
extension type FederatedCredential._(JSObject _)
224244
implements Credential, JSObject {
225245
external factory FederatedCredential(FederatedCredentialInit data);

lib/src/dom/csp.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ typedef SecurityPolicyViolationEventDisposition = String;
3030
/// > or
3131
/// > [`report-to`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to)
3232
/// > policy directive of the header.
33+
///
34+
/// ---
35+
///
36+
/// API documentation sourced from
37+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSPViolationReportBody).
3338
extension type CSPViolationReportBody._(JSObject _)
3439
implements ReportBody, JSObject {
3540
external JSObject toJSON();
@@ -49,6 +54,11 @@ extension type CSPViolationReportBody._(JSObject _)
4954
/// The **`SecurityPolicyViolationEvent`** interface inherits from [Event], and
5055
/// represents the event object of an event sent on a document or worker when
5156
/// its content security policy is violated.
57+
///
58+
/// ---
59+
///
60+
/// API documentation sourced from
61+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent).
5262
extension type SecurityPolicyViolationEvent._(JSObject _)
5363
implements Event, JSObject {
5464
external factory SecurityPolicyViolationEvent(

lib/src/dom/css_animations.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ import 'dom.dart';
1919
/// The **`AnimationEvent`** interface represents events providing information
2020
/// related to
2121
/// [animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations/Using_CSS_animations).
22+
///
23+
/// ---
24+
///
25+
/// API documentation sourced from
26+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent).
2227
extension type AnimationEvent._(JSObject _) implements Event, JSObject {
2328
external factory AnimationEvent(
2429
String type, [
@@ -51,6 +56,11 @@ extension type AnimationEventInit._(JSObject _) implements EventInit, JSObject {
5156
/// of styles for a given keyframe. It corresponds to the contents of a single
5257
/// keyframe of a
5358
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
59+
///
60+
/// ---
61+
///
62+
/// API documentation sourced from
63+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframeRule).
5464
extension type CSSKeyframeRule._(JSObject _) implements CSSRule, JSObject {
5565
external set keyText(String value);
5666
external String get keyText;
@@ -61,6 +71,11 @@ extension type CSSKeyframeRule._(JSObject _) implements CSSRule, JSObject {
6171
/// complete set of keyframes for a CSS animation. It corresponds to the
6272
/// contents of a whole
6373
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
74+
///
75+
/// ---
76+
///
77+
/// API documentation sourced from
78+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSKeyframesRule).
6479
extension type CSSKeyframesRule._(JSObject _) implements CSSRule, JSObject {
6580
/// The **`appendRule()`** method of the [CSSKeyframeRule] interface appends a
6681
/// [CSSKeyFrameRule] to the end of the rules.

lib/src/dom/css_animations_2.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ import 'web_animations.dart';
1717

1818
/// The **`CSSAnimation`** interface of the [Web Animations API] represents an
1919
/// [Animation] object.
20+
///
21+
/// ---
22+
///
23+
/// API documentation sourced from
24+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSAnimation).
2025
extension type CSSAnimation._(JSObject _) implements Animation, JSObject {
2126
external String get animationName;
2227
}

lib/src/dom/css_cascade.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ import 'cssom.dart';
1818
/// The **`CSSLayerBlockRule`** represents a block rule. It is a grouping
1919
/// at-rule meaning that it can contain other rules, and is associated to a
2020
/// given cascade layer, identified by its _name_.
21+
///
22+
/// ---
23+
///
24+
/// API documentation sourced from
25+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerBlockRule).
2126
extension type CSSLayerBlockRule._(JSObject _)
2227
implements CSSGroupingRule, JSObject {
2328
external String get name;
@@ -33,6 +38,11 @@ extension type CSSLayerBlockRule._(JSObject _)
3338
/// statement allows the reader to understand the layer order. It also allows
3439
/// inline and imported layers to be interleaved, which is not possible when
3540
/// using the `CSSLayerBlockRule` syntax.
41+
///
42+
/// ---
43+
///
44+
/// API documentation sourced from
45+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerStatementRule).
3646
extension type CSSLayerStatementRule._(JSObject _)
3747
implements CSSRule, JSObject {
3848
external JSArray<JSString> get nameList;

lib/src/dom/css_conditional.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,33 @@ import 'cssom.dart';
2222
///
2323
/// Three objects derive from `CSSConditionRule`: [CSSMediaRule],
2424
/// [CSSContainerRule] and [CSSSupportsRule].
25+
///
26+
/// ---
27+
///
28+
/// API documentation sourced from
29+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule).
2530
extension type CSSConditionRule._(JSObject _)
2631
implements CSSGroupingRule, JSObject {
2732
external String get conditionText;
2833
}
2934

3035
/// The **`CSSMediaRule`** interface represents a single CSS rule.
36+
///
37+
/// ---
38+
///
39+
/// API documentation sourced from
40+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule).
3141
extension type CSSMediaRule._(JSObject _)
3242
implements CSSConditionRule, JSObject {
3343
external MediaList get media;
3444
}
3545

3646
/// The **`CSSSupportsRule`** interface represents a single CSS
3747
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
48+
///
49+
/// ---
50+
///
51+
/// API documentation sourced from
52+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSSupportsRule).
3853
extension type CSSSupportsRule._(JSObject _)
3954
implements CSSConditionRule, JSObject {}

lib/src/dom/css_contain_3.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ import 'css_conditional.dart';
2121
/// along with the container name if one is defined.
2222
/// Note that the container name and query together define the "condition text",
2323
/// which can be obtained using [CSSConditionRule.conditionText].
24+
///
25+
/// ---
26+
///
27+
/// API documentation sourced from
28+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSContainerRule).
2429
extension type CSSContainerRule._(JSObject _)
2530
implements CSSConditionRule, JSObject {
2631
external String get containerName;

lib/src/dom/css_counter_styles.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ import 'cssom.dart';
1717

1818
/// The **`CSSCounterStyleRule`** interface represents an
1919
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
20+
///
21+
/// ---
22+
///
23+
/// API documentation sourced from
24+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSCounterStyleRule).
2025
extension type CSSCounterStyleRule._(JSObject _) implements CSSRule, JSObject {
2126
external set name(String value);
2227
external String get name;

lib/src/dom/css_font_loading.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ extension type FontFaceDescriptors._(JSObject _) implements JSObject {
6464
/// `weight`, and so on.
6565
/// For URL font sources it allows authors to trigger when the remote font is
6666
/// fetched and loaded, and to track loading status.
67+
///
68+
/// ---
69+
///
70+
/// API documentation sourced from
71+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFace).
6772
extension type FontFace._(JSObject _) implements JSObject {
6873
external factory FontFace(
6974
String family,
@@ -148,6 +153,11 @@ extension type FontFaceSetLoadEventInit._(JSObject _)
148153
/// ([`loadingdone`](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/loadingdone_event))
149154
/// or there is an error loading one of the fonts
150155
/// ([`loadingerror`](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/loadingerror_event)).
156+
///
157+
/// ---
158+
///
159+
/// API documentation sourced from
160+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSetLoadEvent).
151161
extension type FontFaceSetLoadEvent._(JSObject _) implements Event, JSObject {
152162
external factory FontFaceSetLoadEvent(
153163
String type, [
@@ -167,6 +177,11 @@ extension type FontFaceSetLoadEvent._(JSObject _) implements Event, JSObject {
167177
///
168178
/// This property is available as [Document.fonts], or `self.fonts` in
169179
/// [web workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API).
180+
///
181+
/// ---
182+
///
183+
/// API documentation sourced from
184+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet).
170185
extension type FontFaceSet._(JSObject _) implements EventTarget, JSObject {
171186
external factory FontFaceSet(JSArray<FontFace> initialFaces);
172187

lib/src/dom/css_fonts.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ import 'cssom.dart';
1717

1818
/// The **`CSSFontFaceRule`** interface represents an
1919
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
20+
///
21+
/// ---
22+
///
23+
/// API documentation sourced from
24+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFaceRule).
2025
extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject {
2126
external CSSStyleDeclaration get style;
2227
}
@@ -25,6 +30,11 @@ extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject {
2530
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule), letting
2631
/// developers assign for each font face a common name to specify features
2732
/// indices to be used in .
33+
///
34+
/// ---
35+
///
36+
/// API documentation sourced from
37+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFeatureValuesRule).
2838
extension type CSSFontFeatureValuesRule._(JSObject _)
2939
implements CSSRule, JSObject {
3040
external set fontFamily(String value);
@@ -45,6 +55,11 @@ extension type CSSFontFeatureValuesMap._(JSObject _) implements JSObject {
4555

4656
/// The **`CSSFontPaletteValuesRule`** interface represents an
4757
/// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule).
58+
///
59+
/// ---
60+
///
61+
/// API documentation sourced from
62+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontPaletteValuesRule).
4863
extension type CSSFontPaletteValuesRule._(JSObject _)
4964
implements CSSRule, JSObject {
5065
external String get name;

lib/src/dom/css_highlight_api.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ typedef HighlightType = String;
2929
/// A `Highlight` instance is a
3030
/// [`Set`-like object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set-like_browser_apis)
3131
/// that can hold one or more `Range` objects.
32+
///
33+
/// ---
34+
///
35+
/// API documentation sourced from
36+
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Highlight).
3237
extension type Highlight._(JSObject _) implements JSObject {
3338
external factory Highlight(AbstractRange initialRanges);
3439

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

0 commit comments

Comments
 (0)