import { Context } from "@deepseek-ai/cordis"; import { ILayout } from "@deepseek-ai/dsh-client-ui-layout/client"; import { ISessions, IWorkspaces, SessionListState, SessionSummary, SlotRegistry, WorkspaceId } from "@deepseek-ai/dsh-client-runtime/client"; import { CssRender } from "css-render"; //#region src/client/types/bridge.d.ts /** 宿主命令所需的业务面(由插件体注入 ctx.layout)。 */ interface NavBridgeHandlers { toggleSidebar: () => void; } /** 会话访问栈中的页面。 */ interface Page { key: string | null; el: HTMLElement | null; } /** 记录动作(与宿主 `PluginError.action` 语义一致)。 */ type ErrorAction = 'runtime' | 'install' | 'update' | 'remove'; //#endregion //#region src/client/types/inject.d.ts interface LocaleService { register: (namespace: string, locale: string, dict: Record) => () => void; getLocale: () => { active: string; }; subscribe: (onChange: () => void) => () => void; } //#endregion //#region src/client/types/context.d.ts /** Cordis context with the client services consumed by the Tauri plugins. */ type ClientContext = Context & { locale: LocaleService; layout: ILayout; }; //#endregion //#region src/client/types/global.d.ts declare global { interface Window { /** 插件接管标记:桌面端 NAV_SHIM_JS 检测到后停止收发,避免双重执行。 */ __dsh_tauri_bridge__?: boolean; } } //#endregion //#region src/client/types/runtime.d.ts /** Runtime session service projection used by legacy plugin helpers. */ interface SessionsRuntime { list: { getSnapshot: () => unknown; subscribe: (listener: () => void) => () => void; }; } /** Runtime workspace service projection used by legacy plugin helpers. */ interface WorkspacesRuntime { list: { getSnapshot: () => unknown; subscribe: (listener: () => void) => () => void; }; startSession: (workspaceId?: WorkspaceId) => void; } //#endregion //#region src/client/compat.d.ts type StartSession = (workspaceId?: string) => unknown; /** Resolve the navigation method across Alpha and rc.2 service layouts. */ declare function resolveStartSession(ctx: ClientContext): StartSession | undefined; /** Adapt alpha's nested list/navigation services to the rc.2 plugin contract. */ declare function compat(ctx: ClientContext): ClientContext; //#endregion //#region src/client/store.d.ts /** * Framework-neutral external state store. * * This store is intentionally independent of React and Cordis so it can be * shared by slot components, hydration/controllers, and DOM observers. React * consumers can connect it with `useSyncExternalStore`. * * State updates are immutable: callers return the next state instead of * mutating a draft. This avoids cloning the whole state tree for every update * and makes the ownership of each state transition explicit. */ type StoreUpdater = (current: T) => T; type StoreValue = T | StoreUpdater; type StoreListener = () => void; interface ExternalStore { /** Returns the same reference until a real state change is committed. */ getSnapshot: () => T; /** Subscribes to committed state changes and returns an unsubscribe function. */ subscribe: (listener: StoreListener) => () => void; /** Replaces the state, or derives the next state from the current state. */ set: (next: StoreValue) => void; } /** * Creates a small external store for state shared across independent plugin * slots or non-React controllers. */ declare function createExternalStore(initial: T): ExternalStore; /** * A deliberately tiny signal for invalidating derived UI such as locale * revisions without allocating `{ rev: number }` snapshots. */ interface RevisionSignal extends ExternalStore { bump: () => void; } declare function createRevisionSignal(initial?: number): RevisionSignal; //#endregion //#region src/client/index.d.ts /** 插件显示名(诊断元数据)。 */ declare const name = "dsh-tauri"; /** 需要的客户端服务:layout(侧边栏切换)。 */ declare const inject: string[]; /** * 插件体:接管导航桥(置位接管标记 → 挂命令监听/状态观察/历史跟踪)。 * @param ctx - 客户端根上下文。 */ declare function apply(ctx: ClientContext): void; //#endregion export { ClientContext, CssRender, ErrorAction, ExternalStore, type ILayout, type ISessions, type IWorkspaces, LocaleService, NavBridgeHandlers, Page, RevisionSignal, type SessionListState, type SessionSummary, SessionsRuntime, type SlotRegistry, StoreListener, StoreUpdater, StoreValue, type WorkspaceId, WorkspacesRuntime, apply, compat, createExternalStore, createRevisionSignal, inject, name, resolveStartSession }; //# sourceMappingURL=client.d.cts.map