Core Types
Session
Copy
interface Session {
id: string;
expiresAt: string;
previewUrl: string;
createdAt: string;
resourceLimits: ResourceLimits;
}
ExecuteRequest
Copy
interface ExecuteRequest {
sessionId: string;
code?: string;
command?: string;
files?: Array<{ path: string; content: string }>;
env?: Record<string, string>;
timeout?: number;
}
ExecuteResponse
Copy
interface ExecuteResponse {
stdout: string;
stderr: string;
exitCode: number;
executionTime: number;
memoryUsed: number;
}
File
Copy
interface File {
path: string;
size: number;
modified: string;
type: 'file' | 'directory';
}
Error Types
BuntimeError
Copy
class BuntimeError extends Error {
code: string;
status: number;
details?: any;
retryAfter?: number;
}
Import Types
Copy
import type {
Session,
ExecuteRequest,
ExecuteResponse,
File,
BuntimeError
} from 'buntime.sh';