mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Declare enum values where applicable (#29722)
This commit is contained in:
parent
f1827c5eff
commit
f89eb54b58
@ -36,6 +36,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), {
|
||||
tooltips: {
|
||||
filter: data => Number(data.yLabel) > 0,
|
||||
intersect: true,
|
||||
mode: 'index',
|
||||
itemSort: (a, b) => Math.random() - 0.5,
|
||||
position: "average",
|
||||
caretPadding: 2,
|
||||
@ -125,6 +126,7 @@ const chartConfig: Chart.ChartConfiguration = {
|
||||
backgroundColor: '#37738353',
|
||||
borderColor: '#37738353',
|
||||
borderWidth: 3,
|
||||
borderCapStyle: 'round',
|
||||
fill: true
|
||||
}]
|
||||
},
|
||||
|
||||
16
types/chart.js/index.d.ts
vendored
16
types/chart.js/index.d.ts
vendored
@ -174,6 +174,8 @@ declare namespace Chart {
|
||||
|
||||
type PositionType = 'left' | 'right' | 'top' | 'bottom';
|
||||
|
||||
type InteractionMode = 'point' | 'nearest' | 'single' | 'label' | 'index' | 'x-axis' | 'dataset' | 'x' | 'y';
|
||||
|
||||
interface ChartArea {
|
||||
top: number;
|
||||
right: number;
|
||||
@ -185,10 +187,10 @@ declare namespace Chart {
|
||||
text?: string;
|
||||
fillStyle?: string;
|
||||
hidden?: boolean;
|
||||
lineCap?: string;
|
||||
lineCap?: 'butt' | 'round' | 'square';
|
||||
lineDash?: number[];
|
||||
lineDashOffset?: number;
|
||||
lineJoin?: string;
|
||||
lineJoin?: 'bevel' | 'round' | 'miter';
|
||||
lineWidth?: number;
|
||||
strokeStyle?: string;
|
||||
pointStyle?: PointStyle;
|
||||
@ -331,7 +333,7 @@ declare namespace Chart {
|
||||
interface ChartTooltipOptions {
|
||||
enabled?: boolean;
|
||||
custom?(a: any): void;
|
||||
mode?: string;
|
||||
mode?: InteractionMode;
|
||||
intersect?: boolean;
|
||||
backgroundColor?: ChartColor;
|
||||
titleFontFamily?: string;
|
||||
@ -373,7 +375,7 @@ declare namespace Chart {
|
||||
type ChartTooltipPositioner = (elements: any[], eventPosition: Point) => Point;
|
||||
|
||||
interface ChartHoverOptions {
|
||||
mode?: string;
|
||||
mode?: InteractionMode;
|
||||
animationDuration?: number;
|
||||
intersect?: boolean;
|
||||
onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any;
|
||||
@ -541,10 +543,10 @@ declare namespace Chart {
|
||||
backgroundColor?: ChartColor | ChartColor[];
|
||||
borderWidth?: number | number[];
|
||||
borderColor?: ChartColor | ChartColor[];
|
||||
borderCapStyle?: string;
|
||||
borderCapStyle?: 'butt' | 'round' | 'square';
|
||||
borderDash?: number[];
|
||||
borderDashOffset?: number;
|
||||
borderJoinStyle?: string;
|
||||
borderJoinStyle?: 'bevel' | 'round' | 'miter';
|
||||
borderSkipped?: PositionType;
|
||||
data?: number[] | ChartPoint[];
|
||||
fill?: boolean | number | string;
|
||||
@ -566,7 +568,7 @@ declare namespace Chart {
|
||||
pointStyle?: PointStyle | HTMLImageElement | HTMLCanvasElement | Array<PointStyle | HTMLImageElement | HTMLCanvasElement>;
|
||||
xAxisID?: string;
|
||||
yAxisID?: string;
|
||||
type?: string;
|
||||
type?: ChartType | string;
|
||||
hidden?: boolean;
|
||||
hideInLegendAndTooltip?: boolean;
|
||||
showLine?: boolean;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user