From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- toolkit/components/extensions/types/globals.ts | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 toolkit/components/extensions/types/globals.ts (limited to 'toolkit/components/extensions/types/globals.ts') diff --git a/toolkit/components/extensions/types/globals.ts b/toolkit/components/extensions/types/globals.ts new file mode 100644 index 0000000000..45722828e2 --- /dev/null +++ b/toolkit/components/extensions/types/globals.ts @@ -0,0 +1,33 @@ +/** + * Support types for toolkit/components/extensions code. + */ + +/// +/// +/// + +// This now relies on types generated in bug 1872918, or get the built +// artifact tslib directly and put it in your src/node_modules/@types: +// https://phabricator.services.mozilla.com/D197620 +/// + +// Exports for all other external modules redirected to globals.ts. +export var AppConstants, + GeckoViewConnection, GeckoViewWebExtension, IndexedDB, JSONFile, Log; + +/** + * This is a mock for the "class" from EventEmitter.sys.mjs. When we import + * it in extensions code using resource://gre/modules/EventEmitter.sys.mjs, + * the catch-all rule from tsconfig.json redirects it to this file. The export + * of the class below fulfills the import. The mock is needed when we subclass + * that EventEmitter, typescript gets confused because it's an old style + * function-and-prototype-based "class", and some types don't match up. + * + * TODO: Convert EventEmitter.sys.mjs into a proper class. + */ +export declare class EventEmitter { + on(event: string, listener: callback): void; + once(event: string, listener: callback): Promise; + off(event: string, listener: callback): void; + emit(event: string, ...args: any[]): void; +} -- cgit v1.2.3