UNPKG

@awamwang/vue-socket.io-extended

Version:

Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)

25 lines (20 loc) 697 B
// @ts-ignore import { PluginInstallFunction } from 'vue'; import * as SocketIOClient from 'socket.io-client'; // augment typings of Vue.js import "./vue" export interface SocketToVuexOptions { actionPrefix?: string; mutationPrefix?: string; eventToMutationTransformer?: (eventName: string) => string; eventToActionTransformer?: (eventName: string) => string; eventMapping? : (eventMapping : string, socketPayload : any[]) => string } export interface VueSocketIOExtOptions extends SocketToVuexOptions{ socket: SocketIOClient.Socket; } declare class VueSocketIOExt { static install: PluginInstallFunction; static defaults: SocketToVuexOptions; } export default VueSocketIOExt;