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

12 lines
360 B
TypeScript
Raw Normal View History

import NumCalculator from './NumCalculator';
import CSSCalculator from './CSSCalculator';
import type AbstractCalculator from './calculator';
const genCalc = (type: 'css' | 'js') => {
const Calculator = type === 'css' ? CSSCalculator : NumCalculator;
return (num: number | string | AbstractCalculator) => new Calculator(num);
};
export default genCalc;