# ldesign-search **Repository Path**: ldesign-v1/ldesign-search ## Basic Information - **Project Name**: ldesign-search - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-18 - **Last Updated**: 2026-11-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LDesign 全局搜索 `@composy/search-core` 协调多个异步搜索 provider,为全局搜索和命令面板提供本地模糊匹配、结果排序、去重、权限过滤、键盘选择与命令执行。`@composy/search-vue` 将 controller 接入 Vue 响应式状态。 搜索 provider 负责自己的索引和领域匹配。本包不替代通讯录、选择器或翻译编辑器内部的局部搜索,也不创建应用专属索引。 ## 安装 ```sh pnpm add @composy/search-core pnpm add @composy/search-vue vue ``` ## 命令面板 ```ts import { SearchController, createCommandProvider, getSearchMatchRanges } from '@composy/search-core' const search = new SearchController({ providers: [createCommandProvider([ { id: 'settings', title: '打开设置', run: openSettings }, ])], }) search.open() await search.search('设置') search.moveActive(1) await search.executeActive() const ranges = getSearchMatchRanges('cafe', 'Café 设置') // [{ start: 0, end: 4 }],end 为不包含的 UTF-16 偏移量,可用于渲染高亮片段。 ``` Vue 适配器可将 Cmd/Ctrl+K 绑定到同一个 controller,并把结果交给应用自己的对话框或命令面板展示。