hypixel-auction-notifier/src/Types.ts
2024-12-28 14:05:03 +01:00

96 lines
No EOL
1.7 KiB
TypeScript

// item.ts
//#region ItemData Interface
export interface ItemData {
name: string;
id: string;
stars: number;
rarity: string;
recomb: boolean;
enchants: Record<string, number>;
hpbs: number;
fpbs: number;
gemstones: string[];
aow: boolean;
lore: string;
}
export interface AuctionData {
auctionID: string;
category: string;
sales: number;
price: number;
profit: number;
percentProfit: number;
lbin: number;
ahType: string | null;
}
export class Item {
public itemData: ItemData;
public auctionData: AuctionData;
constructor(
name: string,
auctionID: string,
price: number,
rarity: string,
enchants: Record<string, number>,
hpbs: number,
fpbs: number,
recomb: boolean,
artofwar: boolean,
stars: number,
gemstones: string[],
id: string,
category: string,
profit: number,
percentProfit: number,
lbin: number,
sales: number,
lore: string,
ahType: string | null = null
) {
this.itemData = {
name,
id,
stars,
rarity,
recomb,
enchants,
hpbs,
fpbs,
gemstones,
aow: artofwar,
lore,
};
this.auctionData = {
auctionID,
category,
sales,
price,
profit,
percentProfit,
lbin,
ahType,
};
}
}
//#endregion
//#region ItemCompactData
export class ItemCompactData {
public sales: number;
public lbin: number;
public cleanPrice: number;
public price: number;
constructor(sales: number = 0, lbin: number = 0, cleanPrice: number = 0, price: number = 0) {
this.sales = sales;
this.lbin = lbin;
this.cleanPrice = cleanPrice;
this.price = price;
}
}
//#endregion