Comparing version 4.4.7 to 4.4.8
@@ -19,3 +19,3 @@ /** | ||
*/ | ||
formats(this: DateAdapter<T>): Record<string, string>; | ||
formats(this: DateAdapter<T>): Record<TimeUnit | 'datetime', string>; | ||
/** | ||
@@ -26,3 +26,3 @@ * Parses the given `value` and return the associated timestamp. | ||
*/ | ||
parse(this: DateAdapter<T>, value: unknown, format?: TimeUnit): number | null; | ||
parse(this: DateAdapter<T>, value: unknown, format?: string): number | null; | ||
/** | ||
@@ -33,3 +33,3 @@ * Returns the formatted date in the specified `format` for a given `timestamp`. | ||
*/ | ||
format(this: DateAdapter<T>, timestamp: number, format: TimeUnit): string; | ||
format(this: DateAdapter<T>, timestamp: number, format: string): string; | ||
/** | ||
@@ -56,3 +56,3 @@ * Adds the specified `amount` of `unit` to the given `timestamp`. | ||
*/ | ||
startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number; | ||
startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number | boolean): number; | ||
/** | ||
@@ -63,36 +63,10 @@ * Returns end of `unit` for the given `timestamp`. | ||
*/ | ||
endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek'): number; | ||
endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit): number; | ||
} | ||
/** | ||
* Date adapter (current used by the time scale) | ||
* @namespace Chart._adapters._date | ||
* @memberof Chart._adapters | ||
* @private | ||
*/ | ||
declare class DateAdapterBase implements DateAdapter { | ||
/** | ||
* Override default date adapter methods. | ||
* Accepts type parameter to define options type. | ||
* @example | ||
* Chart._adapters._date.override<{myAdapterOption: string}>({ | ||
* init() { | ||
* console.log(this.options.myAdapterOption); | ||
* } | ||
* }) | ||
*/ | ||
static override<T extends AnyObject = AnyObject>(members: Partial<Omit<DateAdapter<T>, 'options'>>): void; | ||
readonly options: AnyObject; | ||
constructor(options: AnyObject); | ||
init(): void; | ||
formats(): Record<string, string>; | ||
parse(): number | null; | ||
format(): string; | ||
add(): number; | ||
diff(): number; | ||
startOf(): number; | ||
endOf(): number; | ||
} | ||
declare const _default: { | ||
_date: typeof DateAdapterBase; | ||
_date: { | ||
new (options?: AnyObject): DateAdapter; | ||
override<T extends AnyObject = AnyObject>(members: Partial<Omit<DateAdapter<T>, "options">>): void; | ||
}; | ||
}; | ||
export default _default; |
/*! | ||
* Chart.js v4.4.7 | ||
* Chart.js v4.4.8 | ||
* https://www.chartjs.org | ||
* (c) 2024 Chart.js Contributors | ||
* (c) 2025 Chart.js Contributors | ||
* Released under the MIT License | ||
@@ -6,0 +6,0 @@ */ |
@@ -1,11 +0,4 @@ | ||
import type Chart from '../core/core.controller.js'; | ||
import type { ChartEvent } from '../types.js'; | ||
import type PrivateChart from '../core/core.controller.js'; | ||
import type { Chart, ChartEvent } from '../types.js'; | ||
/** | ||
* Note: typedefs are auto-exported, so use a made-up `dom` namespace where | ||
* necessary to avoid duplicates with `export * from './helpers`; see | ||
* https://github.com/microsoft/TypeScript/issues/46011 | ||
* @typedef { import('../core/core.controller.js').default } dom.Chart | ||
* @typedef { import('../../types').ChartEvent } ChartEvent | ||
*/ | ||
/** | ||
* @private | ||
@@ -25,3 +18,3 @@ */ | ||
*/ | ||
export declare function getRelativePosition(event: Event | ChartEvent | TouchEvent | MouseEvent, chart: Chart): { | ||
export declare function getRelativePosition(event: Event | ChartEvent | TouchEvent | MouseEvent, chart: Chart | PrivateChart): { | ||
x: number; | ||
@@ -40,3 +33,3 @@ y: number; | ||
*/ | ||
export declare function retinaScale(chart: Chart, forceRatio: number, forceStyle?: boolean): boolean | void; | ||
export declare function retinaScale(chart: Chart | PrivateChart, forceRatio: number, forceStyle?: boolean): boolean | void; | ||
/** | ||
@@ -43,0 +36,0 @@ * Detects support for options object argument in addEventListener. |
@@ -5,3 +5,3 @@ { | ||
"description": "Simple HTML5 charts using the canvas element.", | ||
"version": "4.4.7", | ||
"version": "4.4.8", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
4951561
37115
0