1
- import type { Async , Readable } from "@zarrita/storage" ;
1
+ import type { Readable } from "@zarrita/storage" ;
2
2
import type {
3
3
ArrayMetadata ,
4
4
Attributes ,
@@ -14,29 +14,29 @@ import {
14
14
} from "./util.js" ;
15
15
16
16
async function load_attrs (
17
- location : Location < Readable | Async < Readable > > ,
17
+ location : Location < Readable > ,
18
18
) : Promise < Attributes > {
19
19
let meta_bytes = await location . store . get ( location . resolve ( ".zattrs" ) . path ) ;
20
20
if ( ! meta_bytes ) return { } ;
21
21
return json_decode_object ( meta_bytes ) ;
22
22
}
23
23
24
- function open_v2 < Store extends Readable | Async < Readable > > (
24
+ function open_v2 < Store extends Readable > (
25
25
location : Location < Store > | Store ,
26
26
options : { kind : "group" ; attrs ?: boolean } ,
27
27
) : Promise < Group < Store > > ;
28
28
29
- function open_v2 < Store extends Readable | Async < Readable > > (
29
+ function open_v2 < Store extends Readable > (
30
30
location : Location < Store > | Store ,
31
31
options : { kind : "array" ; attrs ?: boolean } ,
32
32
) : Promise < Array < DataType , Store > > ;
33
33
34
- function open_v2 < Store extends Readable | Async < Readable > > (
34
+ function open_v2 < Store extends Readable > (
35
35
location : Location < Store > | Store ,
36
36
options ?: { kind ?: "array" | "group" ; attrs ?: boolean } ,
37
37
) : Promise < Array < DataType , Store > | Group < Store > > ;
38
38
39
- async function open_v2 < Store extends Readable | Async < Readable > > (
39
+ async function open_v2 < Store extends Readable > (
40
40
location : Location < Store > | Store ,
41
41
options : { kind ?: "array" | "group" ; attrs ?: boolean } = { } ,
42
42
) {
@@ -51,7 +51,7 @@ async function open_v2<Store extends Readable | Async<Readable>>(
51
51
} ) ;
52
52
}
53
53
54
- async function open_array_v2 < Store extends Readable | Async < Readable > > (
54
+ async function open_array_v2 < Store extends Readable > (
55
55
location : Location < Store > ,
56
56
attrs : Attributes ,
57
57
) {
@@ -67,7 +67,7 @@ async function open_array_v2<Store extends Readable | Async<Readable>>(
67
67
) ;
68
68
}
69
69
70
- async function open_group_v2 < Store extends Readable | Async < Readable > > (
70
+ async function open_group_v2 < Store extends Readable > (
71
71
location : Location < Store > ,
72
72
attrs : Attributes ,
73
73
) {
@@ -83,7 +83,7 @@ async function open_group_v2<Store extends Readable | Async<Readable>>(
83
83
) ;
84
84
}
85
85
86
- async function _open_v3 < Store extends Readable | Async < Readable > > (
86
+ async function _open_v3 < Store extends Readable > (
87
87
location : Location < Store > ,
88
88
) {
89
89
let { store, path } = location . resolve ( "zarr.json" ) ;
@@ -99,21 +99,25 @@ async function _open_v3<Store extends Readable | Async<Readable>>(
99
99
: new Group ( store , location . path , meta_doc ) ;
100
100
}
101
101
102
- function open_v3 < Store extends Readable | Async < Readable > > (
102
+ function open_v3 < Store extends Readable > (
103
103
location : Location < Store > | Store ,
104
104
options : { kind : "group" } ,
105
105
) : Promise < Group < Store > > ;
106
106
107
- function open_v3 < Store extends Readable | Async < Readable > > (
107
+ function open_v3 < Store extends Readable > (
108
108
location : Location < Store > | Store ,
109
109
options : { kind : "array" } ,
110
110
) : Promise < Array < DataType , Store > > ;
111
111
112
- function open_v3 < Store extends Readable | Async < Readable > > (
112
+ function open_v3 < Store extends Readable > (
113
113
location : Location < Store > | Store ,
114
114
) : Promise < Array < DataType , Store > | Group < Store > > ;
115
115
116
- async function open_v3 < Store extends Readable | Async < Readable > > (
116
+ function open_v3 < Store extends Readable > (
117
+ location : Location < Store > | Store ,
118
+ ) : Promise < Array < DataType , Store > | Group < Store > > ;
119
+
120
+ async function open_v3 < Store extends Readable > (
117
121
location : Location < Store > ,
118
122
options : { kind ?: "array" | "group" } = { } ,
119
123
) : Promise < Array < DataType , Store > | Group < Store > > {
@@ -126,26 +130,26 @@ async function open_v3<Store extends Readable | Async<Readable>>(
126
130
throw new Error ( `Expected node of kind ${ options . kind } , found ${ kind } .` ) ;
127
131
}
128
132
129
- export function open < Store extends Readable | Async < Readable > > (
133
+ export function open < Store extends Readable > (
130
134
location : Location < Store > | Store ,
131
135
options : { kind : "group" } ,
132
136
) : Promise < Group < Store > > ;
133
137
134
- export function open < Store extends Readable | Async < Readable > > (
138
+ export function open < Store extends Readable > (
135
139
location : Location < Store > | Store ,
136
140
options : { kind : "array" } ,
137
141
) : Promise < Array < DataType , Store > > ;
138
142
139
- export function open < Store extends Readable | Async < Readable > > (
143
+ export function open < Store extends Readable > (
140
144
location : Location < Store > | Store ,
141
145
options : { kind : "auto" } ,
142
146
) : Promise < Array < DataType , Store > | Group < Store > > ;
143
147
144
- export function open < Store extends Readable | Async < Readable > > (
148
+ export function open < Store extends Readable > (
145
149
location : Location < Store > | Store ,
146
150
) : Promise < Array < DataType , Store > | Group < Store > > ;
147
151
148
- export async function open < Store extends Readable | Async < Readable > > (
152
+ export async function open < Store extends Readable > (
149
153
location : Location < Store > | Store ,
150
154
options : { kind : "auto" | "array" | "group" } = { kind : "auto" } ,
151
155
) : Promise < Array < DataType , Store > | Group < Store > > {
0 commit comments