You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2021/10/20 03:24:06 UTC
[echarts] 01/01: fix(types): add `undefined` for the return type of
`getInstanceByDom` & `getInstanceById`.
This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch fix-types
in repository https://gitbox.apache.org/repos/asf/echarts.git
commit 1ee1ae003ce24c6d167b446ba5ea3630468a38ca
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Wed Oct 20 11:20:44 2021 +0800
fix(types): add `undefined` for the return type of `getInstanceByDom` & `getInstanceById`.
---
src/core/echarts.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/echarts.ts b/src/core/echarts.ts
index 8a61c98..1bd2609 100644
--- a/src/core/echarts.ts
+++ b/src/core/echarts.ts
@@ -2653,11 +2653,11 @@ export function dispose(chart: EChartsType | HTMLElement | string): void {
}
}
-export function getInstanceByDom(dom: HTMLElement): EChartsType {
+export function getInstanceByDom(dom: HTMLElement): EChartsType | undefined {
return instances[modelUtil.getAttribute(dom, DOM_ATTRIBUTE_KEY)];
}
-export function getInstanceById(key: string): EChartsType {
+export function getInstanceById(key: string): EChartsType | undefined {
return instances[key];
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org