-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathvue.d.ts
33 lines (31 loc) · 841 Bytes
/
vue.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import Vue from "vue";
import { ChannelNameWithParams } from "actioncable";
import { ChannelOptions } from "./options";
declare module "vue/types/vue" {
export interface Vue {
$cable: {
subscribe: (
subscription: string | ChannelNameWithParams,
name?: string,
) => void;
perform: (whatToDo: {
channel: string;
action: string;
data: object;
}) => void;
unsubscribe: (channelName: string) => void;
connected: boolean;
disconnected: boolean;
connection?: {
connect: (url?: string | (() => string) | null) => void;
disconnect: () => void;
};
};
}
}
declare module "vue/types/options" {
// eslint-disable-next-line no-unused-vars
export interface ComponentOptions<V extends Vue> {
channels?: ChannelOptions;
}
}