Skip to content
This repository was archived by the owner on Jun 18, 2025. It is now read-only.

Commit bff1318

Browse files
authored
fix: type definition for decorator (#529)
* Fix types definition for decorator * Update import in README
1 parent 05620af commit bff1318

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ Check the example below:
299299
<!-- App.vue -->
300300
<script>
301301
import { Options, Vue } from 'vue-class-component';
302-
import { Socket } from 'vue-socket.io-extended'
302+
import Socket from 'vue-socket.io-extended/decorator';
303303
304304
@Options({})
305305
export default class App extends Vue {

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"import": "./dist/vue-socket.io-ext.esm.js",
1010
"default": "./dist/vue-socket.io-ext.min.js"
1111
},
12-
"./decorator/": "./dist/vue-socket.io-ext.decorator.esm.js"
12+
"./decorator": "./dist/vue-socket.io-ext.decorator.esm.js"
1313
},
1414
"scripts": {
1515
"test": "jest",
@@ -27,6 +27,11 @@
2727
"types/"
2828
],
2929
"typings": "types/index.d.ts",
30+
"typesVersions": {
31+
"*": {
32+
"decorator": ["types/decorator.d.ts"]
33+
}
34+
},
3035
"keywords": [
3136
"vuejs",
3237
"socket",

types/decorator.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { VueDecorator } from 'vue-class-component';
2+
3+
declare const Socket: (eventName?: string) => VueDecorator;
4+
5+
export default Socket;

types/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @ts-ignore
22
import { PluginInstallFunction } from 'vue';
3-
import { VueDecorator } from 'vue-class-component';
43
import * as SocketIOClient from 'socket.io-client';
54
// augment typings of Vue.js
65
import "./vue"
@@ -23,4 +22,3 @@ declare class VueSocketIOExt {
2322
}
2423

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

0 commit comments

Comments
 (0)