import { ExcludePrefixKeys, Prefix } from './type'; /** * 模块钩子 * 用于把相同的业务放入同一个模块中,可以避免命名冲突。模拟Setup的属性方式,支持多些生命周期 * 如示例所示 * - 命名:`levelTree.nodeCLick`的方式,而不是`levelTreeNodeClick`,这样有其他业务的树也可以使用`nodeCLick`, * 如`userTree.nodeCLick`,避免名称困难 * - 生命周期:使用`[SetupLifeCycle.onMounted]`的方式来定义生命周期,可以在模块中写多个 * * ```ts * const levelTree = useSetupModuleHooks({ * // region 获取数据 * treeData: ref(), * getTreeData() {}, * [SetupLifeCycle.onMounted]() { * levelTree.getTreeData() * }, * // endregion * * // region 搜索 * searchQuery: ref(''), * [SetupLifeCycle.onMounted]() { * watch(levelTree.searchQuery, () => {}) * }, * // endregion * * // region 事件 * nodeCLick() {} * // endregion * }) * ``` * @param ops */ export declare function useSetupModuleHooks(ops: T): ExcludePrefixKeys; export declare const SetupLifeCycle: { onMounted: Prefix; onBeforeUnmount: Prefix; onActivated: Prefix; onDeactivated: Prefix; onReactivated: Prefix; };