Skip to content

Commit 974425d

Browse files
committed
TypeScript doesn't handle default exports :-p
1 parent df2344b commit 974425d

13 files changed

+28
-16
lines changed

src/core/core.animation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
import helpers from '../helpers';
3+
import helpers from '../helpers/index';
44

55
const transparent = 'transparent';
66
const interpolators = {

src/core/core.animator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

3-
import helpers from '../helpers';
3+
import helpers from '../helpers/index';
44

55
/**
6-
* @typedef { import("./core.controller") } Chart
6+
* @typedef { import("./core.controller").Chart } Chart
77
*/
88

99
function drawFPS(chart, count, date, lastDate) {

src/core/core.controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,3 +1040,7 @@ class Chart {
10401040
Chart.instances = {};
10411041

10421042
export default Chart;
1043+
1044+
export {
1045+
Chart
1046+
};

src/core/core.datasetController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ helpers.extend(DatasetController.prototype, {
224224

225225
/**
226226
* Element type used to generate a meta dataset (e.g. Chart.element.Line).
227-
* @type {Chart.core.element}
227+
* @type {Element}
228228
*/
229229
datasetElementType: null,
230230

231231
/**
232232
* Element type used to generate a meta data (e.g. Chart.element.Point).
233-
* @type {Chart.core.element}
233+
* @type {Element}
234234
*/
235235
dataElementType: null,
236236

src/core/core.interaction.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {_isPointInArea} from '../helpers/helpers.canvas';
55
import {_lookup, _rlookup} from '../helpers/helpers.collection';
66

77
/**
8-
* @typedef { import("./core.controller") } Chart
8+
* @typedef { import("./core.controller").Chart } Chart
99
*/
1010

1111
/**
@@ -121,7 +121,7 @@ function getDistanceMetricForAxis(axis) {
121121
* @param {Chart} chart - the chart
122122
* @param {object} position - the point to be nearest to
123123
* @param {string} axis - the axis mode. x|y|xy
124-
* @return {ChartElement[]} the nearest items
124+
* @return {object[]} the nearest items
125125
*/
126126
function getIntersectItems(chart, position, axis) {
127127
const items = [];
@@ -146,7 +146,7 @@ function getIntersectItems(chart, position, axis) {
146146
* @param {object} position - the point to be nearest to
147147
* @param {string} axis - the axes along which to measure distance
148148
* @param {boolean} [intersect] - if true, only consider items that intersect the position
149-
* @return {ChartElement[]} the nearest items
149+
* @return {object[]} the nearest items
150150
*/
151151
function getNearestItems(chart, position, axis, intersect) {
152152
const distanceMetric = getDistanceMetricForAxis(axis);

src/core/core.layouts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import defaults from './core.defaults';
44
import helpers from '../helpers';
55

66
/**
7-
* @typedef { import("./core.controller") } Chart
7+
* @typedef { import("./core.controller").Chart } Chart
88
*/
99

1010
const extend = helpers.extend;

src/core/core.plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import defaults from './core.defaults';
44
import {clone} from '../helpers/helpers.core';
55

66
/**
7-
* @typedef { import("./core.controller") } Chart
7+
* @typedef { import("./core.controller").Chart } Chart
88
*/
99

1010
defaults._set('plugins', {});

src/elements/element.line.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas';
99
import {_updateBezierControlPoints} from '../helpers/helpers.curve';
1010

1111
/**
12-
* @typedef { import("./element.point") } Point
12+
* @typedef { import("./element.point").Point } Point
1313
*/
1414

1515
const defaultColor = defaults.color;
@@ -361,3 +361,7 @@ class Line extends Element {
361361
Line.prototype._type = 'line';
362362

363363
export default Line;
364+
365+
export {
366+
Line
367+
};

src/elements/element.point.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,7 @@ class Point extends Element {
9696
Point.prototype._type = 'point';
9797

9898
export default Point;
99+
100+
export {
101+
Point
102+
};

src/helpers/helpers.canvas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import {isArray} from './helpers.core';
44

55
/**
6-
* @typedef { import("../core/core.controller") } Chart
6+
* @typedef { import("../core/core.controller").Chart } Chart
77
*/
88

99
const PI = Math.PI;

0 commit comments

Comments
 (0)