UNPKG

@abextm/cache2

Version:

Utilities for reading OSRS "caches"

46 lines 2.05 kB
import { CacheProvider } from "../Cache.js"; import { Loadable, PerFileLoadable } from "../Loadable.js"; import { Reader } from "../Reader.js"; import { Typed } from "../reflect.js"; import { BaseVarType } from "../ScriptVarType.js"; import { DBColumnID, DBRowID, DBTableID, ScriptVarID } from "../types.js"; export declare class DBRow extends PerFileLoadable { id: DBRowID; constructor(id: DBRowID); [Typed.type]: Typed.Any; static readonly index = 2; static readonly archive = 38; static readonly gameval = 9; table: DBTableID; values: (string | number | bigint | undefined)[][]; types: (ScriptVarID | undefined)[][]; static decode(r: Reader, id: DBRowID): DBRow; } export declare class DBTable extends PerFileLoadable { id: DBTableID; constructor(id: DBTableID); [Typed.type]: Typed.Any; static readonly index = 2; static readonly archive = 39; static readonly gameval = 10; types: (ScriptVarID | undefined)[][]; defaultValues: (string | number | bigint | undefined)[][]; static decode(r: Reader, id: DBTableID): DBTable; static loadRowIDs(cache: CacheProvider | Promise<CacheProvider>, table: DBTableID | number): Promise<DBRowID[] | undefined>; static loadRows(cache: CacheProvider | Promise<CacheProvider>, table: DBTableID | number): Promise<DBRow[] | undefined>; } export declare class DBTableIndex extends Loadable { id: DBTableID; column: number; constructor(id: DBTableID, column: number); [Typed.type]: Typed.Any; static readonly index = 21; static readonly MASTER_COLUMN = -1; types: BaseVarType[]; values: Map<string | number | bigint, DBRowID[]>[]; static loadData(cache: CacheProvider, id: DBColumnID): Promise<Reader | undefined>; static loadData(cache: CacheProvider, id: DBTableID, column: number): Promise<Reader | undefined>; static decode(reader: Reader, id: DBColumnID): DBTableIndex; static decode(reader: Reader, id: DBTableID, column: number): DBTableIndex; } //# sourceMappingURL=DBRow.d.ts.map