import type { Emitter, Event } from "@codesandbox/pitcher-common"; import type { client as clientProtocol, PitcherPermissions, PitcherCapabilities, PitcherRequest } from "@codesandbox/pitcher-protocol"; import type { States } from "class-states"; import type { PitcherFeatureToVersionMap } from "../common/versions"; import type { PitcherManagerResponse } from "../types"; import type { IAiClient } from "./clients/IAiClient"; import type { IChannelClient } from "./clients/IChannelClient"; import type { IClientClient } from "./clients/IClientClient"; import type { ICommandClient } from "./clients/ICommandClient"; import type { IContainerClient } from "./clients/IContainerClient"; import type { IFSClient } from "./clients/IFSClient"; import type { IFileClient } from "./clients/IFileClient"; import type { IGitClient } from "./clients/IGitClient"; import type { ILanguageClient } from "./clients/ILanguageClient"; import type { INotificationClient } from "./clients/INotificationsClient"; import type { IPortClient } from "./clients/IPortClient"; import type { ISetupClient } from "./clients/ISetupClient"; import type { IShellClient } from "./clients/IShellClient"; import type { ISystemClient } from "./clients/ISystemClient"; import type { ITaskClient } from "./clients/ITaskClient"; export type PitcherClientState = /** * This state represents when you are full connected and have sent a succcsessful client/join * request */ { state: "CONNECTED"; lastActivity: number; lastFocus: number; connectedAt: number; } | { state: "CONNECTING"; } | { state: "RECONNECTING"; attempt: number; wasFocused: boolean; lastActivity: number; disconnectReason: string; disconnectedAt: number; } | { state: "HIBERNATED"; wasFocused: boolean; disconnectedAt: number; } | { state: "DISCONNECTED"; reason: string; code: number; wasClean: boolean; wasFocused: boolean; disconnectedAt: number; }; export interface IPitcherClient { type: "browser" | "vm"; bootupType: PitcherManagerResponse["bootupType"]; sessionStartTime: number; state: States; onStateChange: States["onTransition"]; onReconnected: Emitter["event"]; onInstanceChangeRequired: Emitter["event"]; onInstanceChanged: Event<{ instanceId: string; }>; currentClient: clientProtocol.ClientJSON; capabilities: PitcherCapabilities; permissions: PitcherPermissions; pitcherVersion: string; pitcherManagerVersion: string; pitcherProtocolVersion: string; workspacePath: string; userWorkspacePath: string; cluster: string; reconnectToken: string | null; instanceId: string; clients: { fs: IFSClient; shell: IShellClient; port: IPortClient; language: ILanguageClient; client: IClientClient; file: IFileClient; git: IGitClient; setup: ISetupClient; notification: INotificationClient; channel: IChannelClient; task: ITaskClient; system: ISystemClient; command: ICommandClient; ai: IAiClient; container: IContainerClient; }; reconnect(): Promise; hasFeature(feature: T): boolean; changeInstance(instanceId: string): Promise; revertSeamlessFork(): void; toggleSeamlessFork(value: boolean): void; isUpToDate(): boolean; disconnect(): Promise; dispose(): void; } //# sourceMappingURL=IPitcherClient.d.ts.map