Merge pull request #29233 from szechyjs/fix_actioncable

[actioncable] Add missing function to Cable/Consumer interface
This commit is contained in:
Andrew Casey
2018-09-28 10:19:22 -07:00
committed by GitHub
+10 -4
View File
@@ -1,13 +1,15 @@
// Type definitions for ActionCable
// Project: https://github.com/rails/rails/tree/master/actioncable
// Type definitions for ActionCable 5.2
// Project: https://github.com/rails/rails/tree/master/actioncable/app/assets/javascripts
// Definitions by: Vincent Zhu <https://github.com/zhu1230>
// Jared Szechy <https://github.com/szechyjs>
// Definitions: https://github.com/zhu1230/DefinitelyTyped
// TypeScript Version: 2.3
declare module ActionCable {
interface Channel {
unsubscribe(): void;
perform(action: string, data: {}): void;
send(data: Object): boolean;
send(data: any): boolean;
}
interface Subscriptions {
@@ -16,12 +18,16 @@ declare module ActionCable {
interface Cable {
subscriptions: Subscriptions;
send(data: any): void;
connect(): void;
disconnect(): void;
ensureActiveConnection(): void;
}
interface CreateMixin {
connected(): void;
disconnected(): void;
received(obj: Object): void;
received(obj: any): void;
[key: string]: Function;
}