static addSource(key: string, callback: SourceCallback): {remove: () => void} {
    return this._addSource(key, callback, BugReporting._extraSources);
  }

  /**
   * Maps a string key to a simple callback that should return a string payload to be attached
   * to a bug report. Source callbacks are called when `collectExtraData` is called.
   *
   * Returns an object to remove the source when the component unmounts.
   *
   * Conflicts trample with a warning.
   */
  static addFileSource(key: string, callback: SourceCallback): {remove: () => void} {
    return this._addSource(key, callback, BugReporting._fileSources);
  }

  static _addSource(key: string, callback: SourceCallback, source: Map<string, SourceCallback>): {remove: () => void} {
    BugReporting._maybeInit();
    if (source.has(key)) {
      console.warn(`BugReporting.add* called multiple times for same key '${key}'`);
    }
    source.set(key, callback);
    return {remove: () => { source.delete(key); }};
  }
Maps a string key to a simple callback that should return a string payload to be attached
to a bug report. Source callbacks are called when `collectExtraData` is called.

Returns an object to remove the source when the component unmounts.

Conflicts trample with a warning.