Skip to content

Commit

Permalink
feat: allow to ssh to podman virtual machine - api.d.ts changes
Browse files Browse the repository at this point in the history
Signed-off-by: Evzen Gasta <[email protected]>
  • Loading branch information
gastoner committed Oct 15, 2024
1 parent 57090e1 commit 8bea74e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions packages/extension-api/src/extension-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ declare module '@podman-desktop/api' {
displayName?: string;
type: 'docker' | 'podman';
endpoint: ContainerProviderConnectionEndpoint;
shellAccess?: ProviderConnectionShellAccess;
lifecycle?: ProviderConnectionLifecycle;
status(): ProviderConnectionStatus;
vmType?: string;
Expand Down Expand Up @@ -788,6 +789,40 @@ declare module '@podman-desktop/api' {
connection: ContainerProviderConnection;
}

/**
* the callbacks of ssh shell in provider connection
*/
export interface ProviderConnectionShellAccess {
onData: Event<ProviderConnectionShellAccessData>;
onError: Event<ProviderConnectionShellAccessError>;
onEnd: Event<void>;

// 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
*/
Expand Down

0 comments on commit 8bea74e

Please sign in to comment.