Bug 1950119 - Update TypeScript targets to es2024. r=zombie,translations-reviewers,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D239352
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"compilerOptions": {
|
||||
"checkJs": true,
|
||||
"noEmit": true,
|
||||
"target": "es2022",
|
||||
"target": "es2024",
|
||||
"types": ["gecko"],
|
||||
|
||||
// prettier-ignore
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"compilerOptions": {
|
||||
"checkJs": true,
|
||||
"noEmit": true,
|
||||
"target": "es2022",
|
||||
"target": "es2024",
|
||||
"types": ["gecko"],
|
||||
"strict": true,
|
||||
|
||||
|
||||
29
tools/@types/lib.gecko.dom.d.ts
vendored
29
tools/@types/lib.gecko.dom.d.ts
vendored
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/// <reference no-default-lib="true" />
|
||||
/// <reference lib="es2023" />
|
||||
/// <reference lib="es2024" />
|
||||
|
||||
type HTMLCollectionOf<T> = any;
|
||||
type IsInstance<T> = (obj: any) => obj is T;
|
||||
@@ -3491,12 +3491,11 @@ interface SanitizerAttributeNamespace {
|
||||
interface SanitizerConfig {
|
||||
attributes?: SanitizerAttribute[];
|
||||
comments?: boolean;
|
||||
customElements?: boolean;
|
||||
dataAttributes?: boolean;
|
||||
elements?: SanitizerElementWithAttributes[];
|
||||
removeAttributes?: SanitizerAttribute[];
|
||||
removeElements?: SanitizerElement[];
|
||||
replaceWithChildrenElements?: SanitizerElement[];
|
||||
unknownMarkup?: boolean;
|
||||
}
|
||||
|
||||
interface SanitizerElementNamespace {
|
||||
@@ -3558,7 +3557,7 @@ interface ServerSocketOptions {
|
||||
}
|
||||
|
||||
interface SetHTMLOptions {
|
||||
sanitizer?: SanitizerConfig;
|
||||
sanitizer?: Sanitizer | SanitizerConfig | SanitizerPresets;
|
||||
}
|
||||
|
||||
interface ShadowRootInit {
|
||||
@@ -7729,7 +7728,6 @@ interface Element extends Node, ARIAMixin, Animatable, ChildNode, GeometryUtils,
|
||||
setAttributeNodeNS(newAttr: Attr): Attr | null;
|
||||
setCapture(retargetToElement?: boolean): void;
|
||||
setCaptureAlways(retargetToElement?: boolean): void;
|
||||
/** Available only in secure contexts. */
|
||||
setHTML(aInnerHTML: string, options?: SetHTMLOptions): void;
|
||||
setHTMLUnsafe(html: TrustedHTML | string): void;
|
||||
setPointerCapture(pointerId: number): void;
|
||||
@@ -18388,14 +18386,21 @@ interface SVGZoomAndPan {
|
||||
readonly SVG_ZOOMANDPAN_MAGNIFY: 2;
|
||||
}
|
||||
|
||||
/** Available only in secure contexts. */
|
||||
interface Sanitizer {
|
||||
sanitize(input: SanitizerInput): DocumentFragment;
|
||||
allowAttribute(attribute: SanitizerAttribute): void;
|
||||
allowElement(element: SanitizerElementWithAttributes): void;
|
||||
get(): SanitizerConfig;
|
||||
removeAttribute(attribute: SanitizerAttribute): void;
|
||||
removeElement(element: SanitizerElement): void;
|
||||
removeUnsafe(): void;
|
||||
replaceElementWithChildren(element: SanitizerElement): void;
|
||||
setComments(allow: boolean): void;
|
||||
setDataAttributes(allow: boolean): void;
|
||||
}
|
||||
|
||||
declare var Sanitizer: {
|
||||
prototype: Sanitizer;
|
||||
new(sanitizerConfig?: SanitizerConfig): Sanitizer;
|
||||
new(configuration?: SanitizerConfig | SanitizerPresets): Sanitizer;
|
||||
isInstance: IsInstance<Sanitizer>;
|
||||
};
|
||||
|
||||
@@ -24342,10 +24347,11 @@ declare namespace ChromeUtils {
|
||||
function clearMessagingLayerSecurityStateByPrincipal(principal: Principal): void;
|
||||
function clearMessagingLayerSecurityStateBySite(schemelessSite: string, pattern?: OriginAttributesPatternDictionary): void;
|
||||
function clearRecentJSDevError(): void;
|
||||
function clearScriptCache(): void;
|
||||
function clearResourceCache(chrome?: boolean): void;
|
||||
function clearScriptCache(chrome?: boolean): void;
|
||||
function clearScriptCacheByPrincipal(principal: Principal): void;
|
||||
function clearScriptCacheBySite(schemelessSite: string, pattern?: OriginAttributesPatternDictionary): void;
|
||||
function clearStyleSheetCache(): void;
|
||||
function clearStyleSheetCache(chrome?: boolean): void;
|
||||
function clearStyleSheetCacheByPrincipal(principal: Principal): void;
|
||||
function clearStyleSheetCacheBySite(schemelessSite: string, pattern?: OriginAttributesPatternDictionary): void;
|
||||
function collectPerfStats(): Promise<string>;
|
||||
@@ -24358,6 +24364,7 @@ declare namespace ChromeUtils {
|
||||
function defineESModuleGetters(aTarget: any, aModules: any, aOptions?: ImportESModuleOptionsDictionary): void;
|
||||
function defineLazyGetter(aTarget: any, aName: any, aLambda: any): void;
|
||||
function endWheelTransaction(): void;
|
||||
function ensureHeadlessContentProcess(aRemoteType: string): Promise<nsIContentParentKeepAlive>;
|
||||
function ensureJSOracleStarted(): void;
|
||||
function fillNonDefaultOriginAttributes(originAttrs?: OriginAttributesDictionary): OriginAttributesDictionary;
|
||||
function generateQI(interfaces: any[]): MozQueryInterface;
|
||||
@@ -25514,7 +25521,6 @@ type RequestInfo = Request | string;
|
||||
type SanitizerAttribute = string | SanitizerAttributeNamespace;
|
||||
type SanitizerElement = string | SanitizerElementNamespace;
|
||||
type SanitizerElementWithAttributes = string | SanitizerElementNamespaceWithAttributes;
|
||||
type SanitizerInput = DocumentFragment | Document;
|
||||
type StackFrame = nsIStackFrame;
|
||||
type StringOrOpenPopupOptions = string | OpenPopupOptions;
|
||||
type StructuredClonable = any;
|
||||
@@ -25746,6 +25752,7 @@ type RequestPriority = "auto" | "high" | "low";
|
||||
type RequestRedirect = "error" | "follow" | "manual";
|
||||
type ResizeObserverBoxOptions = "border-box" | "content-box" | "device-pixel-content-box";
|
||||
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
|
||||
type SanitizerPresets = "default";
|
||||
type ScreenColorGamut = "p3" | "rec2020" | "srgb";
|
||||
type ScrollBehavior = "auto" | "instant" | "smooth";
|
||||
type ScrollLogicalPosition = "center" | "end" | "nearest" | "start";
|
||||
|
||||
9
tools/@types/lib.gecko.tweaks.d.ts
vendored
9
tools/@types/lib.gecko.tweaks.d.ts
vendored
@@ -91,15 +91,6 @@ interface nsXPCComponents_Utils {
|
||||
waiveXrays<T>(object: T): T;
|
||||
}
|
||||
|
||||
// TODO: remove after next TS update.
|
||||
interface PromiseConstructor {
|
||||
withResolvers<T>(): {
|
||||
promise: Promise<T>;
|
||||
resolve: (value: T | PromiseLike<T>) => void;
|
||||
reject: (reason?: any) => void;
|
||||
};
|
||||
}
|
||||
|
||||
type Sandbox = typeof globalThis & nsISupports;
|
||||
|
||||
// Hand-crafted artisanal types.
|
||||
|
||||
24
tools/@types/lib.gecko.xpcom.d.ts
vendored
24
tools/@types/lib.gecko.xpcom.d.ts
vendored
@@ -805,6 +805,7 @@ interface nsIAlertAction extends nsISupports {
|
||||
|
||||
interface nsIAlertNotification extends nsISupports {
|
||||
init(aName?: string, aImageURL?: string, aTitle?: string, aText?: string, aTextClickable?: boolean, aCookie?: string, aDir?: string, aLang?: string, aData?: string, aPrincipal?: nsIPrincipal, aInPrivateBrowsing?: boolean, aRequireInteraction?: boolean, aSilent?: boolean, aVibrate?: u32[]): void;
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly imageURL: string;
|
||||
readonly title: string;
|
||||
@@ -825,6 +826,7 @@ interface nsIAlertNotification extends nsISupports {
|
||||
readonly source: string;
|
||||
opaqueRelaunchData: string;
|
||||
loadImage(aTimeout: u32, aListener: nsIAlertNotificationImageListener, aUserData?: nsISupports): nsICancelable;
|
||||
getAction(aName: string): nsIAlertAction;
|
||||
}
|
||||
|
||||
interface nsIAlertsService extends nsISupports {
|
||||
@@ -3275,7 +3277,7 @@ interface nsINotificationStorageCallback extends nsISupports {
|
||||
|
||||
interface nsINotificationStorage extends nsISupports {
|
||||
put(origin: string, id: string, title: string, dir: string, lang: string, body: string, tag: string, icon: string, data: string, serviceWorkerRegistrationScope: string): void;
|
||||
get(origin: string, tag: string, aCallback: nsINotificationStorageCallback): void;
|
||||
get(origin: string, scope: string, tag: string, aCallback: nsINotificationStorageCallback): void;
|
||||
delete(origin: string, id: string): void;
|
||||
}
|
||||
|
||||
@@ -6139,6 +6141,8 @@ interface nsIIOService extends nsISupports {
|
||||
registerProtocolHandler(aScheme: string, aHandler: nsIProtocolHandler, aProtocolFlags: u32, aDefaultPort: i32): void;
|
||||
unregisterProtocolHandler(aScheme: string): void;
|
||||
setSimpleURIUnknownRemoteSchemes(aRemoteSchemes: string[]): void;
|
||||
addEssentialDomainMapping(aFrom: string, aTo: string): void;
|
||||
clearEssentialDomainMapping(): void;
|
||||
}
|
||||
|
||||
// https://searchfox.org/mozilla-central/source/netwerk/base/nsIIncrementalDownload.idl
|
||||
@@ -6567,12 +6571,12 @@ enum ConnectivityState {
|
||||
declare global {
|
||||
|
||||
interface nsINetworkConnectivityService extends nsISupports, Enums<typeof nsINetworkConnectivityService.ConnectivityState> {
|
||||
readonly DNSv4: nsINetworkConnectivityService.ConnectivityState;
|
||||
readonly DNSv6: nsINetworkConnectivityService.ConnectivityState;
|
||||
readonly DNS_HTTPS: nsINetworkConnectivityService.ConnectivityState;
|
||||
readonly IPv4: nsINetworkConnectivityService.ConnectivityState;
|
||||
readonly IPv6: nsINetworkConnectivityService.ConnectivityState;
|
||||
readonly NAT64: nsINetworkConnectivityService.ConnectivityState;
|
||||
DNSv4: nsINetworkConnectivityService.ConnectivityState;
|
||||
DNSv6: nsINetworkConnectivityService.ConnectivityState;
|
||||
DNS_HTTPS: nsINetworkConnectivityService.ConnectivityState;
|
||||
IPv4: nsINetworkConnectivityService.ConnectivityState;
|
||||
IPv6: nsINetworkConnectivityService.ConnectivityState;
|
||||
NAT64: nsINetworkConnectivityService.ConnectivityState;
|
||||
recheckDNS(): void;
|
||||
recheckIPConnectivity(): void;
|
||||
}
|
||||
@@ -11027,7 +11031,9 @@ interface nsIContentAnalysisResponse extends nsIContentAnalysisResult, Enums<typ
|
||||
readonly action: nsIContentAnalysisResponse.Action;
|
||||
readonly cancelError: nsIContentAnalysisResponse.CancelError;
|
||||
readonly requestToken: string;
|
||||
readonly userActionId: string;
|
||||
readonly isCachedResponse: boolean;
|
||||
readonly isAgentResponse: boolean;
|
||||
acknowledge(aCaa: nsIContentAnalysisAcknowledgement): void;
|
||||
}
|
||||
|
||||
@@ -11131,7 +11137,7 @@ interface nsIContentAnalysis extends nsISupports {
|
||||
setCachedResponse(aURI: nsIURI, aSequenceNumber: i32, aAction: nsIContentAnalysisResponse.Action): void;
|
||||
getCachedResponse(aURI: nsIURI, aSequenceNumber: i32, aAction: OutParam<nsIContentAnalysisResponse.Action>, aIsValid: OutParam<boolean>): void;
|
||||
showBlockedRequestDialog(aRequest: nsIContentAnalysisRequest): void;
|
||||
makeResponseForTest(aAction: nsIContentAnalysisResponse.Action, aToken: string): nsIContentAnalysisResponse;
|
||||
makeResponseForTest(aAction: nsIContentAnalysisResponse.Action, aToken: string, aUserActionId: string): nsIContentAnalysisResponse;
|
||||
sendCancelToAgent(aUserActionId: string): void;
|
||||
}
|
||||
|
||||
@@ -11380,7 +11386,7 @@ interface nsISearchService extends nsISupports {
|
||||
readonly isInitialized: boolean;
|
||||
readonly hasSuccessfullyInitialized: boolean;
|
||||
runBackgroundChecks(): Promise<any>;
|
||||
resetToAppDefaultEngine(): Promise<any>;
|
||||
resetToAppDefaultEngine(): void;
|
||||
addOpenSearchEngine(engineURL: string, iconURL: string): Promise<any>;
|
||||
addUserEngine(name: string, url: string, alias?: string): Promise<any>;
|
||||
addEnginesFromExtension(extension: any): Promise<any>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noEmit": true,
|
||||
"target": "es2022",
|
||||
"target": "es2024",
|
||||
"types": ["gecko"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ const HEADER = `/**
|
||||
*/
|
||||
|
||||
/// <reference no-default-lib="true" />
|
||||
/// <reference lib="es2023" />
|
||||
/// <reference lib="es2024" />
|
||||
|
||||
type HTMLCollectionOf<T> = any;
|
||||
type IsInstance<T> = (obj: any) => obj is T;
|
||||
|
||||
Reference in New Issue
Block a user