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;

0 commit comments

Comments
 (0)