refactor: trim gateway server type exports

This commit is contained in:
Peter Steinberger
2026-05-01 23:01:26 +01:00
parent 7ac23eeeb5
commit 58f2d17e9e
6 changed files with 9 additions and 17 deletions

View File

@@ -9,7 +9,6 @@ import {
import type {
GatewayBroadcastFn,
GatewayBroadcastOpts,
GatewayBroadcastStateVersion,
GatewayBroadcastToConnIdsFn,
} from "./server-broadcast-types.js";
import { MAX_BUFFERED_BYTES } from "./server-constants.js";
@@ -51,13 +50,6 @@ const EVENT_SCOPE_GUARDS: Record<string, string[]> = {
// (e.g. reconfiguring wake-word triggers).
const NODE_ALLOWED_EVENTS = new Set<string>(["voicewake.changed", "voicewake.routing.changed"]);
export type {
GatewayBroadcastFn,
GatewayBroadcastOpts,
GatewayBroadcastStateVersion,
GatewayBroadcastToConnIdsFn,
} from "./server-broadcast-types.js";
function hasEventScope(client: GatewayWsClient, event: string): boolean {
const required = EVENT_SCOPE_GUARDS[event];
// Plugin-defined gateway broadcast events (plugin.* namespace) are allowed

View File

@@ -8,8 +8,8 @@ import { createGatewayHttpServer } from "./server-http.js";
import { createHooksRequestHandler } from "./server/hooks-request-handler.js";
import { withTempConfig } from "./test-temp-config.js";
export type GatewayHttpServer = ReturnType<typeof createGatewayHttpServer>;
export type GatewayServerOptions = Partial<Parameters<typeof createGatewayHttpServer>[0]>;
type GatewayHttpServer = ReturnType<typeof createGatewayHttpServer>;
type GatewayServerOptions = Partial<Parameters<typeof createGatewayHttpServer>[0]>;
type HooksHandlerDeps = Parameters<typeof createHooksRequestHandler>[0];
const responseEndPromises = new WeakMap<ServerResponse, Promise<void>>();
@@ -221,7 +221,7 @@ export function createHooksHandler(
});
}
export type RouteVariant = {
type RouteVariant = {
label: string;
path: string;
};

View File

@@ -1,12 +1,12 @@
export type NodeSendEventFn = (opts: {
type NodeSendEventFn = (opts: {
nodeId: string;
event: string;
payloadJSON?: string | null;
}) => void;
export type NodeListConnectedFn = () => Array<{ nodeId: string }>;
type NodeListConnectedFn = () => Array<{ nodeId: string }>;
export type NodeSubscriptionManager = {
type NodeSubscriptionManager = {
subscribe: (nodeId: string, sessionKey: string) => void;
unsubscribe: (nodeId: string, sessionKey: string) => void;
unsubscribeAll: (nodeId: string) => void;

View File

@@ -8,7 +8,7 @@ type GatewayRequestContextClient = GatewayClient & {
usesSharedGatewayAuth?: boolean;
};
export type GatewayRequestContextParams = {
type GatewayRequestContextParams = {
deps: GatewayRequestContext["deps"];
runtimeState: Pick<GatewayServerLiveState, "cronState">;
getRuntimeConfig: GatewayRequestContext["getRuntimeConfig"];

View File

@@ -20,7 +20,7 @@ import {
} from "./net.js";
import { mergeGatewayTailscaleConfig } from "./startup-auth.js";
export type GatewayRuntimeConfig = {
type GatewayRuntimeConfig = {
bindHost: string;
controlUiEnabled: boolean;
openAiChatCompletionsEnabled: boolean;

View File

@@ -2,7 +2,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { HeartbeatRunner } from "../infra/heartbeat-runner.js";
import type { ChannelHealthMonitor } from "./channel-health-monitor.js";
export type GatewayConfigReloaderHandle = {
type GatewayConfigReloaderHandle = {
stop: () => Promise<void>;
};