diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index b6ef42369252761274a3495ba5569b7ddee701fc..dab0ca35eed4f8daf8e23153180a1f873096ddfa 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -18,26 +18,6 @@ * @kit ArkUI */ -/** - * The type for SpringLoadingContext, see the detailed description in dragController. - * - * @typedef {import('../api/@ohos.arkui.dragController').default.SpringLoadingContext} SpringLoadingContext - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ -declare type SpringLoadingContext = import('../api/@ohos.arkui.dragController').default.SpringLoadingContext; - -/** - * The type for DragSpringLoadingConfiguration, see the detailed description in dragController. - * - * @typedef {import('../api/@ohos.arkui.dragController').default.DragSpringLoadingConfiguration} DragSpringLoadingConfiguration - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ -declare type DragSpringLoadingConfiguration = import('../api/@ohos.arkui.dragController').default.DragSpringLoadingConfiguration; - /** * Defines the options of Component ClassDecorator. * @@ -27462,36 +27442,6 @@ declare class CommonMethod { * @since 19 */ accessibilityFocusDrawLevel(drawLevel: FocusDrawLevel): T; - - /** - * Enables the component as a drag-and-drop target with spring loading functionality. - * - * When a dragged object hovers over the target, it triggers a callback notification. Spring Loading is an enhanced - * feature for drag-and-drop operations, allowing users to automatically trigger view transitions during dragging - * by hovering (hover) without needing to use another hand. - * This feature is primarily designed to enhance the smoothness and efficiency of drag-and-drop operations. Below are - * some common scenarios suitable for supporting this feature: - * - In a file manager, when dragging a file and hovering over a folder, the folder is automatically opened. - * - On a desktop launcher, when dragging a file and hovering over an application icon, the application is - * automatically opened. - * - * Please note: - * 1. Registering spring-loaded or drag-and-drop events (onDragEnter/Move/Leave/Drop) on a control makes it a - * drag-and-drop target. Only one target can be the responder at the same time when user drags and hovers on, and - * child controls always have higher priority. - * 2. Once a complete spring loading is triggered on a component, new spring loading detection will only occur after the - * dragged object leaves and re-enters the component's range. - * - * @param { Callback | null } callback Registers the callback for spring loading response, or - * sets it to null to reset the component's support for spring loading. - * @param { dragController.DragSpringLoadingConfiguration } configuration The initialized spring loading configuration which is - * only used when the entire spring detecting. - * @returns { T } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - onDragSpringLoading(callback: Callback | null, configuration?: DragSpringLoadingConfiguration): T; } /** diff --git a/api/@ohos.arkui.dragController.d.ts b/api/@ohos.arkui.dragController.d.ts index eaf42e314c08acf88dbfb2962011ece5cde43612..9d94a33e049162c2f1351016b7da131fc178bdce 100644 --- a/api/@ohos.arkui.dragController.d.ts +++ b/api/@ohos.arkui.dragController.d.ts @@ -866,211 +866,6 @@ declare namespace dragController { */ READY = 1, } - - /** - * Defines the drag spring loading state. - * Under default system configuration, if no CANCEL occurs, the state reporting is as follows: - * Hover still--500ms-->BEGIN-->100ms-->UPDATE-->100ms-->UPDATE-->100ms-->UPDATE-->100ms-->END - * - * @enum { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - enum DragSpringLoadingState { - /** - * The user has remained stationary for a period, initiating the spring loading process. - * This state allows for some preparatory operations during spring loading. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - BEGIN, - /** - * Already in the spring loading state. The system periodically checks the user's hover status. - * If the user remains stationary, it triggers an UPDATE state notification at regular intervals. - * This state allows for UI effect refreshes to emphasize the hover state. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - UPDATE, - /** - * The entire spring loading state ends. The application can perform cleanup operations - * and execute navigation or view switching actions when this state occurs. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - END, - /** - * After entering the BEGIN state, if the user moves out of the component range, exceeds the displacement - * threshold, lifts the finger, or switches windows (pull out), the CANCEL state is triggered. - * The application should restore the UI style and cancel any pending navigation or view switching actions. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - CANCEL - } - - /** - * Defines parameters affecting spring loading detection. Typically, default system configurations suffice. - * Customization can be done by specifying the config when binding onDragSpringLoading or dynamically modifying it - * using the updateConfiguration method during the BEGIN state. - * - * @typedef { DragSpringLoadingConfiguration } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - interface DragSpringLoadingConfiguration { - /** - * Time interval to maintain a stationary state before entering spring loading. Default: 500 ms. - * - * @type { ?number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - stillTimeLimit?: number; - - /** - * Interval between update notifications after entering the spring loading state. Default: 100ms. - * - * @type { ?number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - updateInterval?: number; - - /** - * Maximum number of update notifications to report while in the spring loading state. Default: 3. - * - * @type { ?number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - updateNotifyCount?: number; - - /** - * Maximum wait time from the last UPDATE state to the end of spring loading. Default: 100ms. - * - * @type { ?number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - updateToFinishInterval?: number; - } - - /** - * Defines drag-related information when triggering spring loading callbacks. - * This interface provides drag data summaries and additional drag information, useful for applications - * needing to dynamically determine whether to respond to spring loading callbacks based on drag data. - * - * @typedef { SpringLoadingDragInfos } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - interface SpringLoadingDragInfos { - /** - * Summary of the dragged data. This field is absent if the source application did not configure data. - * - * @type { ?unifiedDataChannel.Summary } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - dataSummary?: unifiedDataChannel.Summary; - /** - * Summary of the dragged data. This field is absent if the source application did not configure data. - * - * @type { ?unifiedDataChannel.Summary } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - extraInfos?: string; - } - - /** - * Context information for the current spring loading trigger. This object is passed to the application - * in the spring loading callback, allowing it to obtain the current state, dynamically refresh UI effects, - * and access drag data to determine whether to handle the drag operation. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - class SpringLoadingContext { - /** - * Current spring loading state. Refer to the DragSpringLoadingState enum for details. - * - * @type { DragSpringLoadingState } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - state: DragSpringLoadingState; - /** - * Sequence number of the current spring loading state notification. Begins at 0 for BEGIN and increments - * with each callback. - * - * @type { number } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - currentNotifySequence: number; - /** - * Drag-related information. Absent when the state is CANCEL. - * - * @type { ?SpringLoadingDragInfos } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - dragInfos?: SpringLoadingDragInfos; - /** - * Current spring loading configuration. Absent when the state is CANCEL. - * - * @type { ?DragSpringLoadingConfiguration } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - currentConfig?: DragSpringLoadingConfiguration; - /** - * Aborts subsequent spring loading triggers. - * Note: Aborting does not trigger a CANCEL notification, the application must handle state cleanup when aborting. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - abort(): void; - /** - * Updates the spring loading configuration for the current trigger. Only effective during the BEGIN state. - * This method does not modify the original configuration set during onDragSpringLoading binding. - * It provides an opportunity for dynamic configuration updates during the current trigger. - * Typically, applications should use default configurations or set them once during binding. - * Use this method sparingly, e.g., for different drag data types requiring varied UX timing. - * - * @param { config } The spring loading detection configuration - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - */ - updateConfiguration(config: DragSpringLoadingConfiguration): void; - } } export default dragController;