UNPKG

@gamepark/rules-api

Version:

API to implement the rules of a board game

15 lines (14 loc) 665 B
/** * A listing is a quantity of items indexed by they identifier * Use this function to get a list of items where each item is included as much time as their listed quantity * @param listing The listing * @returns the list matching the listing */ export declare function listingToList<T extends number>(listing: Partial<Record<T, number>>): T[]; /** * A listing is a quantity of items indexed by they identifier * Use this function to get a listing based on a list with potential duplicates * @param list The list * @returns the listing matching the list */ export declare function listToListing<T extends number>(list: T[]): Partial<Record<T, number>>;