2021-01-07 11:00:46 -08:00
|
|
|
// solver.ts custom types
|
|
|
|
|
|
|
|
// RollSet is used to preserve all information about a calculated roll
|
2021-01-07 05:34:14 -08:00
|
|
|
export type RollSet = {
|
|
|
|
origidx: number,
|
|
|
|
roll: number,
|
|
|
|
dropped: boolean,
|
|
|
|
rerolled: boolean,
|
|
|
|
exploding: boolean,
|
|
|
|
critHit: boolean,
|
|
|
|
critFail: boolean
|
|
|
|
};
|
|
|
|
|
2021-01-07 11:00:46 -08:00
|
|
|
// SolvedStep is used to preserve information while math is being performed on the roll
|
2021-01-07 05:34:14 -08:00
|
|
|
export type SolvedStep = {
|
|
|
|
total: number,
|
|
|
|
details: string,
|
|
|
|
containsCrit: boolean,
|
|
|
|
containsFail: boolean
|
|
|
|
};
|
|
|
|
|
2021-01-26 23:35:46 -08:00
|
|
|
// ReturnData is the temporary internal type used before getting turned into SolvedRoll
|
|
|
|
export type ReturnData = {
|
|
|
|
rollTotal: number,
|
|
|
|
rollPostFormat: string,
|
|
|
|
rollDetails: string,
|
|
|
|
containsCrit: boolean,
|
|
|
|
containsFail: boolean,
|
|
|
|
initConfig: string
|
|
|
|
};
|
|
|
|
|
2021-01-07 11:00:46 -08:00
|
|
|
// SolvedRoll is the complete solved and formatted roll, or the error said roll created
|
2021-01-07 05:34:14 -08:00
|
|
|
export type SolvedRoll = {
|
|
|
|
error: boolean,
|
|
|
|
errorMsg: string,
|
2021-01-14 05:47:18 -08:00
|
|
|
errorCode: string,
|
2021-01-07 05:34:14 -08:00
|
|
|
line1: string,
|
|
|
|
line2: string,
|
|
|
|
line3: string
|
|
|
|
};
|