style: fix tsd

This commit is contained in:
afc163 2020-08-17 16:29:50 +08:00 committed by Yanyan Wang
parent 10f6cea317
commit 0605f25e28
3 changed files with 19 additions and 14 deletions

View File

@ -227,7 +227,7 @@ export default class ItemController {
each(cfg, (val, key) => {
if (model[key]) {
if (isObject(val) && !isArray(val)) {
cfg[key] = { ...model[key], ...cfg[key] };
cfg[key] = { ...(model[key] as Object), ...(cfg[key] as Object) };
}
}
});

View File

@ -6,25 +6,18 @@ import { isNaN } from '../../util/base';
import { IGraph } from '../../interface/graph';
import { path2Absolute } from '@antv/path-util';
// eslint-disable-next-line @typescript-eslint/no-implied-eval
const mockRaf = (cb: TimerHandler) => setTimeout(cb, 16);
const mockCaf = (reqId: number) => clearTimeout(reqId);
const helper = {
// pollyfill
requestAnimationFrame(callback: FrameRequestCallback) {
const fn =
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
function setTimeout(cb: TimerHandler) {
// eslint-disable-next-line
return setTimeout(cb, 16);
};
const fn = window.requestAnimationFrame || window.webkitRequestAnimationFrame || mockRaf;
return fn(callback);
},
cancelAnimationFrame(requestId: number) {
const fn =
window.cancelAnimationFrame ||
window.webkitCancelAnimationFrame ||
function clearTimeout(reqId: number) {
return clearTimeout(reqId);
};
const fn = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || mockCaf;
return fn(requestId);
},
};

View File

@ -28,6 +28,16 @@ interface TrendConfig {
readonly areaStyle?: ShapeStyle;
}
interface ExtendedTrendConfig {
readonly data: number[];
// 样式
readonly smooth?: boolean;
readonly isArea?: boolean;
readonly backgroundStyle?: ShapeStyle;
readonly lineStyle?: ShapeStyle;
readonly areaStyle?: ShapeStyle;
}
type TimeBarOption = Partial<{
// position size
readonly x: number;
@ -55,6 +65,8 @@ type TimeBarOption = Partial<{
readonly maxText: string;
readonly trend: TrendConfig;
readonly trendCfg: ExtendedTrendConfig;
}>;
interface TimeBarConfig extends IPluginBaseConfig {