Skip to content

Commit

Permalink
fix: common data type
Browse files Browse the repository at this point in the history
  • Loading branch information
lxfu1 committed Dec 27, 2023
1 parent dbde6e1 commit 72b8fe1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/plots/src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TooltipComponent } from '@antv/g2';
import type { TooltipComponent, Data as G2Data } from '@antv/g2';
import { Options, Spec } from './core';

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ export interface AttachConfig {
* @title.en_US Graphics event
* @description.en_US Any graphics event triggers a callback
*/
onEvent?: (chart: Chart, event: PlotEvent) => void;
onEvent?: (chart: Chart, event: any) => void;
}

/**
Expand All @@ -91,14 +91,13 @@ export interface AttachConfig {
* @title.en_US event
* @description.en_US Shallow copy of event type
*/
export type PlotEvent = any; // 来自 G2 ,临时使用 any

export type Datum = any; // 来自 G2 ,临时使用 any
export type Datum = G2Data | any[];

type TransformType<T> = T extends object ? { [P in keyof T]: TransformType<T[P]> } : T;

export interface Common extends AttachConfig, ContainerConfig {
data?: Datum[];
data?: Datum;
/**
* @title 内部属性,只读
*/
Expand Down

0 comments on commit 72b8fe1

Please sign in to comment.