import { PluginFunction } from "vue";
import * as SocketIOClient from "socket.io-client";
import { VueDecorator } from "vue-class-component";
// 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 {
  socketwc: SocketIOClient.Socket;
}

declare class VueSocketIOExtWC {
  static install: PluginFunction<VueSocketIOExtOptions>;
  static defaults: SocketToVuexOptions;
}

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