Skip to content

Commit

Permalink
TypeScript doesn't handle default exports :-p
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Feb 3, 2020
1 parent df2344b commit 974425d
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/core/core.animation.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import helpers from '../helpers';
import helpers from '../helpers/index';

const transparent = 'transparent';
const interpolators = {
Expand Down
4 changes: 2 additions & 2 deletions src/core/core.animator.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

import helpers from '../helpers';
import helpers from '../helpers/index';

/**
* @typedef { import("./core.controller") } Chart
* @typedef { import("./core.controller").Chart } Chart
*/

function drawFPS(chart, count, date, lastDate) {
Expand Down
4 changes: 4 additions & 0 deletions src/core/core.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,3 +1040,7 @@ class Chart {
Chart.instances = {};

export default Chart;

export {
Chart
};
4 changes: 2 additions & 2 deletions src/core/core.datasetController.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ helpers.extend(DatasetController.prototype, {

/**
* Element type used to generate a meta dataset (e.g. Chart.element.Line).
* @type {Chart.core.element}
* @type {Element}
*/
datasetElementType: null,

/**
* Element type used to generate a meta data (e.g. Chart.element.Point).
* @type {Chart.core.element}
* @type {Element}
*/
dataElementType: null,

Expand Down
6 changes: 3 additions & 3 deletions src/core/core.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {_isPointInArea} from '../helpers/helpers.canvas';
import {_lookup, _rlookup} from '../helpers/helpers.collection';

/**
* @typedef { import("./core.controller") } Chart
* @typedef { import("./core.controller").Chart } Chart
*/

/**
Expand Down Expand Up @@ -121,7 +121,7 @@ function getDistanceMetricForAxis(axis) {
* @param {Chart} chart - the chart
* @param {object} position - the point to be nearest to
* @param {string} axis - the axis mode. x|y|xy
* @return {ChartElement[]} the nearest items
* @return {object[]} the nearest items
*/
function getIntersectItems(chart, position, axis) {
const items = [];
Expand All @@ -146,7 +146,7 @@ function getIntersectItems(chart, position, axis) {
* @param {object} position - the point to be nearest to
* @param {string} axis - the axes along which to measure distance
* @param {boolean} [intersect] - if true, only consider items that intersect the position
* @return {ChartElement[]} the nearest items
* @return {object[]} the nearest items
*/
function getNearestItems(chart, position, axis, intersect) {
const distanceMetric = getDistanceMetricForAxis(axis);
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.layouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import defaults from './core.defaults';
import helpers from '../helpers';

/**
* @typedef { import("./core.controller") } Chart
* @typedef { import("./core.controller").Chart } Chart
*/

const extend = helpers.extend;
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import defaults from './core.defaults';
import {clone} from '../helpers/helpers.core';

/**
* @typedef { import("./core.controller") } Chart
* @typedef { import("./core.controller").Chart } Chart
*/

defaults._set('plugins', {});
Expand Down
6 changes: 5 additions & 1 deletion src/elements/element.line.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas';
import {_updateBezierControlPoints} from '../helpers/helpers.curve';

/**
* @typedef { import("./element.point") } Point
* @typedef { import("./element.point").Point } Point
*/

const defaultColor = defaults.color;
Expand Down Expand Up @@ -361,3 +361,7 @@ class Line extends Element {
Line.prototype._type = 'line';

export default Line;

export {
Line
};
4 changes: 4 additions & 0 deletions src/elements/element.point.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ class Point extends Element {
Point.prototype._type = 'point';

export default Point;

export {
Point
};
2 changes: 1 addition & 1 deletion src/helpers/helpers.canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {isArray} from './helpers.core';

/**
* @typedef { import("../core/core.controller") } Chart
* @typedef { import("../core/core.controller").Chart } Chart
*/

const PI = Math.PI;
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/helpers.segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import {_angleBetween, _angleDiff, _normalizeAngle} from './helpers.math';

/**
* @typedef { import("../elements/element.line") } Line
* @typedef { import("../elements/element.line").Line } Line
*/

/**
* @typedef { import("../elements/element.point") } Point
* @typedef { import("../elements/element.point").Point } Point
*/

function propertyFn(property) {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/platform.base.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* @typedef { import("../core/core.controller") } Chart
* @typedef { import("../core/core.controller").Chart } Chart
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/platform/platform.dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

'use strict';

import helpers from '../helpers';
import helpers from '../helpers/index';
import stylesheet from './platform.dom.css';
import BasePlatform from './platform.base';
import platform from './platform';
Expand Down

0 comments on commit 974425d

Please sign in to comment.