the-math
Version:
TheMath is an extensive math library for JavaScript and Node.js. It features a flexible expression parser
29 lines (28 loc) • 738 B
TypeScript
export interface IRoundOptions {
/**
* @default 'round'
* @doc
* floor - rounds down
*
* ceil - rounds up
*
* round - rounds to nearest
*/
type?: 'floor' | 'ceil' | 'round';
precision?: number;
}
export interface IChainOptions {
round?: boolean | IRoundOptions;
}
export interface IChainOptionsGlobal {
round?: IRoundOptions;
}
export interface IChain {
divide(divisor: number): IChain;
multiply(multiplier: number): IChain;
subtract(subtractor: number): IChain;
add(adder: number): IChain;
done(options?: IChainOptions): number;
}
declare function createChain(globalInitOptions?: IChainOptions): (startNumber: number) => IChain;
export default createChain;