UNPKG

@codesandbox/sdk

Version:
36 lines (35 loc) 1.36 kB
import { StartSandboxOpts } from "../types"; import { Client, Config } from "../api-clients/client/client"; export declare function createApiClient(apiKey: string, config?: Config, instrumentation?: (request: Request) => Promise<Response>): Client; export type HandledResponse<D, E> = { data?: { data?: D; }; error?: E; response: Response; }; export declare function getStartOptions(opts: StartSandboxOpts | undefined): { ipcountry?: undefined; tier?: undefined; hibernation_timeout_seconds?: undefined; automatic_wakeup_config?: undefined; } | { ipcountry: string | undefined; tier: "Pico" | "Nano" | "Micro" | "Small" | "Medium" | "Large" | "XLarge" | undefined; hibernation_timeout_seconds: number | undefined; automatic_wakeup_config: { http: boolean; websocket: boolean; } | undefined; }; export declare function getDefaultTemplateTag(apiClient: Client): string; export declare function getDefaultTemplateId(apiClient: Client): string; export declare function retryWithDelay<T>(callback: () => Promise<T>, retries?: number, delay?: number): Promise<T>; export declare function handleResponse<D, E>(result: Awaited<{ data?: { data?: D; }; error?: E; response: Response; }>, errorPrefix: string): D; export declare function generateTraceParent(): string;