mirror of
https://github.com/hustcc/echarts-for-react.git
synced 2025-12-08 20:16:09 +00:00
* add core.d.ts for ReactEchartsCore for ts * make echarts props nessary in core.d.ts * make core.d.ts inherit index.d.ts
This commit is contained in:
parent
4b248e5281
commit
5763e01a4d
36
lib/core.d.ts
vendored
36
lib/core.d.ts
vendored
@ -1,39 +1,11 @@
|
||||
/// <reference types="react" />
|
||||
|
||||
import * as React from 'react';
|
||||
import {ReactEchartsPropsTypes} from './index.d'
|
||||
|
||||
type Func = (...args: any[]) => any;
|
||||
|
||||
interface EventMap {
|
||||
[key: string]: Func,
|
||||
}
|
||||
|
||||
interface ObjectMap {
|
||||
[key: string]: any,
|
||||
}
|
||||
|
||||
interface optsMap {
|
||||
devicePixelRatio?: number,
|
||||
renderer?: 'canvas' | 'svg',
|
||||
width?: number | null | undefined | 'auto',
|
||||
height?: number | null | undefined | 'auto',
|
||||
}
|
||||
|
||||
// Index
|
||||
export interface ReactEchartsPropsTypes {
|
||||
option: ObjectMap;
|
||||
notMerge?: boolean;
|
||||
lazyUpdate?: boolean;
|
||||
style?: ObjectMap;
|
||||
className?: string;
|
||||
theme?: string | null | ObjectMap;
|
||||
onChartReady?: Func;
|
||||
showLoading?: boolean;
|
||||
loadingOption?: ObjectMap;
|
||||
onEvents?: EventMap;
|
||||
// Core
|
||||
export interface ReactEchartsCorePropsTypes extends ReactEchartsPropsTypes{
|
||||
echarts: object;
|
||||
opts?: optsMap;
|
||||
shouldSetOption?: Func;
|
||||
}
|
||||
|
||||
export default class ReactEchartsCore extends React.Component<ReactEchartsPropsTypes, any>{}
|
||||
export default class ReactEchartsCore extends React.Component<ReactEchartsCorePropsTypes, any>{}
|
||||
|
||||
3
lib/index.d.ts
vendored
3
lib/index.d.ts
vendored
@ -26,12 +26,11 @@ export interface ReactEchartsPropsTypes {
|
||||
lazyUpdate?: boolean;
|
||||
style?: ObjectMap;
|
||||
className?: string;
|
||||
theme?: string | null;
|
||||
theme?: string | null | ObjectMap;
|
||||
onChartReady?: Func;
|
||||
showLoading?: boolean;
|
||||
loadingOption?: ObjectMap;
|
||||
onEvents?: EventMap;
|
||||
echarts?: object;
|
||||
opts?: optsMap;
|
||||
shouldSetOption?: Func;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user