]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
fix: move types to src dir to escape src / dist dirs in paths (#10993)
authorDan Onoshko <danon0404@gmail.com>
Fri, 16 Dec 2022 12:56:06 +0000 (16:56 +0400)
committerGitHub <noreply@github.com>
Fri, 16 Dec 2022 12:56:06 +0000 (07:56 -0500)
80 files changed:
.github/workflows/ci.yml
.gitignore
docs/.vuepress/config.ts
package.json
src/core/core.adapters.ts
src/core/core.controller.js
src/core/core.element.ts
src/core/core.interaction.js
src/core/core.plugins.js
src/elements/element.arc.ts
src/elements/element.point.ts
src/helpers/helpers.canvas.js
src/helpers/helpers.core.ts
src/helpers/helpers.curve.ts
src/helpers/helpers.dom.ts
src/helpers/helpers.extras.ts
src/helpers/helpers.interpolation.ts
src/helpers/helpers.math.ts
src/helpers/helpers.options.ts
src/helpers/types.ts
src/plugins/plugin.filler/filler.options.js
src/plugins/plugin.legend.js
src/plugins/plugin.tooltip.js
src/types.ts
src/types/animation.d.ts [moved from types/animation.d.ts with 92% similarity]
src/types/basic.d.ts [moved from types/basic.d.ts with 100% similarity]
src/types/color.d.ts [moved from types/color.d.ts with 100% similarity]
src/types/geometric.d.ts [moved from types/geometric.d.ts with 100% similarity]
src/types/helpers/helpers.canvas.d.ts [moved from types/helpers/helpers.canvas.d.ts with 92% similarity]
src/types/helpers/helpers.segment.d.ts [moved from types/helpers/helpers.segment.d.ts with 100% similarity]
src/types/helpers/index.d.ts [moved from types/helpers/index.d.ts with 100% similarity]
src/types/index.d.ts [moved from types/index.d.ts with 98% similarity]
src/types/layout.d.ts [moved from types/layout.d.ts with 97% similarity]
src/types/utils.d.ts [moved from types/utils.d.ts with 100% similarity]
test/types/.eslintrc.yml [moved from types/.eslintrc.yml with 62% similarity]
test/types/animation.ts [moved from types/tests/animation.ts with 100% similarity]
test/types/autogen.js [moved from types/tests/autogen.js with 100% similarity]
test/types/chart_types.ts [moved from types/tests/chart_types.ts with 100% similarity]
test/types/config_types.ts [moved from types/tests/config_types.ts with 100% similarity]
test/types/controllers/bar_floating_data.ts [moved from types/tests/controllers/bar_floating_data.ts with 100% similarity]
test/types/controllers/bubble_chart_options.ts [moved from types/tests/controllers/bubble_chart_options.ts with 100% similarity]
test/types/controllers/doughnut_meta_total.ts [moved from types/tests/controllers/doughnut_meta_total.ts with 100% similarity]
test/types/controllers/doughnut_offset.ts [moved from types/tests/controllers/doughnut_offset.ts with 100% similarity]
test/types/controllers/doughnut_outer_radius.ts [moved from types/tests/controllers/doughnut_outer_radius.ts with 100% similarity]
test/types/controllers/line_scriptable_parsed_data.ts [moved from types/tests/controllers/line_scriptable_parsed_data.ts with 100% similarity]
test/types/controllers/line_segments.ts [moved from types/tests/controllers/line_segments.ts with 100% similarity]
test/types/controllers/line_span_gaps.ts [moved from types/tests/controllers/line_span_gaps.ts with 100% similarity]
test/types/controllers/line_styling_array.ts [moved from types/tests/controllers/line_styling_array.ts with 100% similarity]
test/types/controllers/radar_dataset_indexable_options.ts [moved from types/tests/controllers/radar_dataset_indexable_options.ts with 100% similarity]
test/types/data_types.ts [moved from types/tests/data_types.ts with 100% similarity]
test/types/dataset_null_data.ts [moved from types/tests/dataset_null_data.ts with 100% similarity]
test/types/date_adapter.ts [moved from types/tests/date_adapter.ts with 100% similarity]
test/types/defaults.ts [moved from types/tests/defaults.ts with 100% similarity]
test/types/elements/scriptable_element_options.ts [moved from types/tests/elements/scriptable_element_options.ts with 100% similarity]
test/types/extensions/plugin.ts [moved from types/tests/extensions/plugin.ts with 100% similarity]
test/types/extensions/scale.ts [moved from types/tests/extensions/scale.ts with 87% similarity]
test/types/helpers/options.ts [moved from types/tests/helpers/options.ts with 100% similarity]
test/types/interaction.ts [moved from types/tests/interaction.ts with 100% similarity]
test/types/layout/position.ts [moved from types/tests/layout/position.ts with 100% similarity]
test/types/options.ts [moved from types/tests/options.ts with 100% similarity]
test/types/overrides.ts [moved from types/tests/overrides.ts with 100% similarity]
test/types/parsed.data.type.ts [moved from types/tests/parsed.data.type.ts with 100% similarity]
test/types/plugins/defaults.ts [moved from types/tests/plugins/defaults.ts with 100% similarity]
test/types/plugins/plugin.decimation/decimation_algorithm.ts [moved from types/tests/plugins/plugin.decimation/decimation_algorithm.ts with 100% similarity]
test/types/plugins/plugin.filler/fill_target_true.ts [moved from types/tests/plugins/plugin.filler/fill_target_true.ts with 100% similarity]
test/types/plugins/plugin.tooltip/chart.tooltip.ts [moved from types/tests/plugins/plugin.tooltip/chart.tooltip.ts with 100% similarity]
test/types/plugins/plugin.tooltip/tooltip_dataset_type.ts [moved from types/tests/plugins/plugin.tooltip/tooltip_dataset_type.ts with 100% similarity]
test/types/plugins/plugin.tooltip/tooltip_parsed_data.ts [moved from types/tests/plugins/plugin.tooltip/tooltip_parsed_data.ts with 100% similarity]
test/types/plugins/plugin.tooltip/tooltip_parsed_data_chart_defaults.ts [moved from types/tests/plugins/plugin.tooltip/tooltip_parsed_data_chart_defaults.ts with 100% similarity]
test/types/plugins/plugin.tooltip/tooltip_scriptable_background_color.ts [moved from types/tests/plugins/plugin.tooltip/tooltip_scriptable_background_color.ts with 100% similarity]
test/types/register.ts [moved from types/tests/register.ts with 100% similarity]
test/types/scales/chart_options.ts [moved from types/tests/scales/chart_options.ts with 100% similarity]
test/types/scales/options.ts [moved from types/tests/scales/options.ts with 100% similarity]
test/types/scales/time_string_max.ts [moved from types/tests/scales/time_string_max.ts with 100% similarity]
test/types/scriptable.ts [moved from types/tests/scriptable.ts with 100% similarity]
test/types/scriptable_core_chart_options.ts [moved from types/tests/scriptable_core_chart_options.ts with 100% similarity]
test/types/test_instance_assignment.ts [moved from types/tests/test_instance_assignment.ts with 100% similarity]
test/types/tsconfig.json [moved from types/tests/tsconfig.json with 95% similarity]
tsconfig.json
types/tests/.eslintrc.yml [deleted file]

index bbaac56b333fbd8ec014930a73fe1799c868f0db..075c93c8db23e303e90ce180bc5c2158753ffac4 100644 (file)
@@ -52,7 +52,6 @@ jobs:
               - 'karma.conf.js'
               - 'package.json'
             types:
-              - 'types/**'
               - 'package.json'
               - 'tsconfig.json'
       - name: Install
@@ -64,7 +63,7 @@ jobs:
       - name: Test
         if: |
           (steps.changes.outputs.src == 'true' ||
-          steps.changes.outputs.test == 'true') && 
+          steps.changes.outputs.test == 'true') &&
           runner.os != 'Windows'
         run: |
           pnpm run build
index bf69bd2c6b4dce6235b15efa4e4830130f451465..c731872efa5dbbe9bca02f130e209f8aeadea521 100644 (file)
@@ -31,7 +31,7 @@ docs/.vuepress/dist
 *.stackdump
 
 # Generated
-/types/tests/autogen*.ts
+/test/types/autogen*.ts
 
 # Eslint
 .eslintcache
index cb8577c95e9028f4e33581ec8fb0e82b70a7458c..d1f7591fbfca32d289eb40333105e31e8b7019b5 100644 (file)
@@ -34,7 +34,7 @@ export default defineConfig({
     }],
     ['vuepress-plugin-code-copy', true],
     ['vuepress-plugin-typedoc', {
-        entryPoints: ['../../types/index.d.ts'],
+        entryPoints: ['../../src/types/index.d.ts'],
         hideInPageTOC: true,
         tsconfig: path.resolve(__dirname, '../../tsconfig.json'),
       },
index 3b990e8f8083020bcfadd8cdf63d491054028f8f..717d1d488c72a7c2acca3fa2eb1ecf71fad850d9 100644 (file)
         "auto/**",
         "dist/**",
         "!dist/docs/**",
-        "helpers/**",
-        "types/**/*.ts",
-        "!types/tests/**"
+        "helpers/**"
     ],
     "scripts": {
         "autobuild": "rollup -c -w",
-        "emitDeclarations": "tsc --emitDeclarationOnly",
+        "emitDeclarations": "tsc --emitDeclarationOnly && cp -R ./src/types/ ./dist/types/",
         "build": "rollup -c && pnpm emitDeclarations",
         "dev": "karma start ./karma.conf.cjs --auto-watch --no-single-run --browsers chrome --grep",
         "dev:ff": "karma start ./karma.conf.cjs --auto-watch --no-single-run --browsers firefox --grep",
@@ -64,7 +62,7 @@
         "docs:dev": "pnpm run build && pnpm --filter \"./docs/**\" dev",
         "lint-js": "eslint \"src/**/*.{js,ts}\" \"test/**/*.js\" \"docs/**/*.js\" --cache",
         "lint-md": "eslint \"**/*.md\" --cache",
-        "lint-types": "eslint \"types/**/*.ts\" --cache && pnpm build && node types/tests/autogen.js && tsc -p types/tests/",
+        "lint-types": "pnpm build && node test/types/autogen.js && tsc -p test/types",
         "lint": "concurrently \"pnpm:lint-*\"",
         "test-size": "size-limit",
         "test": "pnpm lint && pnpm test-ci",
index 56899ae1322e3380d9ce2e395279f894164be7a0..6c9b2b03248b59b81137086e5b2277283c68d532 100644 (file)
@@ -4,8 +4,8 @@
  * @private
  */
 
-import type {AnyObject} from '../../types/basic.js';
-import type {ChartOptions} from '../../types/index.js';
+import type {AnyObject} from '../types/basic.js';
+import type {ChartOptions} from '../types/index.js';
 
 export type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
 
index 007ea6f65d8e8492d1466846a0dc6c47baec2796..2ba26c9f3eeea8b71c3a592301e79c444e199f1a 100644 (file)
@@ -14,8 +14,8 @@ import {version} from '../../package.json';
 import {debounce} from '../helpers/helpers.extras.js';
 
 /**
- * @typedef { import('../../types/index.js').ChartEvent } ChartEvent
- * @typedef { import('../../types/index.js').Point } Point
+ * @typedef { import('../types/index.js').ChartEvent } ChartEvent
+ * @typedef { import('../types/index.js').Point } Point
  */
 
 const KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];
@@ -1258,10 +1258,10 @@ class Chart {
 
   /**
    * @param {ChartEvent} e - The event
-   * @param {import('../../types/index.js').ActiveElement[]} lastActive - Previously active elements
+   * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements
    * @param {boolean} inChartArea - Is the envent inside chartArea
    * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions
-   * @returns {import('../../types/index.js').ActiveElement[]} - The active elements
+   * @returns {import('../types/index.js').ActiveElement[]} - The active elements
    * @pravate
    */
   _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {
index 20f72e95a765ce28657b3a7ed91cd843a39cbc5e..9c1e76172c9d4b68fb1382baf28a05ada7b229e8 100644 (file)
@@ -1,6 +1,6 @@
-import type {AnyObject} from '../../types/basic.js';
-import type {Point} from '../../types/geometric.js';
-import type {Animation} from '../../types/animation.js';
+import type {AnyObject} from '../types/basic.js';
+import type {Point} from '../types/geometric.js';
+import type {Animation} from '../types/animation.js';
 import {isNumber} from '../helpers/helpers.math.js';
 
 export default class Element<T = AnyObject, O = AnyObject> {
index 9f9046b4920df3f01d3c6c66f3f51b5d2076b545..fc5aac83d3870ddf1c88a413ce81a43e3cfecdc1 100644 (file)
@@ -5,10 +5,10 @@ import {_isPointInArea} from '../helpers/index.js';
 
 /**
  * @typedef { import('./core.controller.js').default } Chart
- * @typedef { import('../../types/index.js').ChartEvent } ChartEvent
+ * @typedef { import('../types/index.js').ChartEvent } ChartEvent
  * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions
  * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem
- * @typedef { import('../../types/index.js').Point } Point
+ * @typedef { import('../types/index.js').Point } Point
  */
 
 /**
index b2584955a0fc7022f2ddf5f16f4095e27ccbf997..6de82758944517112d4db2c51a8e85c758810681 100644 (file)
@@ -3,7 +3,7 @@ import {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helper
 
 /**
  * @typedef { import('./core.controller.js').default } Chart
- * @typedef { import('../../types/index.js').ChartEvent } ChartEvent
+ * @typedef { import('../types/index.js').ChartEvent } ChartEvent
  * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip
  */
 
index 5a1dc18451ffba3555c6cc452a0682e87ee6b8aa..f99e2dbc05a1fb708cd3a4613c48e029b68712c4 100644 (file)
@@ -2,7 +2,7 @@ import Element from '../core/core.element.js';
 import {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';
 import {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';
 import {_readValueToProps} from '../helpers/helpers.options.js';
-import type {ArcOptions, Point} from '../../types/index.js';
+import type {ArcOptions, Point} from '../types/index.js';
 
 
 function clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {
index 4b7b26d8a2b415f2fd0ff374d72b90ce98d1ddd9..dbe6b131ef46246d7606b2879273a1d165299e0b 100644 (file)
@@ -6,7 +6,7 @@ import type {
   Point,
   PointHoverOptions,
   PointOptions,
-} from '../../types/index.js';
+} from '../types/index.js';
 
 function inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {
   const options = el.options;
index ce3bf2c1f0632fa3997ea85be3df55b32173887b..217c3f1edce14772d8f19a7de0ad0416a2185241 100644 (file)
@@ -6,7 +6,7 @@ import {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helper
  * necessary to avoid duplicates with `export * from './helpers`; see
  * https://github.com/microsoft/TypeScript/issues/46011
  * @typedef { import('../core/core.controller.js').default } canvas.Chart
- * @typedef { import('../../types/index.js').Point } Point
+ * @typedef { import('../types/index.js').Point } Point
  */
 
 /**
index f6f6f5ce5aa14d4d4d550940b2e14f431b3ab147..74cd7ab17047058a2bd4462b8294265dc45eaa1c 100644 (file)
@@ -2,8 +2,8 @@
  * @namespace Chart.helpers
  */
 
-import type {AnyObject} from '../../types/basic.js';
-import type {ActiveDataPoint, ChartEvent} from '../../types/index.js';
+import type {AnyObject} from '../types/basic.js';
+import type {ActiveDataPoint, ChartEvent} from '../types/index.js';
 
 /**
  * An empty function that can be used, for example, for optional callback.
index e9dab22e838122cc59139f145436b2703e8a8bf5..97b76993e645b7c442ebdd7e273b838c2cbcf022 100644 (file)
@@ -1,6 +1,6 @@
 import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';
 import {_isPointInArea} from './helpers.canvas.js';
-import type {ChartArea} from '../../types/index.js';
+import type {ChartArea} from '../types/index.js';
 
 export interface SplinePoint {
   x: number;
index 60b0aefb0e197ac273aff7391122b7d7ae3a7d02..ce1d1a0459df5ad6850971620531bd517a10dfa8 100644 (file)
@@ -1,4 +1,4 @@
-import type {ChartArea, Scale} from '../../types/index.js';
+import type {ChartArea, Scale} from '../types/index.js';
 import type Chart from '../core/core.controller.js';
 import type {ChartEvent} from '../types.js';
 import {INFINITY} from './helpers.math.js';
index 754f6050483ed0724a3831567f421b62dfa8f246..1428419119ebfddef9d0d4c81125240394c246c3 100644 (file)
@@ -1,4 +1,4 @@
-import type {ChartMeta, PointElement} from '../../types/index.js';
+import type {ChartMeta, PointElement} from '../types/index.js';
 
 import {_limitValue} from './helpers.math.js';
 import {_lookupByKey} from './helpers.collection.js';
index 222654e530c4fc256e412f19afa1f2f16881a05d..202575629d1e4c6ad1f48d98da4fa46678dbc6c9 100644 (file)
@@ -1,4 +1,4 @@
-import type {Point} from '../../types/geometric.js';
+import type {Point} from '../types/geometric.js';
 import type {SplinePoint} from './helpers.curve.js';
 
 /**
index f71786945625b1be8bd404d0ac5626bec038a333..da463aeb04ea0dd55a516d8c5bdf55e11f5ca49d 100644 (file)
@@ -1,4 +1,4 @@
-import type {Point} from '../../types/geometric.js';
+import type {Point} from '../types/geometric.js';
 import {isFinite as isFiniteNumber} from './helpers.core.js';
 
 /**
index 0cd38e4d7d6d8f418e4563e850744a24a8bf6bc4..c476ccb5e1ab2d6b5c418ecc8d315f473cf372b1 100644 (file)
@@ -1,8 +1,8 @@
 import defaults from '../core/core.defaults.js';
 import {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';
 import {Point, toFontString} from './helpers.canvas.js';
-import type {ChartArea, FontSpec} from '../../types/index.js';
-import type {TRBL, TRBLCorners} from '../../types/geometric.js';
+import type {ChartArea, FontSpec} from '../types/index.js';
+import type {TRBL, TRBLCorners} from '../types/geometric.js';
 
 const LINE_HEIGHT = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/;
 const FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;
index 7eff7d57c9791de447b07faab67432d02759e12a..3c3badbc892300fb86aced8981fd66d6f7a9a397 100644 (file)
@@ -16,4 +16,4 @@ export * from './helpers.intl.js';
 export * from './helpers.math.js';
 export * from './helpers.options.js';
 export * from './helpers.rtl.js';
-export * from '../../types/helpers/index.js';
+export * from '../types/helpers/index.js';
index 3185760a2c3e71a4c7246a1757e2c39bcb99bbdb..33b965bc798b0a0dd82b3ef4d1323ba4a84c8386 100644 (file)
@@ -3,8 +3,8 @@ import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js'
 /**
  * @typedef { import('../../core/core.scale.js').default } Scale
  * @typedef { import('../../elements/element.line.js').default } LineElement
- * @typedef { import('../../../types/index.js').FillTarget } FillTarget
- * @typedef { import('../../../types/index.js').ComplexFillTarget } ComplexFillTarget
+ * @typedef { import('../../types/index.js').FillTarget } FillTarget
+ * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget
  */
 
 export function _resolveTarget(sources, index, propagate) {
index e3cee4f2c8e7c55ea0872004b1d4cb54c113ecbe..8d8264d637ff006669b1e7736b478ef16339121f 100644 (file)
@@ -18,7 +18,7 @@ import {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.ext
 import {toTRBLCorners} from '../helpers/helpers.options.js';
 
 /**
- * @typedef { import('../../types/index.js').ChartEvent } ChartEvent
+ * @typedef { import('../types/index.js').ChartEvent } ChartEvent
  */
 
 const getBoxSize = (labelOpts, fontSize) => {
index 1e59f4329716be91c5ece1f2443fe2c9d707d3e2..6a13c8ff285327ba138b7c311a60cbc65cf9b548 100644 (file)
@@ -9,8 +9,8 @@ import {createContext, drawPoint} from '../helpers/index.js';
 
 /**
  * @typedef { import('../platform/platform.base.js').Chart } Chart
- * @typedef { import('../../types/index.js').ChartEvent } ChartEvent
- * @typedef { import('../../types/index.js').ActiveElement } ActiveElement
+ * @typedef { import('../types/index.js').ChartEvent } ChartEvent
+ * @typedef { import('../types/index.js').ActiveElement } ActiveElement
  * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem
  */
 
index 56689652188b3949767f527802a351bca9324d30..32e83eb9189560990baaf477a4c0756346ebdc81 100644 (file)
@@ -46,5 +46,5 @@ export {
   TimeScale,
   TimeSeriesScale,
   registerables
-} from '../types/index.js';
-export * from '../types/index.js';
+} from './types/index.js';
+export * from './types/index.js';
similarity index 92%
rename from types/animation.d.ts
rename to src/types/animation.d.ts
index 9c6aaa34060f583b62db5f6ba0f62bb98b6fa71f..41895125e991d0e269961e5b5258de6f46714b00 100644 (file)
@@ -1,5 +1,5 @@
-import { Chart } from './index.js';
-import { AnyObject } from './basic.js';
+import {Chart} from './index.js';
+import {AnyObject} from './basic.js';
 
 export declare class Animation {
   constructor(cfg: AnyObject, target: AnyObject, prop: string, to?: unknown);
similarity index 100%
rename from types/basic.d.ts
rename to src/types/basic.d.ts
similarity index 100%
rename from types/color.d.ts
rename to src/types/color.d.ts
similarity index 92%
rename from types/helpers/helpers.canvas.d.ts
rename to src/types/helpers/helpers.canvas.d.ts
index 6e7895adb54844cf93016e334365714c411d0198..41f99b2ad10bb3b479908136782845237cbe61df 100644 (file)
@@ -1,7 +1,7 @@
-import { PointStyle, Scriptable, ScriptableScaleContext } from '../index.js';
-import { Color } from '../color.js';
-import { ChartArea, RoundedRect } from '../geometric.js';
-import { CanvasFontSpec } from '../../src/helpers/helpers.options.js';
+import {PointStyle, Scriptable, ScriptableScaleContext} from '../index.js';
+import {Color} from '../color.js';
+import {ChartArea, RoundedRect} from '../geometric.js';
+import {CanvasFontSpec} from '../../helpers/helpers.options.js';
 
 export function clearCanvas(canvas: HTMLCanvasElement, ctx?: CanvasRenderingContext2D): void;
 
similarity index 98%
rename from types/index.d.ts
rename to src/types/index.d.ts
index e3b377562b734e8fd4e77aaca8de6b2ea083aea5..67ceab2383b930bbfbbb3c8e7e6c9b38b5833e31 100644 (file)
@@ -1,24 +1,25 @@
-import { DeepPartial, DistributiveArray, UnionToIntersection } from './utils.js';
-
-import { TimeUnit } from '../src/core/core.adapters.js';
-import PointElement from '../src/elements/element.point.js';
-import { EasingFunction } from '../src/helpers/helpers.easing.js';
-import { AnimationEvent } from './animation.js';
-import { AnyObject, EmptyObject } from './basic.js';
-import { Color } from './color.js';
-import Element from '../src/core/core.element.js';
-import { ChartArea, Padding, Point } from './geometric.js';
-import { LayoutItem, LayoutPosition } from './layout.js';
-import { RenderTextOpts } from './helpers/helpers.canvas.js';
-import { CanvasFontSpec } from '../src/helpers/helpers.options.js';
-
-export { EasingFunction } from '../src/helpers/helpers.easing.js';
-export { default as ArcElement, ArcProps } from '../src/elements/element.arc.js';
-export { default as PointElement, PointProps } from '../src/elements/element.point.js';
-export { Animation, Animations, Animator, AnimationEvent } from './animation.js';
-export { Color } from './color.js';
-export { ChartArea, Point } from './geometric.js';
-export { LayoutItem, LayoutPosition } from './layout.js';
+/* eslint-disable @typescript-eslint/ban-types */
+import {DeepPartial, DistributiveArray, UnionToIntersection} from './utils.js';
+
+import {TimeUnit} from '../core/core.adapters.js';
+import PointElement from '../elements/element.point.js';
+import {EasingFunction} from '../helpers/helpers.easing.js';
+import {AnimationEvent} from './animation.js';
+import {AnyObject, EmptyObject} from './basic.js';
+import {Color} from './color.js';
+import Element from '../core/core.element.js';
+import {ChartArea, Padding, Point} from './geometric.js';
+import {LayoutItem, LayoutPosition} from './layout.js';
+import {RenderTextOpts} from './helpers/helpers.canvas.js';
+import {CanvasFontSpec} from '../helpers/helpers.options.js';
+
+export {EasingFunction} from '../helpers/helpers.easing.js';
+export {default as ArcElement, ArcProps} from '../elements/element.arc.js';
+export {default as PointElement, PointProps} from '../elements/element.point.js';
+export {Animation, Animations, Animator, AnimationEvent} from './animation.js';
+export {Color} from './color.js';
+export {ChartArea, Point} from './geometric.js';
+export {LayoutItem, LayoutPosition} from './layout.js';
 
 export interface ScriptableContext<TType extends ChartType> {
   active: boolean;
@@ -234,7 +235,7 @@ export declare const LineController: ChartComponent & {
 
 export type ScatterControllerDatasetOptions = LineControllerDatasetOptions;
 
-export interface ScatterDataPoint extends Point {}
+export type ScatterDataPoint = Point
 
 export type ScatterControllerChartOptions = LineControllerChartOptions;
 
similarity index 97%
rename from types/layout.d.ts
rename to src/types/layout.d.ts
index 32fef7634512c10a7171507359a88df98cddf49b..39ddc1394b7889c137d24305d72cfcc88a7adc30 100644 (file)
@@ -1,4 +1,4 @@
-import { ChartArea } from './geometric.js';
+import {ChartArea} from './geometric.js';
 
 export type LayoutPosition = 'left' | 'top' | 'right' | 'bottom' | 'center' | 'chartArea' | {[scaleId: string]: number};
 
similarity index 100%
rename from types/utils.d.ts
rename to src/types/utils.d.ts
similarity index 62%
rename from types/.eslintrc.yml
rename to test/types/.eslintrc.yml
index ca79ca01047d129f61f70804d5fa0a42e0386742..07b109145d8bd6bef7dce025184f60c286517044 100644 (file)
@@ -1,6 +1,5 @@
 rules:
-  # These rules were set to warning to make the linting pass initially,
-  # without making any major changes to types.
+  '@typescript-eslint/no-unused-vars': 'off'
   object-curly-spacing: ["warn", "always"]
   '@typescript-eslint/no-empty-interface': "warn"
   '@typescript-eslint/ban-types': "warn"
similarity index 100%
rename from types/tests/autogen.js
rename to test/types/autogen.js
similarity index 87%
rename from types/tests/extensions/scale.ts
rename to test/types/extensions/scale.ts
index 712b3f15ca5160052f4fea5b3364656c57fd3cf1..3623eb3e7dca61cccacd24aac81edd0519734eac 100644 (file)
@@ -1,4 +1,4 @@
-import { AnyObject } from '../../basic.js';
+import { AnyObject } from '../../../src/types/basic.js';
 import { CartesianScaleOptions, Chart, Scale } from '../../../src/types.js';
 
 export type TestScaleOptions = CartesianScaleOptions & {
@@ -17,7 +17,7 @@ export class TestScale<O extends TestScaleOptions = TestScaleOptions> extends Sc
   }
 }
 
-declare module '../../index.js' {
+declare module '../../../src/types/index.js' {
   interface CartesianScaleTypeRegistry {
     test: {
       options: TestScaleOptions
similarity index 100%
rename from types/tests/options.ts
rename to test/types/options.ts
similarity index 95%
rename from types/tests/tsconfig.json
rename to test/types/tsconfig.json
index 438b3b48fd06077ad6c88ec4df9e38033f80eea2..091024595a240a5877a07a6d0e9afa15f566f8da 100644 (file)
@@ -5,7 +5,7 @@
     "rootDir": "../../"
   },
   "include": [
-    "../",
+    "./",
     "../../src/",
     "../../dist/**/*.d.ts"
   ],
index 5ccc6334e7679ee403b56e9b727e60cff5a2982b..bbcd0a350da46262e2ccb1270ba766e3016bd451 100644 (file)
   },
   "typedocOptions": {
     "name": "Chart.js",
-    "entryPoints": ["types/index.d.ts"],
+    "entryPoints": ["src/types/index.d.ts"],
     "readme": "none",
     "excludeExternals": true,
     "includeVersion": true,
     "out": "./dist/docs/typedoc"
   },
   "include": [
-    "./src/**/*",
-    "./types"
+    "./src/**/*"
   ],
   "exclude": [
-    "./types/tests",
     "./dist/**"
   ]
 }
diff --git a/types/tests/.eslintrc.yml b/types/tests/.eslintrc.yml
deleted file mode 100644 (file)
index d5b7cf0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-rules:
-  '@typescript-eslint/no-unused-vars': 'off'