diff --git a/package-lock.json b/package-lock.json index e1c953e..0307ede 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "roamjs-components", - "version": "0.88.1", + "version": "0.88.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "roamjs-components", - "version": "0.88.1", + "version": "0.88.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 454cc04..6d5eaf8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "roamjs-components", "description": "Expansive toolset, utilities, & components for developing RoamJS extensions.", - "version": "0.88.1", + "version": "0.88.2", "main": "index.js", "types": "index.d.ts", "scripts": { diff --git a/src/types/index.ts b/src/types/index.ts index d7f3a0d..8321f93 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,6 +1,7 @@ import { AddPullWatch, PullBlock, + SemanticSearch, SidebarAction, SidebarWindow, SidebarWindowInput, @@ -102,6 +103,7 @@ declare global { }; data: { addPullWatch: AddPullWatch; + semanticSearchEnabled: () => boolean; block: { create: WriteAction; update: WriteAction; @@ -125,6 +127,7 @@ declare global { pattern: string, eids: string[][], ) => Promise; + semanticSearch: SemanticSearch; fast: { q: (query: string, ...params: unknown[]) => Promise; }; diff --git a/src/types/native.ts b/src/types/native.ts index c3b5124..5dfc318 100644 --- a/src/types/native.ts +++ b/src/types/native.ts @@ -332,6 +332,22 @@ export type RoamError = { "status-code": number; }; +export type SemanticSearchArgs = { + "search-str": string; + k?: number; + "hide-code-blocks"?: boolean; +}; + +export type SemanticSearchHit = { + type: "chunk" | "block" | "page"; + uid: string; + topUids: string[]; +}; + +export type SemanticSearch = ( + args: SemanticSearchArgs +) => Promise; + export type TreeNode = { text: string; order: number;