mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-05 08:06:19 +00:00
41 lines
929 B
TypeScript
41 lines
929 B
TypeScript
"use client"
|
|
|
|
import { invoke } from "@tauri-apps/api/core"
|
|
|
|
export type SpotlightMemory = {
|
|
id: string
|
|
title: string | null
|
|
summary?: string | null
|
|
content?: string | null
|
|
raw?: string | null
|
|
url?: string | null
|
|
type?: string | null
|
|
createdAt: string
|
|
}
|
|
|
|
export type SpotlightShortcut = {
|
|
accelerator: string
|
|
}
|
|
|
|
export const OPEN_MEMORY_EVENT = "nav:open-memory"
|
|
export const SPOTLIGHT_SHOWN_EVENT = "spotlight:shown"
|
|
|
|
export function showSpotlight() {
|
|
return invoke("spotlight_show")
|
|
}
|
|
|
|
export function hideSpotlight() {
|
|
return invoke("spotlight_hide")
|
|
}
|
|
|
|
export function openSpotlightResult(memory: SpotlightMemory) {
|
|
return invoke("spotlight_open_result", { memory })
|
|
}
|
|
|
|
export function getSpotlightShortcut() {
|
|
return invoke<SpotlightShortcut>("spotlight_get_shortcut")
|
|
}
|
|
|
|
export function setSpotlightShortcut(accelerator: string) {
|
|
return invoke<SpotlightShortcut>("spotlight_set_shortcut", { accelerator })
|
|
}
|