import { CommonEvent } from '../constants'; import type { RuntimeContext } from '../runtime/types'; import type { ID, IPointerEvent } from '../types'; import type { BaseBehaviorOptions } from './base-behavior'; import { BaseBehavior } from './base-behavior'; /** * 展开/收起元素交互配置项 * * Collapse/Expand combo behavior options */ export interface CollapseExpandOptions extends BaseBehaviorOptions { /** * 是否启用动画 * * Whether to enable animation * @defaultValue true */ animation?: boolean; /** * 是否启用展开/收起功能 * * Whether to enable the expand/collapse function * @defaultValue true */ enable?: boolean | ((event: IPointerEvent) => boolean); /** * 触发方式 * * Trigger method * @defaultValue 'dblclick' */ trigger?: CommonEvent.CLICK | CommonEvent.DBLCLICK; /** * 完成收起时的回调 * * Callback when collapse is completed */ onCollapse?: (id: ID) => void; /** * 完成展开时的回调 * * Callback when expand is completed */ onExpand?: (id: ID) => void; /** * 是否对准目标元素,避免视图偏移 * * Whether to focus on the target element to avoid view offset */ align?: boolean; } /** * 展开/收起元素交互 * * Collapse/Expand Element behavior * @remarks * 通过操作展开/收起元素。 * * Expand/collapse elements by operation. */ export declare class CollapseExpand extends BaseBehavior { static defaultOptions: Partial; constructor(context: RuntimeContext, options: CollapseExpandOptions); update(options: Partial): void; private bindEvents; private unbindEvents; private onCollapseExpand; private validate; destroy(): void; }