For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/genui/openui/data-tools/interfaces/QueryDataStore.md.
Lynx
  • 简体中文
  • 接口: QueryDataStore

    基于宿主持久化的本地 Query 和 Mutation 操作。

    方法

    getInitialQueryResults()

    getInitialQueryResults(prefetched?: Readonly<Record<string, unknown>>): InitialQueryResults

    将已保存的结果覆盖到宿主预取结果上,供 renderer 的 initialQueryResults 输入使用。 仅恢复 defaults 或预取结果中存在的名称,不复制 defaults 本身。

    参数

    参数类型描述
    prefetched?Readonly<Record<string, unknown>>宿主预取结果,默认为空对象。

    返回

    InitialQueryResults


    getSnapshot()

    getSnapshot(): InitialQueryResults

    读取 defaults 与已保存结果合并后的独立快照,不写入存储。

    返回

    InitialQueryResults


    mutate()

    mutate(key: string, value: unknown): void

    使用独立的 JSON 值替换一个已声明的 Query 结果并持久化一次;值无效或存储失败时抛错。

    参数

    参数类型
    keystring
    valueunknown

    返回

    void


    query()

    query(key: string): unknown

    从当前持久化快照读取一个已声明的 Query 结果,并保留假值。

    参数

    参数类型
    keystring

    返回

    unknown

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。