import { GenericModels } from "./../entity/models/GenericModels"; /** * Convenience converters that turn the array-shaped collections * returned by the GearN API into `Map` lookups keyed by * the most common business identifier. * * The SDK transports always deliver collections as arrays so the * wire format stays JSON / MsgPack friendly. Application code * usually wants O(1) lookup by id; wrapping each call site in a * small `for` loop is repetitive, so this helper centralises the * conversion. * * Each method returns `null` when the input is `null` so the call * site can chain it after a typed response without a separate * null-check (`GNUtils.toFriendDictionary(response.getResponseData()?.playerFriends)`). */ export declare class GNUtils { /** * Indexes a {@link GenericModels.DataItem} array by its * `key` field. * * Useful for player-data / custom-data responses where the * application normally needs to look up entries by key. Later * duplicates with the same key win, mirroring `Map.set`'s * default behaviour. * * @param datas Source array, or `null`. * @returns A keyed map, or `null` when `datas` is `null`. */ static toDatasDictionary(datas: Array): Map; /** * Indexes a {@link GenericModels.TagItem} array by its `key` * field. Used for player / character tag responses. */ static toTagsDictionary(tags: Array): Map; /** * Indexes a {@link GenericModels.CurrencyItem} array by its * `key` field. Used for player / group currency responses. */ static toCurrenciesDictionary(currencies: Array): Map; /** * Indexes a {@link GenericModels.StatisticsItem} array by its * `key` field. Used for player / group statistic responses. */ static toStatisticsDictionary(statistics: Array): Map; /** * Indexes a {@link GenericModels.InventoryItem} array by its * `itemId` field — the unique inventory ledger entry id, not * the catalog identifier. To bucket by catalog id instead, * write a custom loop using the `classId` field. */ static toInventoriesDictionary(inventories: Array): Map; /** * Indexes a {@link GenericModels.GroupItem} array by its * `groupId` field. Used for player-group lookup responses. */ static toGroupDictionary(groups: Array): Map; /** * Indexes a {@link GenericModels.FriendItem} array by its * `friendId` field. Used for player-friend lookup responses * and to drive social UIs that need O(1) presence checks. */ static toFriendDictionary(friends: Array): Map; }