-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.d.ts
85 lines (77 loc) · 1.73 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
type ValueOf<T> = T[keyof T];
export type Dtypes = {
"<u1": {
name: "uint8";
size: 8;
arrayConstructor: typeof Uint8Array;
};
"|u1": {
name: "uint8";
size: 8;
arrayConstructor: typeof Uint8Array;
};
"<u2": {
name: "uint16";
size: 16;
arrayConstructor: typeof Uint16Array;
};
"|i1": {
name: "int8";
size: 8;
arrayConstructor: typeof Int8Array;
};
"<i2": {
name: "int16";
size: 16;
arrayConstructor: typeof Int16Array;
};
"<u4": {
name: "uint32";
size: 32;
arrayConstructor: typeof Int32Array;
};
"<i4": {
name: "int32";
size: 32;
arrayConstructor: typeof Int32Array;
};
"<u8": {
name: "uint64";
size: 64;
arrayConstructor: typeof BigUint64Array;
};
"<i8": {
name: "int64";
size: 64;
arrayConstructor: typeof BigInt64Array;
};
"<f4": {
name: "float32";
size: 32;
arrayConstructor: typeof Float32Array;
};
"<f8": {
name: "float64";
size: 64;
arrayConstructor: typeof Float64Array;
};
};
export type Parsed = ValueOf<{
[K in keyof Dtypes]: {
dtype: Dtypes[K]["name"];
data: InstanceType<Dtypes[K]["arrayConstructor"]>;
shape: number[];
fortranOrder: boolean;
};
}>;
declare class npyjs {
constructor(opts?: never);
dtypes: Dtypes;
parse(arrayBufferContents: ArrayBuffer): Parsed;
load(
filename: RequestInfo | URL | ArrayBuffer,
callback?: (result?: Parsed) => any,
fetchArgs?: RequestInit
): Promise<Parsed>;
}
export default npyjs;