<commit_before>// Type definitions for Mopidy.js v1.2.0, Mopidy v3.0.2 WebSocket API

export = Mopidy;

declare class Mopidy {
  // ----------------- MOPIDY.JS SPECIFIC API -----------------

  /**
   * Mopidy.js is a JavaScript library for controlling a Mopidy music server.
   *
   * The library makes Mopidy's core API available from browsers and Node.js
   * programs, using JSON-RPC over a WebSocket to communicate with Mopidy.
   *
   * This library is the foundation of most Mopidy web clients.
   */
  constructor(options: Mopidy.Options);
  /**
   * Explicit connect function for when autoConnect:false is passed to
   * constructor.
   */
  connect(): Promise<void>;
  /**
   * Close the WebSocket without reconnecting. Letting the object be garbage
   * collected will have the same effect, so this isn't strictly necessary.
   */
  close(): Promise<void>;

  // ----------------- EVENT SUBSCRIPTION -----------------

  on<K extends keyof Mopidy.StrictEvents>(
    name: K,
    listener: Mopidy.StrictEvents[K]
  ): this;

  off(): void;
  off<K extends keyof Mopidy.StrictEvents>(
    name: K,
    listener: Mopidy.StrictEvents[K]
  ): this;

  // ----------------- CORE API -----------------

  /**
   * Manages everything related to the list of tracks we will play. See
   * TracklistController. Undefined before Mopidy connects.
   */
  tracklist?: Mopidy.core.TracklistController;
  /**
   * Manages playback state and the current playing track. See
   * PlaybackController. Undefined before Mopidy connects.
   */
  playback?: Mopidy.core.PlaybackController;
  /**
   * Manages the music library, e.g. searching and browsing for music. See
   * LibraryController. Undefined before Mopidy connects.
   */
  library?: Mopidy.core.LibraryController;
  /**
   * Manages stored playlists. See PlaylistsController. Undefined before
   * Mopidy connects.
   */
  playlists?: Mopidy.core.PlaylistsController;
  /**
   * Manages volume and muting. See MixerController. Undefined before Mopidy
   * connects.
   */
  mixer?: Mopidy.core.MixerController;
  /**
   * Keeps record of what tracks have been played. See HistoryController.
   * Undefined before Mopidy connects.
   */
  history?: Mopidy.core.HistoryController;

  /**
   * Get list of URI schemes we can handle
   */
  getUriSchemes(): Promise<string[]>;
  /**
   * Get version of the Mopidy core API
   */
  getVersion(): Promise<string>;
}

declare namespace Mopidy {
  type ValueOf<T> = T[keyof T];
  type URI = string;

  interface Options {
    /**
     * URL used when creating new WebSocket objects.
     *
     * In a browser environment, it defaults to
     * ws://${document.location.host}/mopidy/ws. If the current page is served
     * over HTTPS, it defaults to using wss:// instead of ws://.
     *
     * In a non-browser environment, where document.location isn't available, it
     * defaults to ws://localhost/mopidy/ws.
     */
    webSocketUrl: string;
    /**
     * Whether or not to connect to the WebSocket on instance creation. Defaults
     * to true.
     */
    autoConnect?: boolean;
    /**
     * The minimum number of milliseconds to wait after a connection error before
     * we try to reconnect. For every failed attempt, the backoff delay is doubled
     * until it reaches backoffDelayMax. Defaults to 1000.
     */
    backoffDelayMin?: number;
    /**
     * The maximum number of milliseconds to wait after a connection error before<commit_msg>Minor typing improvements for Mopidy constructor<commit_after>// Type definitions for Mopidy.js v1.2.0, Mopidy v3.0.2 WebSocket API

export = Mopidy;

declare class Mopidy {
  // ----------------- MOPIDY.JS SPECIFIC API -----------------

  /**
   * Mopidy.js is a JavaScript library for controlling a Mopidy music server.
   *
   * The library makes Mopidy's core API available from browsers and Node.js
   * programs, using JSON-RPC over a WebSocket to communicate with Mopidy.
   *
   * This library is the foundation of most Mopidy web clients.
   */
  constructor(options?: Mopidy.Options);
  /**
   * Explicit connect function for when autoConnect:false is passed to
   * constructor.
   */
  connect(): Promise<void>;
  /**
   * Close the WebSocket without reconnecting. Letting the object be garbage
   * collected will have the same effect, so this isn't strictly necessary.
   */
  close(): Promise<void>;

  // ----------------- EVENT SUBSCRIPTION -----------------

  on<K extends keyof Mopidy.StrictEvents>(
    name: K,
    listener: Mopidy.StrictEvents[K]
  ): this;

  off(): void;
  off<K extends keyof Mopidy.StrictEvents>(
    name: K,
    listener: Mopidy.StrictEvents[K]
  ): this;

  // ----------------- CORE API -----------------

  /**
   * Manages everything related to the list of tracks we will play. See
   * TracklistController. Undefined before Mopidy connects.
   */
  tracklist?: Mopidy.core.TracklistController;
  /**
   * Manages playback state and the current playing track. See
   * PlaybackController. Undefined before Mopidy connects.
   */
  playback?: Mopidy.core.PlaybackController;
  /**
   * Manages the music library, e.g. searching and browsing for music. See
   * LibraryController. Undefined before Mopidy connects.
   */
  library?: Mopidy.core.LibraryController;
  /**
   * Manages stored playlists. See PlaylistsController. Undefined before
   * Mopidy connects.
   */
  playlists?: Mopidy.core.PlaylistsController;
  /**
   * Manages volume and muting. See MixerController. Undefined before Mopidy
   * connects.
   */
  mixer?: Mopidy.core.MixerController;
  /**
   * Keeps record of what tracks have been played. See HistoryController.
   * Undefined before Mopidy connects.
   */
  history?: Mopidy.core.HistoryController;

  /**
   * Get list of URI schemes we can handle
   */
  getUriSchemes(): Promise<string[]>;
  /**
   * Get version of the Mopidy core API
   */
  getVersion(): Promise<string>;
}

declare namespace Mopidy {
  type ValueOf<T> = T[keyof T];
  type URI = string;

  interface Options {
    /**
     * URL used when creating new WebSocket objects.
     *
     * In a browser environment, it defaults to
     * ws://${document.location.host}/mopidy/ws. If the current page is served
     * over HTTPS, it defaults to using wss:// instead of ws://.
     *
     * In a non-browser environment, where document.location isn't available, it
     * defaults to ws://localhost/mopidy/ws.
     */
    webSocketUrl?: string;
    /**
     * Whether or not to connect to the WebSocket on instance creation. Defaults
     * to true.
     */
    autoConnect?: boolean;
    /**
     * The minimum number of milliseconds to wait after a connection error before
     * we try to reconnect. For every failed attempt, the backoff delay is doubled
     * until it reaches backoffDelayMax. Defaults to 1000.
     */
    backoffDelayMin?: number;
    /**
     * The maximum number of milliseconds to wait after a connection error before
{'fraction_non_alphanumeric': 0.12040904508137693, 'fraction_numerical': 0.002880599164626242, 'mean_word_length': 2.5979274611398964, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '4391254', 'n_tokens_mistral': 2049, 'n_tokens_neox': 1980, 'n_words': 706}