API
This page documents the public API for @ioai/lerobot-studio. The package provides the viewer, archive helpers, and their types. It does not include the standalone application's export engine.
The generated report below is the canonical API reference. Update the source code, run npm run api:report, and do not edit the generated report directly.
Example
import { LeRobotViewer } from '@ioai/lerobot-studio';
import '@ioai/lerobot-studio/style.css';
<LeRobotViewer dataSource="https://example.com/dataset.zip" theme="system" />;dataSource can be a remote archive URL or a custom DataSource:
createArchiveDataSourceFromFile— local ZIP / TAR / TAR.GZcreateArchiveDataSourceFromUrl— remote archive you want to reuse
The viewer supports in-session episode changes when the dataset allows them. onExport is a callback for your host UI; it does not export anything by itself.
Custom data sources
Implement DataSource if your application needs to read bytes or text by path. Treat paths and content as untrusted, and release object URLs in clear().
Loading phases are download, index, gunzip, and read. Fatal errors include invalid sources, unavailable remote URLs, unsupported archives, and dataset-loading failures.
Generated API report
API Report File for "@ioai/lerobot-studio"
Do not edit this file. It is a report generated by API Extractor.
import { default as React_2 } from 'react';
// @public
export function createArchiveDataSourceFromFile(file: File): DataSource;
// @public
export function createArchiveDataSourceFromUrl(url: string): DataSource;
// @public
export interface DataSource {
clear(): void | Promise<void>;
exists(path: string): Promise<boolean>;
getObjectUrl(path: string, mimeType?: string, onProgress?: ProgressHandler): Promise<string>;
invalidateObjectUrl?(path: string): void | Promise<void>;
listPaths?(): Promise<string[]>;
readBytes(path: string, onProgress?: ProgressHandler): Promise<Uint8Array>;
readText(path: string, onProgress?: ProgressHandler): Promise<string>;
}
// @public (undocumented)
export const LeRobotViewer: React_2.FC<LeRobotViewerProps>;
// @public
export interface LeRobotViewerError {
cause?: unknown;
code: LeRobotViewerErrorCode;
message: string;
recoverable: boolean;
}
// @public
export type LeRobotViewerErrorCode = 'INVALID_DATA_SOURCE' | 'REMOTE_SOURCE_UNAVAILABLE' | 'UNSUPPORTED_ARCHIVE' | 'DATASET_LOAD_FAILED';
// @public
export interface LeRobotViewerProps {
className?: string;
dataSource: string | DataSource;
enableKeyboardShortcuts?: boolean;
language?: string;
onBack?: () => void;
onExport?: () => void;
onFatalError?: (error: LeRobotViewerError) => void;
showPlaybackBar?: boolean;
showSidebar?: boolean;
theme?: 'light' | 'dark' | 'system';
}
// @public
export type LoadingPhase = 'download' | 'index' | 'gunzip' | 'read';
// @public
export type ProgressHandler = (info: ProgressInfo) => void;
// @public
export interface ProgressInfo {
loaded?: number;
message?: string;
phase: LoadingPhase;
total?: number;
}