Import lib/types/context-types.d.ts

This commit is contained in:
QQ 2026-11-11 22:29:10 +08:00
parent 219c344f27
commit 8f21bb8a08
1 changed files with 25 additions and 0 deletions

25
lib/types/context-types.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
/**
* Structural types for the cordis services this plugin consumes. A third-party
* plugin resolves outside the DSH monorepo's single cordis instance, so the
* upstream `declare module` augmentations do not reach this Context — the
* members below mirror the actual runtime shapes this plugin touches:
* - webServer: @deepseek-ai/dsh-host-webserver (the WebServer)
* - effect: the DSH-vendored cordis lifecycle helper
* Drift from upstream is contained to this file.
*/
import type { IncomingMessage, ServerResponse } from 'node:http';
import type { Context } from '@deepseek-ai/cordis';
/** One named webserver route (mirror of the host-webserver WebRoute). */
export interface GroupsWebRoute {
kind: 'exact' | 'prefix';
path: string;
handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
}
/** The webServer service face this plugin uses. */
export interface GroupsWebServer {
register(route: GroupsWebRoute): () => void;
}
/** Cordis Context augmented with the services this plugin needs. */
export interface GroupsContext extends Context {
webServer: GroupsWebServer;
}