Skip to content

Commit b4030ab

Browse files
committed
Add strict typing?
1 parent 45ffc04 commit b4030ab

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/Types.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ export interface VTourData {
124124
getNextStep: ITourStep;
125125
}
126126

127+
export type VTourGoToStep = (stepIndex: number) => Promise<void>;
128+
129+
export type VTourResetTour = (shouldRestart?: boolean) => void;
130+
127131
/**
128132
* Public API methods exposed by the VTour component
129133
*/
@@ -144,12 +148,10 @@ export interface VTourExposedMethods {
144148
stopTour: () => void;
145149

146150
/** Navigate to a specific step by index */
147-
// codacy:disable:next-line
148-
goToStep(stepIndex: number): Promise<void>;
151+
goToStep: VTourGoToStep;
149152

150153
/** Reset tour state and optionally restart */
151-
// codacy:disable:next-line
152-
resetTour(shouldRestart?: boolean): void;
154+
resetTour: VTourResetTour;
153155

154156
/** Update tooltip position */
155157
updatePosition: () => Promise<void>;

vite.config.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { resolve } from 'path';
22
import { defineConfig } from 'vite';
3-
import dts from 'vite-plugin-dts';
3+
import dtsPlugin from 'vite-plugin-dts';
44
import vue from '@vitejs/plugin-vue';
5+
const dtsOptions = {
6+
insertTypesEntry: true,
7+
cleanVueFileName: true,
8+
};
59
export default defineConfig({
610
resolve: {
711
alias: {
@@ -35,10 +39,7 @@ export default defineConfig({
3539
defineModel: true,
3640
},
3741
}),
38-
dts({
39-
insertTypesEntry: true,
40-
cleanVueFileName: true,
41-
}),
42+
dtsPlugin(dtsOptions),
4243
],
4344
server: {
4445
open: true,

vite.config.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import { resolve } from 'path';
22
import { defineConfig } from 'vite';
3-
import dts from 'vite-plugin-dts';
3+
import dtsPlugin, {
4+
type PluginOptions as DtsPluginOptions,
5+
} from 'vite-plugin-dts';
46
import vue from '@vitejs/plugin-vue';
57

8+
const dtsOptions: DtsPluginOptions = {
9+
insertTypesEntry: true,
10+
cleanVueFileName: true,
11+
};
12+
613
export default defineConfig({
714
resolve: {
815
alias: {
@@ -36,11 +43,7 @@ export default defineConfig({
3643
defineModel: true,
3744
},
3845
}),
39-
// codacy:disable:next-line
40-
dts({
41-
insertTypesEntry: true,
42-
cleanVueFileName: true,
43-
}),
46+
dtsPlugin(dtsOptions),
4447
],
4548
server: {
4649
open: true,

0 commit comments

Comments
 (0)