|
| 1 | +import { ExecFunction } from './exec'; |
| 2 | +export interface DevContainerCliError { |
| 3 | + outcome: 'error'; |
| 4 | + code: number; |
| 5 | + message: string; |
| 6 | + description: string; |
| 7 | +} |
| 8 | +declare function isCliInstalled(exec: ExecFunction): Promise<boolean>; |
| 9 | +declare function installCli(exec: ExecFunction): Promise<boolean>; |
| 10 | +export interface DevContainerCliSuccessResult { |
| 11 | + outcome: 'success'; |
| 12 | +} |
| 13 | +export interface DevContainerCliBuildResult extends DevContainerCliSuccessResult { |
| 14 | + imageDigests?: Record<string, string>; |
| 15 | +} |
| 16 | +export interface DevContainerCliBuildArgs { |
| 17 | + workspaceFolder: string; |
| 18 | + configFile: string | undefined; |
| 19 | + imageName?: string[]; |
| 20 | + platform?: string; |
| 21 | + additionalCacheFroms?: string[]; |
| 22 | + userDataFolder?: string; |
| 23 | + output?: string; |
| 24 | + noCache?: boolean; |
| 25 | + cacheTo?: string[]; |
| 26 | +} |
| 27 | +declare function devContainerBuild(args: DevContainerCliBuildArgs, log: (data: string) => void): Promise<DevContainerCliBuildResult | DevContainerCliError>; |
| 28 | +export interface DevContainerCliUpResult extends DevContainerCliSuccessResult { |
| 29 | + containerId: string; |
| 30 | + remoteUser: string; |
| 31 | + remoteWorkspaceFolder: string; |
| 32 | +} |
| 33 | +export interface DevContainerCliUpArgs { |
| 34 | + workspaceFolder: string; |
| 35 | + configFile: string | undefined; |
| 36 | + additionalCacheFroms?: string[]; |
| 37 | + cacheTo?: string[]; |
| 38 | + skipContainerUserIdUpdate?: boolean; |
| 39 | + env?: string[]; |
| 40 | + userDataFolder?: string; |
| 41 | + additionalMounts?: string[]; |
| 42 | +} |
| 43 | +declare function devContainerUp(args: DevContainerCliUpArgs, log: (data: string) => void): Promise<DevContainerCliUpResult | DevContainerCliError>; |
| 44 | +export interface DevContainerCliExecArgs { |
| 45 | + workspaceFolder: string; |
| 46 | + configFile: string | undefined; |
| 47 | + command: string[]; |
| 48 | + env?: string[]; |
| 49 | + userDataFolder?: string; |
| 50 | +} |
| 51 | +declare function devContainerExec(args: DevContainerCliExecArgs, log: (data: string) => void): Promise<number | null>; |
| 52 | +export declare const devcontainer: { |
| 53 | + build: typeof devContainerBuild; |
| 54 | + up: typeof devContainerUp; |
| 55 | + exec: typeof devContainerExec; |
| 56 | + isCliInstalled: typeof isCliInstalled; |
| 57 | + installCli: typeof installCli; |
| 58 | +}; |
| 59 | +export {}; |
0 commit comments