Bug 1911476 - Enable basic IDE types support in toolkit/ and browser/ r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D218503
This commit is contained in:
4
browser/jsconfig.json
Normal file
4
browser/jsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tools/@types/tsconfig.json",
|
||||||
|
"include": ["**/*.sys.mjs"]
|
||||||
|
}
|
||||||
@@ -1,20 +1,3 @@
|
|||||||
/**
|
|
||||||
* 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 GleanPings: GleanPingsImpl;
|
|
||||||
const Services: JSServices;
|
|
||||||
const uneval: (any) => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exports for all modules redirected here by a catch-all rule in tsconfig.json.
|
// Exports for all modules redirected here by a catch-all rule in tsconfig.json.
|
||||||
export var
|
export var
|
||||||
|
|||||||
4
toolkit/jsconfig.json
Normal file
4
toolkit/jsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "../tools/@types/tsconfig.json",
|
||||||
|
"include": ["**/*.sys.mjs"]
|
||||||
|
}
|
||||||
@@ -94,6 +94,9 @@ with Files("mozapps/preferences/**"):
|
|||||||
with Files("l10n-registry.manifest"):
|
with Files("l10n-registry.manifest"):
|
||||||
BUG_COMPONENT = ("Core", "Localization")
|
BUG_COMPONENT = ("Core", "Localization")
|
||||||
|
|
||||||
|
with Files("jsconfig.json"):
|
||||||
|
BUG_COMPONENT = ("Developer Infrastructure", "Lint and Formatting")
|
||||||
|
|
||||||
GeneratedFile(
|
GeneratedFile(
|
||||||
"content/neterror/aboutNetErrorCodes.js",
|
"content/neterror/aboutNetErrorCodes.js",
|
||||||
script="content/neterror/gen_aboutneterror_codes.py",
|
script="content/neterror/gen_aboutneterror_codes.py",
|
||||||
|
|||||||
18
tools/@types/index.d.ts
vendored
18
tools/@types/index.d.ts
vendored
@@ -7,3 +7,21 @@
|
|||||||
/// <reference types="./lib.gecko.nsresult.d.ts" />
|
/// <reference types="./lib.gecko.nsresult.d.ts" />
|
||||||
/// <reference types="./lib.gecko.services.d.ts" />
|
/// <reference types="./lib.gecko.services.d.ts" />
|
||||||
/// <reference types="./lib.gecko.xpcom.d.ts" />
|
/// <reference types="./lib.gecko.xpcom.d.ts" />
|
||||||
|
|
||||||
|
/// Order of references matters here, for overriding type signatures.
|
||||||
|
/// <reference types="./lib.gecko.tweaks.d.ts" />
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
const Cc: nsXPCComponents_Classes;
|
||||||
|
const Ci: nsIXPCComponents_Interfaces;
|
||||||
|
const Components: nsIXPCComponents;
|
||||||
|
const Cr: nsIXPCComponents_Results;
|
||||||
|
|
||||||
|
// Resolve typed generic overloads before the generated ones.
|
||||||
|
const Cu: nsXPCComponents_Utils & nsIXPCComponents_Utils;
|
||||||
|
|
||||||
|
const Services: JSServices;
|
||||||
|
const uneval: (any) => string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|||||||
@@ -91,4 +91,7 @@ interface XULBrowserElement extends XULFrameElement, FrameLoader {
|
|||||||
remoteType: string;
|
remoteType: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type nsQIResult<iid> = import("gecko/lib.gecko.xpcom").nsQIResult<iid>;
|
// https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1736
|
||||||
|
interface Localization {
|
||||||
|
formatValuesSync(aKeys: L10nKey[]): (string | null)[];
|
||||||
|
}
|
||||||
7
tools/@types/tsconfig.json
Normal file
7
tools/@types/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"target": "es2022",
|
||||||
|
"types": ["gecko"]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -41,6 +41,9 @@ with Files("tryselect/**"):
|
|||||||
with Files("tryselect/selectors/release.py"):
|
with Files("tryselect/selectors/release.py"):
|
||||||
BUG_COMPONENT = ("Release Engineering", "General")
|
BUG_COMPONENT = ("Release Engineering", "General")
|
||||||
|
|
||||||
|
with Files("ts/**"):
|
||||||
|
BUG_COMPONENT = ("Developer Infrastructure", "Lint and Formatting")
|
||||||
|
|
||||||
with Files("update-packaging/**"):
|
with Files("update-packaging/**"):
|
||||||
BUG_COMPONENT = ("Release Engineering", "General")
|
BUG_COMPONENT = ("Release Engineering", "General")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user