ant-design/components/theme/util/calc/calculator.ts

34 lines
984 B
TypeScript
Raw Normal View History

abstract class AbstractCalculator {
/**
* @descCN 1 + 2
* @descEN Calculate the sum of two numbers, e.g. 1 + 2
*/
abstract add(num: number | string | AbstractCalculator): this;
/**
* @descCN 1 - 2
* @descEN Calculate the difference between two numbers, e.g. 1 - 2
*/
abstract sub(num: number | string | AbstractCalculator): this;
/**
* @descCN 1 * 2
* @descEN Calculate the product of two numbers, e.g. 1 * 2
*/
abstract mul(num: number | string | AbstractCalculator): this;
/**
* @descCN 1 / 2
* @descEN Calculate the quotient of two numbers, e.g. 1 / 2
*/
abstract div(num: number | string | AbstractCalculator): this;
/**
* @descCN
* @descEN Get the calculation result
*/
abstract equal(options?: { unit?: boolean }): string | number;
}
export default AbstractCalculator;