Skip to content

Commit d0177db

Browse files
authored
chore: 修复控制台 warning (#2472)
1 parent ed682f2 commit d0177db

File tree

36 files changed

+138
-83
lines changed

36 files changed

+138
-83
lines changed

api-extractor.json

+18
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,23 @@
1111
},
1212
"tsdocMetadata": {
1313
"enabled": false
14+
},
15+
"messages": {
16+
"extractorMessageReporting": {
17+
"ae-missing-release-tag": {
18+
"logLevel": "none"
19+
},
20+
"ae-forgotten-export": {
21+
"logLevel": "none"
22+
}
23+
},
24+
"tsdocMessageReporting": {
25+
"tsdoc-param-tag-missing-hyphen": {
26+
"logLevel": "none"
27+
},
28+
"tsdoc-escape-greater-than": {
29+
"logLevel": "none"
30+
}
31+
}
1432
}
1533
}

src/adaptor/geometries/index.ts

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
export { area, AreaGeometryOptions } from './area';
2-
export { line, LineGeometryOptions } from './line';
3-
export { point, PointGeometryOptions } from './point';
4-
export { interval, IntervalGeometryOptions } from './interval';
5-
export { polygon, PolygonGeometryOptions } from './polygon';
6-
export { edge, EdgeGeometryOptions } from './edge';
1+
export { area } from './area';
2+
export type { AreaGeometryOptions } from './area';
3+
export { line } from './line';
4+
export type { LineGeometryOptions } from './line';
5+
export { point } from './point';
6+
export type { PointGeometryOptions } from './point';
7+
export { interval } from './interval';
8+
export type { IntervalGeometryOptions } from './interval';
9+
export { polygon } from './polygon';
10+
export type { PolygonGeometryOptions } from './polygon';
11+
export { edge } from './edge';
12+
export type { EdgeGeometryOptions } from './edge';

src/index.ts

+63-32
Original file line numberDiff line numberDiff line change
@@ -8,107 +8,138 @@ export { G2 };
88
export { Plot } from './core/plot';
99

1010
/** Adaptor 及其参数的类型定义 */
11-
export { Adaptor, Params } from './core/adaptor';
11+
export type { Adaptor, Params } from './core/adaptor';
1212

1313
// 类型定义导出
1414
export * from './types';
1515

1616
// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)
17-
export { Line, LineOptions } from './plots/line';
17+
export { Line } from './plots/line';
18+
export type { LineOptions } from './plots/line';
1819

1920
// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)
20-
export { Area, AreaOptions } from './plots/area';
21+
export { Area } from './plots/area';
22+
export type { AreaOptions } from './plots/area';
2123

2224
// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)
23-
export { Column, ColumnOptions } from './plots/column';
25+
export { Column } from './plots/column';
26+
export type { ColumnOptions } from './plots/column';
2427

2528
// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)
26-
export { Bar, BarOptions } from './plots/bar';
29+
export { Bar } from './plots/bar';
30+
export type { BarOptions } from './plots/bar';
2731

2832
// 饼图及类型定义 | author by [visiky](https://github.com/visiky)
29-
export { Pie, PieOptions } from './plots/pie';
33+
export { Pie } from './plots/pie';
34+
export type { PieOptions } from './plots/pie';
3035

3136
// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)
32-
export { Rose, RoseOptions } from './plots/rose';
37+
export { Rose } from './plots/rose';
38+
export type { RoseOptions } from './plots/rose';
3339

3440
// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)
35-
export { WordCloud, WordCloudOptions } from './plots/word-cloud';
41+
export { WordCloud } from './plots/word-cloud';
42+
export type { WordCloudOptions } from './plots/word-cloud';
3643

3744
// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)
38-
export { Scatter, ScatterOptions } from './plots/scatter';
45+
export { Scatter } from './plots/scatter';
46+
export type { ScatterOptions } from './plots/scatter';
3947

4048
// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)
41-
export { Radar, RadarOptions } from './plots/radar';
49+
export { Radar } from './plots/radar';
50+
export type { RadarOptions } from './plots/radar';
4251

4352
// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)
44-
export { DualAxes, DualAxesOptions } from './plots/dual-axes';
53+
export { DualAxes } from './plots/dual-axes';
54+
export type { DualAxesOptions } from './plots/dual-axes';
4555

4656
// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)
47-
export { TinyLine, TinyLineOptions } from './plots/tiny-line';
57+
export { TinyLine } from './plots/tiny-line';
58+
export type { TinyLineOptions } from './plots/tiny-line';
4859

4960
// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)
50-
export { TinyColumn, TinyColumnOptions } from './plots/tiny-column';
61+
export { TinyColumn } from './plots/tiny-column';
62+
export type { TinyColumnOptions } from './plots/tiny-column';
5163

5264
// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)
53-
export { TinyArea, TinyAreaOptions } from './plots/tiny-area';
65+
export { TinyArea } from './plots/tiny-area';
66+
export type { TinyAreaOptions } from './plots/tiny-area';
5467

5568
// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
56-
export { Histogram, HistogramOptions } from './plots/histogram';
69+
export { Histogram } from './plots/histogram';
70+
export type { HistogramOptions } from './plots/histogram';
5771

5872
// 进度图及类型定义 | author by [connono](https://github.com/connono)
59-
export { Progress, ProgressOptions } from './plots/progress';
73+
export { Progress } from './plots/progress';
74+
export type { ProgressOptions } from './plots/progress';
6075

6176
// 环形进度图及类型定义 | author by [connono](https://github.com/connono)
62-
export { RingProgress, RingProgressOptions } from './plots/ring-progress';
77+
export { RingProgress } from './plots/ring-progress';
78+
export type { RingProgressOptions } from './plots/ring-progress';
6379

6480
// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)
65-
export { Heatmap, HeatmapOptions } from './plots/heatmap';
81+
export { Heatmap } from './plots/heatmap';
82+
export type { HeatmapOptions } from './plots/heatmap';
6683

6784
// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)
68-
export { Box, BoxOptions } from './plots/box';
85+
export { Box } from './plots/box';
86+
export type { BoxOptions } from './plots/box';
6987

7088
// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong)
71-
export { Stock, StockOptions } from './plots/stock';
89+
export { Stock } from './plots/stock';
90+
export type { StockOptions } from './plots/stock';
7291

7392
// 漏斗图及类型定义
74-
export { Funnel, FunnelOptions, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';
93+
export { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';
94+
export type { FunnelOptions } from './plots/funnel';
7595

7696
// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc)
77-
export { Liquid, LiquidOptions } from './plots/liquid';
97+
export { Liquid } from './plots/liquid';
98+
export type { LiquidOptions } from './plots/liquid';
7899

79100
// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
80-
export { Bullet, BulletOptions } from './plots/bullet';
101+
export { Bullet } from './plots/bullet';
102+
export type { BulletOptions } from './plots/bullet';
81103

82104
// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1)
83-
export { Sunburst, SunburstOptions } from './plots/sunburst';
105+
export { Sunburst } from './plots/sunburst';
106+
export type { SunburstOptions } from './plots/sunburst';
84107

85108
// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)
86-
export { Gauge, GaugeOptions } from './plots/gauge';
109+
export { Gauge } from './plots/gauge';
110+
export type { GaugeOptions } from './plots/gauge';
87111

88112
// 瀑布图 | author by [visiky](https://github.com/visiky)
89-
export { Waterfall, WaterfallOptions } from './plots/waterfall';
113+
export { Waterfall } from './plots/waterfall';
114+
export type { WaterfallOptions } from './plots/waterfall';
90115

91116
// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)
92-
export { RadialBar, RadialBarOptions } from './plots/radial-bar';
117+
export { RadialBar } from './plots/radial-bar';
118+
export type { RadialBarOptions } from './plots/radial-bar';
93119

94120
// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)
95-
export { BidirectionalBar, BidirectionalBarOptions } from './plots/bidirectional-bar';
121+
export { BidirectionalBar } from './plots/bidirectional-bar';
122+
export type { BidirectionalBarOptions } from './plots/bidirectional-bar';
96123

97124
// 矩形树图
98-
export { Treemap, TreemapOptions } from './plots/treemap';
125+
export { Treemap } from './plots/treemap';
126+
export type { TreemapOptions } from './plots/treemap';
99127

100128
// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)
101-
export { Sankey, SankeyOptions } from './plots/sankey';
129+
export { Sankey } from './plots/sankey';
130+
export type { SankeyOptions } from './plots/sankey';
102131

103132
// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu)
104-
export { Chord, ChordOptions } from './plots/chord';
133+
export { Chord } from './plots/chord';
134+
export type { ChordOptions } from './plots/chord';
105135

106136
// 以下开放自定义图表开发的能力(目前仅仅是孵化中)
107137
/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */
108138
export { P } from './plugin';
109139

110140
/** 开放多图层图表 (multi-view) */
111-
export { MultiView, MultiViewOptions } from './plots/multi-view';
141+
export { MultiView } from './plots/multi-view';
142+
export type { MultiViewOptions } from './plots/multi-view';
112143

113144
/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */
114145
export { flow, measureTextWidth } from './utils';

src/plots/_template/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Adaptor } from '../../core/adaptor';
33
import { TemplateOptions } from './types';
44
import { adaptor } from './adaptor';
55

6-
export { TemplateOptions };
6+
export type { TemplateOptions };
77

88
/**
99
* 这个是一个图表开发的 模板代码!

src/plots/area/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { AreaOptions } from './types';
55
import { adaptor, meta } from './adaptor';
66
import { DEFAULT_OPTIONS } from './constants';
77

8-
export { AreaOptions };
8+
export type { AreaOptions };
99

1010
export class Area extends Plot<AreaOptions> {
1111
/**
1212
* 获取 面积图 默认配置项
13-
* @static 供外部使用
13+
* 供外部使用
1414
*/
1515
static getDefaultOptions(): Partial<AreaOptions> {
1616
return DEFAULT_OPTIONS;

src/plots/bar/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { adaptor, meta } from './adaptor';
66
import { DEFAULT_OPTIONS } from './constants';
77
import { transformBarData } from './utils';
88

9-
export { BarOptions };
9+
export type { BarOptions };
1010

1111
/**
1212
* 条形图
1313
*/
1414
export class Bar extends Plot<BarOptions> {
1515
/**
1616
* 获取 条形图 默认配置项
17-
* @static 供外部使用
17+
* 供外部使用
1818
*/
1919
static getDefaultOptions(): Partial<BarOptions> {
2020
return DEFAULT_OPTIONS;

src/plots/bidirectional-bar/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { adaptor } from './adaptor';
77
import { syncViewPadding, transformData, isHorizontal } from './utils';
88
import { SERIES_FIELD_KEY, FIRST_AXES_VIEW, SECOND_AXES_VIEW } from './constant';
99

10-
export { BidirectionalBarOptions };
10+
export type { BidirectionalBarOptions };
1111

1212
export class BidirectionalBar extends Plot<BidirectionalBarOptions> {
1313
/** 图表类型 */

src/plots/box/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BoxOptions } from './types';
55
import { adaptor } from './adaptor';
66
import { transformData } from './utils';
77
import { BOX_RANGE, BOX_RANGE_ALIAS, OUTLIERS_VIEW_ID } from './constant';
8-
export { BoxOptions };
8+
export type { BoxOptions };
99

1010
export class Box extends Plot<BoxOptions> {
1111
/** 图表类型 */

src/plots/bullet/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BulletOptions } from './types';
55
import { adaptor, meta } from './adaptor';
66
import { transformData } from './utils';
77

8-
export { BulletOptions };
8+
export type { BulletOptions };
99

1010
export class Bullet extends Plot<BulletOptions> {
1111
/** 图表类型 */

src/plots/chord/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Datum } from '../../types';
44
import { ChordOptions } from './types';
55
import { adaptor } from './adaptor';
66

7-
export { ChordOptions };
7+
export type { ChordOptions };
88

99
/**
1010
* 弦图 Chord

src/plots/column/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import { ColumnOptions } from './types';
55
import { adaptor, meta } from './adaptor';
66
import { DEFAULT_OPTIONS } from './constants';
77

8-
export { ColumnOptions };
8+
export type { ColumnOptions };
99

1010
/**
1111
* 柱形图
1212
*/
1313
export class Column extends Plot<ColumnOptions> {
1414
/**
1515
* 获取 柱形图 默认配置项
16-
* @static 供外部使用
16+
* 供外部使用
1717
*/
1818
static getDefaultOptions(): Partial<ColumnOptions> {
1919
return DEFAULT_OPTIONS;

src/plots/dual-axes/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { deepAssign } from '../../utils';
44
import { DualAxesOptions } from './types';
55
import { adaptor } from './adaptor';
66

7-
export { DualAxesOptions };
7+
export type { DualAxesOptions };
88

99
export class DualAxes extends Plot<DualAxesOptions> {
1010
/** 图表类型: 双轴图 */

src/plots/funnel/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FunnelOptions } from './types';
44
import { adaptor } from './adaptor';
55
import { FUNNEL_CONVERSATION as FUNNEL_CONVERSATION_FIELD } from './constant';
66

7-
export { FunnelOptions };
7+
export type { FunnelOptions };
88

99
export { FUNNEL_CONVERSATION_FIELD };
1010

src/plots/gauge/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import { getIndicatorData, getRangeData } from './utils';
1010
import './shapes/gauge';
1111
import './shapes/meter-gauge';
1212

13-
export { GaugeOptions };
13+
export type { GaugeOptions };
1414

1515
/**
1616
* 仪表盘
1717
*/
1818
export class Gauge extends Plot<GaugeOptions> {
1919
/**
2020
* 获取 仪表盘 默认配置项
21-
* @static 供外部使用
21+
* 供外部使用
2222
*/
2323
static getDefaultOptions(): Partial<GaugeOptions> {
2424
return DEFAULT_OPTIONS;

src/plots/gauge/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type Indicator = {
1414
};
1515
};
1616

17-
type Range = {
17+
export type Range = {
1818
/** 辅助的刻度值 0 ~ 1 的数字 */
1919
readonly ticks?: number[];
2020
/** 辅助刻度的颜色配置 */

src/plots/heatmap/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { adaptor } from './adaptor';
77
import './shapes/circle';
88
import './shapes/square';
99

10-
export { HeatmapOptions };
10+
export type { HeatmapOptions };
1111

1212
export class Heatmap extends Plot<HeatmapOptions> {
1313
/** 图表类型 */

src/plots/histogram/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { binHistogram } from '../../utils/transform/histogram';
55
import { HistogramOptions } from './types';
66
import { adaptor } from './adaptor';
77

8-
export { HistogramOptions };
8+
export type { HistogramOptions };
99

1010
export class Histogram extends Plot<HistogramOptions> {
1111
/** 图表类型 */

src/plots/line/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { adaptor, meta } from './adaptor';
55
import { DEFAULT_OPTIONS } from './constants';
66
import './interactions';
77

8-
export { LineOptions };
8+
export type { LineOptions };
99

1010
export class Line extends Plot<LineOptions> {
1111
/**
1212
* 获取 折线图 默认配置项
13-
* @static 供外部使用
13+
* 供外部使用
1414
*/
1515
static getDefaultOptions(): Partial<LineOptions> {
1616
return DEFAULT_OPTIONS;

0 commit comments

Comments
 (0)