text-overflow-processor-react
Version:
19 lines (18 loc) • 949 B
TypeScript
/**
* 获取固定宽度的字符串,如果传入的text的宽度不够width,则返回原字符串
* @text 将要被提取的原字符串
* @lineWidth 单行宽度,用于换行符\n计算
* @width 想要提取的字符串宽度
* @fontSize 字号大小
* @isNeedEllipsis 当text的宽度大于width时是否需要省略号
* @fontStyleCSSText 文案样式
* @fontClassName 文案类名
* @containerEl 文案容器dom
*/
type GetFixedWidthTextFn = (text: string, lineWidth: number, width: number, fontSize?: number, fontWeight?: number, isNeedEllipsis?: boolean, fontStyleCSSText?: string, fontClassName?: string, containerEl?: HTMLElement | null) => string;
declare const getFixedWidthText: GetFixedWidthTextFn;
declare const getClassNames: (obj: {
[keyName: string]: boolean;
}) => string;
declare const filterComplexDependencies: (value: any) => string;
export { getFixedWidthText, getClassNames, filterComplexDependencies, };