Skip to content

Commit

Permalink
fix: type definition for decorator (#529)
Browse files Browse the repository at this point in the history
* Fix types definition for decorator

* Update import in README
  • Loading branch information
jnt0r authored May 14, 2021
1 parent 05620af commit bff1318
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ Check the example below:
<!-- App.vue -->
<script>
import { Options, Vue } from 'vue-class-component';
import { Socket } from 'vue-socket.io-extended'
import Socket from 'vue-socket.io-extended/decorator';
@Options({})
export default class App extends Vue {
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"import": "./dist/vue-socket.io-ext.esm.js",
"default": "./dist/vue-socket.io-ext.min.js"
},
"./decorator/": "./dist/vue-socket.io-ext.decorator.esm.js"
"./decorator": "./dist/vue-socket.io-ext.decorator.esm.js"
},
"scripts": {
"test": "jest",
Expand All @@ -27,6 +27,11 @@
"types/"
],
"typings": "types/index.d.ts",
"typesVersions": {
"*": {
"decorator": ["types/decorator.d.ts"]
}
},
"keywords": [
"vuejs",
"socket",
Expand Down
5 changes: 5 additions & 0 deletions types/decorator.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { VueDecorator } from 'vue-class-component';

declare const Socket: (eventName?: string) => VueDecorator;

export default Socket;
2 changes: 0 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-ignore
import { PluginInstallFunction } from 'vue';
import { VueDecorator } from 'vue-class-component';
import * as SocketIOClient from 'socket.io-client';
// augment typings of Vue.js
import "./vue"
Expand All @@ -23,4 +22,3 @@ declare class VueSocketIOExt {
}

export default VueSocketIOExt;
export const Socket: (eventName?: string) => VueDecorator;

0 comments on commit bff1318

Please sign in to comment.