-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
92 lines (84 loc) · 2.42 KB
/
index.d.ts
File metadata and controls
92 lines (84 loc) · 2.42 KB
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
86
87
88
89
90
91
92
/**
* signed 64-bit integer
*/
type Int64 = string;
export type Index = string;
/**
* unsigned 32-bit integer
*/
export type Flag = number;
/**
* unsigned 64-bit integer
*/
export type Uint64 = string;
export class File {
close(): void;
read(buffer: Uint8Array, length: Uint64): void;
seek(offset: Index, whence: number): void;
tell(): Index;
isSeekable(): boolean;
}
export class Stat {
name(): string;
size(): Uint64;
compressedSize(): string;
crc(): number;
encryptionMethod(): number;
modificationTime(): string;
index(): Index;
valid(): Flag;
}
export class Source {}
export class Archive {
/**
* @see {@link https://libzip.org/documentation/zip_source_buffer.html}
*/
sourceBuffer(data: Uint8Array): Source;
/**
* @see {@link https://libzip.org/documentation/zip_source_file.html}
*/
sourceFile(fname: string, start: Uint64, len: Int64 | /* int32 */ number): Source;
/**
* @see {@link https://libzip.org/documentation/zip_file_add.html}
* @returns @type {Index}
*/
addFile(path: string, src: Source, flags: Flag): Index;
/**
* @see {@link https://libzip.org/documentation/zip_open.html}
*/
open(path: string, flags: Flag): void;
/**
* @see {@link https://libzip.org/documentation/zip_fopen.html}
*/
openFile(fname: string, flags: Flag): File;
/**
* @see {@link https://libzip.org/documentation/zip_fopen_index.html}
*/
openFileByIndex(index: Index, flags: Flag): File;
/**
* @see {@link https://libzip.org/documentation/zip_close.html}
*/
close(): void;
/**
* @see {@link https://libzip.org/documentation/zip_delete.html}
*/
delete(index: Index);
/**
* @see {@link https://libzip.org/documentation/zip_file_name.html}
*/
renameFile(index: Index, newName: string, flags: Flag): void;
stat(fname: string, flags: Flag, stat: Stat): void;
/**
* @see {@link https://libzip.org/documentation/zip_stat_index.html}
*/
statIndex(index: Index, flags: Flag, stat: Stat): void;
nameLocate(path: string, flags: Flag): Index;
getNumEntries(flags: Flag): Index;
getName(index: Index, flags: Flag): Index;
/**
* @see {@link https://libzip.org/documentation/zip_dir_add.html}
*/
addDirectory(path: string, flags: Flags): Index;
discard(): void;
}
export const constants: import("./constants").IConstants;