Commit 370f6c3
authored
Fix helpers
helpers.dom.ts functions referenced the internal `Chart` JavaScript class rather than the published `Chart<TType, TData, TLabel>` TypeScript definition. This causes errors when outside code tries to call helper functions.
The two `Chart` interfaces are incompatible - the `width`, `height`, and `currentDevicePixelRatio` properties are declared as readonly in the TS declaration but are manipulated by helpers.dom.ts functions, and helpers.dom.ts functions need to be invoked both by internal Chart.js code (which uses the JS class) and by outside code (which uses the TS types). To address this, I'm importing the JS version as `PrivateChart`. There may be a better solution.
It's my understanding that the comment about "typedefs are auto-exported" is obsolete now that helpers.dom is a native TS file.
Fixes #11153Chart type (#12012)1 parent f744621 commit 370f6c3
2 files changed
+18
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 6 | | |
15 | 7 | | |
16 | 8 | | |
| |||
112 | 104 | | |
113 | 105 | | |
114 | 106 | | |
115 | | - | |
| 107 | + | |
116 | 108 | | |
117 | 109 | | |
118 | 110 | | |
| |||
214 | 206 | | |
215 | 207 | | |
216 | 208 | | |
217 | | - | |
| 209 | + | |
218 | 210 | | |
219 | 211 | | |
220 | 212 | | |
221 | 213 | | |
222 | 214 | | |
223 | 215 | | |
224 | 216 | | |
225 | | - | |
226 | | - | |
| 217 | + | |
| 218 | + | |
227 | 219 | | |
228 | 220 | | |
229 | 221 | | |
| |||
238 | 230 | | |
239 | 231 | | |
240 | 232 | | |
241 | | - | |
| 233 | + | |
242 | 234 | | |
243 | 235 | | |
244 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments