From cd1f473b0b1695296b95aa0d9c61361bce1a034b Mon Sep 17 00:00:00 2001 From: plainheart Date: Sun, 31 Dec 2023 20:14:23 +0800 Subject: [PATCH] fix(type): make the last two parameters `ellipsis` & `options` of the function `truncateText` optional. resolves apache/echarts#19447 --- src/graphic/helper/parseText.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphic/helper/parseText.ts b/src/graphic/helper/parseText.ts index 201d8fc00..275e36b0d 100644 --- a/src/graphic/helper/parseText.ts +++ b/src/graphic/helper/parseText.ts @@ -41,8 +41,8 @@ export function truncateText( text: string, containerWidth: number, font: string, - ellipsis: string, - options: InnerTruncateOption + ellipsis?: string, + options?: InnerTruncateOption ): string { if (!containerWidth) { return ''; @@ -63,8 +63,8 @@ export function truncateText( function prepareTruncateOptions( containerWidth: number, font: string, - ellipsis: string, - options: InnerTruncateOption + ellipsis?: string, + options?: InnerTruncateOption ): InnerPreparedTruncateOption { options = options || {}; let preparedOpts = extend({}, options) as InnerPreparedTruncateOption;