<commit_before>// Type definitions for ActionCable
// Project: https://github.com/rails/rails/tree/master/actioncable
// Definitions by: <NAME> <https://github.com/zhu1230>
// Definitions: https://github.com/zhu1230/DefinitelyTyped

declare module ActionCable {
  interface Channel {
    unsubscribe(): void;
    perform(action: string, data: {}): void;
    send(data: Object): boolean;
  }

  interface Subscriptions {
    create(channel: string|ChannelNameWithParams, obj: CreateMixin): Channel;
  }

  interface Cable {
    subscriptions: Subscriptions;
  }

  interface CreateMixin {
    connected(): void;
    disconnected(): void;
    received(obj: Object): void;
    [key: string]: Function;
  }

  interface ChannelNameWithParams {
    channel: string;
    [key: string]: any;
  }

  function createConsumer(): Cable;
  function createConsumer(url: string): Cable;
}

declare interface AppInterface {
  cable?: ActionCable.Cable;<commit_msg>[actioncable] Add missing function to Cable/Consumer interface<commit_after>// Type definitions for ActionCable 5.2
// Project: https://github.com/rails/rails/tree/master/actioncable/app/assets/javascripts
// Definitions by: <NAME> <https://github.com/zhu1230>
//                 <NAME> <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;
  }

  interface Subscriptions {
    create(channel: string|ChannelNameWithParams, obj: CreateMixin): Channel;
  }

  interface Cable {
    subscriptions: Subscriptions;
    send(data: Object): void;
    connect(): void;
    disconnect(): void;
    ensureActiveConnection(): void;
  }

  interface CreateMixin {
    connected(): void;
    disconnected(): void;
    received(obj: Object): void;
    [key: string]: Function;
  }

  interface ChannelNameWithParams {
    channel: string;
    [key: string]: any;
  }

  function createConsumer(): Cable;
  function createConsumer(url: string): Cable;
}

declare interface AppInterface {
  cable?: ActionCable.Cable;
{'fraction_non_alphanumeric': 0.12592250922509224, 'fraction_numerical': 0.00922509225092251, 'mean_word_length': 3.8632286995515694, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1050453', 'n_tokens_mistral': 670, 'n_tokens_neox': 636, 'n_words': 158}