/* * 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 */ /** * Called when the start, end and center positions of the display change. * * @typedef { function } ArcScrollIndexHandler * @param { number } start - the start index of the display area. * @param { number } end - the end index of the display area. * @param { number } center - the center index of the display area. * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ declare type ArcScrollIndexHandler = (start: number, end: number, center: number) => void; /** * Defines the arc list options. * * @interface ArkListOptions * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ declare interface ArkListOptions { /** * Describes the index of initial item, the default value is 0. * * @type { ?number } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ initialIndex?: number; /** * Describes the controller for scrollable container. * * @type { ?Scroller } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ scroller?: Scroller; /** * Describes the header. * * @type { ?ComponentContent } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ header?: ComponentContent; } /** * Defines the arc list component. * * @interface ArcListInterface * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ export interface ArcListInterface { /** * Creates the arc list component. * * @param { ArkListOptions } [options] * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ (options?: ArkListOptions): ArcListAttribute; } /** * Defines the arc list item component. * * @interface ArcListItemInterface * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ export interface ArcListItemInterface { /** * Creates the arc list item component. * * @returns { ArcListItemAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ (): ArcListItemAttribute; } /** * Defines the arc list attribute functions. * * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ export declare class ArcListAttribute extends CommonMethod { /** * Set the digital crown sensitivity. * * @param { Optional } sensitivity * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ digitalCrownSensitivity(sensitivity: Optional): ArcListAttribute; /** * Set the space between items. * * @param { Optional } space - The space between items. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ space(space: Optional): ArcListAttribute; /** * Set the display mode of the side slider. * * @param { Optional } status * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ scrollBar(status: Optional): ArcListAttribute; /** * Color of the scrollbar. * * @param { Optional } color - Color of the scrollbar. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ scrollBarColor(color: Optional): ArcListAttribute; /** * Width of the scrollbar. * * @param { Optional } width - Width of the scrollbar. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ scrollBarWidth(width: Optional): ArcListAttribute; /** * Set the minimum number of list item caches for long list deferred loading. * * @param { Optional } count * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ cachedCount(count: Optional): ArcListAttribute; /** * Whether to enable chain linkage dynamic effect. * * @param { Optional } enable * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ chainAnimation(enable: Optional): ArcListAttribute; /** * Set the children main size for arc list. * * @param { Optional } size - children main size for arc list * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ childrenMainSize(size: Optional): ArcListAttribute; /** * Whether to enable scroll by gesture or mouse. * * @param { Optional } enable * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ enableScrollInteraction(enable: Optional): ArcListAttribute; /** * Whether to enable fading Edge effect. * * @param { Optional } enable * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ fadingEdge(enable: Optional): ArcListAttribute; /** * Friction coefficient. * * @param { Optional } friction - friction coefficient. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ friction(friction: Optional): ArcListAttribute; /** * Limit the max speed when fling. * * @param { Optional } speed - Max fling speed, the value needs to be a positive number, the maximum value is not limited. * The unit is vp/s. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ flingSpeedLimit(speed: Optional): ArcListAttribute; /** * Called when the start, end and center positions of the display change. * * @param { Optional } handler * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onScrollIndex(handler: Optional): ArcListAttribute; /** * Called when the list begins to arrive. * * @param { Optional } handler * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onReachStart(handler: Optional): ArcListAttribute; /** * Called when the list reaches the end. * * @param { Optional } handler * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onReachEnd(handler: Optional): ArcListAttribute; /** * Called when the slider start. * * @param { Optional } handler * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onScrollStart(handler: Optional): ArcListAttribute; /** * Called when the slider stops. * * @param { Optional } handler * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onScrollStop(handler: Optional): ArcListAttribute; /** * Called when the scrollable will scroll. * * @param { Optional } handler - callback of scrollable. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onWillScroll(handler: Optional): ArcListAttribute; /** * Called when the scrollable did scroll. * * @param { Optional } handler - callback of scrollable, * scrollOffset is offset this frame did scroll, scrollState is current scroll state. * @returns { ArcListAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ onDidScroll(handler: Optional): ArcListAttribute; } /** * Defines the arc list item attribute functions. * * @extends CommonMethod * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ export declare class ArcListItemAttribute extends CommonMethod { /** * Whether to enable auto scale when layout. * * @param { Optional } enable * @returns { ArcListItemAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ autoScale(enable: Optional): ArcListItemAttribute; /** * Sets the action item that appears when the list item slides in the cross axis direction of the list. * * @param { Optional } options - items defines in the SwipeActionOption. * @returns { ArcListItemAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ swipeAction(options: Optional): ArcListItemAttribute; } /** * Defines ArcList Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ export declare const ArcListInstance: ArcListAttribute; /** * Defines ArcListItem Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ export declare const ArcListItemInstance: ArcListItemAttribute; /** * Defines ArcList Component. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ /** * Defines ArcList Component. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @uicomponent * @since 19 */ export declare const ArcList: ArcListInterface; /** * Defines ArcListItem Component. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @since 18 */ /** * Defines ArcListItem Component. * * @syscap SystemCapability.ArkUI.ArkUI.Circle * @crossplatform * @atomicservice * @uicomponent * @since 19 */ export declare const ArcListItem: ArcListItemInterface;