Ai
46 Star 180 Fork 4.8K

OpenHarmony/interface_sdk-js
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.arkui.ArcSwiper.d.ts 15.59 KB
一键复制 编辑 原始数据 按行查看 历史
罗希 提交于 2025-08-29 10:22 +08:00 . fix api warning
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
/*
* Copyright (c) 2024 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
*/
/**
* Handler of swiper controller, used in finishAnimation.
*
* @typedef { function } FinishAnimationHandler
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
declare type FinishAnimationHandler = () => void;
/**
* Provide methods for controlling ArcSwiper component.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
export class ArcSwiperController {
/**
* A constructor used to create a ArcSwiperController object.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
constructor();
/**
* Show next subcomponent.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
showNext();
/**
* Show previous subcomponent.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
showPrevious();
/**
* Finish the swiper animation.
*
* @param { FinishAnimationHandler } [handler] - The handler is used to listen for the end of the animation.
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
finishAnimation(handler?: FinishAnimationHandler);
}
/**
* Declare the direction of arc indicator.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
export enum ArcDirection {
/**
* 3 o'clock direction.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
THREE_CLOCK_DIRECTION = 0,
/**
* 6 o'clock direction.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
SIX_CLOCK_DIRECTION = 1,
/**
* 9 o'clock direction.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
NINE_CLOCK_DIRECTION = 2,
}
/**
* Define ArcDotIndicator, the indicator type is arc dot.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
export class ArcDotIndicator {
/**
* A constructor used to create a ArcDotIndicator object.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
constructor();
/**
* Set the direction of arc indicator.
*
* @param { Optional<ArcDirection> } direction - the direction of arc indicator, default value is { ArcDirection.SIX_CLOCK_DIRECTION }.
* @returns { ArcDotIndicator }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
arcDirection(direction: Optional<ArcDirection>): ArcDotIndicator;
/**
* Set the navigation point color.
*
* @param { Optional<ResourceColor> } color - the indicator item color, default value is { #A9FFFFFF }.
* @returns { ArcDotIndicator }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
itemColor(color: Optional<ResourceColor>): ArcDotIndicator;
/**
* Set the selected navigation point color.
*
* @param { Optional<ResourceColor> } color - the indicator item when selected, default value is { #FF5EA1FF }.
* @returns { ArcDotIndicator }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
selectedItemColor(color: Optional<ResourceColor>): ArcDotIndicator;
/**
* Set the background color.
*
* @param { Optional<ResourceColor> } color - the background color, default value is { #FF404040 }.
* @returns { ArcDotIndicator }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
backgroundColor(color: Optional<ResourceColor>): ArcDotIndicator;
/**
* Set the gradient color for the mask.
*
* @param { Optional<LinearGradient> } color - the gradient color, default start color is { #00000000 }, default end color is { #FF000000 }.
* @returns { ArcDotIndicator }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
maskColor(color: Optional<LinearGradient>): ArcDotIndicator;
}
/**
* Provide an interface for ArcSwiper.
*
* @interface ArcSwiperInterface
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
interface ArcSwiperInterface {
/**
* Create ArcSwiper component.
*
* @param { ArcSwiperController } [controller]
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
(controller?: ArcSwiperController): ArcSwiperAttribute;
}
/**
* Handler of swiper, used in OnChange.
*
* @typedef { function } IndexChangedHandler
* @param { number } index - The index of the current swiper.
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
declare 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
* @crossplatform
* @atomicservice
* @since 18
*/
declare 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
* @crossplatform
* @atomicservice
* @since 18
*/
declare 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
* @crossplatform
* @atomicservice
* @since 18
*/
declare type GestureSwipeHandler = (index: number, event: SwiperAnimationEvent) => void;
/**
* Defines the swiper content animated transition options.
*
* @interface SwiperContentAnimatedTransition
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
declare interface SwiperContentAnimatedTransition {
/**
* Defines the timeout of custom content transition animation after the page is moved out of the swiper. The unit is ms.
* If SwiperContentTransitionProxy.finishTransition() is not invoked, use the timeout as animation end time.
*
* @type { ?number }
* @default 0 ms
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
timeout?: number;
/**
* Called when custom content transition animation start.
*
* @type { Callback<SwiperContentTransitionProxy> }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
transition: Callback<SwiperContentTransitionProxy>;
}
/**
*The proxy object returned to the developer during the execution of the Swiper custom content transition animation.
*
* @interface SwiperContentTransitionProxy
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
declare interface SwiperContentTransitionProxy {
/**
* the index value of the swiper content selected before animation start.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
selectedIndex: number;
/**
* The index value of the swiper content.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
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
* @crossplatform
* @atomicservice
* @since 18
*/
position: number;
/**
* the swiper main axis length for calculating position.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
mainAxisLength: number;
/**
* Notifies Swiper page the custom content transition animation is complete.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
finishTransition(): void;
}
/**
* Defines the Arc swiper attribute functions.
*
* @extends CommonMethod<ArcSwiperAttribute>
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
declare class ArcSwiperAttribute extends CommonMethod<ArcSwiperAttribute> {
/**
* Set the index value of the displayed subcomponent.
*
* @param { Optional<number> } index - The index value of the subcomponents to be displayed, default value is { 0 }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
index(index: Optional<number>): ArcSwiperAttribute;
/**
* Set whether the indicator is available or set the indicator style.
*
* @param { Optional<ArcDotIndicator | boolean> } style - The style information of the indicator or whether to
* display the indicator, default value is { true }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
indicator(style: Optional<ArcDotIndicator | boolean>): ArcSwiperAttribute;
/**
* Set the animation duration of the switch in ms.
*
* @param { Optional<number> } duration - Duration of animation, default value is { 400ms }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
duration(duration: Optional<number>): ArcSwiperAttribute;
/**
* Set whether to slide vertically.
*
* @param { Optional<boolean> } isVertical - The value indicates whether to slide vertically, default value is { false }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
vertical(isVertical: Optional<boolean>): ArcSwiperAttribute;
/**
* Set whether to disable sliding function.
*
* @param { Optional<boolean> } disabled - The value indicates whether the sliding function is enabled, default value is { false }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
disableSwipe(disabled: Optional<boolean>): ArcSwiperAttribute;
/**
* Set the sensitivity of rotating crown.
*
* @param { Optional<CrownSensitivity> } sensitivity - The sensitivity of rotating crown, default value is { MEDIUM }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
digitalCrownSensitivity(sensitivity: Optional<CrownSensitivity>): ArcSwiperAttribute;
/**
* Called when the index value has changed.
*
* @param { Optional<IndexChangedHandler> } handler - The handler is used to listen for index values that have changed.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
onChange(handler: Optional<IndexChangedHandler>): ArcSwiperAttribute;
/**
* Called when the swiper animation has started.
*
* @param { Optional<AnimationStartHandler> } handler - The handler is used to listen for the animation has started.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
onAnimationStart(handler: Optional<AnimationStartHandler>): ArcSwiperAttribute;
/**
* Called when the swiper animation has ended.
*
* @param { Optional<AnimationEndHandler> } handler - The handler is used to listen for the animation has ended.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
onAnimationEnd(handler: Optional<AnimationEndHandler>): ArcSwiperAttribute;
/**
* Called when swiping the switch using gestures.
*
* @param { Optional<GestureSwipeHandler> } handler - The handler is used to listen for swiping through gestures.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
onGestureSwipe(handler: Optional<GestureSwipeHandler>): ArcSwiperAttribute;
/**
* Set effect when scrolling over edge.
*
* @param { Optional<EdgeEffect> } edgeEffect - scrolling effect over edge, default value is { EdgeEffect.Spring }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
effectMode(edgeEffect: Optional<EdgeEffect>): ArcSwiperAttribute;
/**
* Custom swiper content transition animation.
*
* @param { Optional<SwiperContentAnimatedTransition> } transition - custom content transition animation.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
customContentTransition(transition: Optional<SwiperContentAnimatedTransition>): ArcSwiperAttribute;
/**
* Custom swiper content transition animation.
*
* @param { Optional<boolean> } disabled - the value indicates whether to disable the transition animation, default value is { false }.
* @returns { ArcSwiperAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
disableTransitionAnimation(disabled: Optional<boolean>): ArcSwiperAttribute;
}
/**
* Defines the ArcSwiper Component that can provide the ability for sub components to swipe and display.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
/**
* Defines the ArcSwiper Component that can provide the ability for sub components to swipe and display.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @uicomponent
* @since 19
*/
declare let ArcSwiper: ArcSwiperInterface;
/**
* Defines ArcSwiper Component instance.
*
* @syscap SystemCapability.ArkUI.ArkUI.Circle
* @crossplatform
* @atomicservice
* @since 18
*/
declare let ArcSwiperInstance: ArcSwiperAttribute;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助