diff --git a/packages/extension-api/src/extension-api.d.ts b/packages/extension-api/src/extension-api.d.ts index c6ca50bd3ff14..fea65410d3bd8 100644 --- a/packages/extension-api/src/extension-api.d.ts +++ b/packages/extension-api/src/extension-api.d.ts @@ -393,6 +393,7 @@ declare module '@podman-desktop/api' { displayName?: string; type: 'docker' | 'podman'; endpoint: ContainerProviderConnectionEndpoint; + shellAccess?: ProviderConnectionShellAccess; lifecycle?: ProviderConnectionLifecycle; status(): ProviderConnectionStatus; vmType?: string; @@ -788,6 +789,40 @@ declare module '@podman-desktop/api' { connection: ContainerProviderConnection; } + /** + * the callbacks of ssh shell in provider connection + */ + export interface ProviderConnectionShellAccess { + onData: Event; + onError: Event; + onEnd: Event; + + // function used for writting to shell (e.g. `ls`) + write(data: string): void; + + // function that starts the ssh connection to providers connection shell + startConnection(): void; + + // function that stops running ssh connection + stopConnection(): void; + + // function that sets window size of shell + setWindow(dimensions: ProviderConnectionShellDimensions): void; + } + + export interface ProviderConnectionShellDimensions { + rows: number; + cols: number; + } + + export interface ProviderConnectionShellAccessError { + error: string; + } + + export interface ProviderConnectionShellAccessData { + data: string; + } + /** * the description of a file in an image filesystem layer */