Skip to content

Commit

Permalink
feat: provide types for typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
glorat committed Mar 18, 2020
1 parent f1d99ae commit eee7fef
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"type": "git",
"url": "https://github.com/pulsardev/vue-tour.git"
},
"typings": "types/index.d.ts",
"keywords": [
"vue",
"tour"
Expand Down
21 changes: 21 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import './vue';
import Vue from 'vue';

export function install (vue: typeof Vue): void

export interface Tour {
// Methods
start(startStep?: string): void
previousStep(): void
nextStep(): void
stop(): void
skip(): void
finish(): void
currentStep: number

// Computed
isRunning: boolean
isFirst: boolean
isLast: boolean
numberOfSteps: number
}
8 changes: 8 additions & 0 deletions types/vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {Tour} from './index';

declare module 'vue/types/vue' {

interface Vue {
$tours: Record<string, Tour>;
}
}

0 comments on commit eee7fef

Please sign in to comment.