summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/types/globals.ts
blob: dee9de0cf4d2b323aaeb17a7315790dfb1534f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
 * Gecko globals.
 */
declare global {
  const Cc: nsXPCComponents_Classes;
  const Ci: nsIXPCComponents_Interfaces;
  const Cr: nsIXPCComponents_Results;
  const Components: nsIXPCComponents;

  // Resolve typed generic overloads before the generated ones.
  const Cu: nsXPCComponents_Utils & nsIXPCComponents_Utils;

  const Glean: GleanImpl;
  const Services: JSServices;
  const uneval: (any) => string;
}

// Exports for all modules redirected here by a catch-all rule in tsconfig.json.
export var
  AddonWrapper, AppConstants, GeckoViewConnection, GeckoViewWebExtension,
  IndexedDB, JSONFile, Log, UrlbarUtils, WebExtensionDescriptorActor;

/**
 * A stub type for the "class" from EventEmitter.sys.mjs.
 * TODO: Convert EventEmitter.sys.mjs into a proper class.
 */
export declare class EventEmitter {
  emit(event: string, ...args: any[]): void;
  on(event: string, listener: callback): void;
  once(event: string, listener: callback): Promise<any>;
  off(event: string, listener: callback): void;
}