This commit is contained in:
nomnes 2019-08-06 20:45:26 +07:00
parent 847e567cc2
commit 13bb9944e6

19
index.d.ts vendored
View file

@ -7,6 +7,7 @@ import {
PropsDefinition,
} from "vue/types/options";
import { Vue } from "vue/types/vue";
import { PluginFunction, PluginObject } from "vue";
interface socketHandler<T> {
(this: T, ...args: any[]): SocketIOClient.Socket
@ -29,3 +30,21 @@ declare module 'vue/types/options' {
sockets: {[key: string]: socketHandler<V>}
}
}
export interface VueSocketOptions {
debug?: boolean;
connection: string,
vuex?: {
store?: any,
actionPrefix?: string,
mutationPrefix?: string,
options?: {
useConnectionNamespace?: boolean
}
}
}
export default class VueSocketIO<T> implements PluginObject<T> {
constructor (options: VueSocketOptions);
install: PluginFunction<T>
}