@@ -51,8 +51,6 @@ export declare class Session {
5151 amend ( message : string ) : Promise < string >
5252 flush ( message : string ) : Promise < string >
5353 rebase ( ) : Promise < void >
54- /** Get all virtual chunk locations referenced by this session */
55- allVirtualChunkLocations ( ) : Promise < Array < string > >
5654}
5755export type JsSession = Session
5856
@@ -66,32 +64,19 @@ export declare class Storage {
6664 * especially useful for WASM builds where native Rust networking is unavailable.
6765 */
6866 static newCustom ( backend : { canWrite : ( ) => Promise < boolean > ; getObjectRange : ( args : StorageGetObjectRangeArgs ) => Promise < StorageGetObjectResponse > ; putObject : ( args : StoragePutObjectArgs ) => Promise < StorageVersionedUpdateResult > ; copyObject : ( args : StorageCopyObjectArgs ) => Promise < StorageVersionedUpdateResult > ; listObjects : ( prefix : string ) => Promise < Array < StorageListInfo > > ; deleteBatch : ( args : StorageDeleteBatchArgs ) => Promise < StorageDeleteObjectsResult > ; getObjectLastModified : ( path : string ) => Promise < Date > ; getObjectConditional : ( args : StorageGetObjectConditionalArgs ) => Promise < StorageGetModifiedResult > } ) : Storage
69- static newLocalFilesystem ( path : string ) : Promise < Storage >
70- static newS3 ( bucket : string , prefix ?: string | undefined | null , credentials ?: S3Credentials | undefined | null , options ?: S3Options | undefined | null ) : Storage
71- static newR2 ( bucket ?: string | undefined | null , prefix ?: string | undefined | null , accountId ?: string | undefined | null , credentials ?: S3Credentials | undefined | null , options ?: S3Options | undefined | null ) : Storage
72- static newTigris ( bucket : string , prefix ?: string | undefined | null , credentials ?: S3Credentials | undefined | null , options ?: S3Options | undefined | null , useWeakConsistency ?: boolean | undefined | null ) : Storage
73- static newS3ObjectStore ( bucket : string , prefix ?: string | undefined | null , credentials ?: S3Credentials | undefined | null , options ?: S3Options | undefined | null ) : Promise < Storage >
74- static newGcs ( bucket : string , prefix ?: string | undefined | null , credentials ?: GcsCredentials | undefined | null , config ?: Record < string , string > | undefined | null ) : Storage
75- static newAzureBlob ( account : string , container : string , prefix ?: string | undefined | null , credentials ?: AzureCredentials | undefined | null , config ?: Record < string , string > | undefined | null ) : Promise < Storage >
76- static newHttp ( baseUrl : string , config ?: Record < string , string > | undefined | null ) : Storage
77- static newS3WithRefreshableCredentials ( bucket : string , prefix : string | undefined | null , credentialsCallback : ( ) => Promise < S3StaticCredentials > , initialCredentials ?: S3StaticCredentials | undefined | null , options ?: S3Options | undefined | null ) : Storage
78- static newR2WithRefreshableCredentials ( bucket : string | undefined | null , prefix : string | undefined | null , accountId : string | undefined | null , credentialsCallback : ( ) => Promise < S3StaticCredentials > , initialCredentials ?: S3StaticCredentials | undefined | null , options ?: S3Options | undefined | null ) : Storage
79- static newTigrisWithRefreshableCredentials ( bucket : string , prefix : string | undefined | null , credentialsCallback : ( ) => Promise < S3StaticCredentials > , initialCredentials ?: S3StaticCredentials | undefined | null , options ?: S3Options | undefined | null , useWeakConsistency ?: boolean | undefined | null ) : Storage
80- static newS3ObjectStoreWithRefreshableCredentials ( bucket : string , prefix : string | undefined | null , credentialsCallback : ( ) => Promise < S3StaticCredentials > , initialCredentials ?: S3StaticCredentials | undefined | null , options ?: S3Options | undefined | null ) : Promise < Storage >
81- static newGcsWithRefreshableCredentials ( bucket : string , prefix : string | undefined | null , credentialsCallback : ( ) => Promise < GcsBearerCredential > , initialCredentials ?: GcsBearerCredential | undefined | null , config ?: Record < string , string > | undefined | null ) : Storage
8267}
8368export type JsStorage = Storage
8469
8570export declare class Store {
86- get ( key : string ) : Promise < Buffer | null >
71+ get ( key : string ) : Promise < Uint8Array | null >
8772 /**
8873 * Fetch a byte range from a key.
8974 *
9075 * Accepts zarrita's RangeQuery format:
9176 * { offset: number, length: number } - fetch length bytes starting at offset
9277 * { suffixLength: number } - fetch the last suffixLength bytes
9378 */
94- getRange ( key : string , range : RangeQuery ) : Promise < Buffer | null >
79+ getRange ( key : string , range : RangeQuery ) : Promise < Uint8Array | null >
9580 set ( key : string , value : Buffer ) : Promise < void >
9681 exists ( key : string ) : Promise < boolean >
9782 delete ( key : string ) : Promise < void >
@@ -109,32 +94,9 @@ export declare class Store {
10994 deleteDir ( prefix : string ) : Promise < void >
11095 getsize ( key : string ) : Promise < number >
11196 getsizePrefix ( prefix : string ) : Promise < number >
112- /**
113- * Set a single virtual reference to a chunk
114- *
115- * For checksum validation, provide either etag_checksum (string) or last_modified (JS Date object).
116- * If both are provided, etag_checksum takes precedence.
117- */
118- setVirtualRef ( key : string , location : string , offset : number , length : number , etagChecksum : string | undefined | null , lastModified : Date | undefined | null , validateContainer : boolean ) : Promise < void >
119- /**
120- * Set multiple virtual references for the same array
121- * Returns the indices of failed chunk references if any
122- */
123- setVirtualRefs ( arrayPath : string , chunks : Array < VirtualChunkSpec > , validateContainers : boolean ) : Promise < Array < Array < number > > | null >
12497}
12598export type JsStore = Store
12699
127- /** Azure credentials */
128- export type AzureCredentials =
129- | { type : 'FromEnv' }
130- | { type : 'Static' , field0 : AzureStaticCredentials }
131-
132- /** Azure static credentials */
133- export type AzureStaticCredentials =
134- | { type : 'AccessKey' , field0 : string }
135- | { type : 'SasToken' , field0 : string }
136- | { type : 'BearerToken' , field0 : string }
137-
138100/** Caching configuration */
139101export interface CachingConfig {
140102 numSnapshotNodes ?: number
@@ -155,12 +117,6 @@ export interface CompressionConfig {
155117 level ?: number
156118}
157119
158- /** Credentials for virtual chunk access */
159- export type Credentials =
160- | { type : 'S3' , field0 : S3Credentials }
161- | { type : 'Gcs' , field0 : GcsCredentials }
162- | { type : 'Azure' , field0 : AzureCredentials }
163-
164120export interface DiffOptions {
165121 fromBranch ?: string
166122 fromTag ?: string
@@ -189,25 +145,6 @@ export interface FeatureFlag {
189145 enabled : boolean
190146}
191147
192- /** GCS bearer credential with optional expiry */
193- export interface GcsBearerCredential {
194- bearer : string
195- expiresAfter ?: Date
196- }
197-
198- /** GCS credentials */
199- export type GcsCredentials =
200- | { type : 'Anonymous' }
201- | { type : 'FromEnv' }
202- | { type : 'Static' , field0 : GcsStaticCredentials }
203-
204- /** GCS static credentials */
205- export type GcsStaticCredentials =
206- | { type : 'ServiceAccount' , field0 : string }
207- | { type : 'ServiceAccountKey' , field0 : string }
208- | { type : 'ApplicationCredentials' , field0 : string }
209- | { type : 'BearerToken' , field0 : string }
210-
211148export interface ManifestFileInfo {
212149 id : string
213150 sizeBytes : number
@@ -219,17 +156,6 @@ export interface MovedNode {
219156 to : string
220157}
221158
222- /** Object store configuration for virtual chunk containers */
223- export type ObjectStoreConfig =
224- | { type : 'InMemory' }
225- | { type : 'LocalFileSystem' , field0 : string }
226- | { type : 'Http' , field0 : Record < string , string > }
227- | { type : 'S3Compatible' , field0 : S3Options }
228- | { type : 'S3' , field0 : S3Options }
229- | { type : 'Gcs' , field0 : Record < string , string > }
230- | { type : 'Azure' , field0 : Record < string , string > }
231- | { type : 'Tigris' , field0 : S3Options }
232-
233159/**
234160 * Range query matching zarrita's RangeQuery type:
235161 * { offset: number, length: number } | { suffixLength: number }
@@ -246,28 +172,7 @@ export interface ReadonlySessionOptions {
246172 snapshotId ?: string
247173}
248174
249- /**
250- * Repository configuration
251- *
252- * The `manifest` field accepts a JSON object matching the serde serialization
253- * of `ManifestConfig`. Example:
254- * ```js
255- * {
256- * manifest: {
257- * preload: {
258- * max_total_refs: 1000,
259- * preload_if: { true: null },
260- * max_arrays_to_scan: 10
261- * },
262- * splitting: {
263- * split_sizes: [
264- * [{ path_matches: { regex: ".*" } }, [{ condition: "any", num_chunks: 100 }]]
265- * ]
266- * }
267- * }
268- * }
269- * ```
270- */
175+ /** Repository configuration (WASM build — no virtual chunk support) */
271176export interface RepositoryConfig {
272177 inlineChunkThresholdBytes ?: number
273178 getPartialValuesConcurrency ?: number
@@ -280,33 +185,6 @@ export interface RepositoryConfig {
280185 * The object is deserialized using serde, matching the Rust ManifestConfig structure.
281186 */
282187 manifest ?: any
283- /** Virtual chunk containers configuration */
284- virtualChunkContainers ?: Record < string , VirtualChunkContainer >
285- }
286-
287- /** S3 credentials */
288- export type S3Credentials =
289- | { type : 'FromEnv' }
290- | { type : 'Anonymous' }
291- | { type : 'Static' , field0 : S3StaticCredentials }
292-
293- /** S3 options */
294- export interface S3Options {
295- region ?: string
296- endpointUrl ?: string
297- allowHttp ?: boolean
298- anonymous ?: boolean
299- forcePathStyle ?: boolean
300- networkStreamTimeoutSeconds ?: number
301- requesterPays ?: boolean
302- }
303-
304- /** S3 static credentials */
305- export interface S3StaticCredentials {
306- accessKeyId : string
307- secretAccessKey : string
308- sessionToken ?: string
309- expiresAfter ?: Date
310188}
311189
312190export interface SnapshotInfo {
@@ -445,21 +323,3 @@ export interface VersionOptions {
445323 tag ?: string
446324 snapshotId ?: string
447325}
448-
449- /** Virtual chunk container configuration */
450- export interface VirtualChunkContainer {
451- name ?: string
452- urlPrefix : string
453- store : JsObjectStoreConfig
454- }
455-
456- /** Specification for a virtual chunk reference */
457- export interface VirtualChunkSpec {
458- index : Array < number >
459- location : string
460- offset : number
461- length : number
462- etagChecksum ?: string
463- /** Last modified datetime (accepts JS Date object) */
464- lastModified ?: Date
465- }
0 commit comments