dicewerx
Version:
Standard dice notation parser and evaluator, written in TypeScript
42 lines (41 loc) • 1.42 kB
TypeScript
import { Die } from "./die";
/**
* Drops the highest die in the set
* @remarks
* Works on any number of dice in a array, even of varying sides
* @param numbers - A set of dice
* @returns The same set without the highest result that was rolled
*/
export declare function dropLowest(numbers: Die[]): Die[];
/**
* Drops the lowest die in the set
* @remarks
* Works on any number of dice in a array, even of varying sides
* @param numbers - A set of dice
* @returns The same set without the lowest result that was rolled
*/
export declare function dropHighest(numbers: Die[]): Die[];
/**
* Rolls the dice and returns the actual result
* @remarks
* Works on any number of dice in a array, even of varying sides
* @param numbers - A set of dice
* @returns The result for the set of dice
*/
export declare function sum(numbers: Die[]): number;
/**
* Rolls the dice and returns the maximum result
* @remarks
* Works on any number of dice in a array, even of varying sides
* @param numbers - A set of dice
* @returns The highest possible result for the set of dice
*/
export declare function rollMax(dice: Die[]): number;
/**
* Rolls the dice and returns the minimum result
* @remarks
* Works on any number of dice in a array, even of varying sides
* @param numbers - A set of dice
* @returns The lowest possible result for the set of dice
*/
export declare function rollMin(dice: Die[]): number;