@rhyster/wow-casc-dbc
Version:
Fetch World of Warcraft data files from CASC and parse DBC/DB2 files.
87 lines • 3.22 kB
TypeScript
import type ADBReader from './adb.ts';
import type { MissingKeyBlock } from './blte.ts';
import type { ArchiveIndex } from './parsers/archiveIndex.ts';
import type { EncodingData } from './parsers/encodingFile.ts';
import type { InstallFile, InstallData } from './parsers/installFile.ts';
import type { Version } from './parsers/productConfig.ts';
import type { FileInfo, RootData } from './parsers/rootFile.ts';
interface ClientPreloadData {
prefixes: string[];
archives: Map<string, ArchiveIndex>;
encoding: EncodingData;
rootFile: RootData;
install: InstallData;
}
interface FileFetchResultFull {
type: 'full';
buffer: Buffer;
blocks: undefined;
}
interface FileFetchResultPartial {
type: 'partial';
buffer: Buffer;
blocks: MissingKeyBlock[];
}
type FileFetchResult = FileFetchResultFull | FileFetchResultPartial;
declare enum LogLevel {
error = 0,
warn = 1,
info = 2,
debug = 3
}
export default class CASCClient {
readonly region: string;
readonly product: string;
readonly version: Version;
readonly name2FileDataID: Map<string, number>;
readonly keys: Map<string, Uint8Array<ArrayBufferLike>>;
preload?: ClientPreloadData;
static getProductVersion(region: string, product: string): Promise<Version | undefined>;
static LocaleFlags: {
readonly enUS: 2;
readonly koKR: 4;
readonly frFR: 16;
readonly deDE: 32;
readonly zhCN: 64;
readonly esES: 128;
readonly zhTW: 256;
readonly enGB: 512;
readonly esMX: 4096;
readonly ruRU: 8192;
readonly ptBR: 16384;
readonly itIT: 32768;
readonly ptPT: 65536;
};
static ContentFlags: {
readonly Install: 4;
readonly LoadOnWindows: 8;
readonly LoadOnMacOS: 16;
readonly x86_32: 32;
readonly x86_64: 64;
readonly LowViolence: 128;
readonly DoNotLoad: 256;
readonly UpdatePlugin: 2048;
readonly ARM64: 32768;
readonly Encrypted: 134217728;
readonly NoNameHash: 268435456;
readonly UncommonResolution: 536870912;
readonly Bundle: 1073741824;
readonly NoCompression: 2147483648;
};
static LogLevel: typeof LogLevel;
logLevel: LogLevel;
constructor(region: string, product: string, version: Version, logLevel?: LogLevel);
private log;
init(): Promise<void>;
loadRemoteListFile(): Promise<void>;
loadRemoteTACTKeys(): Promise<void>;
loadTACTKeys(): Promise<void>;
loadBroadcastTACTKeys(adb: ADBReader): void;
getFileDataIDByName(name: string): number | undefined;
getContentKeysByFileDataID(fileDataID: number): FileInfo[] | undefined;
getContentKeysFromInstall(name: string): InstallFile[] | undefined;
getFileByContentKey(cKey: string, allowMissingKey?: false): Promise<FileFetchResultFull>;
getFileByContentKey(cKey: string, allowMissingKey: true): Promise<FileFetchResult>;
}
export type { Version, ClientPreloadData, ArchiveIndex, EncodingData, InstallFile, InstallData, RootData, FileInfo, FileFetchResultFull, FileFetchResultPartial, FileFetchResult, MissingKeyBlock, };
//# sourceMappingURL=client.d.ts.map