@jamiephan/casclib 0.0.0-dev.4 → 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.
Binary file
@@ -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,OAAO,IAAI;IACX,IAAI,IAAI;IACR,WAAW,IAAI;CAChB;AAGD,oBAAY,iBAAiB;IAC3B,UAAU,IAAI;IACd,UAAU,IAAI;IACd,QAAQ,IAAI;IACZ,QAAQ,IAAI;CACb;AAGD,oBAAY,YAAY;IACtB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,IAAI,IAAI;IACR,IAAI,IAAI;CACT;AAGD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;CACxB;AAGD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAA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MAAyC,CAAC;AAChF,eAAO,MAAM,sBAAsB,EAAE,MAAwC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,EAAE,MAAmC,CAAC;AACpE,eAAO,MAAM,yBAAyB,EAAE,MAA2C,CAAC;AACpF,eAAO,MAAM,kCAAkC,EAAE,MAAoD,CAAC;AACtG,eAAO,MAAM,0BAA0B,EAAE,MAA4C,CAAC;AACtF,eAAO,MAAM,yBAAyB,EAAE,MAA2C,CAAC;AACpF,eAAO,MAAM,0BAA0B,EAAE,MAA4C,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"}
@@ -35,8 +35,10 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.CASC_LOCALE_ITIT = exports.CASC_LOCALE_PTBR = exports.CASC_LOCALE_RURU = exports.CASC_LOCALE_ESMX = exports.CASC_LOCALE_ENTW = exports.CASC_LOCALE_ENCN = exports.CASC_LOCALE_ENGB = exports.CASC_LOCALE_ZHTW = exports.CASC_LOCALE_ESES = exports.CASC_LOCALE_ZHCN = exports.CASC_LOCALE_DEDE = exports.CASC_LOCALE_FRFR = exports.CASC_LOCALE_RESERVED = exports.CASC_LOCALE_KOKR = exports.CASC_LOCALE_ENUS = exports.CASC_LOCALE_UNKNOWN1 = exports.CASC_LOCALE_NONE = exports.CASC_LOCALE_ALL_WOW = exports.CASC_LOCALE_ALL = exports.CASC_OPEN_CKEY_ONCE = exports.CASC_OVERCOME_ENCRYPTED = exports.CASC_STRICT_DATA_CHECK = exports.CASC_OPEN_FLAGS_MASK = exports.CASC_OPEN_TYPE_MASK = exports.CASC_OPEN_BY_FILEID = exports.CASC_OPEN_BY_EKEY = exports.CASC_OPEN_BY_CKEY = exports.CASC_OPEN_BY_NAME = exports.CascProgressDownloadingArchiveIndexes = exports.CascProgressLoadingIndexes = exports.CascProgressDownloadingFile = exports.CascProgressLoadingManifest = exports.CascProgressLoadingFile = exports.CASC_PARAM_SEPARATOR = exports.CASC_FILEID_FORMAT = exports.FILE_END = exports.FILE_CURRENT = exports.FILE_BEGIN = exports.CASCLIB_VERSION_STRING = exports.CASCLIB_VERSION = exports.CascCdnDownload = exports.CascCdnGetDefault = exports.SetCascError = exports.GetCascError = exports.CascOpenLocalFile = exports.CascFileBinding = exports.CascStorageBinding = exports.CascNameType = exports.CascFileInfoClass = exports.CascStorageInfoClass = void 0;
37
37
  exports.CASC_KEY_LENGTH = exports.CASC_FEATURE_FORCE_DOWNLOAD = exports.CASC_FEATURE_ONLINE = exports.CASC_FEATURE_DATA_FILES = exports.CASC_FEATURE_DATA_ARCHIVES = exports.CASC_FEATURE_CONTENT_FLAGS = exports.CASC_FEATURE_LOCALE_FLAGS = exports.CASC_FEATURE_FILE_DATA_IDS = exports.CASC_FEATURE_FNAME_HASHES_OPTIONAL = exports.CASC_FEATURE_FNAME_HASHES = exports.CASC_FEATURE_TAGS = exports.CASC_FEATURE_ROOT_CKEY = exports.CASC_FEATURE_FILE_NAMES = exports.CascFileSpanInfo = exports.CascFileFullInfo = exports.CascFileEncodedKey = exports.CascFileContentKey = exports.CascStoragePathProduct = exports.CascStorageTags = exports.CascStorageProduct = exports.CascStorageInstalledLocales = exports.CascStorageFeatures = exports.CascStorageTotalFileCount = exports.CascStorageLocalFileCount = exports.CASC_INVALID_SIZE64 = exports.CASC_INVALID_OFFS64 = exports.CASC_INVALID_ID = exports.CASC_INVALID_POS = exports.CASC_INVALID_SIZE = exports.CASC_INVALID_INDEX = exports.SHA1_STRING_SIZE = exports.SHA1_HASH_SIZE = exports.MD5_STRING_SIZE = exports.MD5_HASH_SIZE = exports.CASC_CFLAG_NO_COMPRESSION = exports.CASC_CFLAG_BUNDLE = exports.CASC_CFLAG_UNCMN_RESOLUTION = exports.CASC_CFLAG_NO_NAME_HASH = exports.CASC_CFLAG_ENCRYPTED = exports.CASC_CFLAG_ARM64 = exports.CASC_CFLAG_UPDATE_PLUGIN = exports.CASC_CFLAG_DONT_LOAD = exports.CASC_CFLAG_LOW_VIOLENCE = exports.CASC_CFLAG_X86_64 = exports.CASC_CFLAG_X86_32 = exports.CASC_CFLAG_LOAD_ON_MAC = exports.CASC_CFLAG_LOAD_ON_WINDOWS = exports.CASC_CFLAG_INSTALL = exports.CASC_LOCALE_PTPT = void 0;
38
+ // Native bindings for CascLib
38
39
  const path = __importStar(require("path"));
39
40
  const bindings = require('node-gyp-build')(path.join(__dirname, '..'));
41
+ // Storage info classes
40
42
  var CascStorageInfoClass;
41
43
  (function (CascStorageInfoClass) {
42
44
  CascStorageInfoClass[CascStorageInfoClass["LocalFileCount"] = 0] = "LocalFileCount";
@@ -47,6 +49,7 @@ var CascStorageInfoClass;
47
49
  CascStorageInfoClass[CascStorageInfoClass["Tags"] = 5] = "Tags";
48
50
  CascStorageInfoClass[CascStorageInfoClass["PathProduct"] = 6] = "PathProduct";
49
51
  })(CascStorageInfoClass || (exports.CascStorageInfoClass = CascStorageInfoClass = {}));
52
+ // File info classes
50
53
  var CascFileInfoClass;
51
54
  (function (CascFileInfoClass) {
52
55
  CascFileInfoClass[CascFileInfoClass["ContentKey"] = 0] = "ContentKey";
@@ -54,6 +57,7 @@ var CascFileInfoClass;
54
57
  CascFileInfoClass[CascFileInfoClass["FullInfo"] = 2] = "FullInfo";
55
58
  CascFileInfoClass[CascFileInfoClass["SpanInfo"] = 3] = "SpanInfo";
56
59
  })(CascFileInfoClass || (exports.CascFileInfoClass = CascFileInfoClass = {}));
60
+ // Name type enum
57
61
  var CascNameType;
58
62
  (function (CascNameType) {
59
63
  CascNameType[CascNameType["Full"] = 0] = "Full";
@@ -63,23 +67,30 @@ var CascNameType;
63
67
  })(CascNameType || (exports.CascNameType = CascNameType = {}));
64
68
  exports.CascStorageBinding = bindings.Storage;
65
69
  exports.CascFileBinding = bindings.File;
70
+ // Utility functions
66
71
  exports.CascOpenLocalFile = bindings.CascOpenLocalFile;
67
72
  exports.GetCascError = bindings.GetCascError;
68
73
  exports.SetCascError = bindings.SetCascError;
74
+ // CDN functions
69
75
  exports.CascCdnGetDefault = bindings.CascCdnGetDefault;
70
76
  exports.CascCdnDownload = bindings.CascCdnDownload;
77
+ // Version constants
71
78
  exports.CASCLIB_VERSION = bindings.CASCLIB_VERSION || 0x0300;
72
79
  exports.CASCLIB_VERSION_STRING = "3.0";
80
+ // File positioning constants
73
81
  exports.FILE_BEGIN = bindings.FILE_BEGIN;
74
82
  exports.FILE_CURRENT = bindings.FILE_CURRENT;
75
83
  exports.FILE_END = bindings.FILE_END;
84
+ // Other useful constants
76
85
  exports.CASC_FILEID_FORMAT = bindings.CASC_FILEID_FORMAT;
77
86
  exports.CASC_PARAM_SEPARATOR = bindings.CASC_PARAM_SEPARATOR;
87
+ // Progress message constants
78
88
  exports.CascProgressLoadingFile = bindings.CascProgressLoadingFile;
79
89
  exports.CascProgressLoadingManifest = bindings.CascProgressLoadingManifest;
80
90
  exports.CascProgressDownloadingFile = bindings.CascProgressDownloadingFile;
81
91
  exports.CascProgressLoadingIndexes = bindings.CascProgressLoadingIndexes;
82
92
  exports.CascProgressDownloadingArchiveIndexes = bindings.CascProgressDownloadingArchiveIndexes;
93
+ // Open flags
83
94
  exports.CASC_OPEN_BY_NAME = bindings.CASC_OPEN_BY_NAME;
84
95
  exports.CASC_OPEN_BY_CKEY = bindings.CASC_OPEN_BY_CKEY;
85
96
  exports.CASC_OPEN_BY_EKEY = bindings.CASC_OPEN_BY_EKEY;
@@ -89,6 +100,7 @@ exports.CASC_OPEN_FLAGS_MASK = bindings.CASC_OPEN_FLAGS_MASK;
89
100
  exports.CASC_STRICT_DATA_CHECK = bindings.CASC_STRICT_DATA_CHECK;
90
101
  exports.CASC_OVERCOME_ENCRYPTED = bindings.CASC_OVERCOME_ENCRYPTED;
91
102
  exports.CASC_OPEN_CKEY_ONCE = bindings.CASC_OPEN_CKEY_ONCE;
103
+ // Locale flags
92
104
  exports.CASC_LOCALE_ALL = bindings.CASC_LOCALE_ALL;
93
105
  exports.CASC_LOCALE_ALL_WOW = bindings.CASC_LOCALE_ALL_WOW;
94
106
  exports.CASC_LOCALE_NONE = bindings.CASC_LOCALE_NONE;
@@ -109,6 +121,7 @@ exports.CASC_LOCALE_RURU = bindings.CASC_LOCALE_RURU;
109
121
  exports.CASC_LOCALE_PTBR = bindings.CASC_LOCALE_PTBR;
110
122
  exports.CASC_LOCALE_ITIT = bindings.CASC_LOCALE_ITIT;
111
123
  exports.CASC_LOCALE_PTPT = bindings.CASC_LOCALE_PTPT;
124
+ // Content flags
112
125
  exports.CASC_CFLAG_INSTALL = bindings.CASC_CFLAG_INSTALL;
113
126
  exports.CASC_CFLAG_LOAD_ON_WINDOWS = bindings.CASC_CFLAG_LOAD_ON_WINDOWS;
114
127
  exports.CASC_CFLAG_LOAD_ON_MAC = bindings.CASC_CFLAG_LOAD_ON_MAC;
@@ -123,16 +136,19 @@ exports.CASC_CFLAG_NO_NAME_HASH = bindings.CASC_CFLAG_NO_NAME_HASH;
123
136
  exports.CASC_CFLAG_UNCMN_RESOLUTION = bindings.CASC_CFLAG_UNCMN_RESOLUTION;
124
137
  exports.CASC_CFLAG_BUNDLE = bindings.CASC_CFLAG_BUNDLE;
125
138
  exports.CASC_CFLAG_NO_COMPRESSION = bindings.CASC_CFLAG_NO_COMPRESSION;
139
+ // Hash sizes
126
140
  exports.MD5_HASH_SIZE = bindings.MD5_HASH_SIZE;
127
141
  exports.MD5_STRING_SIZE = bindings.MD5_STRING_SIZE;
128
142
  exports.SHA1_HASH_SIZE = bindings.SHA1_HASH_SIZE;
129
143
  exports.SHA1_STRING_SIZE = bindings.SHA1_STRING_SIZE;
144
+ // Invalid values
130
145
  exports.CASC_INVALID_INDEX = bindings.CASC_INVALID_INDEX;
131
146
  exports.CASC_INVALID_SIZE = bindings.CASC_INVALID_SIZE;
132
147
  exports.CASC_INVALID_POS = bindings.CASC_INVALID_POS;
133
148
  exports.CASC_INVALID_ID = bindings.CASC_INVALID_ID;
134
149
  exports.CASC_INVALID_OFFS64 = bindings.CASC_INVALID_OFFS64;
135
150
  exports.CASC_INVALID_SIZE64 = bindings.CASC_INVALID_SIZE64;
151
+ // Storage info constants
136
152
  exports.CascStorageLocalFileCount = bindings.CascStorageLocalFileCount;
137
153
  exports.CascStorageTotalFileCount = bindings.CascStorageTotalFileCount;
138
154
  exports.CascStorageFeatures = bindings.CascStorageFeatures;
@@ -140,10 +156,12 @@ exports.CascStorageInstalledLocales = bindings.CascStorageInstalledLocales;
140
156
  exports.CascStorageProduct = bindings.CascStorageProduct;
141
157
  exports.CascStorageTags = bindings.CascStorageTags;
142
158
  exports.CascStoragePathProduct = bindings.CascStoragePathProduct;
159
+ // File info constants
143
160
  exports.CascFileContentKey = bindings.CascFileContentKey;
144
161
  exports.CascFileEncodedKey = bindings.CascFileEncodedKey;
145
162
  exports.CascFileFullInfo = bindings.CascFileFullInfo;
146
163
  exports.CascFileSpanInfo = bindings.CascFileSpanInfo;
164
+ // Feature flags
147
165
  exports.CASC_FEATURE_FILE_NAMES = bindings.CASC_FEATURE_FILE_NAMES;
148
166
  exports.CASC_FEATURE_ROOT_CKEY = bindings.CASC_FEATURE_ROOT_CKEY;
149
167
  exports.CASC_FEATURE_TAGS = bindings.CASC_FEATURE_TAGS;
@@ -156,5 +174,6 @@ exports.CASC_FEATURE_DATA_ARCHIVES = bindings.CASC_FEATURE_DATA_ARCHIVES;
156
174
  exports.CASC_FEATURE_DATA_FILES = bindings.CASC_FEATURE_DATA_FILES;
157
175
  exports.CASC_FEATURE_ONLINE = bindings.CASC_FEATURE_ONLINE;
158
176
  exports.CASC_FEATURE_FORCE_DOWNLOAD = bindings.CASC_FEATURE_FORCE_DOWNLOAD;
177
+ // Key length
159
178
  exports.CASC_KEY_LENGTH = bindings.CASC_KEY_LENGTH;
160
179
  //# sourceMappingURL=bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindings.js","sourceRoot":"","sources":["../../lib/bindings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,2CAA6B;AAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;AAEvE,uBAAuB;AACvB,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC9B,mFAAkB,CAAA;IAClB,mFAAkB,CAAA;IAClB,uEAAY,CAAA;IACZ,uFAAoB,CAAA;IACpB,qEAAW,CAAA;IACX,+DAAQ,CAAA;IACR,6EAAe,CAAA;AACjB,CAAC,EARW,oBAAoB,oCAApB,oBAAoB,QAQ/B;AAED,oBAAoB;AACpB,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,qEAAc,CAAA;IACd,qEAAc,CAAA;IACd,iEAAY,CAAA;IACZ,iEAAY,CAAA;AACd,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED,iBAAiB;AACjB,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,+CAAQ,CAAA;IACR,mDAAU,CAAA;IACV,+CAAQ,CAAA;IACR,+CAAQ,CAAA;AACV,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AA+IY,QAAA,kBAAkB,GAA0B,QAAQ,CAAC,OAAO,CAAC;AAC7D,QAAA,eAAe,GAAuB,QAAQ,CAAC,IAAI,CAAC;AAEjE,oBAAoB;AACP,QAAA,iBAAiB,GAAmD,QAAQ,CAAC,iBAAiB,CAAC;AAC/F,QAAA,YAAY,GAAiB,QAAQ,CAAC,YAAY,CAAC;AACnD,QAAA,YAAY,GAA4B,QAAQ,CAAC,YAAY,CAAC;AAE3E,gBAAgB;AACH,QAAA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AAmB,CAAC;AAC3D,QAAA,2BAA2B,GAAW,QAAQ,CAAC,2BAA2B,CAAC;AAExF,aAAa;AACA,QAAA,eAAe,GAAW,QAAQ,CAAC,eAAe,CAAC"}
@@ -0,0 +1,233 @@
1
+ import { CascFindData, CascStorageInfo, CascFileInfoResult, CascOpenStorageExOptions, CascFile } from './bindings';
2
+ /**
3
+ * Options for opening a CASC storage
4
+ */
5
+ export interface StorageOpenOptions {
6
+ /** Flags for opening the storage */
7
+ flags?: number;
8
+ }
9
+ /**
10
+ * Information about a file in CASC storage
11
+ */
12
+ export interface FileInfo {
13
+ /** File name */
14
+ name: string;
15
+ /** File size in bytes */
16
+ size: number;
17
+ }
18
+ /**
19
+ * Options for opening a file from storage
20
+ */
21
+ export interface FileOpenOptions {
22
+ /** Open flags */
23
+ flags?: number;
24
+ }
25
+ /**
26
+ * CascLib Storage wrapper class
27
+ * Provides methods to interact with CASC storage archives
28
+ */
29
+ export declare class Storage {
30
+ private storage;
31
+ constructor();
32
+ /**
33
+ * Open a CASC storage at the specified path
34
+ * @param path - Path to the CASC storage directory
35
+ * @param options - Optional opening options
36
+ */
37
+ open(path: string, options?: StorageOpenOptions): void;
38
+ /**
39
+ * Open an online CASC storage
40
+ * @param path - Connection string in the format: `local_cache_folder[*cdn_server_url]*code_name[*region]`
41
+ * - `local_cache_folder`: Local cache directory for downloaded game data (reusable)
42
+ * - Windows: `C:/Temp/CASC/Cache`
43
+ * - Linux: `/tmp/casc/cache`
44
+ * - `cdn_server_url`: Optional CDN server URL (e.g., "http://us.patch.battle.net:1119")
45
+ * - `code_name`: TACT product code (e.g., "hero" for Heroes of the Storm, "wow" for World of Warcraft)
46
+ * See https://wowdev.wiki/TACT for available product codes
47
+ * - `region`: Optional server region (e.g., "us", "eu", "kr", "tw", "cn")
48
+ * @param options - Optional opening options
49
+ * @example
50
+ * ```typescript
51
+ * // Windows - Basic usage with minimal parameters
52
+ * storage.openOnline('C:/Temp/CASC/Cache*hero');
53
+ *
54
+ * // Linux - Basic usage
55
+ * storage.openOnline('/tmp/casc/cache*hero');
56
+ *
57
+ * // With CDN server specified
58
+ * storage.openOnline('C:/Temp/CASC/Cache*http://us.patch.battle.net:1119*hero');
59
+ *
60
+ * // With region specified
61
+ * storage.openOnline('/tmp/casc/cache*hero*us');
62
+ *
63
+ * // Full format with all parameters
64
+ * storage.openOnline('C:/Temp/CASC/Cache*http://us.patch.battle.net:1119*hero*us');
65
+ * ```
66
+ */
67
+ openOnline(path: string, options?: StorageOpenOptions): void;
68
+ /**
69
+ * Open a CASC storage with extended parameters (CascOpenStorageEx)
70
+ * @param params - Path or parameter string
71
+ * @param options - Extended opening options
72
+ */
73
+ openEx(params: string, options?: CascOpenStorageExOptions): void;
74
+ /**
75
+ * Close the CASC storage
76
+ */
77
+ close(): boolean;
78
+ /**
79
+ * Open a file from the storage
80
+ * @param filename - Name of the file to open
81
+ * @param options - Optional opening options
82
+ * @returns A File object
83
+ */
84
+ openFile(filename: string, options?: FileOpenOptions): File;
85
+ /**
86
+ * Get information about a file
87
+ * @param filename - Name of the file
88
+ * @returns File information or null if file doesn't exist
89
+ */
90
+ getFileInfo(filename: string): FileInfo | null;
91
+ /**
92
+ * Check if a file exists in the storage
93
+ * @param filename - Name of the file
94
+ * @returns true if file exists, false otherwise
95
+ */
96
+ fileExists(filename: string): boolean;
97
+ /**
98
+ * Get storage information
99
+ * @param infoClass - The type of information to retrieve
100
+ * @returns Storage information object
101
+ */
102
+ getStorageInfo(infoClass: number): CascStorageInfo;
103
+ /**
104
+ * Find the first file matching the mask
105
+ * @param mask - File mask (e.g., "*.txt")
106
+ * @param listFile - Optional list file path
107
+ * @returns Find data or null if no files found
108
+ */
109
+ findFirstFile(mask?: string, listFile?: string): CascFindData | null;
110
+ /**
111
+ * Find the next file in the search
112
+ * @returns Find data or null if no more files
113
+ */
114
+ findNextFile(): CascFindData | null;
115
+ /**
116
+ * Close the current find operation
117
+ * @returns true if closed successfully
118
+ */
119
+ findClose(): boolean;
120
+ /**
121
+ * Add an encryption key to the storage
122
+ * @param keyName - Name/ID of the key
123
+ * @param key - Key data as Buffer
124
+ * @returns true if added successfully
125
+ */
126
+ addEncryptionKey(keyName: number, key: Buffer): boolean;
127
+ /**
128
+ * Add an encryption key from a string
129
+ * @param keyName - Name/ID of the key
130
+ * @param keyStr - Key as string
131
+ * @returns true if added successfully
132
+ */
133
+ addStringEncryptionKey(keyName: number, keyStr: string): boolean;
134
+ /**
135
+ * Import encryption keys from a string
136
+ * @param keyList - String containing key list
137
+ * @returns true if imported successfully
138
+ */
139
+ importKeysFromString(keyList: string): boolean;
140
+ /**
141
+ * Import encryption keys from a file
142
+ * @param filePath - Path to the key file
143
+ * @returns true if imported successfully
144
+ */
145
+ importKeysFromFile(filePath: string): boolean;
146
+ /**
147
+ * Find an encryption key by name
148
+ * @param keyName - Name/ID of the key
149
+ * @returns Key data or null if not found
150
+ */
151
+ findEncryptionKey(keyName: number): Buffer | null;
152
+ /**
153
+ * Get the name of an encryption key that was not found
154
+ * @returns Key name or null
155
+ */
156
+ getNotFoundEncryptionKey(): number | null;
157
+ }
158
+ /**
159
+ * CascLib File wrapper class
160
+ * Represents an open file in CASC storage
161
+ */
162
+ export declare class File {
163
+ private file;
164
+ constructor(file: CascFile);
165
+ /**
166
+ * Read data from the file
167
+ * @param bytesToRead - Number of bytes to read (default: 4096)
168
+ * @returns Buffer containing the read data
169
+ */
170
+ read(bytesToRead?: number): Buffer;
171
+ /**
172
+ * Read all data from the file
173
+ * @returns Buffer containing all file data
174
+ */
175
+ readAll(): Buffer;
176
+ /**
177
+ * Get the file size (32-bit)
178
+ * @returns File size in bytes
179
+ */
180
+ getSize(): number;
181
+ /**
182
+ * Get the file size (64-bit)
183
+ * @returns File size in bytes
184
+ */
185
+ getSize64(): number;
186
+ /**
187
+ * Get the current file position (32-bit)
188
+ * @returns Current position in bytes
189
+ */
190
+ getPosition(): number;
191
+ /**
192
+ * Get the current file position (64-bit)
193
+ * @returns Current position in bytes
194
+ */
195
+ getPosition64(): number;
196
+ /**
197
+ * Set the file position (32-bit)
198
+ * @param position - New position in bytes
199
+ * @returns The new position
200
+ */
201
+ setPosition(position: number): number;
202
+ /**
203
+ * Set the file position (64-bit)
204
+ * @param position - New position in bytes
205
+ * @param moveMethod - Move method (FILE_BEGIN, FILE_CURRENT, FILE_END)
206
+ * @returns The new position
207
+ */
208
+ setPosition64(position: number, moveMethod?: number): number;
209
+ /**
210
+ * Get detailed file information
211
+ * @param infoClass - The type of information to retrieve
212
+ * @returns File information object
213
+ */
214
+ getFileInfo(infoClass: number): CascFileInfoResult;
215
+ /**
216
+ * Set file flags
217
+ * @param flags - Flags to set
218
+ * @returns true if set successfully
219
+ */
220
+ setFileFlags(flags: number): boolean;
221
+ /**
222
+ * Close the file
223
+ * @returns true if closed successfully
224
+ */
225
+ close(): boolean;
226
+ }
227
+ export * from './bindings';
228
+ declare const _default: {
229
+ Storage: typeof Storage;
230
+ File: typeof File;
231
+ };
232
+ export default _default;
233
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EACZ,eAAe,EACf,kBAAkB,EAElB,wBAAwB,EAExB,QAAQ,EACT,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,OAAO,CAAc;;IAM7B;;;;OAIG;IACH,IAAI,C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D;;;OAGG;IACH,wBAAwB,IAAI,MAAM,GAAG,IAAI;CAG1C;AAED;;;GAGG;AACH,qBAAa,IAAI;IACf,OAAO,CAAC,IAAI,CAAW;gBAEX,IAAI,EAAE,QAAQ;IAI1B;;;;OAIG;IACH,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;IAIlC;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,WAAW,IAAI,MAAM;IAIrB;;;OAGG;IACH,aAAa,IAAI,MAAM;IAIvB;;;;OAIG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIrC;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;IAI5D;;;;OAIG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB;IAIlD;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIpC;;;OAGG;IACH,KAAK,IAAI,OAAO;CAGjB;AAGD,cAAc,YAAY,CAAC;;;;;AAG3B,wBAGE"}
@@ -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