mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
32 lines
708 B
TypeScript
32 lines
708 B
TypeScript
// Type definitions for ActionCable
|
|
// Project: https://github.com/rails/rails/tree/master/actioncable
|
|
// Definitions by: Vincent Zhu <https://github.com/zhu1230>
|
|
// Definitions: https://github.com/zhu1230/DefinitelyTyped
|
|
|
|
declare module ActionCable {
|
|
interface Channel {
|
|
unsubscribe(): void;
|
|
perform(action: string, data: {}): void;
|
|
}
|
|
interface Subscriptions {
|
|
create(chan_name: string, obj: {}): Channel;
|
|
}
|
|
interface Cable {
|
|
subscriptions: Subscriptions;
|
|
}
|
|
function createConsumer(): Cable;
|
|
function createConsumer(url: string): Cable;
|
|
}
|
|
|
|
declare interface AppInterface {
|
|
cable?: ActionCable.Cable;
|
|
network?: ActionCable.Channel;
|
|
}
|
|
|
|
declare var App: AppInterface;
|
|
|
|
|
|
|
|
|
|
|