From ea616540b5f71125178160225cd2d5df1d175c55 Mon Sep 17 00:00:00 2001 From: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Date: Sun, 21 Feb 2021 02:00:26 +0100 Subject: [PATCH 1/2] Update index.esm.d.ts tickValue is to my knowledge always a number or a string so this will make it so people wont have to parse it themselfs --- types/index.esm.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index 46c14653415..250b0a56056 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -2589,7 +2589,7 @@ export interface TickOptions { /** * Returns the string representation of the tick value as it should be displayed on the chart. See callback. */ - callback: (tickValue: unknown, index: number, ticks: Tick[]) => string; + callback: (tickValue: number | string, index: number, ticks: Tick[]) => string; /** * If true, show tick labels. * @default true From daa0f57330b90b49e89acec0636569b2c2c64b1c Mon Sep 17 00:00:00 2001 From: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Date: Sun, 21 Feb 2021 02:47:47 +0100 Subject: [PATCH 2/2] Update core.scale.js Update typedef according to types update --- src/core/core.scale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index fe468b9adb4..10b41402167 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -8,7 +8,7 @@ import Ticks from './core.ticks'; /** * @typedef { import("./core.controller").default } Chart - * @typedef {{value:any, label?:string, major?:boolean, $context?:any}} Tick + * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick */ defaults.set('scale', {