Skip to content

Commit 21ef77b

Browse files
committed
fix: api documentation
1 parent 7c95731 commit 21ef77b

File tree

6 files changed

+166
-15
lines changed

6 files changed

+166
-15
lines changed

docs/.vuepress/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export default defineConfig({
2121
{base: '/samples', alternative: ['basic']},
2222
],
2323
}],
24-
/*
2524
[
2625
'vuepress-plugin-typedoc',
2726
{
@@ -34,7 +33,6 @@ export default defineConfig({
3433
},
3534
},
3635
],
37-
*/
3836
['@simonbrunel/vuepress-plugin-versions', {
3937
filters: {
4038
suffix: (tag) => tag ? ` (${tag})` : '',
@@ -113,7 +111,7 @@ export default defineConfig({
113111
nav: [
114112
{text: 'Home', link: '/'},
115113
{text: 'Guide', link: '/guide/'},
116-
// {text: 'API', link: '/api/'},
114+
{text: 'API', link: '/api/'},
117115
{text: 'Samples', link: `/samples/`},
118116
{
119117
text: 'Ecosystem',

package-lock.json

Lines changed: 156 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@
8585
"rollup": "^4.27.4",
8686
"rollup-plugin-cleanup": "^3.2.1",
8787
"rollup-plugin-istanbul": "^5.0.0",
88-
"typescript": "5.6",
88+
"typedoc": "^0.23.28",
89+
"typedoc-plugin-markdown": "3.13",
90+
"typescript": "5.0",
8991
"vuepress": "^1.8.2",
9092
"vuepress-plugin-flexsearch": "^0.3.0",
9193
"vuepress-plugin-redirect": "^1.2.5",
94+
"vuepress-plugin-typedoc": "^0.10.3",
9295
"vuepress-theme-chartjs": "^0.2.0"
9396
},
9497
"peerDependencies": {

src/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ function addHandler<T extends Event>(
3232
return
3333
}
3434
removeHandler(chart, type)
35-
handlers[type] = (event) => handler(chart, event as T, options)
35+
const listener = (handlers[type] = (event) => handler(chart, event as T, options))
3636
targets[type] = target
3737

3838
// `passive: false` for wheel events, to prevent chrome warnings. Use default value for other events.
3939
const passive = type === 'wheel' ? false : undefined
40-
target.addEventListener(type, handlers[type], { passive })
40+
target.addEventListener(type, listener, { passive })
4141
}
4242

4343
export function mouseMove(chart: Chart, event: MouseEvent) {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import plugin from './plugin'
33

44
import type { ZoomPluginOptions } from './options'
55
import type { ScaleRange } from './state'
6-
import type { DistributiveArray, PanAmount, ZoomAmount } from './types'
6+
import type { DistributiveArray, PanAmount, ZoomAmount } from './types.js'
77
import type { ChartType, ChartTypeRegistry, Point, Scale, UpdateMode } from 'chart.js'
88

99
declare module 'chart.js' {

tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"module": "ES2022",
1616
"moduleResolution": "bundler",
1717
"resolveJsonModule": true,
18-
"rootDir": "src",
18+
"rootDir": ".",
1919

2020
/* Emit */
2121
"declaration": true,
@@ -37,15 +37,14 @@
3737
},
3838
"typedocOptions": {
3939
"name": "chartjs-plugin-zoom",
40-
"entryPoints": ["types/index.d.ts"],
40+
"entryPoints": ["src/index.ts"],
4141
"readme": "none",
4242
"excludeExternals": true,
4343
"includeVersion": true,
4444
"out": "./dist/docs/typedoc"
4545
},
4646
"include": [
4747
"./src/**/*.ts",
48-
"./types"
4948
],
5049
"exclude": [
5150
"./src/**/*.spec.ts",

0 commit comments

Comments
 (0)