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 {
 | 
			
		||||
            console.assert(key.substring(-3) == "Bin");
 | 
			
		||||
            const left = InventoryChanges[key] as IBinChanges;
 | 
			
		||||
            const right: IBinChanges = delta[key];
 | 
			
		||||
            const right: IBinChanges = delta[key] as IBinChanges;
 | 
			
		||||
            left.count += right.count;
 | 
			
		||||
            left.platinum += right.platinum;
 | 
			
		||||
            left.Slots += right.Slots;
 | 
			
		||||
 | 
			
		||||
@ -17,7 +17,9 @@ export interface IPurchaseParams {
 | 
			
		||||
    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 {
 | 
			
		||||
    InventoryChanges: IInventoryChanges;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user