Skip to content

Commit 677497e

Browse files
committed
fix(dashboard): [ERROR] TS2307: Cannot find module 'chart.js/dist/types/utils' or its corresponding type declarations. [plugin angular-compiler] - tempfix
1 parent c3dcb55 commit 677497e

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/app/views/charts/charts.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<c-row>
22
<c-col xs="12">
33
<app-docs-callout href="charts">
4-
CoreUI Angular wrapper component for Chart.js 4.4, the most popular charting library.
4+
CoreUI Angular wrapper component for Chart.js 4.5, the most popular charting library.
55
<br>
66
</app-docs-callout>
77
</c-col>

src/app/views/dashboard/dashboard-charts-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { ChartData, ChartDataset, ChartOptions, ChartType, PluginOptionsByType, ScaleOptions, TooltipLabelStyle } from 'chart.js';
3-
import { DeepPartial } from 'chart.js/dist/types/utils';
3+
import { DeepPartial } from './utils';
44
import { getStyle } from '@coreui/utils';
55

66
export interface IChartProps {

src/app/views/dashboard/utils.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// DeepPartial implementation taken from the utility-types NPM package, which is
2+
// Copyright (c) 2016 Piotr Witek <[email protected]> (http://piotrwitek.github.io)
3+
// and used under the terms of the MIT license
4+
export type DeepPartial<T> = { [P in keyof T]?: _DeepPartial<T[P]> };
5+
6+
/** @private */
7+
export type _DeepPartial<T> = T extends Function
8+
? T
9+
: T extends Array<infer U>
10+
? _DeepPartialArray<U>
11+
: T extends object
12+
? DeepPartial<T>
13+
: T | undefined;
14+
/** @private */
15+
export interface _DeepPartialArray<T> extends Array<_DeepPartial<T>> {}

0 commit comments

Comments
 (0)