@ioai/lerobot-studio 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Client-only React viewer for supported LeRobot datasets.
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+
7
+ import { default as React_2 } from 'react';
8
+
9
+ /** Create a viewer data source for a local ZIP, TAR, or TAR.GZ archive. */
10
+ export declare function createArchiveDataSourceFromFile(file: File): DataSource;
11
+
12
+ /**
13
+ * Create a viewer data source for a remote archive.
14
+ *
15
+ * The host must provide appropriate CORS and HTTP Range support.
16
+ */
17
+ export declare function createArchiveDataSourceFromUrl(url: string): DataSource;
18
+
19
+ /** Browser-readable storage abstraction consumed by the viewer. */
20
+ export declare interface DataSource {
21
+ /** Return whether a logical dataset path exists. */
22
+ exists(path: string): Promise<boolean>;
23
+ /** Read a UTF-8 text file. */
24
+ readText(path: string, onProgress?: ProgressHandler): Promise<string>;
25
+ /** Read a file as bytes. */
26
+ readBytes(path: string, onProgress?: ProgressHandler): Promise<Uint8Array>;
27
+ /** Return an object URL or remote URL suitable for browser media APIs. */
28
+ getObjectUrl(path: string, mimeType?: string, onProgress?: ProgressHandler): Promise<string>;
29
+ /** Release object URLs, handles, caches, and other source-owned resources. */
30
+ clear(): void | Promise<void>;
31
+ /**
32
+ * Lists logical dataset paths when the backing source has an index.
33
+ * Adapters use this to load every v3 metadata shard rather than guessing a
34
+ * contiguous chunk/file sequence.
35
+ */
36
+ listPaths?(): Promise<string[]>;
37
+ /** Invalidate object/blob URL for a logical path when the implementation supports it. */
38
+ invalidateObjectUrl?(path: string): void | Promise<void>;
39
+ }
40
+
41
+ export declare const LeRobotViewer: React_2.FC<LeRobotViewerProps>;
42
+
43
+ /** A fatal viewer error that requires host action or an explicit retry. */
44
+ export declare interface LeRobotViewerError {
45
+ /** Machine-readable category. */
46
+ code: LeRobotViewerErrorCode;
47
+ /** Localized message suitable for display. */
48
+ message: string;
49
+ /** Whether retrying the same operation may succeed. */
50
+ recoverable: boolean;
51
+ /** Original failure when one is available. */
52
+ cause?: unknown;
53
+ }
54
+
55
+ /** Stable error categories reported to an embedding host. */
56
+ export declare type LeRobotViewerErrorCode = 'INVALID_DATA_SOURCE' | 'REMOTE_SOURCE_UNAVAILABLE' | 'UNSUPPORTED_ARCHIVE' | 'DATASET_LOAD_FAILED';
57
+
58
+ /** Properties for the stable, client-only LeRobot dataset viewer. */
59
+ export declare interface LeRobotViewerProps {
60
+ /** Remote archive URL or a custom browser data source. */
61
+ dataSource: string | DataSource;
62
+ /** Viewer color scheme. @defaultValue 'system' */
63
+ theme?: 'light' | 'dark' | 'system';
64
+ /** BCP 47 language tag. Built-in messages currently cover en, zh, and ja. */
65
+ language?: string;
66
+ /** Show the episode sidebar. @defaultValue true */
67
+ showSidebar?: boolean;
68
+ /** Show playback controls. @defaultValue true */
69
+ showPlaybackBar?: boolean;
70
+ /** Additional class name applied to the scoped viewer root. */
71
+ className?: string;
72
+ /** Optional host-owned navigation action. */
73
+ onBack?: () => void;
74
+ /** Optional host-owned export action; the npm viewer does not export data itself. */
75
+ onExport?: () => void;
76
+ /**
77
+ * Receives fatal source or dataset loading failures. When provided, the host
78
+ * owns fatal-error rendering and the built-in fatal state is not rendered.
79
+ */
80
+ onFatalError?: (error: LeRobotViewerError) => void;
81
+ /**
82
+ * Enable viewer keyboard shortcuts such as Space and arrow-key seeking.
83
+ * @defaultValue true
84
+ */
85
+ enableKeyboardShortcuts?: boolean;
86
+ }
87
+
88
+ /** A phase reported while a data source reads or prepares content. */
89
+ export declare type LoadingPhase = 'download' | 'index' | 'gunzip' | 'read';
90
+
91
+ /** Receives data-source progress updates. */
92
+ export declare type ProgressHandler = (info: ProgressInfo) => void;
93
+
94
+ /** Progress reported by a data-source operation. */
95
+ export declare interface ProgressInfo {
96
+ /** Current operation phase. */
97
+ phase: LoadingPhase;
98
+ /** Bytes or logical units processed so far. */
99
+ loaded?: number;
100
+ /** Total bytes or logical units when known. */
101
+ total?: number;
102
+ /** Optional human-readable detail. */
103
+ message?: string;
104
+ }
105
+
106
+ export { }