chore: require SlotNames in IInventoryChanges to be of type IBinChanges
This commit is contained in:
parent
27af54d039
commit
e909216001
@ -85,7 +85,7 @@ export const combineInventoryChanges = (InventoryChanges: IInventoryChanges, del
|
|||||||
} else {
|
} else {
|
||||||
console.assert(key.substring(-3) == "Bin");
|
console.assert(key.substring(-3) == "Bin");
|
||||||
const left = InventoryChanges[key] as IBinChanges;
|
const left = InventoryChanges[key] as IBinChanges;
|
||||||
const right: IBinChanges = delta[key];
|
const right: IBinChanges = delta[key] as IBinChanges;
|
||||||
left.count += right.count;
|
left.count += right.count;
|
||||||
left.platinum += right.platinum;
|
left.platinum += right.platinum;
|
||||||
left.Slots += right.Slots;
|
left.Slots += right.Slots;
|
||||||
|
@ -17,7 +17,9 @@ export interface IPurchaseParams {
|
|||||||
UseFreeFavor?: boolean; // for Source 2
|
UseFreeFavor?: boolean; // for Source 2
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IInventoryChanges = Record<string, IBinChanges | object[]>;
|
export type IInventoryChanges = {
|
||||||
|
[_ in SlotNames]?: IBinChanges;
|
||||||
|
} & Record<string, IBinChanges | number | object[]>;
|
||||||
|
|
||||||
export interface IPurchaseResponse {
|
export interface IPurchaseResponse {
|
||||||
InventoryChanges: IInventoryChanges;
|
InventoryChanges: IInventoryChanges;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user