@jamiephan/casclib 0.0.0-dev.3 → 0.0.0-dev.5
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.
- package/README.md +7 -7
- package/build/Release/casclib.node +0 -0
- package/dist/cjs/bindings.d.ts.map +1 -0
- package/dist/{bindings.js → cjs/bindings.js} +19 -0
- package/dist/cjs/bindings.js.map +1 -0
- package/dist/cjs/index.d.ts +233 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +289 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/bindings.d.ts +229 -0
- package/dist/esm/bindings.d.ts.map +1 -0
- package/dist/esm/bindings.js +142 -0
- package/dist/esm/bindings.js.map +1 -0
- package/dist/esm/index.d.ts +233 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +270 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/bindings.d.ts +229 -0
- package/dist/types/bindings.d.ts.map +1 -0
- package/dist/types/index.d.ts +233 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +10 -7
- package/prebuilds/win32-x64/@jamiephan+casclib.node +0 -0
- package/dist/bindings.d.ts.map +0 -1
- package/dist/bindings.js.map +0 -1
- package/dist/bindings.mjs +0 -9
- package/dist/index.d.ts +0 -54
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -121
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -18
- /package/dist/{bindings.d.ts → cjs/bindings.d.ts} +0 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.File = exports.Storage = void 0;
|
|
18
|
+
const bindings_1 = require("./bindings");
|
|
19
|
+
/**
|
|
20
|
+
* CascLib Storage wrapper class
|
|
21
|
+
* Provides methods to interact with CASC storage archives
|
|
22
|
+
*/
|
|
23
|
+
class Storage {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.storage = new bindings_1.CascStorageBinding();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Open a CASC storage at the specified path
|
|
29
|
+
* @param path - Path to the CASC storage directory
|
|
30
|
+
* @param options - Optional opening options
|
|
31
|
+
*/
|
|
32
|
+
open(path, options) {
|
|
33
|
+
this.storage.CascOpenStorage(path, options?.flags || 0);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Open an online CASC storage
|
|
37
|
+
* @param path - Connection string in the format: `local_cache_folder[*cdn_server_url]*code_name[*region]`
|
|
38
|
+
* - `local_cache_folder`: Local cache directory for downloaded game data (reusable)
|
|
39
|
+
* - Windows: `C:/Temp/CASC/Cache`
|
|
40
|
+
* - Linux: `/tmp/casc/cache`
|
|
41
|
+
* - `cdn_server_url`: Optional CDN server URL (e.g., "http://us.patch.battle.net:1119")
|
|
42
|
+
* - `code_name`: TACT product code (e.g., "hero" for Heroes of the Storm, "wow" for World of Warcraft)
|
|
43
|
+
* See https://wowdev.wiki/TACT for available product codes
|
|
44
|
+
* - `region`: Optional server region (e.g., "us", "eu", "kr", "tw", "cn")
|
|
45
|
+
* @param options - Optional opening options
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Windows - Basic usage with minimal parameters
|
|
49
|
+
* storage.openOnline('C:/Temp/CASC/Cache*hero');
|
|
50
|
+
*
|
|
51
|
+
* // Linux - Basic usage
|
|
52
|
+
* storage.openOnline('/tmp/casc/cache*hero');
|
|
53
|
+
*
|
|
54
|
+
* // With CDN server specified
|
|
55
|
+
* storage.openOnline('C:/Temp/CASC/Cache*http://us.patch.battle.net:1119*hero');
|
|
56
|
+
*
|
|
57
|
+
* // With region specified
|
|
58
|
+
* storage.openOnline('/tmp/casc/cache*hero*us');
|
|
59
|
+
*
|
|
60
|
+
* // Full format with all parameters
|
|
61
|
+
* storage.openOnline('C:/Temp/CASC/Cache*http://us.patch.battle.net:1119*hero*us');
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
openOnline(path, options) {
|
|
65
|
+
this.storage.CascOpenOnlineStorage(path, options?.flags || 0);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Open a CASC storage with extended parameters (CascOpenStorageEx)
|
|
69
|
+
* @param params - Path or parameter string
|
|
70
|
+
* @param options - Extended opening options
|
|
71
|
+
*/
|
|
72
|
+
openEx(params, options) {
|
|
73
|
+
this.storage.CascOpenStorageEx(params, options);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Close the CASC storage
|
|
77
|
+
*/
|
|
78
|
+
close() {
|
|
79
|
+
return this.storage.CascCloseStorage();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Open a file from the storage
|
|
83
|
+
* @param filename - Name of the file to open
|
|
84
|
+
* @param options - Optional opening options
|
|
85
|
+
* @returns A File object
|
|
86
|
+
*/
|
|
87
|
+
openFile(filename, options) {
|
|
88
|
+
const file = this.storage.CascOpenFile(filename, options?.flags || 0);
|
|
89
|
+
return new File(file);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get information about a file
|
|
93
|
+
* @param filename - Name of the file
|
|
94
|
+
* @returns File information or null if file doesn't exist
|
|
95
|
+
*/
|
|
96
|
+
getFileInfo(filename) {
|
|
97
|
+
return this.storage.CascGetFileInfo(filename);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Check if a file exists in the storage
|
|
101
|
+
* @param filename - Name of the file
|
|
102
|
+
* @returns true if file exists, false otherwise
|
|
103
|
+
*/
|
|
104
|
+
fileExists(filename) {
|
|
105
|
+
return this.storage.fileExists(filename);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get storage information
|
|
109
|
+
* @param infoClass - The type of information to retrieve
|
|
110
|
+
* @returns Storage information object
|
|
111
|
+
*/
|
|
112
|
+
getStorageInfo(infoClass) {
|
|
113
|
+
return this.storage.CascGetStorageInfo(infoClass);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Find the first file matching the mask
|
|
117
|
+
* @param mask - File mask (e.g., "*.txt")
|
|
118
|
+
* @param listFile - Optional list file path
|
|
119
|
+
* @returns Find data or null if no files found
|
|
120
|
+
*/
|
|
121
|
+
findFirstFile(mask, listFile) {
|
|
122
|
+
return this.storage.CascFindFirstFile(mask, listFile);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Find the next file in the search
|
|
126
|
+
* @returns Find data or null if no more files
|
|
127
|
+
*/
|
|
128
|
+
findNextFile() {
|
|
129
|
+
return this.storage.CascFindNextFile();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Close the current find operation
|
|
133
|
+
* @returns true if closed successfully
|
|
134
|
+
*/
|
|
135
|
+
findClose() {
|
|
136
|
+
return this.storage.CascFindClose();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Add an encryption key to the storage
|
|
140
|
+
* @param keyName - Name/ID of the key
|
|
141
|
+
* @param key - Key data as Buffer
|
|
142
|
+
* @returns true if added successfully
|
|
143
|
+
*/
|
|
144
|
+
addEncryptionKey(keyName, key) {
|
|
145
|
+
return this.storage.CascAddEncryptionKey(keyName, key);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Add an encryption key from a string
|
|
149
|
+
* @param keyName - Name/ID of the key
|
|
150
|
+
* @param keyStr - Key as string
|
|
151
|
+
* @returns true if added successfully
|
|
152
|
+
*/
|
|
153
|
+
addStringEncryptionKey(keyName, keyStr) {
|
|
154
|
+
return this.storage.CascAddStringEncryptionKey(keyName, keyStr);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Import encryption keys from a string
|
|
158
|
+
* @param keyList - String containing key list
|
|
159
|
+
* @returns true if imported successfully
|
|
160
|
+
*/
|
|
161
|
+
importKeysFromString(keyList) {
|
|
162
|
+
return this.storage.CascImportKeysFromString(keyList);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Import encryption keys from a file
|
|
166
|
+
* @param filePath - Path to the key file
|
|
167
|
+
* @returns true if imported successfully
|
|
168
|
+
*/
|
|
169
|
+
importKeysFromFile(filePath) {
|
|
170
|
+
return this.storage.CascImportKeysFromFile(filePath);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Find an encryption key by name
|
|
174
|
+
* @param keyName - Name/ID of the key
|
|
175
|
+
* @returns Key data or null if not found
|
|
176
|
+
*/
|
|
177
|
+
findEncryptionKey(keyName) {
|
|
178
|
+
return this.storage.CascFindEncryptionKey(keyName);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get the name of an encryption key that was not found
|
|
182
|
+
* @returns Key name or null
|
|
183
|
+
*/
|
|
184
|
+
getNotFoundEncryptionKey() {
|
|
185
|
+
return this.storage.CascGetNotFoundEncryptionKey();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.Storage = Storage;
|
|
189
|
+
/**
|
|
190
|
+
* CascLib File wrapper class
|
|
191
|
+
* Represents an open file in CASC storage
|
|
192
|
+
*/
|
|
193
|
+
class File {
|
|
194
|
+
constructor(file) {
|
|
195
|
+
this.file = file;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Read data from the file
|
|
199
|
+
* @param bytesToRead - Number of bytes to read (default: 4096)
|
|
200
|
+
* @returns Buffer containing the read data
|
|
201
|
+
*/
|
|
202
|
+
read(bytesToRead) {
|
|
203
|
+
return this.file.CascReadFile(bytesToRead || 4096);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Read all data from the file
|
|
207
|
+
* @returns Buffer containing all file data
|
|
208
|
+
*/
|
|
209
|
+
readAll() {
|
|
210
|
+
return this.file.readFileAll();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get the file size (32-bit)
|
|
214
|
+
* @returns File size in bytes
|
|
215
|
+
*/
|
|
216
|
+
getSize() {
|
|
217
|
+
return this.file.CascGetFileSize();
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Get the file size (64-bit)
|
|
221
|
+
* @returns File size in bytes
|
|
222
|
+
*/
|
|
223
|
+
getSize64() {
|
|
224
|
+
return this.file.CascGetFileSize64();
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Get the current file position (32-bit)
|
|
228
|
+
* @returns Current position in bytes
|
|
229
|
+
*/
|
|
230
|
+
getPosition() {
|
|
231
|
+
return this.file.CascGetFilePointer();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get the current file position (64-bit)
|
|
235
|
+
* @returns Current position in bytes
|
|
236
|
+
*/
|
|
237
|
+
getPosition64() {
|
|
238
|
+
return this.file.CascGetFilePointer64();
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Set the file position (32-bit)
|
|
242
|
+
* @param position - New position in bytes
|
|
243
|
+
* @returns The new position
|
|
244
|
+
*/
|
|
245
|
+
setPosition(position) {
|
|
246
|
+
return this.file.CascSetFilePointer(position);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Set the file position (64-bit)
|
|
250
|
+
* @param position - New position in bytes
|
|
251
|
+
* @param moveMethod - Move method (FILE_BEGIN, FILE_CURRENT, FILE_END)
|
|
252
|
+
* @returns The new position
|
|
253
|
+
*/
|
|
254
|
+
setPosition64(position, moveMethod) {
|
|
255
|
+
return this.file.CascSetFilePointer64(position, moveMethod);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Get detailed file information
|
|
259
|
+
* @param infoClass - The type of information to retrieve
|
|
260
|
+
* @returns File information object
|
|
261
|
+
*/
|
|
262
|
+
getFileInfo(infoClass) {
|
|
263
|
+
return this.file.CascGetFileInfo(infoClass);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Set file flags
|
|
267
|
+
* @param flags - Flags to set
|
|
268
|
+
* @returns true if set successfully
|
|
269
|
+
*/
|
|
270
|
+
setFileFlags(flags) {
|
|
271
|
+
return this.file.CascSetFileFlags(flags);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Close the file
|
|
275
|
+
* @returns true if closed successfully
|
|
276
|
+
*/
|
|
277
|
+
close() {
|
|
278
|
+
return this.file.CascCloseFile();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
exports.File = File;
|
|
282
|
+
// Re-export everything from bindings
|
|
283
|
+
__exportStar(require("./bindings"), exports);
|
|
284
|
+
// High-level exports
|
|
285
|
+
exports.default = {
|
|
286
|
+
Storage,
|
|
287
|
+
File
|
|
288
|
+
};
|
|
289
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAUoB;AA4BpB;;;GAGG;AACH,MAAa,OAAO;IAGlB;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,6BAAkB,EAAE,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,IAAY,EAAE,OAA4B;QAC7C,IAAI,CAAC,OA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1,
|
|
4
|
+
Features = 2,
|
|
5
|
+
InstalledLocales = 3,
|
|
6
|
+
Product = 4,
|
|
7
|
+
Tags = 5,
|
|
8
|
+
PathProduct = 6
|
|
9
|
+
}
|
|
10
|
+
export declare enum CascFileInfoClass {
|
|
11
|
+
ContentKey = 0,
|
|
12
|
+
EncodedKey = 1,
|
|
13
|
+
FullInfo = 2,
|
|
14
|
+
SpanInfo = 3
|
|
15
|
+
}
|
|
16
|
+
export declare enum CascNameType {
|
|
17
|
+
Full = 0,
|
|
18
|
+
DataId = 1,
|
|
19
|
+
CKey = 2,
|
|
20
|
+
EKey = 3
|
|
21
|
+
}
|
|
22
|
+
export interface CascFindData {
|
|
23
|
+
fileName: string;
|
|
24
|
+
ckey: Buffer;
|
|
25
|
+
ekey: Buffer;
|
|
26
|
+
tagBitMask: number;
|
|
27
|
+
fileSize: number;
|
|
28
|
+
plainName: string | null;
|
|
29
|
+
fileDataId: number;
|
|
30
|
+
localeFlags: number;
|
|
31
|
+
contentFlags: number;
|
|
32
|
+
spanCount: number;
|
|
33
|
+
available: boolean;
|
|
34
|
+
nameType: CascNameType;
|
|
35
|
+
}
|
|
36
|
+
export interface CascStorageProduct {
|
|
37
|
+
codeName: string;
|
|
38
|
+
buildNumber: number;
|
|
39
|
+
}
|
|
40
|
+
export interface CascStorageInfo {
|
|
41
|
+
fileCount?: number;
|
|
42
|
+
features?: number;
|
|
43
|
+
codeName?: string;
|
|
44
|
+
buildNumber?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface CascFileFullInfo {
|
|
47
|
+
ckey: Buffer;
|
|
48
|
+
ekey: Buffer;
|
|
49
|
+
dataFileName: string;
|
|
50
|
+
storageOffset: number;
|
|
51
|
+
segmentOffset: number;
|
|
52
|
+
tagBitMask: number;
|
|
53
|
+
fileNameHash: number;
|
|
54
|
+
contentSize: number;
|
|
55
|
+
encodedSize: number;
|
|
56
|
+
segmentIndex: number;
|
|
57
|
+
spanCount: number;
|
|
58
|
+
fileDataId: number;
|
|
59
|
+
localeFlags: number;
|
|
60
|
+
contentFlags: number;
|
|
61
|
+
}
|
|
62
|
+
export interface CascFileSpanInfo {
|
|
63
|
+
ckey: Buffer;
|
|
64
|
+
ekey: Buffer;
|
|
65
|
+
startOffset: number;
|
|
66
|
+
endOffset: number;
|
|
67
|
+
archiveIndex: number;
|
|
68
|
+
archiveOffs: number;
|
|
69
|
+
headerSize: number;
|
|
70
|
+
frameCount: number;
|
|
71
|
+
}
|
|
72
|
+
export interface CascFileInfoResult {
|
|
73
|
+
ckey?: Buffer;
|
|
74
|
+
ekey?: Buffer;
|
|
75
|
+
dataFileName?: string;
|
|
76
|
+
storageOffset?: number;
|
|
77
|
+
segmentOffset?: number;
|
|
78
|
+
tagBitMask?: number;
|
|
79
|
+
fileNameHash?: number;
|
|
80
|
+
contentSize?: number;
|
|
81
|
+
encodedSize?: number;
|
|
82
|
+
segmentIndex?: number;
|
|
83
|
+
spanCount?: number;
|
|
84
|
+
fileDataId?: number;
|
|
85
|
+
localeFlags?: number;
|
|
86
|
+
contentFlags?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface CascOpenStorageExOptions {
|
|
89
|
+
localPath?: string;
|
|
90
|
+
codeName?: string;
|
|
91
|
+
region?: string;
|
|
92
|
+
localeMask?: number;
|
|
93
|
+
flags?: number;
|
|
94
|
+
buildKey?: string;
|
|
95
|
+
cdnHostUrl?: string;
|
|
96
|
+
online?: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface CascStorage {
|
|
99
|
+
CascOpenStorage(path: string, flags: number): boolean;
|
|
100
|
+
CascOpenOnlineStorage(path: string, flags: number): boolean;
|
|
101
|
+
CascOpenStorageEx(params: string, options?: CascOpenStorageExOptions): boolean;
|
|
102
|
+
CascCloseStorage(): boolean;
|
|
103
|
+
CascOpenFile(filename: string, flags: number): CascFile;
|
|
104
|
+
CascGetFileInfo(filename: string): {
|
|
105
|
+
name: string;
|
|
106
|
+
size: number;
|
|
107
|
+
} | null;
|
|
108
|
+
fileExists(filename: string): boolean;
|
|
109
|
+
CascGetStorageInfo(infoClass: number): CascStorageInfo;
|
|
110
|
+
CascFindFirstFile(mask?: string, listFile?: string): CascFindData | null;
|
|
111
|
+
CascFindNextFile(): CascFindData | null;
|
|
112
|
+
CascFindClose(): boolean;
|
|
113
|
+
CascAddEncryptionKey(keyName: number, key: Buffer): boolean;
|
|
114
|
+
CascAddStringEncryptionKey(keyName: number, keyStr: string): boolean;
|
|
115
|
+
CascImportKeysFromString(keyList: string): boolean;
|
|
116
|
+
CascImportKeysFromFile(filePath: string): boolean;
|
|
117
|
+
CascFindEncryptionKey(keyName: number): Buffer | null;
|
|
118
|
+
CascGetNotFoundEncryptionKey(): number | null;
|
|
119
|
+
}
|
|
120
|
+
export interface CascFile {
|
|
121
|
+
CascReadFile(bytesToRead: number): Buffer;
|
|
122
|
+
readFileAll(): Buffer;
|
|
123
|
+
CascGetFileSize(): number;
|
|
124
|
+
CascGetFileSize64(): number;
|
|
125
|
+
CascGetFilePointer(): number;
|
|
126
|
+
CascGetFilePointer64(): number;
|
|
127
|
+
CascSetFilePointer(position: number): number;
|
|
128
|
+
CascSetFilePointer64(position: number, moveMethod?: number): number;
|
|
129
|
+
CascGetFileInfo(infoClass: number): CascFileInfoResult;
|
|
130
|
+
CascSetFileFlags(flags: number): boolean;
|
|
131
|
+
CascCloseFile(): boolean;
|
|
132
|
+
}
|
|
133
|
+
export declare const CascStorageBinding: new () => CascStorage;
|
|
134
|
+
export declare const CascFileBinding: new () => CascFile;
|
|
135
|
+
export declare const CascOpenLocalFile: (filename: string, flags?: number) => CascFile;
|
|
136
|
+
export declare const GetCascError: () => number;
|
|
137
|
+
export declare const SetCascError: (error: number) => void;
|
|
138
|
+
export declare const CascCdnGetDefault: () => string | null;
|
|
139
|
+
export declare const CascCdnDownload: (cdnHostUrl: string, product: string, fileName: string) => Buffer | null;
|
|
140
|
+
export declare const CASCLIB_VERSION: number;
|
|
141
|
+
export declare const CASCLIB_VERSION_STRING: string;
|
|
142
|
+
export declare const FILE_BEGIN: number;
|
|
143
|
+
export declare const FILE_CURRENT: number;
|
|
144
|
+
export declare const FILE_END: number;
|
|
145
|
+
export declare const CASC_FILEID_FORMAT: string;
|
|
146
|
+
export declare const CASC_PARAM_SEPARATOR: string;
|
|
147
|
+
export declare const CascProgressLoadingFile: number;
|
|
148
|
+
export declare const CascProgressLoadingManifest: number;
|
|
149
|
+
export declare const CascProgressDownloadingFile: number;
|
|
150
|
+
export declare const CascProgressLoadingIndexes: number;
|
|
151
|
+
export declare const CascProgressDownloadingArchiveIndexes: number;
|
|
152
|
+
export declare const CASC_OPEN_BY_NAME: number;
|
|
153
|
+
export declare const CASC_OPEN_BY_CKEY: number;
|
|
154
|
+
export declare const CASC_OPEN_BY_EKEY: number;
|
|
155
|
+
export declare const CASC_OPEN_BY_FILEID: number;
|
|
156
|
+
export declare const CASC_OPEN_TYPE_MASK: number;
|
|
157
|
+
export declare const CASC_OPEN_FLAGS_MASK: number;
|
|
158
|
+
export declare const CASC_STRICT_DATA_CHECK: number;
|
|
159
|
+
export declare const CASC_OVERCOME_ENCRYPTED: number;
|
|
160
|
+
export declare const CASC_OPEN_CKEY_ONCE: number;
|
|
161
|
+
export declare const CASC_LOCALE_ALL: number;
|
|
162
|
+
export declare const CASC_LOCALE_ALL_WOW: number;
|
|
163
|
+
export declare const CASC_LOCALE_NONE: number;
|
|
164
|
+
export declare const CASC_LOCALE_UNKNOWN1: number;
|
|
165
|
+
export declare const CASC_LOCALE_ENUS: number;
|
|
166
|
+
export declare const CASC_LOCALE_KOKR: number;
|
|
167
|
+
export declare const CASC_LOCALE_RESERVED: number;
|
|
168
|
+
export declare const CASC_LOCALE_FRFR: number;
|
|
169
|
+
export declare const CASC_LOCALE_DEDE: number;
|
|
170
|
+
export declare const CASC_LOCALE_ZHCN: number;
|
|
171
|
+
export declare const CASC_LOCALE_ESES: number;
|
|
172
|
+
export declare const CASC_LOCALE_ZHTW: number;
|
|
173
|
+
export declare const CASC_LOCALE_ENGB: number;
|
|
174
|
+
export declare const CASC_LOCALE_ENCN: number;
|
|
175
|
+
export declare const CASC_LOCALE_ENTW: number;
|
|
176
|
+
export declare const CASC_LOCALE_ESMX: number;
|
|
177
|
+
export declare const CASC_LOCALE_RURU: number;
|
|
178
|
+
export declare const CASC_LOCALE_PTBR: number;
|
|
179
|
+
export declare const CASC_LOCALE_ITIT: number;
|
|
180
|
+
export declare const CASC_LOCALE_PTPT: number;
|
|
181
|
+
export declare const CASC_CFLAG_INSTALL: number;
|
|
182
|
+
export declare const CASC_CFLAG_LOAD_ON_WINDOWS: number;
|
|
183
|
+
export declare const CASC_CFLAG_LOAD_ON_MAC: number;
|
|
184
|
+
export declare const CASC_CFLAG_X86_32: number;
|
|
185
|
+
export declare const CASC_CFLAG_X86_64: number;
|
|
186
|
+
export declare const CASC_CFLAG_LOW_VIOLENCE: number;
|
|
187
|
+
export declare const CASC_CFLAG_DONT_LOAD: number;
|
|
188
|
+
export declare const CASC_CFLAG_UPDATE_PLUGIN: number;
|
|
189
|
+
export declare const CASC_CFLAG_ARM64: number;
|
|
190
|
+
export declare const CASC_CFLAG_ENCRYPTED: number;
|
|
191
|
+
export declare const CASC_CFLAG_NO_NAME_HASH: number;
|
|
192
|
+
export declare const CASC_CFLAG_UNCMN_RESOLUTION: number;
|
|
193
|
+
export declare const CASC_CFLAG_BUNDLE: number;
|
|
194
|
+
export declare const CASC_CFLAG_NO_COMPRESSION: number;
|
|
195
|
+
export declare const MD5_HASH_SIZE: number;
|
|
196
|
+
export declare const MD5_STRING_SIZE: number;
|
|
197
|
+
export declare const SHA1_HASH_SIZE: number;
|
|
198
|
+
export declare const SHA1_STRING_SIZE: number;
|
|
199
|
+
export declare const CASC_INVALID_INDEX: number;
|
|
200
|
+
export declare const CASC_INVALID_SIZE: number;
|
|
201
|
+
export declare const CASC_INVALID_POS: number;
|
|
202
|
+
export declare const CASC_INVALID_ID: number;
|
|
203
|
+
export declare const CASC_INVALID_OFFS64: number;
|
|
204
|
+
export declare const CASC_INVALID_SIZE64: number;
|
|
205
|
+
export declare const CascStorageLocalFileCount: number;
|
|
206
|
+
export declare const CascStorageTotalFileCount: number;
|
|
207
|
+
export declare const CascStorageFeatures: number;
|
|
208
|
+
export declare const CascStorageInstalledLocales: number;
|
|
209
|
+
export declare const CascStorageProduct: number;
|
|
210
|
+
export declare const CascStorageTags: number;
|
|
211
|
+
export declare const CascStoragePathProduct: number;
|
|
212
|
+
export declare const CascFileContentKey: number;
|
|
213
|
+
export declare const CascFileEncodedKey: number;
|
|
214
|
+
export declare const CascFileFullInfo: number;
|
|
215
|
+
export declare const CascFileSpanInfo: number;
|
|
216
|
+
export declare const CASC_FEATURE_FILE_NAMES: number;
|
|
217
|
+
export declare const CASC_FEATURE_ROOT_CKEY: number;
|
|
218
|
+
export declare const CASC_FEATURE_TAGS: number;
|
|
219
|
+
export declare const CASC_FEATURE_FNAME_HASHES: number;
|
|
220
|
+
export declare const CASC_FEATURE_FNAME_HASHES_OPTIONAL: number;
|
|
221
|
+
export declare const CASC_FEATURE_FILE_DATA_IDS: number;
|
|
222
|
+
export declare const CASC_FEATURE_LOCALE_FLAGS: number;
|
|
223
|
+
export declare const CASC_FEATURE_CONTENT_FLAGS: number;
|
|
224
|
+
export declare const CASC_FEATURE_DATA_ARCHIVES: number;
|
|
225
|
+
export declare const CASC_FEATURE_DATA_FILES: number;
|
|
226
|
+
export declare const CASC_FEATURE_ONLINE: number;
|
|
227
|
+
export declare const CASC_FEATURE_FORCE_DOWNLOAD: number;
|
|
228
|
+
export declare const CASC_KEY_LENGTH: number;
|
|
229
|
+
//# sourceMappingURL=bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../lib/bindings.ts"],"names":[],"mappings":"AAKA,oBAAY,oBAAoB;IAC9B,cAAc,IAAI;IAClB,cAAc,IAAI;IAClB,QAAQ,IAAI;IACZ,gBAAgB,IAAI;IACpB,OAA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CAAC;AACtF,eAAO,MAAM,0BAA0B,EAAE,MAA4C,CAAC;AACtF,eAAO,MAAM,uBAAuB,EAAE,MAAyC,CAAC;AAChF,eAAO,MAAM,mBAAmB,EAAE,MAAqC,CAAC;AACxE,eAAO,MAAM,2BAA2B,EAAE,MAA6C,CAAC;AAGxF,eAAO,MAAM,eAAe,EAAE,MAAiC,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Native bindings for CascLib
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
const bindings = require('node-gyp-build')(path.join(__dirname, '..'));
|
|
4
|
+
// Storage info classes
|
|
5
|
+
export var CascStorageInfoClass;
|
|
6
|
+
(function (CascStorageInfoClass) {
|
|
7
|
+
CascStorageInfoClass[CascStorageInfoClass["LocalFileCount"] = 0] = "LocalFileCount";
|
|
8
|
+
CascStorageInfoClass[CascStorageInfoClass["TotalFileCount"] = 1] = "TotalFileCount";
|
|
9
|
+
CascStorageInfoClass[CascStorageInfoClass["Features"] = 2] = "Features";
|
|
10
|
+
CascStorageInfoClass[CascStorageInfoClass["InstalledLocales"] = 3] = "InstalledLocales";
|
|
11
|
+
CascStorageInfoClass[CascStorageInfoClass["Product"] = 4] = "Product";
|
|
12
|
+
CascStorageInfoClass[CascStorageInfoClass["Tags"] = 5] = "Tags";
|
|
13
|
+
CascStorageInfoClass[CascStorageInfoClass["PathProduct"] = 6] = "PathProduct";
|
|
14
|
+
})(CascStorageInfoClass || (CascStorageInfoClass = {}));
|
|
15
|
+
// File info classes
|
|
16
|
+
export var CascFileInfoClass;
|
|
17
|
+
(function (CascFileInfoClass) {
|
|
18
|
+
CascFileInfoClass[CascFileInfoClass["ContentKey"] = 0] = "ContentKey";
|
|
19
|
+
CascFileInfoClass[CascFileInfoClass["EncodedKey"] = 1] = "EncodedKey";
|
|
20
|
+
CascFileInfoClass[CascFileInfoClass["FullInfo"] = 2] = "FullInfo";
|
|
21
|
+
CascFileInfoClass[CascFileInfoClass["SpanInfo"] = 3] = "SpanInfo";
|
|
22
|
+
})(CascFileInfoClass || (CascFileInfoClass = {}));
|
|
23
|
+
// Name type enum
|
|
24
|
+
export var CascNameType;
|
|
25
|
+
(function (CascNameType) {
|
|
26
|
+
CascNameType[CascNameType["Full"] = 0] = "Full";
|
|
27
|
+
CascNameType[CascNameType["DataId"] = 1] = "DataId";
|
|
28
|
+
CascNameType[CascNameType["CKey"] = 2] = "CKey";
|
|
29
|
+
CascNameType[CascNameType["EKey"] = 3] = "EKey";
|
|
30
|
+
})(CascNameType || (CascNameType = {}));
|
|
31
|
+
export const CascStorageBinding = bindings.Storage;
|
|
32
|
+
export const CascFileBinding = bindings.File;
|
|
33
|
+
// Utility functions
|
|
34
|
+
export const CascOpenLocalFile = bindings.CascOpenLocalFile;
|
|
35
|
+
export const GetCascError = bindings.GetCascError;
|
|
36
|
+
export const SetCascError = bindings.SetCascError;
|
|
37
|
+
// CDN functions
|
|
38
|
+
export const CascCdnGetDefault = bindings.CascCdnGetDefault;
|
|
39
|
+
export const CascCdnDownload = bindings.CascCdnDownload;
|
|
40
|
+
// Version constants
|
|
41
|
+
export const CASCLIB_VERSION = bindings.CASCLIB_VERSION || 0x0300;
|
|
42
|
+
export const CASCLIB_VERSION_STRING = "3.0";
|
|
43
|
+
// File positioning constants
|
|
44
|
+
export const FILE_BEGIN = bindings.FILE_BEGIN;
|
|
45
|
+
export const FILE_CURRENT = bindings.FILE_CURRENT;
|
|
46
|
+
export const FILE_END = bindings.FILE_END;
|
|
47
|
+
// Other useful constants
|
|
48
|
+
export const CASC_FILEID_FORMAT = bindings.CASC_FILEID_FORMAT;
|
|
49
|
+
export const CASC_PARAM_SEPARATOR = bindings.CASC_PARAM_SEPARATOR;
|
|
50
|
+
// Progress message constants
|
|
51
|
+
export const CascProgressLoadingFile = bindings.CascProgressLoadingFile;
|
|
52
|
+
export const CascProgressLoadingManifest = bindings.CascProgressLoadingManifest;
|
|
53
|
+
export const CascProgressDownloadingFile = bindings.CascProgressDownloadingFile;
|
|
54
|
+
export const CascProgressLoadingIndexes = bindings.CascProgressLoadingIndexes;
|
|
55
|
+
export const CascProgressDownloadingArchiveIndexes = bindings.CascProgressDownloadingArchiveIndexes;
|
|
56
|
+
// Open flags
|
|
57
|
+
export const CASC_OPEN_BY_NAME = bindings.CASC_OPEN_BY_NAME;
|
|
58
|
+
export const CASC_OPEN_BY_CKEY = bindings.CASC_OPEN_BY_CKEY;
|
|
59
|
+
export const CASC_OPEN_BY_EKEY = bindings.CASC_OPEN_BY_EKEY;
|
|
60
|
+
export const CASC_OPEN_BY_FILEID = bindings.CASC_OPEN_BY_FILEID;
|
|
61
|
+
export const CASC_OPEN_TYPE_MASK = bindings.CASC_OPEN_TYPE_MASK;
|
|
62
|
+
export const CASC_OPEN_FLAGS_MASK = bindings.CASC_OPEN_FLAGS_MASK;
|
|
63
|
+
export const CASC_STRICT_DATA_CHECK = bindings.CASC_STRICT_DATA_CHECK;
|
|
64
|
+
export const CASC_OVERCOME_ENCRYPTED = bindings.CASC_OVERCOME_ENCRYPTED;
|
|
65
|
+
export const CASC_OPEN_CKEY_ONCE = bindings.CASC_OPEN_CKEY_ONCE;
|
|
66
|
+
// Locale flags
|
|
67
|
+
export const CASC_LOCALE_ALL = bindings.CASC_LOCALE_ALL;
|
|
68
|
+
export const CASC_LOCALE_ALL_WOW = bindings.CASC_LOCALE_ALL_WOW;
|
|
69
|
+
export const CASC_LOCALE_NONE = bindings.CASC_LOCALE_NONE;
|
|
70
|
+
export const CASC_LOCALE_UNKNOWN1 = bindings.CASC_LOCALE_UNKNOWN1;
|
|
71
|
+
export const CASC_LOCALE_ENUS = bindings.CASC_LOCALE_ENUS;
|
|
72
|
+
export const CASC_LOCALE_KOKR = bindings.CASC_LOCALE_KOKR;
|
|
73
|
+
export const CASC_LOCALE_RESERVED = bindings.CASC_LOCALE_RESERVED;
|
|
74
|
+
export const CASC_LOCALE_FRFR = bindings.CASC_LOCALE_FRFR;
|
|
75
|
+
export const CASC_LOCALE_DEDE = bindings.CASC_LOCALE_DEDE;
|
|
76
|
+
export const CASC_LOCALE_ZHCN = bindings.CASC_LOCALE_ZHCN;
|
|
77
|
+
export const CASC_LOCALE_ESES = bindings.CASC_LOCALE_ESES;
|
|
78
|
+
export const CASC_LOCALE_ZHTW = bindings.CASC_LOCALE_ZHTW;
|
|
79
|
+
export const CASC_LOCALE_ENGB = bindings.CASC_LOCALE_ENGB;
|
|
80
|
+
export const CASC_LOCALE_ENCN = bindings.CASC_LOCALE_ENCN;
|
|
81
|
+
export const CASC_LOCALE_ENTW = bindings.CASC_LOCALE_ENTW;
|
|
82
|
+
export const CASC_LOCALE_ESMX = bindings.CASC_LOCALE_ESMX;
|
|
83
|
+
export const CASC_LOCALE_RURU = bindings.CASC_LOCALE_RURU;
|
|
84
|
+
export const CASC_LOCALE_PTBR = bindings.CASC_LOCALE_PTBR;
|
|
85
|
+
export const CASC_LOCALE_ITIT = bindings.CASC_LOCALE_ITIT;
|
|
86
|
+
export const CASC_LOCALE_PTPT = bindings.CASC_LOCALE_PTPT;
|
|
87
|
+
// Content flags
|
|
88
|
+
export const CASC_CFLAG_INSTALL = bindings.CASC_CFLAG_INSTALL;
|
|
89
|
+
export const CASC_CFLAG_LOAD_ON_WINDOWS = bindings.CASC_CFLAG_LOAD_ON_WINDOWS;
|
|
90
|
+
export const CASC_CFLAG_LOAD_ON_MAC = bindings.CASC_CFLAG_LOAD_ON_MAC;
|
|
91
|
+
export const CASC_CFLAG_X86_32 = bindings.CASC_CFLAG_X86_32;
|
|
92
|
+
export const CASC_CFLAG_X86_64 = bindings.CASC_CFLAG_X86_64;
|
|
93
|
+
export const CASC_CFLAG_LOW_VIOLENCE = bindings.CASC_CFLAG_LOW_VIOLENCE;
|
|
94
|
+
export const CASC_CFLAG_DONT_LOAD = bindings.CASC_CFLAG_DONT_LOAD;
|
|
95
|
+
export const CASC_CFLAG_UPDATE_PLUGIN = bindings.CASC_CFLAG_UPDATE_PLUGIN;
|
|
96
|
+
export const CASC_CFLAG_ARM64 = bindings.CASC_CFLAG_ARM64;
|
|
97
|
+
export const CASC_CFLAG_ENCRYPTED = bindings.CASC_CFLAG_ENCRYPTED;
|
|
98
|
+
export const CASC_CFLAG_NO_NAME_HASH = bindings.CASC_CFLAG_NO_NAME_HASH;
|
|
99
|
+
export const CASC_CFLAG_UNCMN_RESOLUTION = bindings.CASC_CFLAG_UNCMN_RESOLUTION;
|
|
100
|
+
export const CASC_CFLAG_BUNDLE = bindings.CASC_CFLAG_BUNDLE;
|
|
101
|
+
export const CASC_CFLAG_NO_COMPRESSION = bindings.CASC_CFLAG_NO_COMPRESSION;
|
|
102
|
+
// Hash sizes
|
|
103
|
+
export const MD5_HASH_SIZE = bindings.MD5_HASH_SIZE;
|
|
104
|
+
export const MD5_STRING_SIZE = bindings.MD5_STRING_SIZE;
|
|
105
|
+
export const SHA1_HASH_SIZE = bindings.SHA1_HASH_SIZE;
|
|
106
|
+
export const SHA1_STRING_SIZE = bindings.SHA1_STRING_SIZE;
|
|
107
|
+
// Invalid values
|
|
108
|
+
export const CASC_INVALID_INDEX = bindings.CASC_INVALID_INDEX;
|
|
109
|
+
export const CASC_INVALID_SIZE = bindings.CASC_INVALID_SIZE;
|
|
110
|
+
export const CASC_INVALID_POS = bindings.CASC_INVALID_POS;
|
|
111
|
+
export const CASC_INVALID_ID = bindings.CASC_INVALID_ID;
|
|
112
|
+
export const CASC_INVALID_OFFS64 = bindings.CASC_INVALID_OFFS64;
|
|
113
|
+
export const CASC_INVALID_SIZE64 = bindings.CASC_INVALID_SIZE64;
|
|
114
|
+
// Storage info constants
|
|
115
|
+
export const CascStorageLocalFileCount = bindings.CascStorageLocalFileCount;
|
|
116
|
+
export const CascStorageTotalFileCount = bindings.CascStorageTotalFileCount;
|
|
117
|
+
export const CascStorageFeatures = bindings.CascStorageFeatures;
|
|
118
|
+
export const CascStorageInstalledLocales = bindings.CascStorageInstalledLocales;
|
|
119
|
+
export const CascStorageProduct = bindings.CascStorageProduct;
|
|
120
|
+
export const CascStorageTags = bindings.CascStorageTags;
|
|
121
|
+
export const CascStoragePathProduct = bindings.CascStoragePathProduct;
|
|
122
|
+
// File info constants
|
|
123
|
+
export const CascFileContentKey = bindings.CascFileContentKey;
|
|
124
|
+
export const CascFileEncodedKey = bindings.CascFileEncodedKey;
|
|
125
|
+
export const CascFileFullInfo = bindings.CascFileFullInfo;
|
|
126
|
+
export const CascFileSpanInfo = bindings.CascFileSpanInfo;
|
|
127
|
+
// Feature flags
|
|
128
|
+
export const CASC_FEATURE_FILE_NAMES = bindings.CASC_FEATURE_FILE_NAMES;
|
|
129
|
+
export const CASC_FEATURE_ROOT_CKEY = bindings.CASC_FEATURE_ROOT_CKEY;
|
|
130
|
+
export const CASC_FEATURE_TAGS = bindings.CASC_FEATURE_TAGS;
|
|
131
|
+
export const CASC_FEATURE_FNAME_HASHES = bindings.CASC_FEATURE_FNAME_HASHES;
|
|
132
|
+
export const CASC_FEATURE_FNAME_HASHES_OPTIONAL = bindings.CASC_FEATURE_FNAME_HASHES_OPTIONAL;
|
|
133
|
+
export const CASC_FEATURE_FILE_DATA_IDS = bindings.CASC_FEATURE_FILE_DATA_IDS;
|
|
134
|
+
export const CASC_FEATURE_LOCALE_FLAGS = bindings.CASC_FEATURE_LOCALE_FLAGS;
|
|
135
|
+
export const CASC_FEATURE_CONTENT_FLAGS = bindings.CASC_FEATURE_CONTENT_FLAGS;
|
|
136
|
+
export const CASC_FEATURE_DATA_ARCHIVES = bindings.CASC_FEATURE_DATA_ARCHIVES;
|
|
137
|
+
export const CASC_FEATURE_DATA_FILES = bindings.CASC_FEATURE_DATA_FILES;
|
|
138
|
+
export const CASC_FEATURE_ONLINE = bindings.CASC_FEATURE_ONLINE;
|
|
139
|
+
export const CASC_FEATURE_FORCE_DOWNLOAD = bindings.CASC_FEATURE_FORCE_DOWNLOAD;
|
|
140
|
+
// Key length
|
|
141
|
+
export const CASC_KEY_LENGTH = bindings.CASC_KEY_LENGTH;
|
|
142
|
+
//# sourceMappingURL=bindings.js.map
|