> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hopx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Type Definitions

> TypeScript type definitions for the HopX JavaScript SDK. Complete TypeScript type definitions for sandbox objects, execution results, file metadata, template structures, and all SDK methods. Essential for type-safe development with IntelliSense support. Includes complete type reference and usage examples.

**Version:** 0.1.22\
**Last Verified:** 2025-01-27\
**Package:** `@hopx-ai/sdk` on [npm](https://www.npmjs.com/package/@hopx-ai/sdk)

## Overview

The JavaScript SDK provides comprehensive TypeScript type definitions for all API responses and objects.

## Core Types

### `SandboxInfo`

Sandbox information type.

```typescript theme={null}
interface SandboxInfo {
    sandboxId: string;
    templateId: string;
    templateName: string;
    organizationId: string;
    nodeId: string;
    region: string;
    status: 'running' | 'stopped' | 'paused' | 'creating';
    publicHost: string;
    resources: Resources;
    startedAt: Date;
    endAt?: Date;
    createdAt: Date;
}
```

***

### `TemplateInfo`

Template information type.

```typescript theme={null}
interface TemplateInfo {
    id: string;
    name: string;
    displayName: string;
    description: string;
    category: string;
    language: string;
    defaultResources: TemplateResources;
    // ... more fields
}
```

***

### `ExecutionResult`

Result of code execution.

```typescript theme={null}
interface ExecutionResult {
    success: boolean;
    stdout: string;
    stderr: string;
    exitCode: number;
    executionTime: number;
    richOutputs: RichOutput[];
}
```

***

### `CommandResponse`

Result of command execution.

```typescript theme={null}
interface CommandResponse {
    stdout: string;
    stderr: string;
    exitCode: number;
    executionTime: number;
}
```

***

### `FileInfo`

File or directory information.

```typescript theme={null}
interface FileInfo {
    name: string;
    path: string;
    size: number;
    isDirectory: boolean;
    permissions: string;
    modifiedTime: Date;
}
```

***

## Options Types

### `SandboxCreateOptions`

Options for creating a sandbox.

```typescript theme={null}
interface SandboxCreateOptions {
    template?: string;
    templateId?: string;
    region?: string;
    timeoutSeconds?: number;
    internetAccess?: boolean;
    envVars?: Record<string, string>;
    apiKey?: string;
    baseURL?: string;
}
```

***

### `CodeExecutionOptions`

Options for code execution.

```typescript theme={null}
interface CodeExecutionOptions {
    language?: string;
    timeout?: number;
    workingDir?: string;
    env?: Record<string, string>;
}
```

***

### `CommandOptions`

Options for command execution.

```typescript theme={null}
interface CommandOptions {
    timeout?: number;
    background?: boolean;
    workingDir?: string;
    env?: Record<string, string>;
}
```

***

## Related Classes

* **[Errors](/sdk/javascript/errors)** - Error classes and exception handling
* **[Sandbox](/sdk/javascript/sandbox)** - Use types with sandbox operations

## See Also

* [Errors](/sdk/javascript/errors) - Learn about error handling
* [Core Concepts](/core-concepts) - Learn about core concepts

## Next Steps

Now that you understand TypeScript types, explore:

* [Sandbox Operations](/sdk/javascript/sandbox) - Use types in practice
* [Error Handling](/sdk/javascript/errors) - Type-safe error handling
* [Quickstart Guide](/sdk/javascript/quickstart) - Get started with the SDK
* **[CLI Reference](/cli/introduction)** - Use HopX from the command line
* [TypeScript Documentation](https://www.typescriptlang.org/docs/) - Learn more about TypeScript
