diff --git a/CHANGELOG.md b/CHANGELOG.md index 046f2935..c950fcad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ allowed to contain those fields. - Empty dictionary constructors now create an empty object instead of being treated like non-object literal `external` constructors. +- Generate MDN API documentation for getters. - Update the docs for generated interface types to reference the MDN Web Docs project. - Address several broken links in API documentation. diff --git a/analysis_options.yaml b/analysis_options.yaml index 15660257..a4687c44 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -35,7 +35,6 @@ linter: - no_runtimeType_toString - package_api_docs - prefer_const_declarations - - prefer_expression_function_bodies - prefer_final_locals - unnecessary_await_in_return - use_string_buffers diff --git a/lib/src/dom/clipboard_apis.dart b/lib/src/dom/clipboard_apis.dart index 876a1e61..ddf3668e 100644 --- a/lib/src/dom/clipboard_apis.dart +++ b/lib/src/dom/clipboard_apis.dart @@ -29,8 +29,8 @@ extension type ClipboardEventInit._(JSObject _) implements EventInit, JSObject { DataTransfer? clipboardData, }); - external set clipboardData(DataTransfer? value); external DataTransfer? get clipboardData; + external set clipboardData(DataTransfer? value); } /// The **`ClipboardEvent`** interface of the @@ -49,6 +49,17 @@ extension type ClipboardEvent._(JSObject _) implements Event, JSObject { ClipboardEventInit eventInitDict, ]); + /// The **`clipboardData`** property of the [ClipboardEvent] interface holds a + /// [DataTransfer] object, which can be used to: + /// + /// - specify what data should be put into the clipboard from the + /// [Element.cut_event] and [Element.copy_event] event handlers, typically + /// with a [DataTransfer.setData] call; + /// - obtain the data to be pasted from the [Element.paste_event] event + /// handler, typically with a [DataTransfer.getData] call. + /// + /// See the [Element.cut_event], [Element.copy_event], and + /// [Element.paste_event] events documentation for more information. external DataTransfer? get clipboardData; } @@ -80,14 +91,23 @@ extension type ClipboardItem._(JSObject _) implements JSObject { /// `Promise` that resolves with a [Blob] of the requested or an error if the /// MIME type is not found. external JSPromise getType(String type); + + /// The read-only **`presentationStyle`** property of the [ClipboardItem] + /// interface returns a string indicating how an item should be presented. + /// + /// For example, in some contexts an image might be displayed inline, while in + /// others it might be represented as an attachment. external PresentationStyle get presentationStyle; + + /// The read-only **`types`** property of the [ClipboardItem] interface + /// returns an `Array` of available within the [ClipboardItem] external JSArray get types; } extension type ClipboardItemOptions._(JSObject _) implements JSObject { external factory ClipboardItemOptions({PresentationStyle presentationStyle}); - external set presentationStyle(PresentationStyle value); external PresentationStyle get presentationStyle; + external set presentationStyle(PresentationStyle value); } /// The **`Clipboard`** interface of the @@ -151,8 +171,8 @@ extension type Clipboard._(JSObject _) implements EventTarget, JSObject { extension type ClipboardUnsanitizedFormats._(JSObject _) implements JSObject { external factory ClipboardUnsanitizedFormats({JSArray unsanitized}); - external set unsanitized(JSArray value); external JSArray get unsanitized; + external set unsanitized(JSArray value); } extension type ClipboardPermissionDescriptor._(JSObject _) implements PermissionDescriptor, JSObject { @@ -161,6 +181,6 @@ extension type ClipboardPermissionDescriptor._(JSObject _) bool allowWithoutGesture, }); - external set allowWithoutGesture(bool value); external bool get allowWithoutGesture; + external set allowWithoutGesture(bool value); } diff --git a/lib/src/dom/compression.dart b/lib/src/dom/compression.dart index 45e3d711..3dc3df7e 100644 --- a/lib/src/dom/compression.dart +++ b/lib/src/dom/compression.dart @@ -27,7 +27,12 @@ typedef CompressionFormat = String; extension type CompressionStream._(JSObject _) implements JSObject { external factory CompressionStream(CompressionFormat format); + /// The **`readable`** read-only property of the [CompressionStream] interface + /// returns a [ReadableStream]. external ReadableStream get readable; + + /// The **`writable`** read-only property of the [CompressionStream] interface + /// returns a [WritableStream]. external WritableStream get writable; } @@ -41,6 +46,11 @@ extension type CompressionStream._(JSObject _) implements JSObject { extension type DecompressionStream._(JSObject _) implements JSObject { external factory DecompressionStream(CompressionFormat format); + /// The **`readable`** read-only property of the [DecompressionStream] + /// interface returns a [ReadableStream]. external ReadableStream get readable; + + /// The **`writable`** read-only property of the [DecompressionStream] + /// interface returns a [WritableStream]. external WritableStream get writable; } diff --git a/lib/src/dom/credential_management.dart b/lib/src/dom/credential_management.dart index add175b3..b016bdfa 100644 --- a/lib/src/dom/credential_management.dart +++ b/lib/src/dom/credential_management.dart @@ -38,7 +38,16 @@ typedef CredentialMediationRequirement = String; /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Credential). extension type Credential._(JSObject _) implements JSObject { external static JSPromise isConditionalMediationAvailable(); + + /// The **`id`** read-only property of the [Credential] interface returns a + /// string containing the credential's identifier. This might be a GUID, + /// username, or email address, or some other value, depending on the type of + /// credential. external String get id; + + /// The **`type`** read-only property of the [Credential] interface returns a + /// string containing the credential's type. Valid values are `password`, + /// `federated`, `public-key`, `identity` and `otp`. external String get type; } @@ -138,8 +147,8 @@ extension type CredentialsContainer._(JSObject _) implements JSObject { extension type CredentialData._(JSObject _) implements JSObject { external factory CredentialData({required String id}); - external set id(String value); external String get id; + external set id(String value); } extension type CredentialRequestOptions._(JSObject _) implements JSObject { external factory CredentialRequestOptions({ @@ -150,16 +159,16 @@ extension type CredentialRequestOptions._(JSObject _) implements JSObject { PublicKeyCredentialRequestOptions publicKey, }); - external set mediation(CredentialMediationRequirement value); external CredentialMediationRequirement get mediation; - external set signal(AbortSignal value); + external set mediation(CredentialMediationRequirement value); external AbortSignal get signal; - external set password(bool value); + external set signal(AbortSignal value); external bool get password; - external set federated(FederatedCredentialRequestOptions value); + external set password(bool value); external FederatedCredentialRequestOptions get federated; - external set publicKey(PublicKeyCredentialRequestOptions value); + external set federated(FederatedCredentialRequestOptions value); external PublicKeyCredentialRequestOptions get publicKey; + external set publicKey(PublicKeyCredentialRequestOptions value); } extension type CredentialCreationOptions._(JSObject _) implements JSObject { external factory CredentialCreationOptions({ @@ -169,14 +178,14 @@ extension type CredentialCreationOptions._(JSObject _) implements JSObject { PublicKeyCredentialCreationOptions publicKey, }); - external set signal(AbortSignal value); external AbortSignal get signal; - external set password(PasswordCredentialInit value); + external set signal(AbortSignal value); external PasswordCredentialInit get password; - external set federated(FederatedCredentialInit value); + external set password(PasswordCredentialInit value); external FederatedCredentialInit get federated; - external set publicKey(PublicKeyCredentialCreationOptions value); + external set federated(FederatedCredentialInit value); external PublicKeyCredentialCreationOptions get publicKey; + external set publicKey(PublicKeyCredentialCreationOptions value); } /// The **`PasswordCredential`** interface of the @@ -196,8 +205,23 @@ extension type PasswordCredential._(JSObject _) implements Credential, JSObject { external factory PasswordCredential(JSObject dataOrForm); + /// The **`password`** read-only property + /// of the [PasswordCredential] interface returns a string + /// containing the password of the credential. external String get password; + + /// The **`name`** read-only property of + /// the [PasswordCredential] interface returns a string + /// containing a human-readable public name for display in a credential + /// chooser. external String get name; + + /// The **`iconURL`** read-only property + /// of the [PasswordCredential] interface returns a string + /// containing a URL pointing to an image for an icon. This image is intended + /// for display + /// in a credential chooser. The URL must be accessible without + /// authentication. external String get iconURL; } extension type PasswordCredentialData._(JSObject _) @@ -210,14 +234,14 @@ extension type PasswordCredentialData._(JSObject _) required String password, }); - external set name(String value); external String get name; - external set iconURL(String value); + external set name(String value); external String get iconURL; - external set origin(String value); + external set iconURL(String value); external String get origin; - external set password(String value); + external set origin(String value); external String get password; + external set password(String value); } /// The **`FederatedCredential`** interface of the @@ -244,7 +268,18 @@ extension type FederatedCredential._(JSObject _) implements Credential, JSObject { external factory FederatedCredential(FederatedCredentialInit data); + /// The **`provider`** property of the + /// [FederatedCredential] interface returns a string + /// containing a credential's federated identity provider. external String get provider; + + /// The **`protocol`** property of the + /// [FederatedCredential] interface returns a read-only + /// string containing a credential's federated identity protocol. If this + /// property is + /// [`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null), + /// the protocol may be inferred from the + /// [FederatedCredential.provider] property. external String? get protocol; external String get name; external String get iconURL; @@ -256,10 +291,10 @@ extension type FederatedCredentialRequestOptions._(JSObject _) JSArray protocols, }); - external set providers(JSArray value); external JSArray get providers; - external set protocols(JSArray value); + external set providers(JSArray value); external JSArray get protocols; + external set protocols(JSArray value); } extension type FederatedCredentialInit._(JSObject _) implements CredentialData, JSObject { @@ -272,14 +307,14 @@ extension type FederatedCredentialInit._(JSObject _) String protocol, }); - external set name(String value); external String get name; - external set iconURL(String value); + external set name(String value); external String get iconURL; - external set origin(String value); + external set iconURL(String value); external String get origin; - external set provider(String value); + external set origin(String value); external String get provider; - external set protocol(String value); + external set provider(String value); external String get protocol; + external set protocol(String value); } diff --git a/lib/src/dom/csp.dart b/lib/src/dom/csp.dart index 2c96cdb3..b7a6240a 100644 --- a/lib/src/dom/csp.dart +++ b/lib/src/dom/csp.dart @@ -66,17 +66,70 @@ extension type SecurityPolicyViolationEvent._(JSObject _) SecurityPolicyViolationEventInit eventInitDict, ]); + /// The **`documentURI`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing the URI of the document or worker in which the violation was + /// found. external String get documentURI; + + /// The **`referrer`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing the referrer of the resources whose policy was violated. This + /// will be a URL + /// or `null`. external String get referrer; + + /// The **`blockedURI`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing the URI of the resource that was blocked because it violates + /// a policy. external String get blockedURI; + + /// The **`effectiveDirective`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing the directive whose enforcement uncovered the violation. external String get effectiveDirective; + + /// The **`violatedDirective`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing the directive whose enforcement uncovered the violation. external String get violatedDirective; + + /// The **`originalPolicy`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// containing the policy whose enforcement uncovered the violation. external String get originalPolicy; + + /// The **`sourceFile`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing the URI of the document or worker in which the violation was + /// found. external String get sourceFile; + + /// The **`sample`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a string + /// representing a sample of the resource that caused the violation. external String get sample; + + /// The **`disposition`** read-only property of the + /// [SecurityPolicyViolationEvent] interface indicates how the violated policy + /// is configured to be treated by the user agent. external SecurityPolicyViolationEventDisposition get disposition; + + /// The **`statusCode`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is a number representing the HTTP + /// status code of the document or worker in which the violation occurred. external int get statusCode; + + /// The **`lineNumber`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is the line number in the + /// document + /// or worker at which the violation occurred. external int get lineNumber; + + /// The **`columnNumber`** read-only property of the + /// [SecurityPolicyViolationEvent] interface is the column number in the + /// document or worker at which the violation occurred. external int get columnNumber; } extension type SecurityPolicyViolationEventInit._(JSObject _) @@ -99,28 +152,28 @@ extension type SecurityPolicyViolationEventInit._(JSObject _) int columnNumber, }); - external set documentURI(String value); external String get documentURI; - external set referrer(String value); + external set documentURI(String value); external String get referrer; - external set blockedURI(String value); + external set referrer(String value); external String get blockedURI; - external set violatedDirective(String value); + external set blockedURI(String value); external String get violatedDirective; - external set effectiveDirective(String value); + external set violatedDirective(String value); external String get effectiveDirective; - external set originalPolicy(String value); + external set effectiveDirective(String value); external String get originalPolicy; - external set sourceFile(String value); + external set originalPolicy(String value); external String get sourceFile; - external set sample(String value); + external set sourceFile(String value); external String get sample; - external set disposition(SecurityPolicyViolationEventDisposition value); + external set sample(String value); external SecurityPolicyViolationEventDisposition get disposition; - external set statusCode(int value); + external set disposition(SecurityPolicyViolationEventDisposition value); external int get statusCode; - external set lineNumber(int value); + external set statusCode(int value); external int get lineNumber; - external set columnNumber(int value); + external set lineNumber(int value); external int get columnNumber; + external set columnNumber(int value); } diff --git a/lib/src/dom/css_animations.dart b/lib/src/dom/css_animations.dart index 9ba9debc..f99cdbd2 100644 --- a/lib/src/dom/css_animations.dart +++ b/lib/src/dom/css_animations.dart @@ -30,8 +30,27 @@ extension type AnimationEvent._(JSObject _) implements Event, JSObject { AnimationEventInit animationEventInitDict, ]); + /// The **`AnimationEvent.animationName`** read-only property is a + /// string containing the value of the CSS + /// property associated with the transition. external String get animationName; + + /// The **`AnimationEvent.elapsedTime`** read-only property is a + /// `float` giving the amount of time the animation has been running, in + /// seconds, + /// when this event fired, excluding any time the animation was paused. For an + /// [Element.animationstart_event] event, + /// `elapsedTime` is `0.0` unless there was a negative value for + /// , in which case the event will be fired with + /// `elapsedTime` containing `(-1 * delay)`. external num get elapsedTime; + + /// The **`AnimationEvent.pseudoElement`** read-only property is a + /// string, starting with `'::'`, containing the name of the + /// [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements) + /// the animation runs on. + /// If the animation doesn't run on a pseudo-element but on the element, an + /// empty string: `''`. external String get pseudoElement; } extension type AnimationEventInit._(JSObject _) implements EventInit, JSObject { @@ -44,12 +63,12 @@ extension type AnimationEventInit._(JSObject _) implements EventInit, JSObject { String pseudoElement, }); - external set animationName(String value); external String get animationName; - external set elapsedTime(num value); + external set animationName(String value); external num get elapsedTime; - external set pseudoElement(String value); + external set elapsedTime(num value); external String get pseudoElement; + external set pseudoElement(String value); } /// The **`CSSKeyframeRule`** interface describes an object representing a set @@ -62,8 +81,16 @@ extension type AnimationEventInit._(JSObject _) implements EventInit, JSObject { /// 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); + /// The **`keyText`** property of the [CSSKeyframeRule] interface represents + /// the keyframe selector as a comma-separated list of percentage values. The + /// from and to keywords map to 0% and 100%, respectively. external String get keyText; + external set keyText(String value); + + /// The read-only **`CSSKeyframeRule.style`** property is the + /// [CSSStyleDeclaration] interface for the + /// [declaration block](https://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block) + /// of the [CSSKeyframeRule]. external CSSStyleDeclaration get style; } @@ -88,8 +115,15 @@ extension type CSSKeyframesRule._(JSObject _) implements CSSRule, JSObject { /// The **`findRule()`** method of the [CSSKeyframeRule] interface finds the /// [CSSKeyFrameRule] that matches the specified keyframe selector. external CSSKeyframeRule? findRule(String select); - external set name(String value); + + /// The **`name`** property of the [CSSKeyframeRule] interface gets and sets + /// the name of the animation as used by the property. external String get name; + external set name(String value); + + /// The read-only **`cssRules`** property of the [CSSKeyframeRule] interface + /// returns a [CSSRuleList] containing the rules in the keyframes + /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule). external CSSRuleList get cssRules; external int get length; } diff --git a/lib/src/dom/css_animations_2.dart b/lib/src/dom/css_animations_2.dart index 58e03954..949c29fe 100644 --- a/lib/src/dom/css_animations_2.dart +++ b/lib/src/dom/css_animations_2.dart @@ -23,5 +23,10 @@ import 'web_animations.dart'; /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSAnimation). extension type CSSAnimation._(JSObject _) implements Animation, JSObject { + /// The **`animationName`** property of the + /// [CSSAnimation] interface returns the . This + /// specifies one or more keyframe at-rules which describe the animation + /// applied to the + /// element. external String get animationName; } diff --git a/lib/src/dom/css_cascade.dart b/lib/src/dom/css_cascade.dart index b2dd9fbf..6c1c1014 100644 --- a/lib/src/dom/css_cascade.dart +++ b/lib/src/dom/css_cascade.dart @@ -25,6 +25,8 @@ import 'cssom.dart'; /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerBlockRule). extension type CSSLayerBlockRule._(JSObject _) implements CSSGroupingRule, JSObject { + /// The read-only **`name`** property of the [CSSLayerBlockRule] interface + /// represents the name of the associated cascade layer. external String get name; } @@ -45,5 +47,8 @@ extension type CSSLayerBlockRule._(JSObject _) /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerStatementRule). extension type CSSLayerStatementRule._(JSObject _) implements CSSRule, JSObject { + /// The read-only **`nameList`** property of the [CSSLayerStatementRule] + /// interface return the list of associated cascade layer names. The names + /// can't be modified. external JSArray get nameList; } diff --git a/lib/src/dom/css_conditional.dart b/lib/src/dom/css_conditional.dart index cb2ffc58..062fe593 100644 --- a/lib/src/dom/css_conditional.dart +++ b/lib/src/dom/css_conditional.dart @@ -29,6 +29,9 @@ import 'cssom.dart'; /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSConditionRule). extension type CSSConditionRule._(JSObject _) implements CSSGroupingRule, JSObject { + /// The **`conditionText`** property of + /// the [CSSConditionRule] interface returns or sets the text of the CSS + /// rule. external String get conditionText; } @@ -40,6 +43,9 @@ extension type CSSConditionRule._(JSObject _) /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule). extension type CSSMediaRule._(JSObject _) implements CSSConditionRule, JSObject { + /// The read-only **`media`** property of the + /// [CSSMediaRule] interface [MediaList] represents the intended + /// destination medium for style information. external MediaList get media; } diff --git a/lib/src/dom/css_contain_3.dart b/lib/src/dom/css_contain_3.dart index 66083dc8..2fe1f7e3 100644 --- a/lib/src/dom/css_contain_3.dart +++ b/lib/src/dom/css_contain_3.dart @@ -28,6 +28,34 @@ import 'css_conditional.dart'; /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSContainerRule). extension type CSSContainerRule._(JSObject _) implements CSSConditionRule, JSObject { + /// The read-only **`containerName`** property of the [CSSContainerRule] + /// interface represents the container name of the associated CSS at-rule. + /// + /// For example, the value of `containerName` for the below is `sidebar`: + /// + /// ```css + /// @container sidebar (min-width: 700px) { + /// .card { + /// font-size: 2em; + /// } + /// } + /// ``` external String get containerName; + + /// The read-only **`containerQuery`** property of the [CSSContainerRule] + /// interface returns a string representing the container conditions that are + /// evaluated when the container changes size in order to determine if the + /// styles in the associated are applied. + /// + /// For example, the value of `containerQuery` for the below is `(min-width: + /// 700px)`: + /// + /// ```css + /// @container sidebar (min-width: 700px) { + /// .card { + /// font-size: 2em; + /// } + /// } + /// ``` external String get containerQuery; } diff --git a/lib/src/dom/css_counter_styles.dart b/lib/src/dom/css_counter_styles.dart index 120481c5..e1ac9a0d 100644 --- a/lib/src/dom/css_counter_styles.dart +++ b/lib/src/dom/css_counter_styles.dart @@ -23,26 +23,68 @@ import 'cssom.dart'; /// 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); + /// The **`name`** property of the [CSSCounterStyleRule] interface gets and + /// sets the defined as the `name` for the associated rule. external String get name; - external set system(String value); + external set name(String value); + + /// The **`system`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get system; - external set symbols(String value); + external set system(String value); + + /// The **`symbols`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get symbols; - external set additiveSymbols(String value); + external set symbols(String value); + + /// The **`additiveSymbols`** property of the [CSSCounterStyleRule] interface + /// gets and sets the value of the descriptor. If the descriptor does not + /// have a value set, this attribute returns an empty string. external String get additiveSymbols; - external set negative(String value); + external set additiveSymbols(String value); + + /// The **`negative`** property of the [CSSCounterStyleRule] interface gets + /// and sets the value of the descriptor. If the descriptor does not have a + /// value set, this attribute returns an empty string. external String get negative; - external set prefix(String value); + external set negative(String value); + + /// The **`prefix`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get prefix; - external set suffix(String value); + external set prefix(String value); + + /// The **`suffix`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get suffix; - external set range(String value); + external set suffix(String value); + + /// The **`range`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get range; - external set pad(String value); + external set range(String value); + + /// The **`pad`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get pad; - external set speakAs(String value); + external set pad(String value); + + /// The **`speakAs`** property of the [CSSCounterStyleRule] interface gets and + /// sets the value of the descriptor. If the descriptor does not have a value + /// set, this attribute returns an empty string. external String get speakAs; - external set fallback(String value); + external set speakAs(String value); + + /// The **`fallback`** property of the [CSSCounterStyleRule] interface gets + /// and sets the value of the descriptor. If the descriptor does not have a + /// value set, this attribute returns an empty string. external String get fallback; + external set fallback(String value); } diff --git a/lib/src/dom/css_font_loading.dart b/lib/src/dom/css_font_loading.dart index df27fc9f..b00000e7 100644 --- a/lib/src/dom/css_font_loading.dart +++ b/lib/src/dom/css_font_loading.dart @@ -33,26 +33,26 @@ extension type FontFaceDescriptors._(JSObject _) implements JSObject { String lineGapOverride, }); - external set style(String value); external String get style; - external set weight(String value); + external set style(String value); external String get weight; - external set stretch(String value); + external set weight(String value); external String get stretch; - external set unicodeRange(String value); + external set stretch(String value); external String get unicodeRange; - external set featureSettings(String value); + external set unicodeRange(String value); external String get featureSettings; - external set variationSettings(String value); + external set featureSettings(String value); external String get variationSettings; - external set display(String value); + external set variationSettings(String value); external String get display; - external set ascentOverride(String value); + external set display(String value); external String get ascentOverride; - external set descentOverride(String value); + external set ascentOverride(String value); external String get descentOverride; - external set lineGapOverride(String value); + external set descentOverride(String value); external String get lineGapOverride; + external set lineGapOverride(String value); } /// The **`FontFace`** interface of the @@ -84,29 +84,117 @@ extension type FontFace._(JSObject _) implements JSObject { /// font [FontFace.status] property of the font face is anything other than /// `unloaded`, then this method does nothing. external JSPromise load(); - external set family(String value); + + /// The **`FontFace.family`** property allows the author to get or set the + /// font family of a [FontFace] object. + /// + /// The value is used for name matching against a particular font face when + /// styling elements using the + /// [`font-family`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) + /// property. + /// Any name may be used, and this overrides any name specified in the + /// underlying font data. + /// + /// This property is equivalent to the descriptor of . external String get family; - external set style(String value); + external set family(String value); + + /// The **`style`** property of the [FontFace] interface retrieves or sets the + /// font's style. + /// + /// This property is equivalent to the descriptor. external String get style; - external set weight(String value); + external set style(String value); + + /// The **`weight`** property of the [FontFace] interface retrieves or sets + /// the weight of the font. + /// + /// This property is equivalent to the descriptor. external String get weight; - external set stretch(String value); + external set weight(String value); + + /// The **`stretch`** property of the [FontFace] interface retrieves or sets + /// how the font stretches. + /// + /// This property is equivalent to the descriptor. external String get stretch; - external set unicodeRange(String value); + external set stretch(String value); + + /// The **`unicodeRange`** property of the [FontFace] interface retrieves or + /// sets the range of unicode code points encompassing the font. + /// + /// This property is equivalent to the descriptor. external String get unicodeRange; - external set featureSettings(String value); + external set unicodeRange(String value); + + /// The **`featureSettings`** property of the [FontFace] interface retrieves + /// or sets infrequently used font features that are not available from a + /// font's variant properties. + /// + /// This property is equivalent to the descriptor. external String get featureSettings; - external set variationSettings(String value); + external set featureSettings(String value); + + /// The **`variationSettings`** property of the [FontFace] interface retrieves + /// or sets low-level OpenType or TrueType font variations. + /// + /// This property is equivalent to the descriptor. external String get variationSettings; - external set display(String value); + external set variationSettings(String value); + + /// The **`display`** property of the [FontFace] interface determines how a + /// font face is displayed based on whether and when it is downloaded and + /// ready to use. + /// This property is equivalent to the CSS `font-display` descriptor. + /// + /// When this property is used, font loading has a timeline with three + /// periods. + /// The lengths of the first two periods depend on the value of the property + /// and the user agent. + /// (See below.) + /// + /// - block period + /// - : The browser invisibly prepares a fallback font. If the font face loads during this time, it's used to display the text and display is complete. + /// - swap period + /// - : If the font face is still not loaded, the fallback font will be shown. + /// When the font face loads, the fallback will be swapped for the downloaded + /// font. + /// - failure period + /// - : If the font face still is not loaded, the fallback font will be shown and no swap will occur. external String get display; - external set ascentOverride(String value); + external set display(String value); + + /// The **`ascentOverride`** property of the [FontFace] interface returns and + /// sets the ascent metric for the font, the height above the baseline that + /// CSS uses to lay out line boxes in an inline formatting context. + /// + /// This property is equivalent to the descriptor of . external String get ascentOverride; - external set descentOverride(String value); + external set ascentOverride(String value); + + /// The **`descentOverride`** property of the [FontFace] interface returns and + /// sets the value of the descriptor. + /// The possible values are `normal`, indicating that the metric used should + /// be obtained from the font file, or a percentage. external String get descentOverride; - external set lineGapOverride(String value); + external set descentOverride(String value); + + /// The **`lineGapOverride`** property of the [FontFace] interface returns and + /// sets the value of the descriptor. + /// The possible values are `normal`, indicating that the metric used should + /// be obtained from the font file, or a percentage. external String get lineGapOverride; + external set lineGapOverride(String value); + + /// The **`status`** read-only property of the [FontFace] interface returns an + /// enumerated value indicating the status of the font, one of `"unloaded"`, + /// `"loading"`, `"loaded"`, or `"error"`. external FontFaceLoadStatus get status; + + /// The **`loaded`** read-only property of the [FontFace] interface returns a + /// `Promise` that resolves with the current `FontFace` object when the font + /// specified in the object's constructor is done loading or rejects with a + /// `SyntaxError`. external JSPromise get loaded; external FontFaceFeatures get features; external FontFaceVariations get variations; @@ -138,8 +226,8 @@ extension type FontFaceSetLoadEventInit._(JSObject _) JSArray fontfaces, }); - external set fontfaces(JSArray value); external JSArray get fontfaces; + external set fontfaces(JSArray value); } /// The **`FontFaceSetLoadEvent`** interface of the @@ -164,6 +252,9 @@ extension type FontFaceSetLoadEvent._(JSObject _) implements Event, JSObject { FontFaceSetLoadEventInit eventInitDict, ]); + /// The **`fontfaces`** read-only property of the + /// [FontFaceSetLoadEvent] interface returns an array of + /// [FontFace] instances, each of which represents a single usable font. external JSArray get fontfaces; } @@ -216,12 +307,22 @@ extension type FontFaceSet._(JSObject _) implements EventTarget, JSObject { String font, [ String text, ]); - external set onloading(EventHandler value); external EventHandler get onloading; - external set onloadingdone(EventHandler value); + external set onloading(EventHandler value); external EventHandler get onloadingdone; - external set onloadingerror(EventHandler value); + external set onloadingdone(EventHandler value); external EventHandler get onloadingerror; + external set onloadingerror(EventHandler value); + + /// The `ready` read-only property of the [FontFaceSet] interface returns a + /// `Promise` that resolves to the given [FontFaceSet]. + /// + /// The promise will only resolve once the document has completed loading + /// fonts, layout operations are completed, and no further font loads are + /// needed. external JSPromise get ready; + + /// The **`status`** read-only property of the [FontFaceSet] interface returns + /// the loading state of the fonts in the set. external FontFaceSetLoadStatus get status; } diff --git a/lib/src/dom/css_fonts.dart b/lib/src/dom/css_fonts.dart index a889df27..833204e2 100644 --- a/lib/src/dom/css_fonts.dart +++ b/lib/src/dom/css_fonts.dart @@ -23,6 +23,10 @@ import 'cssom.dart'; /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontFaceRule). extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject { + /// The read-only **`style`** property of the [CSSFontFaceRule] interface + /// returns the style information from the + /// [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule). This + /// will be in the form of a [CSSStyleDeclaration] object. external CSSStyleDeclaration get style; } @@ -37,8 +41,10 @@ extension type CSSFontFaceRule._(JSObject _) implements CSSRule, JSObject { /// [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); + /// The **`fontFamily`** property of the [CSSConditionRule] interface + /// represents the name of the font family it applies to. external String get fontFamily; + external set fontFamily(String value); external CSSFontFeatureValuesMap get annotation; external CSSFontFeatureValuesMap get ornaments; external CSSFontFeatureValuesMap get stylistic; @@ -62,8 +68,24 @@ extension type CSSFontFeatureValuesMap._(JSObject _) implements JSObject { /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSFontPaletteValuesRule). extension type CSSFontPaletteValuesRule._(JSObject _) implements CSSRule, JSObject { + /// The read-only **`name`** property of the [CSSFontPaletteValuesRule] + /// interface represents the name identifying the associated at-rule. A valid + /// name always starts with two dashes, such as `--Alternate`. external String get name; + + /// The read-only **`fontFamily`** property of the [CSSFontPaletteValuesRule] + /// interface lists the font families the rule can be applied to. The font + /// families must be _named_ families; _generic_ families like `courier` are + /// not valid. external String get fontFamily; + + /// The read-only **`basePalette`** property of the [CSSFontPaletteValuesRule] + /// interface indicates the base palette associated with the rule. external String get basePalette; + + /// The read-only **`overrideColors`** property of the + /// [CSSFontPaletteValuesRule] interface is a string containing a list of + /// color index and color pair that are to be used instead. It is specified in + /// the same format as the corresponding descriptor. external String get overrideColors; } diff --git a/lib/src/dom/css_highlight_api.dart b/lib/src/dom/css_highlight_api.dart index 26e0534f..4c04da8b 100644 --- a/lib/src/dom/css_highlight_api.dart +++ b/lib/src/dom/css_highlight_api.dart @@ -37,10 +37,42 @@ typedef HighlightType = String; extension type Highlight._(JSObject _) implements JSObject { external factory Highlight(AbstractRange initialRanges); - external set priority(int value); + /// It is possible to create [Range] objects that overlap in a document. + /// + /// When overlapping ranges are used by multiple different [Highlight] + /// objects, and when those highlights are styled using pseudo-elements, this + /// may lead to conflicting styles. + /// + /// If two text ranges overlap and are both highlighted using the + /// [css_custom_highlight_api], and if they're both styled using the `color` + /// CSS property, the browser needs to decide which color should be used for + /// styling the text in the overlapping part. + /// + /// By default, all highlights have the same priority and the browser chooses + /// the most recently registered highlight to style the overlapping parts. + /// + /// The `priority` property of the [Highlight] interface is a `Number` used to + /// change this default behavior and determine which highlight's styles should + /// be used to resolve style conflicts in overlapping parts. + /// + /// Note that all the styles of a highlight are applied and the browser only + /// needs to resolve conflicts when the same CSS properties are used by + /// multiple overlapping highlights. The highlight style conflict resolution + /// also does not depend on the order in which the pseudo-elements rules + /// appear in the source, or whether or not CSS properties are marked as + /// `!important`. external int get priority; - external set type(HighlightType value); + external set priority(int value); + + /// The `type` property of the [Highlight] interface is an enumerated `String` + /// used to specify the meaning of the highlight. This allows assistive + /// technologies, such as screen readers, to include this meaning when + /// exposing the highlight to users. + /// + /// By default, a highlight object will have its type set to `highlight`, but + /// you can change it to `spelling-error` or `grammar-error`. external HighlightType get type; + external set type(HighlightType value); } /// The **`HighlightRegistry`** interface of the diff --git a/lib/src/dom/css_masking.dart b/lib/src/dom/css_masking.dart index 3a21e6fb..bf829eb9 100644 --- a/lib/src/dom/css_masking.dart +++ b/lib/src/dom/css_masking.dart @@ -32,7 +32,18 @@ extension type SVGClipPathElement._(JSObject _) 'clipPath', ); + /// The read-only **`clipPathUnits`** property of the [SVGClipPathElement] + /// interface reflects the `clipPathUnits` attribute of a element which + /// defines the coordinate system to use for the content of the element. + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedEnumeration.baseVal] and + /// > [SVGAnimatedEnumeration.animVal]. external SVGAnimatedEnumeration get clipPathUnits; + + /// The read-only **`transform`** property of the [SVGClipPathElement] + /// interface reflects the `transform` attribute of a element, that is a list + /// of transformations applied to the element. external SVGAnimatedTransformList get transform; } @@ -51,10 +62,59 @@ extension type SVGMaskElement._(JSObject _) implements SVGElement, JSObject { 'mask', ); + /// The read-only **`maskUnits`** property of the [SVGMaskElement] interface + /// reflects the `maskUnits` attribute of a element which defines the + /// coordinate system to use for the mask of the element. + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedEnumeration.baseVal] and + /// > [SVGAnimatedEnumeration.animVal]. external SVGAnimatedEnumeration get maskUnits; + + /// The read-only **`maskContentUnits`** property of the [SVGMaskElement] + /// interface reflects the `maskContentUnits` attribute. It indicates which + /// coordinate system to use for the contents of the element. + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedEnumeration.baseVal] and + /// > [SVGAnimatedEnumeration.animVal]. external SVGAnimatedEnumeration get maskContentUnits; + + /// The read-only **`x`** property of the [SVGMaskElement] interface returns + /// an [SVGAnimatedLength] object containing the value of the `x` attribute of + /// the . It represents the x-axis coordinate of the _top-left_ corner of the + /// masking area. + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedLength.baseVal] and + /// > [SVGAnimatedLength.animVal]. external SVGAnimatedLength get x; + + /// The read-only **`y`** property of the [SVGMaskElement] interface returns + /// an [SVGAnimatedLength] object containing the value of the `y` attribute of + /// the . It represents the y-axis coordinate of the _top-left_ corner of the + /// masking area. + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedLength.baseVal] and + /// > [SVGAnimatedLength.animVal]. external SVGAnimatedLength get y; + + /// The read-only **`width`** property of the [SVGMaskElement] interface + /// returns an [SVGAnimatedLength] object containing the value of the `width` + /// attribute of the . + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedLength.baseVal] and + /// > [SVGAnimatedLength.animVal]. external SVGAnimatedLength get width; + + /// The read-only **`height`** property of the [SVGMaskElement] interface + /// returns an [SVGAnimatedLength] object containing the value of the `height` + /// attribute of the . + /// + /// > **Note:** Although this property is read-only, it is merely a container + /// > for two values you can modify, [SVGAnimatedLength.baseVal] and + /// > [SVGAnimatedLength.animVal]. external SVGAnimatedLength get height; } diff --git a/lib/src/dom/css_properties_values_api.dart b/lib/src/dom/css_properties_values_api.dart index 7936413f..27d84142 100644 --- a/lib/src/dom/css_properties_values_api.dart +++ b/lib/src/dom/css_properties_values_api.dart @@ -23,14 +23,14 @@ extension type PropertyDefinition._(JSObject _) implements JSObject { String initialValue, }); - external set name(String value); external String get name; - external set syntax(String value); + external set name(String value); external String get syntax; - external set inherits(bool value); + external set syntax(String value); external bool get inherits; - external set initialValue(String value); + external set inherits(bool value); external String get initialValue; + external set initialValue(String value); } /// The **`CSSPropertyRule`** interface of the @@ -42,8 +42,26 @@ extension type PropertyDefinition._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSPropertyRule). extension type CSSPropertyRule._(JSObject _) implements CSSRule, JSObject { + /// The read-only **`name`** property of the [CSSPropertyRule] interface + /// represents the property name, this being the serialization of the name + /// given to the custom property in the rule's prelude. external String get name; + + /// The read-only **`syntax`** property of the [CSSPropertyRule] interface + /// returns the literal syntax of the custom property registration represented + /// by the rule, controlling how the property's value is parsed at + /// computed-value time. external String get syntax; + + /// The read-only **`inherits`** property of the [CSSPropertyRule] interface + /// returns the inherit flag of the custom property registration represented + /// by the rule, a boolean describing whether or not the property inherits by + /// default. external bool get inherits; + + /// The read-only **`initialValue`** nullable property of the + /// [CSSPropertyRule] interface returns the initial value of the custom + /// property registration represented by the rule, controlling the property's + /// initial value. external String? get initialValue; } diff --git a/lib/src/dom/css_transitions.dart b/lib/src/dom/css_transitions.dart index b7554554..dca7a3bb 100644 --- a/lib/src/dom/css_transitions.dart +++ b/lib/src/dom/css_transitions.dart @@ -29,8 +29,25 @@ extension type TransitionEvent._(JSObject _) implements Event, JSObject { TransitionEventInit transitionEventInitDict, ]); + /// The **`propertyName`** read-only property of [TransitionEvent] objects is + /// a string containing the name of the CSS property associated with the + /// transition. external String get propertyName; + + /// The **`TransitionEvent.elapsedTime`** read-only property is a + /// `float` giving the amount of time the animation has been running, in + /// seconds, + /// when this event fired. This value is not affected by the + /// property. external num get elapsedTime; + + /// The **`TransitionEvent.pseudoElement`** read-only property is a + /// string, starting with `'::'`, containing the name of the + /// [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements) + /// the animation runs on. + /// If the transition doesn't run on a pseudo-element but on the element, an + /// empty string: + /// `''``.` external String get pseudoElement; } extension type TransitionEventInit._(JSObject _) @@ -44,10 +61,10 @@ extension type TransitionEventInit._(JSObject _) String pseudoElement, }); - external set propertyName(String value); external String get propertyName; - external set elapsedTime(num value); + external set propertyName(String value); external num get elapsedTime; - external set pseudoElement(String value); + external set elapsedTime(num value); external String get pseudoElement; + external set pseudoElement(String value); } diff --git a/lib/src/dom/css_transitions_2.dart b/lib/src/dom/css_transitions_2.dart index 0e5e479a..43abb4d2 100644 --- a/lib/src/dom/css_transitions_2.dart +++ b/lib/src/dom/css_transitions_2.dart @@ -36,5 +36,9 @@ extension type CSSStartingStyleRule._(JSObject _) /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSTransition). extension type CSSTransition._(JSObject _) implements Animation, JSObject { + /// The **`transitionProperty`** property of the + /// [CSSTransition] interface returns the **expanded transition property + /// name** of the transition. This is the longhand CSS property for which the + /// transition was generated. external String get transitionProperty; } diff --git a/lib/src/dom/css_typed_om.dart b/lib/src/dom/css_typed_om.dart index cbe4db3c..61e6ac20 100644 --- a/lib/src/dom/css_typed_om.dart +++ b/lib/src/dom/css_typed_om.dart @@ -71,6 +71,10 @@ extension type StylePropertyMapReadOnly._(JSObject _) implements JSObject { /// [StylePropertyMapReadOnly] interface indicates whether the specified /// property is in the `StylePropertyMapReadOnly` object. external bool has(String property); + + /// The **`size`** read-only property of the + /// [StylePropertyMapReadOnly] interface returns an unsigned long integer + /// containing the size of the `StylePropertyMapReadOnly` object. external int get size; } @@ -126,6 +130,8 @@ extension type CSSUnparsedValue._(JSObject _) implements CSSStyleValue, JSObject { external factory CSSUnparsedValue(JSArray members); + /// The **`length`** read-only property of the + /// [CSSUnparsedValue] interface returns the number of items in the object. external int get length; } @@ -144,8 +150,18 @@ extension type CSSVariableReferenceValue._(JSObject _) implements JSObject { CSSUnparsedValue? fallback, ]); - external set variable(String value); + /// The **`variable`** property of the + /// [CSSVariableReferenceValue] interface returns the + /// [custom property name](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) + /// of the + /// [CSSVariableReferenceValue]. external String get variable; + external set variable(String value); + + /// The **`fallback`** read-only property of the + /// [CSSVariableReferenceValue] interface returns the + /// [custom property fallback value](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties#custom_property_fallback_values) + /// of the [CSSVariableReferenceValue]. external CSSUnparsedValue? get fallback; } @@ -164,8 +180,11 @@ extension type CSSKeywordValue._(JSObject _) implements CSSStyleValue, JSObject { external factory CSSKeywordValue(String value); - external set value(String value); + /// The **`value`** property of the + /// [CSSKeywordValue] interface returns or sets the value of the + /// `CSSKeywordValue`. external String get value; + external set value(String value); } extension type CSSNumericType._(JSObject _) implements JSObject { external factory CSSNumericType({ @@ -179,22 +198,22 @@ extension type CSSNumericType._(JSObject _) implements JSObject { CSSNumericBaseType percentHint, }); - external set length(int value); external int get length; - external set angle(int value); + external set length(int value); external int get angle; - external set time(int value); + external set angle(int value); external int get time; - external set frequency(int value); + external set time(int value); external int get frequency; - external set resolution(int value); + external set frequency(int value); external int get resolution; - external set flex(int value); + external set resolution(int value); external int get flex; - external set percent(int value); + external set flex(int value); external int get percent; - external set percentHint(CSSNumericBaseType value); + external set percent(int value); external CSSNumericBaseType get percentHint; + external set percentHint(CSSNumericBaseType value); } /// The **`CSSNumericValue`** interface of the @@ -282,8 +301,14 @@ extension type CSSUnitValue._(JSObject _) implements CSSNumericValue, JSObject { String unit, ); - external set value(num value); + /// The **`CSSUnitValue.value`** property of the + /// [CSSUnitValue] interface returns a double indicating the number of units. external num get value; + external set value(num value); + + /// The **`CSSUnitValue.unit`** read-only property + /// of the [CSSUnitValue] interface returns a string + /// indicating the type of unit. external String get unit; } @@ -295,6 +320,11 @@ extension type CSSUnitValue._(JSObject _) implements CSSNumericValue, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue). extension type CSSMathValue._(JSObject _) implements CSSNumericValue, JSObject { + /// The **`CSSMathValue.operator`** read-only + /// property of the [CSSMathValue] interface indicates the operator that the + /// current subtype represents. For example, if the current `CSSMathValue` + /// subtype is `CSSMathSum`, this property will return the string + /// `"sum"`. external CSSMathOperator get operator; } @@ -314,6 +344,9 @@ extension type CSSMathValue._(JSObject _) implements CSSNumericValue, JSObject { extension type CSSMathSum._(JSObject _) implements CSSMathValue, JSObject { external factory CSSMathSum(CSSNumberish args); + /// The **`CSSMathSum.values`** read-only property + /// of the [CSSMathSum] interface returns a [CSSNumericArray] + /// object which contains one or more [CSSNumericValue] objects. external CSSNumericArray get values; } @@ -329,6 +362,10 @@ extension type CSSMathSum._(JSObject _) implements CSSMathValue, JSObject { extension type CSSMathProduct._(JSObject _) implements CSSMathValue, JSObject { external factory CSSMathProduct(CSSNumberish args); + /// The **`CSSMathProduct.values`** read-only + /// property of the [CSSMathProduct] interface returns a + /// [CSSNumericArray] object which contains one or more + /// [CSSNumericValue] objects. external CSSNumericArray get values; } @@ -342,6 +379,8 @@ extension type CSSMathProduct._(JSObject _) implements CSSMathValue, JSObject { extension type CSSMathNegate._(JSObject _) implements CSSMathValue, JSObject { external factory CSSMathNegate(CSSNumberish arg); + /// The CSSMathNegate.value read-only property of the + /// [CSSMathNegate] interface returns a [CSSNumericValue] object. external CSSNumericValue get value; } @@ -356,6 +395,8 @@ extension type CSSMathNegate._(JSObject _) implements CSSMathValue, JSObject { extension type CSSMathInvert._(JSObject _) implements CSSMathValue, JSObject { external factory CSSMathInvert(CSSNumberish arg); + /// The CSSMathInvert.value read-only property of the + /// [CSSMathInvert] interface returns a [CSSNumericValue] object. external CSSNumericValue get value; } @@ -369,6 +410,9 @@ extension type CSSMathInvert._(JSObject _) implements CSSMathValue, JSObject { extension type CSSMathMin._(JSObject _) implements CSSMathValue, JSObject { external factory CSSMathMin(CSSNumberish args); + /// The CSSMathMin.values read-only property of the + /// [CSSMathMin] interface returns a [CSSNumericArray] object + /// which contains one or more [CSSNumericValue] objects. external CSSNumericArray get values; } @@ -382,6 +426,9 @@ extension type CSSMathMin._(JSObject _) implements CSSMathValue, JSObject { extension type CSSMathMax._(JSObject _) implements CSSMathValue, JSObject { external factory CSSMathMax(CSSNumberish args); + /// The CSSMathMax.values read-only property of the + /// [CSSMathMax] interface returns a [CSSNumericArray] object + /// which contains one or more [CSSNumericValue] objects. external CSSNumericArray get values; } extension type CSSMathClamp._(JSObject _) implements CSSMathValue, JSObject { @@ -404,6 +451,9 @@ extension type CSSMathClamp._(JSObject _) implements CSSMathValue, JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericArray). extension type CSSNumericArray._(JSObject _) implements JSObject { + /// The read-only **`length`** property of the + /// [CSSNumericArray] interface returns the number of + /// [CSSNumericValue] objects in the list. external int get length; } @@ -421,7 +471,20 @@ extension type CSSTransformValue._(JSObject _) /// The **`toMatrix()`** method of the /// [CSSTransformValue] interface returns a [DOMMatrix] object. external DOMMatrix toMatrix(); + + /// The read-only **`length`** property of the + /// [CSSTransformValue] interface returns the number of transform components + /// in + /// the list. external int get length; + + /// The read-only **`is2D`** property of the + /// [CSSTransformValue] interface returns whether the transform is 2D or 3D. + /// + /// In the case of the `CSSTransformValue` this property returns + /// true unless any of the individual functions return false for `Is2D`, in + /// which + /// case it returns false. external bool get is2D; } @@ -447,8 +510,11 @@ extension type CSSTransformComponent._(JSObject _) implements JSObject { /// > found in /// > [Using CSS transforms](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transforms/Using_CSS_transforms). external DOMMatrix toMatrix(); - external set is2D(bool value); + + /// The **`is2D`** read-only property of the [CSSTransformComponent] interface + /// indicates where the transform is 2D or 3D. external bool get is2D; + external set is2D(bool value); } /// The **`CSSTranslate`** interface of the represents the @@ -468,12 +534,29 @@ extension type CSSTranslate._(JSObject _) CSSNumericValue z, ]); - external set x(CSSNumericValue value); + /// The **`x`** property of the + /// [CSSTranslate] interface gets and sets the abscissa or x-axis of the + /// translating vector. external CSSNumericValue get x; - external set y(CSSNumericValue value); + external set x(CSSNumericValue value); + + /// The **`y`** property of the + /// [CSSTranslate] interface gets and sets the ordinate or y-axis of the + /// translating vector. external CSSNumericValue get y; - external set z(CSSNumericValue value); + external set y(CSSNumericValue value); + + /// The **`z`** property of the + /// [CSSTranslate] interface representing the z-component of the translating + /// vector. A positive value moves the element towards the viewer, and a + /// negative value + /// farther away. + /// + /// If this value is present then the transform is a 3D transform and the + /// `is2D` + /// property will be set to false. external CSSNumericValue get z; + external set z(CSSNumericValue value); } /// The **`CSSRotate`** interface of the represents the rotate value of the @@ -493,14 +576,32 @@ extension type CSSRotate._(JSObject _) CSSNumericValue angle, ]); - external set x(CSSNumberish value); + /// The **`x`** property of the + /// [CSSRotate] interface gets and sets the abscissa or x-axis of the + /// translating vector. external CSSNumberish get x; - external set y(CSSNumberish value); + external set x(CSSNumberish value); + + /// The **`y`** property of the + /// [CSSRotate] interface gets and sets the ordinate or y-axis of the + /// translating vector. external CSSNumberish get y; - external set z(CSSNumberish value); + external set y(CSSNumberish value); + + /// The **`z`** property of the + /// [CSSRotate] interface representing the z-component of the translating + /// vector. A positive value moves the element towards the viewer, and a + /// negative value + /// farther away. external CSSNumberish get z; - external set angle(CSSNumericValue value); + external set z(CSSNumberish value); + + /// The **`angle`** property of the + /// [CSSRotate] interface gets and sets the angle of rotation. A positive + /// angle + /// denotes a clockwise rotation, a negative angle a counter-clockwise one. external CSSNumericValue get angle; + external set angle(CSSNumericValue value); } /// The **`CSSScale`** interface of the represents the @@ -522,12 +623,29 @@ extension type CSSScale._(JSObject _) CSSNumberish z, ]); - external set x(CSSNumberish value); + /// The **`x`** property of the + /// [CSSScale] interface gets and sets the abscissa or x-axis of the + /// translating vector. external CSSNumberish get x; - external set y(CSSNumberish value); + external set x(CSSNumberish value); + + /// The **`y`** property of the + /// [CSSScale] interface gets and sets the ordinate or y-axis of the + /// translating vector. external CSSNumberish get y; - external set z(CSSNumberish value); + external set y(CSSNumberish value); + + /// The **`z`** property of the + /// [CSSScale] interface representing the z-component of the translating + /// vector. A positive value moves the element towards the viewer, and a + /// negative value + /// farther away. + /// + /// If this value is present then the transform is a 3D transform and the + /// `is2D` + /// property will be set to false. external CSSNumberish get z; + external set z(CSSNumberish value); } /// The **`CSSSkew`** interface of the is part of the [CSSTransformValue] @@ -546,10 +664,17 @@ extension type CSSSkew._(JSObject _) CSSNumericValue ay, ); - external set ax(CSSNumericValue value); + /// The **`ax`** property of the + /// [CSSSkew] interface gets and sets the angle used to distort the element + /// along the x-axis (or abscissa). external CSSNumericValue get ax; - external set ay(CSSNumericValue value); + external set ax(CSSNumericValue value); + + /// The **`ay`** property of the + /// [CSSSkew] interface gets and sets the angle used to distort the element + /// along the y-axis (or ordinate). external CSSNumericValue get ay; + external set ay(CSSNumericValue value); } /// The **`CSSSkewX`** interface of the represents the @@ -565,8 +690,11 @@ extension type CSSSkewX._(JSObject _) implements CSSTransformComponent, JSObject { external factory CSSSkewX(CSSNumericValue ax); - external set ax(CSSNumericValue value); + /// The **`ax`** property of the + /// [CSSSkewX] interface gets and sets the angle used to distort the element + /// along the x-axis (or abscissa). external CSSNumericValue get ax; + external set ax(CSSNumericValue value); } /// The **`CSSSkewY`** interface of the represents the @@ -582,8 +710,11 @@ extension type CSSSkewY._(JSObject _) implements CSSTransformComponent, JSObject { external factory CSSSkewY(CSSNumericValue ay); - external set ay(CSSNumericValue value); + /// The **`ay`** property of the + /// [CSSSkewY] interface gets and sets the angle used to distort the element + /// along the y-axis (or ordinate). external CSSNumericValue get ay; + external set ay(CSSNumericValue value); } /// The **`CSSPerspective`** interface of the represents the @@ -599,8 +730,14 @@ extension type CSSPerspective._(JSObject _) implements CSSTransformComponent, JSObject { external factory CSSPerspective(CSSPerspectiveValue length); - external set length(CSSPerspectiveValue value); + /// The **`length`** property of the + /// [CSSPerspective] interface sets the distance from z=0. + /// + /// It is used to apply a perspective transform to the element and its + /// content. If the + /// value is 0 or a negative number, no perspective transform is applied. external CSSPerspectiveValue get length; + external set length(CSSPerspectiveValue value); } /// The **`CSSMatrixComponent`** interface of the represents the @@ -621,14 +758,23 @@ extension type CSSMatrixComponent._(JSObject _) CSSMatrixComponentOptions options, ]); - external set matrix(DOMMatrix value); + /// The **`matrix`** property of the + /// [CSSMatrixComponent] interface gets and sets a 2d or 3d matrix. + /// + /// See the + /// [matrix()](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix) + /// and + /// [matrix3d()](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d) + /// pages for + /// examples. external DOMMatrix get matrix; + external set matrix(DOMMatrix value); } extension type CSSMatrixComponentOptions._(JSObject _) implements JSObject { external factory CSSMatrixComponentOptions({bool is2D}); - external set is2D(bool value); external bool get is2D; + external set is2D(bool value); } /// The **`CSSImageValue`** interface of the @@ -659,14 +805,14 @@ extension type CSSRGB._(JSObject _) implements CSSColorValue, JSObject { CSSColorPercent alpha, ]); - external set r(CSSColorRGBComp value); external CSSColorRGBComp get r; - external set g(CSSColorRGBComp value); + external set r(CSSColorRGBComp value); external CSSColorRGBComp get g; - external set b(CSSColorRGBComp value); + external set g(CSSColorRGBComp value); external CSSColorRGBComp get b; - external set alpha(CSSColorPercent value); + external set b(CSSColorRGBComp value); external CSSColorPercent get alpha; + external set alpha(CSSColorPercent value); } extension type CSSHSL._(JSObject _) implements CSSColorValue, JSObject { external factory CSSHSL( @@ -676,14 +822,14 @@ extension type CSSHSL._(JSObject _) implements CSSColorValue, JSObject { CSSColorPercent alpha, ]); - external set h(CSSColorAngle value); external CSSColorAngle get h; - external set s(CSSColorPercent value); + external set h(CSSColorAngle value); external CSSColorPercent get s; - external set l(CSSColorPercent value); + external set s(CSSColorPercent value); external CSSColorPercent get l; - external set alpha(CSSColorPercent value); + external set l(CSSColorPercent value); external CSSColorPercent get alpha; + external set alpha(CSSColorPercent value); } extension type CSSHWB._(JSObject _) implements CSSColorValue, JSObject { external factory CSSHWB( @@ -693,14 +839,14 @@ extension type CSSHWB._(JSObject _) implements CSSColorValue, JSObject { CSSNumberish alpha, ]); - external set h(CSSNumericValue value); external CSSNumericValue get h; - external set w(CSSNumberish value); + external set h(CSSNumericValue value); external CSSNumberish get w; - external set b(CSSNumberish value); + external set w(CSSNumberish value); external CSSNumberish get b; - external set alpha(CSSNumberish value); + external set b(CSSNumberish value); external CSSNumberish get alpha; + external set alpha(CSSNumberish value); } extension type CSSLab._(JSObject _) implements CSSColorValue, JSObject { external factory CSSLab( @@ -710,14 +856,14 @@ extension type CSSLab._(JSObject _) implements CSSColorValue, JSObject { CSSColorPercent alpha, ]); - external set l(CSSColorPercent value); external CSSColorPercent get l; - external set a(CSSColorNumber value); + external set l(CSSColorPercent value); external CSSColorNumber get a; - external set b(CSSColorNumber value); + external set a(CSSColorNumber value); external CSSColorNumber get b; - external set alpha(CSSColorPercent value); + external set b(CSSColorNumber value); external CSSColorPercent get alpha; + external set alpha(CSSColorPercent value); } extension type CSSLCH._(JSObject _) implements CSSColorValue, JSObject { external factory CSSLCH( @@ -727,14 +873,14 @@ extension type CSSLCH._(JSObject _) implements CSSColorValue, JSObject { CSSColorPercent alpha, ]); - external set l(CSSColorPercent value); external CSSColorPercent get l; - external set c(CSSColorPercent value); + external set l(CSSColorPercent value); external CSSColorPercent get c; - external set h(CSSColorAngle value); + external set c(CSSColorPercent value); external CSSColorAngle get h; - external set alpha(CSSColorPercent value); + external set h(CSSColorAngle value); external CSSColorPercent get alpha; + external set alpha(CSSColorPercent value); } extension type CSSOKLab._(JSObject _) implements CSSColorValue, JSObject { external factory CSSOKLab( @@ -744,14 +890,14 @@ extension type CSSOKLab._(JSObject _) implements CSSColorValue, JSObject { CSSColorPercent alpha, ]); - external set l(CSSColorPercent value); external CSSColorPercent get l; - external set a(CSSColorNumber value); + external set l(CSSColorPercent value); external CSSColorNumber get a; - external set b(CSSColorNumber value); + external set a(CSSColorNumber value); external CSSColorNumber get b; - external set alpha(CSSColorPercent value); + external set b(CSSColorNumber value); external CSSColorPercent get alpha; + external set alpha(CSSColorPercent value); } extension type CSSOKLCH._(JSObject _) implements CSSColorValue, JSObject { external factory CSSOKLCH( @@ -761,14 +907,14 @@ extension type CSSOKLCH._(JSObject _) implements CSSColorValue, JSObject { CSSColorPercent alpha, ]); - external set l(CSSColorPercent value); external CSSColorPercent get l; - external set c(CSSColorPercent value); + external set l(CSSColorPercent value); external CSSColorPercent get c; - external set h(CSSColorAngle value); + external set c(CSSColorPercent value); external CSSColorAngle get h; - external set alpha(CSSColorPercent value); + external set h(CSSColorAngle value); external CSSColorPercent get alpha; + external set alpha(CSSColorPercent value); } extension type CSSColor._(JSObject _) implements CSSColorValue, JSObject { external factory CSSColor( @@ -777,10 +923,10 @@ extension type CSSColor._(JSObject _) implements CSSColorValue, JSObject { CSSNumberish alpha, ]); - external set colorSpace(CSSKeywordish value); external CSSKeywordish get colorSpace; - external set channels(JSArray value); + external set colorSpace(CSSKeywordish value); external JSArray get channels; - external set alpha(CSSNumberish value); + external set channels(JSArray value); external CSSNumberish get alpha; + external set alpha(CSSNumberish value); } diff --git a/lib/src/dom/css_view_transitions.dart b/lib/src/dom/css_view_transitions.dart index 0f37ffbf..19ffa14d 100644 --- a/lib/src/dom/css_view_transitions.dart +++ b/lib/src/dom/css_view_transitions.dart @@ -36,7 +36,38 @@ extension type ViewTransition._(JSObject _) implements JSObject { /// transition, but doesn't skip running the [Document.startViewTransition] /// callback that updates the DOM. external void skipTransition(); + + /// The **`updateCallbackDone`** read-only property of the + /// [ViewTransition] interface is a `Promise` that fulfills when the promise + /// returned by the [Document.startViewTransition]'s callback fulfills, or + /// rejects when it rejects. + /// + /// `updateCallbackDone` is useful when you don't care about the + /// success/failure of the transition animation, and just want to know if and + /// when the DOM is updated. external JSPromise get updateCallbackDone; + + /// The **`ready`** read-only property of the + /// [ViewTransition] interface is a `Promise` that fulfills once the + /// pseudo-element tree is created and the transition animation is about to + /// start. + /// + /// `ready` will reject if the transition cannot begin. This can be due to + /// misconfiguration, for example duplicate s, or if the callback passed to + /// [Document.startViewTransition] throws or returns a promise that rejects. external JSPromise get ready; + + /// The **`finished`** read-only property of the + /// [ViewTransition] interface is a `Promise` that fulfills once the + /// transition animation is finished, and the new page view is visible and + /// interactive to the user. + /// + /// `finished` only rejects if the callback passed to + /// [Document.startViewTransition]throws or returns a promise that rejects, + /// which indicates that the new state of the page wasn't created. + /// + /// If a transition animation fails to start, or is skipped during the + /// animation using [ViewTransition.skipTransition], the end state is still + /// reached therefore `finished` still fulfills. external JSPromise get finished; } diff --git a/lib/src/dom/cssom.dart b/lib/src/dom/cssom.dart index bc9f7af2..00be0949 100644 --- a/lib/src/dom/cssom.dart +++ b/lib/src/dom/cssom.dart @@ -42,8 +42,15 @@ extension type MediaList._(JSObject _) implements JSObject { /// The `deleteMedium()` method of the [MediaList] interface removes from this /// `MediaList` the given media query. external void deleteMedium(String medium); - external set mediaText(String value); + + /// The **`mediaText`** property of the [MediaList] + /// interface is a that returns a string representing the + /// `MediaList` as text, and also allows you to set a new `MediaList`. external String get mediaText; + external set mediaText(String value); + + /// The read-only **`length`** property of the [MediaList] interface returns + /// the number of media queries in the list. external int get length; } @@ -56,14 +63,60 @@ extension type MediaList._(JSObject _) implements JSObject { /// API documentation sourced from /// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet). extension type StyleSheet._(JSObject _) implements JSObject { + /// The **`type`** property of the [StyleSheet] + /// interface specifies the style sheet language for the given style sheet. external String get type; + + /// The **`href`** property of the [StyleSheet] + /// interface returns the location of the style sheet. + /// + /// This property is read-only. external String? get href; + + /// The **`ownerNode`** property of the + /// [StyleSheet] interface returns the node that associates this style sheet + /// with the document. + /// + /// This is usually an HTML + /// [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) + /// or + /// [`