import type { FileCache } from "../cache/file-cache.js"; import type { ProjectFile, VeryfrontApiClient } from "../../veryfront-api-client/index.js"; import type { ContentSource, InvalidationCallbacks, PreviewStyleArtifactInfo, ResolvedContentContext } from "./types.js"; type WebSocketFactory = (url: string, protocols?: string | string[]) => WebSocket; interface WebSocketDeps { apiBaseUrl: string; apiToken: string; projectSlug: string; cache: FileCache; client: VeryfrontApiClient; invalidationCallbacks: InvalidationCallbacks; /** * The project's default branch name. Used to decide whether an unscoped * production poke applies to the current branch preview. Defaults to "main" * when not provided; set this to the project's actual default branch to * avoid skipping valid production pokes on non-"main" default branches. */ defaultBranchName?: string; getContentContext: () => ResolvedContentContext | null; getContentSource: () => ContentSource; getProjectDir: () => string | undefined; clearMemoryCaches: () => void; getSourceSnapshotVersion?: () => number; replaceSourceSnapshot: (cacheKey: string, files: ProjectFile[], expectedSnapshotVersion?: number) => Promise; pregenerateStyles?: (files: ProjectFile[]) => Promise; createWebSocket?: WebSocketFactory; } export declare class WebSocketManager { #private; private readonly deps; private ws; private wsReconnectTimer; private wsHeartbeatTimer; private wsLastPong; private invalidationTimer; private selectiveInvalidationTimer; private pendingChangedPaths; private wsConnectionId; private wsConsecutiveFailures; private wsErrorLogged; private disposed; private previewInvalidationVersion; private activePreviewInvalidationPrefixes; private pokeMetrics; private apiToken; constructor(deps: WebSocketDeps); setApiToken(token: string): void; private getConnectionLogContext; private getPreviewInvalidationPrefixes; private beginPreviewInvalidation; private completePreviewInvalidation; getPokeMetrics(): { received: number; invalidationsTriggered: number; lastPokeTime: number; connectionId: string | null; }; connect(projectId: string): void; private getReconnectDelay; dispose(): void; private handlePokeMessage; private clearPersistentCacheForPublish; private scheduleInvalidation; private scheduleSelectiveInvalidation; private performSelectiveInvalidation; private performInvalidation; private startHeartbeat; private cleanupTimers; private sendPokeAck; } export {}; //# sourceMappingURL=websocket-manager.d.ts.map