import { Item } from "kolmafia"; /** * An entry showing the value of each Item in a session * * @member item the item associated with this detail * @member value the numeric value of the full quantity of items (to get value of each item, do value / quantity) (can be negative) * @member quantity the number of items for this detail */ export interface ItemDetail { item: Item; value: number; quantity: number; } /** * The full value (in meat) results of a session * * @member meat the value of this session in pure meat * @member items the value of the items in this session in meat * @member total sum of meat and items * @member itemDetails a list of the detailed accounting for each item in this session * @member turns the number of turns associated with this session */ export interface ItemResult { meat: number; items: number; total: number; itemDetails: ItemDetail[]; turns: number; } export interface MeatPerAdventureAnalysis { mpa: { effective: number; meat: number; items: number; total: number; }; values: { effective: number; meat: number; items: number; total: number; }; outlierItems: ItemDetail[]; turns: number; } /** * A wrapper around tracking items and meat gained from this session * Smartly handles foldables being added/removed based on their state * Provides operations to add sessions and subtract Sessions so you can isolate the value of each Session using a baseline * * @member meat the raw meat associated with this Session * @member items a map representing the items gained/lost during this Session */ export declare class Session { meat: number; items: Map; totalTurns: number; /** * Construct a new session * * @param meat the amount of meat associated with this session * @param items the items associated with this session * @param totalTurns the number of turns associated with this session */ private constructor(); /** * Register session results that do not get tracked natively * * @param target either the Item or a string saying "meat" of what quantity to modify * @param quantity How much to modify the tracked amount by */ register(target: Item | "meat", quantity: number): void; /** * Value this session * * @param itemValue a function that, when given an item, will give a meat value of the item * @returns ItemResult with the full value of this session given the input function */ value(itemValue: (item: Item) => number): ItemResult; /** * Subtract the contents of another session from this one, removing any items that have a resulting quantity of 0 * (this will ignore elements in b but not in a) * * @param other the session from which to pull values to remove from this session * @returns a new session representing the difference between this session and the other session */ diff(other: Session): Session; /** * Subtract the contents of snasphot b from session a, removing any items that have a resulting quantity of 0 * (this will ignore elements in b but not in a) * * @param a the session from which to subtract elements * @param b the session from which to add elements * @returns a new session representing the difference between a and b */ static diff(a: Session, b: Session): Session; /** * Generate a new session combining multiple sessions together * * @param other the session from which to add elements to this set * @returns a new session representing the addition of other to this */ add(other: Session): Session; /** * Combine the contents of sessions * * @param sessions the set of sessions to combine together * @returns a new session representing the difference between a and b */ static add(...sessions: Session[]): Session; static getFilepath(filename: string): string; /** * Export this session to a file in the data/ directory. Conventionally this file should end in ".json" * * @param filename The file into which to export */ toFile(filename: string): void; /** * Import a session from a file in the data/ directory. Conventionally the file should end in ".json" * * @param filename The file from which to import * @returns the session represented by the file */ static fromFile(filename: string): Session; /** * Return the meat and items for the current session * * @param sessionOnly should closet, DC, and storage be ignored for the session calculation * @returns current session */ static current(sessionOnly?: boolean): Session; /** * @param baseline the base session to use when computing MPA * @param full the full session to use when computing MPA * @param options options for computing MPA * @param options.value a function to compute the meat value of a given item * @param options.isOutlier a function to compute if an item is considered an outlier. By default, no items are outliers * @param options.excludeValue meat values to exclude when calculating specific portions of the MPA * @param options.excludeValue.meat how much meat to exclude when calculating the meat portion of MPA * @param options.excludeValue.item how much meat to exclude when calculating hte item portion of MPA * @returns an analysis of the effective MPA for the given session */ static computeMPA(baseline: Session, full: Session, options: { value: (item: Item) => number; isOutlier?: (item: ItemDetail) => boolean; excludeValue?: { meat?: number; item?: number; }; }): MeatPerAdventureAnalysis; /** * @param other the session to diff against this session when computing MPA * @param options options for computing MPA * @param options.value a function to compute the meat value of a given item * @param options.isOutlier a function to compute if an item is considered an outlier. By default, no items are outliers * @param options.excludeValue meat values to exclude when calculating specific portions of the MPA * @param options.excludeValue.meat how much meat to exclude when calculating the meat portion of MPA * @param options.excludeValue.item how much meat to exclude when calculating hte item portion of MPA * @returns an analysis of the effective MPA for the given session */ computeMPA(other: Session, options: { value: (item: Item) => number; isOutlier?: (item: ItemDetail) => boolean; excludeValue?: { meat?: number; item?: number; }; }): MeatPerAdventureAnalysis; }