From 55ab0fbd43e18a75b16b9cf6009f437890122ef8 Mon Sep 17 00:00:00 2001 From: SQ Date: Thu, 21 Aug 2025 19:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E7=B1=BB=E7=BB=84=E4=BB=B6un?= =?UTF-8?q?defined=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SQ --- api/@ohos.arkui.ArcSwiper.static.d.ets | 479 ++++++++++++++++++++++++ api/arkui/component/swiper.static.d.ets | 139 ++++--- 2 files changed, 574 insertions(+), 44 deletions(-) create mode 100644 api/@ohos.arkui.ArcSwiper.static.d.ets diff --git a/api/@ohos.arkui.ArcSwiper.static.d.ets b/api/@ohos.arkui.ArcSwiper.static.d.ets new file mode 100644 index 0000000000..1f0d638f95 --- /dev/null +++ b/api/@ohos.arkui.ArcSwiper.static.d.ets @@ -0,0 +1,479 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { SwiperAnimationEvent } from './arkui/component/swiper'; +import { CrownSensitivity, EdgeEffect } from './arkui/component/enums'; +import { LinearGradient } from './arkui/component/dataPanel'; +import { ResourceColor } from './arkui/component/units'; +import { CommonMethod, Callback } from './arkui/component/common'; +import { memo, ComponentBuilder } from './arkui/stateManagement/runtime'; +/** + * Handler of swiper controller, used in finishAnimation. + * + * @typedef { function } FinishAnimationHandler + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export type FinishAnimationHandler = () => void; + +/** + * Provide methods for controlling ArcSwiper component. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export declare class ArcSwiperController { + /** + * A constructor used to create a ArcSwiperController object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + constructor(); + + /** + * Show next subcomponent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + showNext(): void; + + /** + * Show previous subcomponent. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + showPrevious(): void; + + /** + * Finish the swiper animation. + * + * @param { FinishAnimationHandler } [handler] - The handler is used to listen for the end of the animation. + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + finishAnimation(handler?: FinishAnimationHandler): void; +} + +/** + * Declare the direction of arc indicator. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export declare enum ArcDirection { + /** + * 3 o'clock direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + THREE_CLOCK_DIRECTION = 0, + + /** + * 6 o'clock direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + SIX_CLOCK_DIRECTION = 1, + + /** + * 9 o'clock direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + NINE_CLOCK_DIRECTION = 2, +} + +/** + * Define ArcDotIndicator, the indicator type is arc dot. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export declare class ArcDotIndicator { + /** + * A constructor used to create a ArcDotIndicator object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + constructor(); + + /** + * Set the direction of arc indicator. + * + * @param { ArcDirection | undefined } direction - the direction of arc indicator, + * default value is { ArcDirection.SIX_CLOCK_DIRECTION }, + * undefined means setting to default value. + * @returns { ArcDotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + arcDirection(direction: ArcDirection | undefined): ArcDotIndicator; + + /** + * Set the navigation point color. + * + * @param { ResourceColor | undefined } color - the indicator item color, + * default value is { #A9FFFFFF }, undefined means setting to default value. + * @returns { ArcDotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + itemColor(color: ResourceColor | undefined): ArcDotIndicator; + + /** + * Set the selected navigation point color. + * + * @param { ResourceColor | undefined } color - the indicator item when selected, + * default value is { #FF5EA1FF }, undefined means setting to default value. + * @returns { ArcDotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + selectedItemColor(color: ResourceColor | undefined): ArcDotIndicator; + + /** + * Set the background color. + * + * @param { ResourceColor | undefined } color - the background color, default value is { #FF404040 }, + * undefined means setting to default value. + * @returns { ArcDotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + backgroundColor(color: ResourceColor | undefined): ArcDotIndicator; + + /** + * Set the gradient color for the mask. + * + * @param { LinearGradient | undefined } color - the gradient color, default start color is { #00000000 }, + * default end color is { #FF000000 }, undefined means setting to default value. + * @returns { ArcDotIndicator } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + maskColor(color: LinearGradient | undefined): ArcDotIndicator; +} + +/** + * Handler of swiper, used in OnChange. + * + * @typedef { function } IndexChangedHandler + * @param { number } index - The index of the current swiper. + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export type IndexChangedHandler = (index: number) => void; + +/** + * Handler of swiper, used in OnAnimationStart. + * + * @typedef { function } AnimationStartHandler + * @param { number } index - The index of the current swiper. + * @param { number } targetIndex - The index of the target swiper. + * @param { SwiperAnimationEvent } event - The extra information of the animation. + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export type AnimationStartHandler = (index: number, targetIndex: number, event: SwiperAnimationEvent) => void; + +/** + * Handler of swiper, used in OnAnimationEnd. + * + * @typedef { function } AnimationEndHandler + * @param { number } index - The index of the current swiper. + * @param { SwiperAnimationEvent } event - The extra information of the animation. + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export type AnimationEndHandler = (index: number, event: SwiperAnimationEvent) => void; + +/** + * Handler of swiper, used in OnGestureSwipe. + * + * @typedef { function } GestureSwipeHandler + * @param { number } index - The index of the current swiper. + * @param { SwiperAnimationEvent } event - The extra information of the animation. + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export type GestureSwipeHandler = (index: number, event: SwiperAnimationEvent) => void; + + +/** + * Defines the swiper content animated transition options. + * + * @interface ArcSwiperContentAnimatedTransition + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export declare interface ArcSwiperContentAnimatedTransition { + /** + * Defines the timeout of custom content transition animation after the page is moved out of the swiper. + * The unit is ms. + * If ArcSwiperContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time. + * + * @type { ?number } + * @default 0 ms + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + timeout?: number; + + /** + * Called when custom content transition animation start. + * + * @type { Callback } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + transition: Callback; +} + +/** + *The proxy object returned to the developer during the execution of the Swiper custom content transition animation. + * + * @interface ArcSwiperContentTransitionProxy + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export declare interface ArcSwiperContentTransitionProxy { + /** + * the index value of the swiper content selected before animation start. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + selectedIndex: number; + + /** + * The index value of the swiper content. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + index: number; + + /** + * the moving ratio of the swiper content from the start position of the swiper main axis. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + position: number; + + /** + * the swiper main axis length for calculating position. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + mainAxisLength: number; + + /** + * Notifies Swiper page the custom content transition animation is complete. + * + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + finishTransition(): void; +} + +/** + * Defines the Arc swiper attribute functions. + * + * @extends CommonMethod + * @typedef ArcSwiperAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ +export declare interface ArcSwiperAttribute extends CommonMethod { + /** + * Set the index value of the displayed subcomponent. + * + * @param { number | undefined } index - The index value of the subcomponents to be displayed, + * default value is { 0 }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default index(index: number | undefined): this; + + /** + * Set whether the indicator is available or set the indicator style. + * + * @param { ArcDotIndicator | boolean | undefined } style - The style information of the indicator or whether to + * display the indicator, default value is { true }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default indicator(style: ArcDotIndicator | boolean | undefined): this; + + /** + * Set the animation duration of the switch in ms. + * + * @param { number | undefined } duration - Duration of animation, default value is { 400ms }, + * undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default duration(duration: number | undefined): this; + + /** + * Set whether to slide vertically. + * + * @param { boolean | undefined } isVertical - The value indicates whether to slide vertically, + * default value is { false }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default vertical(isVertical: boolean | undefined): this; + + /** + * Set whether to disable sliding function. + * + * @param { boolean | undefined } disabled - The value indicates whether the sliding function is enabled, + * default value is { false }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default disableSwipe(disabled: boolean | undefined): this; + + /** + * Set the sensitivity of rotating crown. + * + * @param { CrownSensitivity | undefined } sensitivity - The sensitivity of rotating crown, + * default value is { MEDIUM }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default digitalCrownSensitivity(sensitivity: CrownSensitivity | undefined): this; + + /** + * Called when the index value has changed. + * + * @param { IndexChangedHandler | undefined } handler - The handler is used to listen for index + * values that have changed, undefined means clear handler. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default onChange(handler: IndexChangedHandler | undefined): this; + + /** + * Called when the swiper animation has started. + * + * @param { AnimationStartHandler | undefined } handler - The handler is used to listen for + * the animation has started, undefined means clear handler. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default onAnimationStart(handler: AnimationStartHandler | undefined): this; + + /** + * Called when the swiper animation has ended. + * + * @param { AnimationEndHandler | undefined } handler - The handler is used to listen for the animation has ended, + * undefined means clear handler. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default onAnimationEnd(handler: AnimationEndHandler | undefined): this; + + /** + * Called when swiping the switch using gestures. + * + * @param { GestureSwipeHandler | undefined } handler - The handler is used to listen for swiping through gestures, + * undefined means clear handler. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default onGestureSwipe(handler: GestureSwipeHandler | undefined): this; + + /** + * Set effect when scrolling over edge. + * + * @param { EdgeEffect | undefined } edgeEffect - scrolling effect over edge, + * default value is { EdgeEffect.Spring }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default effectMode(edgeEffect: EdgeEffect | undefined): this; + + /** + * Custom swiper content transition animation. + * + * @param { ArcSwiperContentAnimatedTransition | undefined } transition - custom content transition animation, + * undefined means clear transition. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default customContentTransition(transition: ArcSwiperContentAnimatedTransition | undefined): this; + + /** + * Custom swiper content transition animation. + * + * @param { boolean | undefined } disabled - the value indicates whether to disable the transition animation, + * default value is { false }, undefined means setting to default value. + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Circle + * @since 20 + */ + default disableTransitionAnimation(disabled: boolean | undefined): this; +} + +/** + * Defines ArcSwiper Component + * + * @param { ArcSwiperController } [controller] - ArcSwiper constructor options + * @param { function } [content_] - container + * @returns { ArcSwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function ArcSwiper( + controller?: ArcSwiperController, + @memo + content_?: () => void, +): ArcSwiperAttribute \ No newline at end of file diff --git a/api/arkui/component/swiper.static.d.ets b/api/arkui/component/swiper.static.d.ets index d0994d8332..7391b73045 100644 --- a/api/arkui/component/swiper.static.d.ets +++ b/api/arkui/component/swiper.static.d.ets @@ -21,7 +21,7 @@ */ import { IndicatorComponentController } from './indicatorcomponent'; -import { CommonMethod, Callback, ICurve, Optional, Bindable, AttributeModifier } from './common'; +import { CommonMethod, Callback, ICurve, Bindable, AttributeModifier } from './common'; import { EdgeEffect, Curve, PageFlipMode } from './enums'; import { Length, LengthMetrics, VoidCallback, ResourceColor, VP, Font } from './units'; import { memo, ComponentBuilder } from './../stateManagement/runtime'; @@ -60,13 +60,15 @@ export declare class SwiperController { /** * Controlling Swiper to change to the specified subcomponent. * - * @param { number } index - the index of item to be redirected. + * @param { number | undefined } index - the index of item to be redirected, default value is 0, + * undefined means setting to default value. * @param { SwiperAnimationMode | boolean } [animationMode] - animation mode for changeIndex, - * true is equivalent to SwiperAnimationMode.DEFAULT_ANIMATION, false is equivalent to SwiperAnimationMode.NO_ANIMATION + * true is equivalent to SwiperAnimationMode.DEFAULT_ANIMATION, + * false is equivalent to SwiperAnimationMode.NO_ANIMATION. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - changeIndex(index: number, animationMode?: SwiperAnimationMode | boolean): void; + changeIndex(index: number | undefined, animationMode?: SwiperAnimationMode | boolean): void; /** * Called when need to stop the swiper animation. @@ -80,7 +82,8 @@ export declare class SwiperController { /** * Called when need to preload specified child. * - * @param { Optional> } indices - Indices of swiper child to be preloaded. + * @param { Array | undefined } indices - Indices of swiper child to be preloaded, + * default value is no swiper child to be preloaded, undefined means setting to default value. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - Parameter invalid. Possible causes: *
1. The parameter type is not Array. @@ -90,7 +93,7 @@ export declare class SwiperController { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - preloadItems(indices: Optional>): Promise; + preloadItems(indices: Array | undefined): Promise; } /** @@ -103,64 +106,88 @@ export declare class Indicator { /** * Set the indicator to the left. * - * @param { Length } value - the indicator to the left. + * @param { Length | undefined } value - the indicator to the left, default value is adaptive size layout, + * centered alignment in the spindle direction according to the size of the indicator itself and + * the size of the swiper, undefined means setting to default value. * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - left(value: Length): T; + left(value: Length | undefined): T; /** * Set the indicator to the top. * - * @param { Length } value - the indicator to the top. + * @param { Length | undefined } value - the indicator to the top, default value is adaptive size layout, + * centered alignment in the spindle direction according to the size of the indicator itself and + * the size of the swiper, undefined means setting to default value. * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - top(value: Length): T; + top(value: Length | undefined): T; /** * Set the indicator to the right. * - * @param { Length } value - the indicator to the right. + * @param { Length | undefined } value - the indicator to the right, default value is adaptive size layout, + * centered alignment in the spindle direction according to the size of the indicator itself and + * the size of the swiper, undefined means setting to default value. * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - right(value: Length): T; + right(value: Length | undefined): T; /** * Set the indicator to the bottom. * - * @param { Length } value - the indicator to the bottom. + * @param { Length | undefined } value - the indicator to the bottom, default value is adaptive size layout, + * centered alignment in the spindle direction according to the size of the indicator itself and + * the size of the swiper, undefined means setting to default value. * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - bottom(value: Length): T; + bottom(value: Length | undefined): T; + + /** + * Sets the position of the navigation indicator relative to the bottom edge of the Swiper component. + * You can also choose to ignore the size of the navigation indicator using the ignoreSize property. + * + * @param { LengthMetrics | Length | undefined } bottom - the offset of indicator to the bottom, + * default value is adaptive size layout, centered alignment in the spindle direction according + * to the size of the indicator itself and the size of the swiper, undefined means setting to default value. + * @param { boolean } ignoreSize - ignore the size of the indicator. + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + bottom(bottom: LengthMetrics | Length | undefined, ignoreSize: boolean): T; /** * Set the indicator to the left in LTR * Set the indicator to the right in RTL * - * @param { LengthMetrics } value - the indicator to the right in LTR, indicator to the left in RTL + * @param { LengthMetrics | undefined } value - the indicator to the right in LTR, indicator to the left in RTL, + * default value is 0.0_vp, undefined means setting to default value. * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - start(value: LengthMetrics): T; + start(value: LengthMetrics | undefined): T; /** * Set the indicator to the left in RTL * Set the indicator to the right in LTR * - * @param { LengthMetrics } value - the indicator to the left in RTL, Set the indicator to the right in LTR + * @param { LengthMetrics | undefined } value - the indicator to the left in RTL, Set the indicator + * to the right in LTR, default value is 0.0_vp, undefined means setting to default value. * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - end(value: LengthMetrics): T; + end(value: LengthMetrics | undefined): T; /** * DotIndicator class object. @@ -202,92 +229,101 @@ export declare class DotIndicator extends Indicator { /** * Set the indicator item width. * - * @param { Length } value - the indicator item width. + * @param { Length | undefined } value - the indicator item width, default value is 6.0_vp, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - itemWidth(value: Length): DotIndicator; + itemWidth(value: Length | undefined): DotIndicator; /** * Set the indicator item height. * - * @param { Length } value - the indicator item height. + * @param { Length | undefined } value - the indicator item height, default value is 6.0_vp, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - itemHeight(value: Length): DotIndicator; + itemHeight(value: Length | undefined): DotIndicator; /** * Set the indicator item width when selected. * - * @param { Length } value - the indicator item width when selected. + * @param { Length | undefined } value - the indicator item width when selected, default value is 6.0_vp, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - selectedItemWidth(value: Length): DotIndicator; + selectedItemWidth(value: Length | undefined): DotIndicator; /** * Set the indicator item height when selected. * - * @param { Length } value - the indicator item height when selected. + * @param { Length | undefined } value - the indicator item height when selected, default value is 6.0_vp, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - selectedItemHeight(value: Length): DotIndicator; + selectedItemHeight(value: Length | undefined): DotIndicator; /** * Setting indicator style mask. * - * @param { boolean } value - the indicator item mask. + * @param { boolean | undefined } value - the indicator item mask, default value is false, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - mask(value: boolean): DotIndicator; + mask(value: boolean | undefined): DotIndicator; /** * Set the indicator color. * - * @param { ResourceColor } value - the indicator item color. + * @param { ResourceColor | undefined } value - the indicator item color, default value is { #18243119 }, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - color(value: ResourceColor): DotIndicator; + color(value: ResourceColor | undefined): DotIndicator; /** * Set the navigation point color. * - * @param { ResourceColor } value - the indicator item when selected. + * @param { ResourceColor | undefined } value - the indicator item when selected, default value is { #007DFFFF }, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - selectedColor(value: ResourceColor): DotIndicator; + selectedColor(value: ResourceColor | undefined): DotIndicator; /** * Set the Indicator maxDisplayCount when selected. * - * @param { number } maxDisplayCount - the indicator item maxDisplayCount when selected. + * @param { number | undefined } maxDisplayCount - the indicator item maxDisplayCount when selected, + * default value is 6, undefined means setting to default value. * @returns { DotIndicator } return the DotIndicator * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - maxDisplayCount(maxDisplayCount: number): DotIndicator; + maxDisplayCount(maxDisplayCount: number | undefined): DotIndicator; /** * Set the space between dots. * - * @param { LengthMetrics } space - the space between dots + * @param { LengthMetrics | undefined } space - the space between dots, default value is 8.0_vp, + * undefined means setting to default value. * @returns { DotIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - space(space: LengthMetrics): DotIndicator; + space(space: LengthMetrics | undefined): DotIndicator; } /** @@ -327,42 +363,46 @@ export declare class DigitIndicator extends Indicator { /** * Set font color of the digital indicator. * - * @param { ResourceColor } value - the indicator font color. + * @param { ResourceColor | undefined } value - the indicator font color, default value is { #FF182431 }, + * undefined means setting to default value. * @returns { DigitIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - fontColor(value: ResourceColor): DigitIndicator; + fontColor(value: ResourceColor | undefined): DigitIndicator; /** * Set font color of the digital indicator when selected. * - * @param { ResourceColor } value - the indicator font color when selected. + * @param { ResourceColor | undefined } value - the indicator font color when selected, + * default value is { #FF182431 }, undefined means setting to default value. * @returns { DigitIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - selectedFontColor(value: ResourceColor): DigitIndicator; + selectedFontColor(value: ResourceColor | undefined): DigitIndicator; /** * Set the digital indicator font (just support font size and weight). * - * @param { Font } value - the indicator font size and weight. + * @param { Font | undefined } value - the indicator font size and weight, + * default value is { size: 14, weight: FontWeight.Normal }, undefined means setting to default value. * @returns { DigitIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - digitFont(value: Font): DigitIndicator; + digitFont(value: Font | undefined): DigitIndicator; /** * Set the digital indicator font (just support font size and weight). * - * @param { Font } value - the indicator font size and weight when selected. + * @param { Font | undefined } value - the indicator font size and weight when selected, + * default value is { size: 14, weight: FontWeight.Normal }, undefined means setting to default value. * @returns { DigitIndicator } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 20 */ - selectedDigitFont(value: Font): DigitIndicator; + selectedDigitFont(value: Font | undefined): DigitIndicator; } /** @@ -626,6 +666,17 @@ export declare interface SwiperAttribute extends CommonMethod { */ default index(value: number | Bindable | undefined): this; + /** + * Sets whether to enable automatic playback for child component switching. + * + * @param { boolean | undefined } value - Whether to enable automatic playback for child component switching, + * default value is false, undefined means setting to default value. + * @returns { SwiperAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default autoPlay(value: boolean | undefined): this; + /** * Set whether the subcomponent plays automatically. * -- Gitee