You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/11/05 10:02:54 UTC

[incubator-echarts] 01/02: fix(type): not leak inner structure in types

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch bundle-dts
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 7e425d401cf784f0e4bc8d82b77a1f70d898f671
Author: pissang <bm...@gmail.com>
AuthorDate: Thu Nov 5 18:02:08 2020 +0800

    fix(type): not leak inner structure in types
---
 src/echarts.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/echarts.ts b/src/echarts.ts
index b36df31..1e47487 100644
--- a/src/echarts.ts
+++ b/src/echarts.ts
@@ -336,7 +336,8 @@ class ECharts extends Eventful {
     // Can't dispatch action during rendering procedure
     private _pendingActions: Payload[] = [];
 
-    protected _$eventProcessor: ECEventProcessor;
+    // We use unkown here so ECEventProcessor, which may include many unexpected types won't be exposed in the types to developers.
+    protected _$eventProcessor: unknown;
 
     private _disposed: boolean;
 
@@ -1016,7 +1017,7 @@ class ECharts extends Eventful {
                     params.event = e;
                     params.type = eveName;
 
-                    this._$eventProcessor.eventInfo = {
+                    (this._$eventProcessor as ECEventProcessor).eventInfo = {
                         targetEl: el,
                         packedEvent: params,
                         model: model,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org