提交 198ccdb4 编写于 作者: 1 100pah

ts: tweak lint

上级 e25f1dcb
...@@ -81,16 +81,16 @@ function getClipArea(coord: CoordSysOfBar, data: List) { ...@@ -81,16 +81,16 @@ function getClipArea(coord: CoordSysOfBar, data: List) {
class BarView extends ChartView { class BarView extends ChartView {
static type = 'bar' as const static type = 'bar' as const;
type = BarView.type type = BarView.type;
_data: List _data: List;
_isLargeDraw: boolean _isLargeDraw: boolean;
_backgroundGroup: Group _backgroundGroup: Group;
_backgroundEls: (Rect | Sector)[] _backgroundEls: (Rect | Sector)[];
render(seriesModel: BarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) { render(seriesModel: BarSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {
this._updateDrawMode(seriesModel); this._updateDrawMode(seriesModel);
......
...@@ -219,9 +219,9 @@ class GraphSeriesModel extends SeriesModel<GraphSeriesOption> { ...@@ -219,9 +219,9 @@ class GraphSeriesModel extends SeriesModel<GraphSeriesOption> {
/** /**
* Preserved points during layouting * Preserved points during layouting
*/ */
preservedPoints?: Dictionary<VectorArray> preservedPoints?: Dictionary<VectorArray>;
forceLayout?: ForceLayoutInstance forceLayout?: ForceLayoutInstance;
init(option: GraphSeriesOption) { init(option: GraphSeriesOption) {
super.init.apply(this, arguments as any); super.init.apply(this, arguments as any);
......
...@@ -313,7 +313,7 @@ class SunburstPiece extends graphic.Group { ...@@ -313,7 +313,7 @@ class SunburstPiece extends graphic.Group {
} }
label.attr('rotation', rotate); label.attr('rotation', rotate);
type LabelOption = SunburstSeriesNodeOption['label'] type LabelOption = SunburstSeriesNodeOption['label'];
function getLabelAttr<T extends keyof LabelOption>(name: T): LabelOption[T] { function getLabelAttr<T extends keyof LabelOption>(name: T): LabelOption[T] {
var stateAttr = labelModel.get(name); var stateAttr = labelModel.get(name);
if (stateAttr == null) { if (stateAttr == null) {
......
...@@ -26,7 +26,7 @@ import { ColorString, ZRColor } from '../../util/types'; ...@@ -26,7 +26,7 @@ import { ColorString, ZRColor } from '../../util/types';
import { modifyHSL, modifyAlpha } from 'zrender/src/tool/color'; import { modifyHSL, modifyAlpha } from 'zrender/src/tool/color';
import { makeInner } from '../../util/model'; import { makeInner } from '../../util/model';
type NodeModel = Model<TreemapSeriesNodeItemOption> type NodeModel = Model<TreemapSeriesNodeItemOption>;
type NodeItemStyleModel = Model<TreemapSeriesNodeItemOption['itemStyle']>; type NodeItemStyleModel = Model<TreemapSeriesNodeItemOption['itemStyle']>;
const ITEM_STYLE_NORMAL = 'itemStyle'; const ITEM_STYLE_NORMAL = 'itemStyle';
......
...@@ -34,7 +34,7 @@ const XY = ['x', 'y'] as const; ...@@ -34,7 +34,7 @@ const XY = ['x', 'y'] as const;
const WH = ['width', 'height'] as const; const WH = ['width', 'height'] as const;
// Not use top level axisPointer model // Not use top level axisPointer model
type AxisPointerModel = Model<CommonAxisPointerOption> type AxisPointerModel = Model<CommonAxisPointerOption>;
class SingleAxisPointer extends BaseAxisPointer { class SingleAxisPointer extends BaseAxisPointer {
......
...@@ -100,7 +100,7 @@ interface AxisTriggerPayload extends Payload { ...@@ -100,7 +100,7 @@ interface AxisTriggerPayload extends Payload {
type ShowValueMap = Dictionary<{ type ShowValueMap = Dictionary<{
value: AxisValue value: AxisValue
payloadBatch: BatchItem[] payloadBatch: BatchItem[]
}> }>;
/** /**
* Basic logic: check all axis, if they do not demand show/highlight, * Basic logic: check all axis, if they do not demand show/highlight,
......
...@@ -67,12 +67,12 @@ class CalendarView extends ComponentView { ...@@ -67,12 +67,12 @@ class CalendarView extends ComponentView {
/** /**
* first day of month * first day of month
*/ */
private _firstDayOfMonth: CalendarParsedDateInfo[] private _firstDayOfMonth: CalendarParsedDateInfo[];
/** /**
* first day point of month * first day point of month
*/ */
private _firstDayPoints: number[][] private _firstDayPoints: number[][];
render(calendarModel: CalendarModel, ecModel: GlobalModel, api: ExtensionAPI) { render(calendarModel: CalendarModel, ecModel: GlobalModel, api: ExtensionAPI) {
......
...@@ -58,7 +58,7 @@ interface PayloadBatch { ...@@ -58,7 +58,7 @@ interface PayloadBatch {
dataZoomId: string dataZoomId: string
} }
type Store = Dictionary<Record> type Store = Dictionary<Record>;
const inner = makeInner<Store, ExtensionAPI>(); const inner = makeInner<Store, ExtensionAPI>();
......
...@@ -27,7 +27,7 @@ import Group from 'zrender/src/container/Group'; ...@@ -27,7 +27,7 @@ import Group from 'zrender/src/container/Group';
// Can be null/undefined or true/false // Can be null/undefined or true/false
// or 'pan/move' or 'zoom'/'scale' // or 'pan/move' or 'zoom'/'scale'
export type RoamType = RoamOptionMixin['roam'] export type RoamType = RoamOptionMixin['roam'];
interface RoamOption { interface RoamOption {
zoomOnMouseWheel?: boolean | 'ctrl' | 'shift' | 'alt' zoomOnMouseWheel?: boolean | 'ctrl' | 'shift' | 'alt'
......
...@@ -26,7 +26,6 @@ import { ZRColor, LabelOption } from '../../util/types'; ...@@ -26,7 +26,6 @@ import { ZRColor, LabelOption } from '../../util/types';
import Model from '../../model/Model'; import Model from '../../model/Model';
import ComponentModel from '../../model/Component'; import ComponentModel from '../../model/Component';
import GlobalModel from '../../model/Global'; import GlobalModel from '../../model/Global';
import * as zrUtil from 'zrender/src/core/util';
import { inheritDefaultOption } from '../../util/component'; import { inheritDefaultOption } from '../../util/component';
export interface ScrollableLegendOption extends LegendOption { export interface ScrollableLegendOption extends LegendOption {
...@@ -56,8 +55,8 @@ export interface ScrollableLegendOption extends LegendOption { ...@@ -56,8 +55,8 @@ export interface ScrollableLegendOption extends LegendOption {
class ScrollableLegendModel extends LegendModel<ScrollableLegendOption> { class ScrollableLegendModel extends LegendModel<ScrollableLegendOption> {
static type = 'legend.scroll' as const static type = 'legend.scroll' as const;
type = ScrollableLegendModel.type type = ScrollableLegendModel.type;
/** /**
* @param {number} scrollDataIndex * @param {number} scrollDataIndex
......
...@@ -64,7 +64,7 @@ interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption { ...@@ -64,7 +64,7 @@ interface ToolboxDataZoomFeatureOption extends ToolboxFeatureOption {
yAxisIndex?: ModelFinderIndexQuery | false yAxisIndex?: ModelFinderIndexQuery | false
} }
type ToolboxDataZoomFeatureModel = ToolboxFeatureModel<ToolboxDataZoomFeatureOption> type ToolboxDataZoomFeatureModel = ToolboxFeatureModel<ToolboxDataZoomFeatureOption>;
class DataZoomFeature extends ToolboxFeature<ToolboxDataZoomFeatureOption> { class DataZoomFeature extends ToolboxFeature<ToolboxDataZoomFeatureOption> {
......
...@@ -108,7 +108,7 @@ class SaveAsImage extends ToolboxFeature<ToolboxSaveAsImageFeatureOption> { ...@@ -108,7 +108,7 @@ class SaveAsImage extends ToolboxFeature<ToolboxSaveAsImageFeatureOption> {
excludeComponents: ['toolbox'], excludeComponents: ['toolbox'],
pixelRatio: 1, pixelRatio: 1,
lang: saveAsImageLang.lang.slice() lang: saveAsImageLang.lang.slice()
} };
} }
SaveAsImage.prototype.unusable = !env.canvasSupported; SaveAsImage.prototype.unusable = !env.canvasSupported;
......
...@@ -60,7 +60,7 @@ type ShapeStorage = { ...@@ -60,7 +60,7 @@ type ShapeStorage = {
indicator: graphic.Polygon indicator: graphic.Polygon
indicatorLabel: graphic.Text indicatorLabel: graphic.Text
indicatorLabelPoint: number[] indicatorLabelPoint: number[]
} };
type TargetDataIndices = ReturnType<ContinuousModel['findTargetDataIndices']>; type TargetDataIndices = ReturnType<ContinuousModel['findTargetDataIndices']>;
......
...@@ -307,10 +307,10 @@ class Graph { ...@@ -307,10 +307,10 @@ class Graph {
var graph = new Graph(this._directed); var graph = new Graph(this._directed);
var nodes = this.nodes; var nodes = this.nodes;
var edges = this.edges; var edges = this.edges;
for (var i = 0; i < nodes.length; i++) { for (let i = 0; i < nodes.length; i++) {
graph.addNode(nodes[i].id, nodes[i].dataIndex); graph.addNode(nodes[i].id, nodes[i].dataIndex);
} }
for (var i = 0; i < edges.length; i++) { for (let i = 0; i < edges.length; i++) {
var e = edges[i]; var e = edges[i];
graph.addEdge(e.node1.id, e.node2.id, e.dataIndex); graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);
} }
......
...@@ -654,7 +654,7 @@ class GlobalModel extends Model<ECUnitOption> { ...@@ -654,7 +654,7 @@ class GlobalModel extends Model<ECUnitOption> {
ecModel.mergeOption(baseOption); ecModel.mergeOption(baseOption);
}; };
})() })();
} }
// ----------------------- // -----------------------
......
...@@ -131,8 +131,8 @@ class Scheduler { ...@@ -131,8 +131,8 @@ class Scheduler {
// processors might be registered after echarts instance created. // processors might be registered after echarts instance created.
// Register processors incrementally for a echarts instance is // Register processors incrementally for a echarts instance is
// not supported by this stream architecture. // not supported by this stream architecture.
var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();
var visualHandlers = this._visualHandlers = visualHandlers.slice(); visualHandlers = this._visualHandlers = visualHandlers.slice();
this._allHandlers = dataProcessorHandlers.concat(visualHandlers); this._allHandlers = dataProcessorHandlers.concat(visualHandlers);
} }
......
...@@ -31,7 +31,7 @@ type ECSymbol = graphic.Path & { ...@@ -31,7 +31,7 @@ type ECSymbol = graphic.Path & {
setColor: (color: ZRColor, innerColor?: string) => void setColor: (color: ZRColor, innerColor?: string) => void
}; };
type SymbolCtor = { new(): ECSymbol }; type SymbolCtor = { new(): ECSymbol };
type SymbolShapeMaker = (x: number, y: number, w: number, h: number, shape: Dictionary<any>) => void type SymbolShapeMaker = (x: number, y: number, w: number, h: number, shape: Dictionary<any>) => void;
/** /**
* Triangle shape * Triangle shape
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册