|
1 | 1 | import { |
2 | 2 | Sandbox as SandboxBase, |
3 | 3 | SandboxOpts as SandboxOptsBase, |
4 | | - SandboxBetaCreateOpts as SandboxBetaCreateOptsBase, |
5 | 4 | CommandHandle, |
6 | 5 | CommandResult, |
7 | 6 | CommandExitError, |
@@ -116,31 +115,6 @@ export interface SandboxOpts extends SandboxOptsBase { |
116 | 115 | display?: string |
117 | 116 | } |
118 | 117 |
|
119 | | -/** |
120 | | - * Configuration options for the Sandbox environment. |
121 | | - * @interface SandboxOpts |
122 | | - * @extends {SandboxOptsBase} |
123 | | - */ |
124 | | -export interface SandboxBetaCreateOpts extends SandboxBetaCreateOptsBase { |
125 | | - /** |
126 | | - * The screen resolution in pixels, specified as [width, height]. |
127 | | - * @type {[number, number]} |
128 | | - */ |
129 | | - resolution?: [number, number] |
130 | | - |
131 | | - /** |
132 | | - * Dots per inch (DPI) setting for the display. |
133 | | - * @type {number} |
134 | | - */ |
135 | | - dpi?: number |
136 | | - |
137 | | - /** |
138 | | - * Display identifier. |
139 | | - * @type {string} |
140 | | - */ |
141 | | - display?: string |
142 | | -} |
143 | | - |
144 | 118 | export class Sandbox extends SandboxBase { |
145 | 119 | protected static override readonly defaultTemplate: string = 'desktop' |
146 | 120 | public display: string = ':0' |
@@ -229,71 +203,6 @@ export class Sandbox extends SandboxBase { |
229 | 203 | return sbx |
230 | 204 | } |
231 | 205 |
|
232 | | - /** |
233 | | - * Create a new sandbox from the default `desktop` sandbox template. |
234 | | - * |
235 | | - * @param opts connection options. |
236 | | - * |
237 | | - * @returns sandbox instance for the new sandbox. |
238 | | - * |
239 | | - * @example |
240 | | - * ```ts |
241 | | - * const sandbox = await Sandbox.create() |
242 | | - * ``` |
243 | | - * @constructs Sandbox |
244 | | - */ |
245 | | - static async betaCreate<S extends typeof Sandbox>( |
246 | | - this: S, |
247 | | - opts?: SandboxBetaCreateOpts |
248 | | - ): Promise<InstanceType<S>> |
249 | | - /** |
250 | | - * Create a new sandbox from the specified sandbox template. |
251 | | - * |
252 | | - * @param template sandbox template name or ID. |
253 | | - * @param opts connection options. |
254 | | - * |
255 | | - * @returns sandbox instance for the new sandbox. |
256 | | - * |
257 | | - * @example |
258 | | - * ```ts |
259 | | - * const sandbox = await Sandbox.create('<template-name-or-id>') |
260 | | - * ``` |
261 | | - * @constructs Sandbox |
262 | | - */ |
263 | | - static async betaCreate<S extends typeof Sandbox>( |
264 | | - this: S, |
265 | | - template: string, |
266 | | - opts?: SandboxBetaCreateOpts |
267 | | - ): Promise<InstanceType<S>> |
268 | | - static async betaCreate<S extends typeof Sandbox>( |
269 | | - this: S, |
270 | | - templateOrOpts?: SandboxBetaCreateOpts | string, |
271 | | - opts?: SandboxOpts |
272 | | - ): Promise<InstanceType<S>> { |
273 | | - const { template, sandboxOpts } = |
274 | | - typeof templateOrOpts === 'string' |
275 | | - ? { template: templateOrOpts, sandboxOpts: opts } |
276 | | - : { template: this.defaultTemplate, sandboxOpts: templateOrOpts } |
277 | | - |
278 | | - // Add DISPLAY environment variable if not already set |
279 | | - const display = opts?.display || ':0' |
280 | | - const sandboxOptsWithDisplay = { |
281 | | - ...sandboxOpts, |
282 | | - envs: { |
283 | | - ...sandboxOpts?.envs, |
284 | | - DISPLAY: display, |
285 | | - }, |
286 | | - } |
287 | | - |
288 | | - const sbx = (await super.betaCreate( |
289 | | - template, |
290 | | - sandboxOptsWithDisplay |
291 | | - )) as InstanceType<S> |
292 | | - await sbx._start(display, sandboxOptsWithDisplay) |
293 | | - |
294 | | - return sbx |
295 | | - } |
296 | | - |
297 | 206 | /** |
298 | 207 | * Wait for a command to return a specific result. |
299 | 208 | * @param cmd - The command to run. |
|
0 commit comments