Skip to content

Commit e5e8ae9

Browse files
committed
Add type to defineExpose
1 parent 272a005 commit e5e8ae9

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/Types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@ export interface VTourData {
127127
/**
128128
* Programmatic step navigation signature.
129129
*
130-
* @param arg0 Step index to navigate to.
130+
* @param stepIndex Step index to navigate to.
131131
*/
132-
export type VTourGoToStep = (arg0: number) => Promise<void>;
132+
export type VTourGoToStep = (stepIndex: number) => Promise<void>;
133133

134134
/**
135135
* Reset behaviour signature.
136136
*
137-
* @param arg0 When true, restarts immediately after reset.
137+
* @param shouldRestart When true, restarts immediately after reset.
138138
*/
139-
export type VTourResetTour = (arg0?: boolean) => void;
139+
export type VTourResetTour = (shouldRestart?: boolean) => void;
140140

141141
/**
142142
* Public API methods exposed by the VTour component

src/components/VTour.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
import { createPopper, type NanoPop } from 'nanopop';
33
import { computed, onMounted, onUnmounted, reactive, ref } from 'vue';
44
import jump from 'jump.js';
5-
import type { VTourProps, VTourEmits, VTourData } from '../Types.ts';
5+
import type {
6+
VTourProps,
7+
VTourEmits,
8+
VTourData,
9+
VTourExposedMethods,
10+
} from '../Types.ts';
611
712
// Props with defaults
813
const props = withDefaults(defineProps<VTourProps>(), {
@@ -324,7 +329,7 @@ onUnmounted(() => {
324329
});
325330
326331
// Expose public API
327-
defineExpose({
332+
defineExpose<VTourExposedMethods>({
328333
startTour,
329334
nextStep,
330335
lastStep,

0 commit comments

Comments
 (0)