unpak.js
Version:
Modern TypeScript library for reading Unreal Engine pak files and assets, inspired by CUE4Parse
41 lines • 1.28 kB
TypeScript
import { Collection } from '@discordjs/collection';
/**
* Map used in unreal.js
* This map uses <object>.equals() for looking up entries
* If the method doesn't exists, it falls back to: ===
* This can be useful if the key is not a primitive
* @extends {Collection}
*/
export declare class UnrealMap<K, V> extends Collection<K, V> {
/**
* Gets an entry
* @param {any} key Key to lookup
* @returns {V | undefined} Entry
*/
get(key: K): V | undefined;
/**
* Deletes an entry
* @param {any} key Key of the entry to delete
* @returns {boolean} Whether the entry got deleted
*/
delete(key: K): boolean;
/**
* Maps values to a new map
* @param {Function} fn Function to map values
* @returns {UnrealMap} New map with mapped values
*/
mapValues<T>(fn: (value: V, key: K, collection: this) => T): UnrealMap<K, T>;
/**
* Sets a key-value pair
* @param {K} key Key to set
* @param {V} value Value to set
* @returns {this} This map for chaining
*/
set(key: K, value: V): this;
/**
* Iterator for the map
* @returns {IterableIterator} Iterator for entries
*/
[Symbol.iterator](): IterableIterator<[K, V]>;
}
//# sourceMappingURL=UnrealMap.d.ts.map