1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

style: Formatted the project, b=(no-bug), c=scripts

This commit is contained in:
Mr. M 2025-04-21 00:05:34 +02:00
parent e65991aa03
commit 8136387a75
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
11 changed files with 41339 additions and 33414 deletions

View file

@ -2,23 +2,24 @@
import os
FILES = [
"index.d.ts",
"lib.gecko.darwin.d.ts",
"lib.gecko.dom.d.ts",
"lib.gecko.glean.d.ts",
"lib.gecko.linux.d.ts",
"lib.gecko.modules.d.ts",
"lib.gecko.nsresult.d.ts",
"lib.gecko.services.d.ts",
"lib.gecko.tweaks.d.ts",
"lib.gecko.win32.d.ts",
"lib.gecko.xpcom.d.ts",
"lib.gecko.xpidl.d.ts",
"index.d.ts",
"lib.gecko.darwin.d.ts",
"lib.gecko.dom.d.ts",
"lib.gecko.glean.d.ts",
"lib.gecko.linux.d.ts",
"lib.gecko.modules.d.ts",
"lib.gecko.nsresult.d.ts",
"lib.gecko.services.d.ts",
"lib.gecko.tweaks.d.ts",
"lib.gecko.win32.d.ts",
"lib.gecko.xpcom.d.ts",
"lib.gecko.xpidl.d.ts",
]
ENGINE_PATH = os.path.join("engine", "tools", "@types")
SRC_PATH = os.path.join("src", "zen", "@types")
def update_ts_types():
os.system("cd engine && ./mach ts build && ./mach ts update")
# copy the files from engine/tools/@types to src/@types
@ -36,6 +37,7 @@ def update_ts_types():
f.write('/// <reference types="./zen.d.ts" />\n')
f.write('\n')
if __name__ == "__main__":
update_ts_types()
print("Updated TypeScript types.")

View file

@ -34,4 +34,3 @@ declare global {
export {};
/// <reference types="./zen.d.ts" />

View file

@ -5,13 +5,11 @@
*/
declare global {
// https://searchfox.org/mozilla-central/source/accessible/interfaces/nsIAccessibleMacInterface.idl
// https://searchfox.org/mozilla-central/source/accessible/interfaces/nsIAccessibleMacInterface.idl
interface nsIAccessibleMacNSObjectWrapper extends nsISupports {}
interface nsIAccessibleMacNSObjectWrapper extends nsISupports {
}
interface nsIAccessibleMacInterface extends nsISupports {
interface nsIAccessibleMacInterface extends nsISupports {
readonly attributeNames: string[];
readonly parameterizedAttributeNames: string[];
readonly actionNames: string[];
@ -20,34 +18,34 @@ interface nsIAccessibleMacInterface extends nsISupports {
performAction(actionName: string): void;
isAttributeSettable(attributeName: string): boolean;
setAttributeValue(attributeName: string, attributeValue: any): void;
}
}
interface nsIAccessibleMacEvent extends nsISupports {
interface nsIAccessibleMacEvent extends nsISupports {
readonly macIface: nsIAccessibleMacInterface;
readonly data: any;
}
}
// https://searchfox.org/mozilla-central/source/browser/components/migration/nsIKeychainMigrationUtils.idl
// https://searchfox.org/mozilla-central/source/browser/components/migration/nsIKeychainMigrationUtils.idl
interface nsIKeychainMigrationUtils extends nsISupports {
interface nsIKeychainMigrationUtils extends nsISupports {
getGenericPassword(aServiceName: string, aAccountName: string): string;
}
}
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIMacShellService.idl
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIMacShellService.idl
interface nsIMacShellService extends nsIShellService {
interface nsIMacShellService extends nsIShellService {
showDesktopPreferences(): void;
showSecurityPreferences(aPaneID: string): void;
getAvailableApplicationsForProtocol(protocol: string): string[][];
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIMacDockSupport.idl
// https://searchfox.org/mozilla-central/source/widget/nsIMacDockSupport.idl
interface nsIAppBundleLaunchOptions extends nsISupports {
interface nsIAppBundleLaunchOptions extends nsISupports {
readonly addsToRecentItems: boolean;
}
}
interface nsIMacDockSupport extends nsISupports {
interface nsIMacDockSupport extends nsISupports {
dockMenu: nsIStandaloneNativeMenu;
activateApplication(aIgnoreOtherApplications: boolean): void;
badgeText: string;
@ -55,59 +53,59 @@ interface nsIMacDockSupport extends nsISupports {
readonly isAppInDock: boolean;
ensureAppIsPinnedToDock(aAppPath?: string, aAppToReplacePath?: string): boolean;
launchAppBundle(aAppBundle: nsIFile, aArgs: string[], aLaunchOptions?: nsIAppBundleLaunchOptions): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIMacFinderProgress.idl
// https://searchfox.org/mozilla-central/source/widget/nsIMacFinderProgress.idl
type nsIMacFinderProgressCanceledCallback = Callable<{
type nsIMacFinderProgressCanceledCallback = Callable<{
canceled(): void;
}>
}>;
interface nsIMacFinderProgress extends nsISupports {
interface nsIMacFinderProgress extends nsISupports {
init(path: string, canceledCallback: nsIMacFinderProgressCanceledCallback): void;
updateProgress(currentProgress: u64, totalProgress: u64): void;
end(): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIMacSharingService.idl
// https://searchfox.org/mozilla-central/source/widget/nsIMacSharingService.idl
interface nsIMacSharingService extends nsISupports {
interface nsIMacSharingService extends nsISupports {
getSharingProviders(pageUrl: string): any;
shareUrl(serviceName: string, pageUrl: string, pageTitle: string): void;
openSharingPreferences(): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIMacUserActivityUpdater.idl
// https://searchfox.org/mozilla-central/source/widget/nsIMacUserActivityUpdater.idl
interface nsIMacUserActivityUpdater extends nsISupports {
interface nsIMacUserActivityUpdater extends nsISupports {
updateLocation(pageUrl: string, pageTitle: string, window: nsIBaseWindow): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIMacWebAppUtils.idl
// https://searchfox.org/mozilla-central/source/widget/nsIMacWebAppUtils.idl
type nsITrashAppCallback = Callable<{
type nsITrashAppCallback = Callable<{
trashAppFinished(rv: nsresult): void;
}>
}>;
interface nsIMacWebAppUtils extends nsISupports {
interface nsIMacWebAppUtils extends nsISupports {
pathForAppWithIdentifier(bundleIdentifier: string): string;
launchAppWithIdentifier(bundleIdentifier: string): void;
trashApp(path: string, callback: nsITrashAppCallback): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIStandaloneNativeMenu.idl
// https://searchfox.org/mozilla-central/source/widget/nsIStandaloneNativeMenu.idl
interface nsIStandaloneNativeMenu extends nsISupports {
interface nsIStandaloneNativeMenu extends nsISupports {
init(aElement: Element): void;
menuWillOpen(): boolean;
activateNativeMenuItemAt(anIndexString: string): void;
forceUpdateNativeMenuAt(anIndexString: string): void;
dump(): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarProgress.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarProgress.idl
interface nsITaskbarProgress extends nsISupports {
interface nsITaskbarProgress extends nsISupports {
readonly STATE_NO_PROGRESS?: 0;
readonly STATE_INDETERMINATE?: 1;
readonly STATE_NORMAL?: 2;
@ -115,11 +113,11 @@ interface nsITaskbarProgress extends nsISupports {
readonly STATE_PAUSED?: 4;
setProgressState(state: nsTaskbarProgressState, currentValue?: u64, maxValue?: u64): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITouchBarHelper.idl
// https://searchfox.org/mozilla-central/source/widget/nsITouchBarHelper.idl
interface nsITouchBarHelper extends nsISupports {
interface nsITouchBarHelper extends nsISupports {
readonly activeUrl: string;
readonly activeTitle: string;
readonly isUrlbarFocused: boolean;
@ -129,15 +127,15 @@ interface nsITouchBarHelper extends nsISupports {
readonly document: Document;
getTouchBarInput(aInputName: string): nsITouchBarInput;
insertRestrictionInUrlbar(aToken: string): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITouchBarInput.idl
// https://searchfox.org/mozilla-central/source/widget/nsITouchBarInput.idl
type nsITouchBarInputCallback = Callable<{
type nsITouchBarInputCallback = Callable<{
onCommand(): void;
}>
}>;
interface nsITouchBarInput extends nsISupports {
interface nsITouchBarInput extends nsISupports {
readonly key: string;
title: string;
image: nsIURI;
@ -146,28 +144,28 @@ interface nsITouchBarInput extends nsISupports {
color: u32;
disabled: boolean;
children: nsIArray;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITouchBarUpdater.idl
// https://searchfox.org/mozilla-central/source/widget/nsITouchBarUpdater.idl
interface nsITouchBarUpdater extends nsISupports {
interface nsITouchBarUpdater extends nsISupports {
updateTouchBarInputs(aWindow: nsIBaseWindow, aInputs: nsITouchBarInput[]): void;
enterCustomizeMode(): void;
isTouchBarInitialized(): boolean;
setTouchBarInitialized(aIsInitialized: boolean): void;
showPopover(aWindow: nsIBaseWindow, aPopover: nsITouchBarInput, aShowing: boolean): void;
}
}
// https://searchfox.org/mozilla-central/source/xpcom/base/nsIMacPreferencesReader.idl
// https://searchfox.org/mozilla-central/source/xpcom/base/nsIMacPreferencesReader.idl
interface nsIMacPreferencesReader extends nsISupports {
interface nsIMacPreferencesReader extends nsISupports {
policiesEnabled(): boolean;
readPreferences(): any;
}
}
// https://searchfox.org/mozilla-central/source/xpcom/io/nsILocalFileMac.idl
// https://searchfox.org/mozilla-central/source/xpcom/io/nsILocalFileMac.idl
interface nsILocalFileMac extends nsIFile {
interface nsILocalFileMac extends nsIFile {
readonly fileSizeWithResFork: i64;
launchWithDoc(aDocToLoad: nsIFile, aLaunchInBackground: boolean): void;
openDocWithApp(aAppToOpenWith: nsIFile, aLaunchInBackground: boolean): void;
@ -179,9 +177,9 @@ interface nsILocalFileMac extends nsIFile {
getXAttr(aAttrName: string): u8[];
setXAttr(aAttrName: string, aAttrValue: u8[]): void;
delXAttr(aAttrName: string): void;
}
}
interface nsIXPCComponents_Interfaces {
interface nsIXPCComponents_Interfaces {
nsIAccessibleMacNSObjectWrapper: nsJSIID<nsIAccessibleMacNSObjectWrapper>;
nsIAccessibleMacInterface: nsJSIID<nsIAccessibleMacInterface>;
nsIAccessibleMacEvent: nsJSIID<nsIAccessibleMacEvent>;
@ -203,8 +201,7 @@ interface nsIXPCComponents_Interfaces {
nsITouchBarUpdater: nsJSIID<nsITouchBarUpdater>;
nsIMacPreferencesReader: nsJSIID<nsIMacPreferencesReader>;
nsILocalFileMac: nsJSIID<nsILocalFileMac>;
}
}
} // global
// Typedefs from xpidl.
@ -223,6 +220,6 @@ type OutParam<T> = { value?: T };
type Enums<enums> = Partial<Pick<enums, keyof enums>>;
/** Callable accepts either form of a [function] interface. */
type Callable<iface> = iface | Extract<iface[keyof iface], Function>
type Callable<iface> = iface | Extract<iface[keyof iface], Function>;
export {};

File diff suppressed because it is too large Load diff

View file

@ -5,41 +5,40 @@
*/
declare global {
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIGNOMEShellService.idl
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIGNOMEShellService.idl
interface nsIGNOMEShellService extends nsIShellService {
interface nsIGNOMEShellService extends nsIShellService {
readonly canSetDesktopBackground: boolean;
isDefaultForScheme(aScheme: string): boolean;
}
}
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIOpenTabsProvider.idl
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIOpenTabsProvider.idl
interface nsIOpenTabsProvider extends nsISupports {
interface nsIOpenTabsProvider extends nsISupports {
getOpenTabs(): string[];
switchToOpenTab(url: string): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIApplicationChooser.idl
// https://searchfox.org/mozilla-central/source/widget/nsIApplicationChooser.idl
type nsIApplicationChooserFinishedCallback = Callable<{
type nsIApplicationChooserFinishedCallback = Callable<{
done(handlerApp: nsIHandlerApp): void;
}>
}>;
interface nsIApplicationChooser extends nsISupports {
interface nsIApplicationChooser extends nsISupports {
init(parent: mozIDOMWindowProxy, title: string): void;
open(contentType: string, applicationChooserFinishedCallback: nsIApplicationChooserFinishedCallback): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIGtkTaskbarProgress.idl
// https://searchfox.org/mozilla-central/source/widget/nsIGtkTaskbarProgress.idl
interface nsIGtkTaskbarProgress extends nsITaskbarProgress {
interface nsIGtkTaskbarProgress extends nsITaskbarProgress {
setPrimaryWindow(aWindow: mozIDOMWindowProxy): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarProgress.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarProgress.idl
interface nsITaskbarProgress extends nsISupports {
interface nsITaskbarProgress extends nsISupports {
readonly STATE_NO_PROGRESS?: 0;
readonly STATE_INDETERMINATE?: 1;
readonly STATE_NORMAL?: 2;
@ -47,17 +46,16 @@ interface nsITaskbarProgress extends nsISupports {
readonly STATE_PAUSED?: 4;
setProgressState(state: nsTaskbarProgressState, currentValue?: u64, maxValue?: u64): void;
}
}
interface nsIXPCComponents_Interfaces {
interface nsIXPCComponents_Interfaces {
nsIGNOMEShellService: nsJSIID<nsIGNOMEShellService>;
nsIOpenTabsProvider: nsJSIID<nsIOpenTabsProvider>;
nsIApplicationChooserFinishedCallback: nsJSIID<nsIApplicationChooserFinishedCallback>;
nsIApplicationChooser: nsJSIID<nsIApplicationChooser>;
nsIGtkTaskbarProgress: nsJSIID<nsIGtkTaskbarProgress>;
nsITaskbarProgress: nsJSIID<nsITaskbarProgress>;
}
}
} // global
// Typedefs from xpidl.
@ -77,6 +75,6 @@ type OutParam<T> = { value?: T };
type Enums<enums> = Partial<Pick<enums, keyof enums>>;
/** Callable accepts either form of a [function] interface. */
type Callable<iface> = iface | Extract<iface[keyof iface], Function>
type Callable<iface> = iface | Extract<iface[keyof iface], Function>;
export {};

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,6 @@
*/
interface nsIXPCComponents_Results {
// Error Message definitions.
// xpconnect specific codes (from nsIXPConnect.h)

View file

@ -17,21 +17,21 @@ interface ChromeWindow extends Window {
}
interface Document {
createXULElement(name: "browser"): XULBrowserElement;
createXULElement(name: 'browser'): XULBrowserElement;
}
type nsIGleanPingNoReason = {
[K in keyof nsIGleanPing]: K extends "submit" ? (_?: never) => void : nsIGleanPing[K];
}
[K in keyof nsIGleanPing]: K extends 'submit' ? (_?: never) => void : nsIGleanPing[K];
};
type nsIGleanPingWithReason<T> = {
[K in keyof nsIGleanPing]: K extends "submit" ? (reason: T) => void : nsIGleanPing[K];
}
[K in keyof nsIGleanPing]: K extends 'submit' ? (reason: T) => void : nsIGleanPing[K];
};
interface MessageListenerManagerMixin {
// Overloads that define `data` arg as required, since it's ~always expected.
addMessageListener(msg: string, listener: { receiveMessage(_: ReceiveMessageArgument & { data })});
removeMessageListener(msg: string, listener: { receiveMessage(_: ReceiveMessageArgument & { data })});
addMessageListener(msg: string, listener: { receiveMessage(_: ReceiveMessageArgument & { data }) });
removeMessageListener(msg: string, listener: { receiveMessage(_: ReceiveMessageArgument & { data }) });
}
interface MozQueryInterface {
@ -52,31 +52,30 @@ interface nsISupports {
}
interface nsIXPCComponents_Constructor {
<const T, IIDs = nsIXPCComponents_Interfaces>(cid, id: T, init?): {
<const T, IIDs = nsIXPCComponents_Interfaces>(
cid,
id: T,
init?
): {
new (...any): nsQIResult<T extends keyof IIDs ? IIDs[T] : T>;
(...any): nsQIResult<T extends keyof IIDs ? IIDs[T] : T>;
}
};
}
interface ComponentsExceptionOptions {
result?: number,
stack?: nsIStackFrame,
data?: object,
result?: number;
stack?: nsIStackFrame;
data?: object;
}
interface nsIException extends Exception {}
interface nsIXPCComponents_Exception {
(
message?: string,
resultOrOptions?: number | ComponentsExceptionOptions,
stack?: nsIStackFrame,
data?: object
): nsIException;
(message?: string, resultOrOptions?: number | ComponentsExceptionOptions, stack?: nsIStackFrame, data?: object): nsIException;
}
interface nsIXPCComponents_ID {
(uuid: string): nsID
(uuid: string): nsID;
}
interface nsIXPCComponents_utils_Sandbox {
@ -87,7 +86,7 @@ interface nsXPCComponents_Classes {
[cid: string]: {
createInstance<T>(aID: T): nsQIResult<T>;
getService<T>(aID?: T): unknown extends T ? nsISupports : nsQIResult<T>;
}
};
}
// Generic overloads.

View file

@ -5,15 +5,14 @@
*/
declare global {
// https://searchfox.org/mozilla-central/source/toolkit/components/aboutthirdparty/nsIAboutThirdParty.idl
// https://searchfox.org/mozilla-central/source/toolkit/components/aboutthirdparty/nsIAboutThirdParty.idl
interface nsIInstalledApplication extends nsISupports {
interface nsIInstalledApplication extends nsISupports {
readonly name: string;
readonly publisher: string;
}
}
interface nsIAboutThirdParty extends nsISupports {
interface nsIAboutThirdParty extends nsISupports {
readonly ModuleType_Unknown?: 1;
readonly ModuleType_IME?: 2;
readonly ModuleType_ShellExtension?: 4;
@ -27,16 +26,15 @@ interface nsIAboutThirdParty extends nsISupports {
updateBlocklist(aLeafName: string, aNewBlockStatus: boolean): Promise<any>;
collectSystemInfo(): Promise<any>;
loadModuleForTesting(aModulePath: string): void;
}
}
// https://searchfox.org/mozilla-central/source/toolkit/components/aboutwindowsmessages/nsIAboutWindowsMessages.idl
// https://searchfox.org/mozilla-central/source/toolkit/components/aboutwindowsmessages/nsIAboutWindowsMessages.idl
interface nsIAboutWindowsMessages extends nsISupports {
interface nsIAboutWindowsMessages extends nsISupports {
getMessages(currentWindow: mozIDOMWindowProxy, messages: OutParam<string[][]>, windowTitles: OutParam<string[]>): void;
}
// https://searchfox.org/mozilla-central/source/toolkit/components/alerts/nsIWindowsAlertsService.idl
}
// https://searchfox.org/mozilla-central/source/toolkit/components/alerts/nsIWindowsAlertsService.idl
} // global
declare enum nsIWindowsAlertNotification_ImagePlacement {
@ -46,24 +44,23 @@ declare enum nsIWindowsAlertNotification_ImagePlacement {
}
declare global {
namespace nsIWindowsAlertNotification {
namespace nsIWindowsAlertNotification {
type ImagePlacement = nsIWindowsAlertNotification_ImagePlacement;
}
}
interface nsIWindowsAlertNotification extends nsIAlertNotification, Enums<typeof nsIWindowsAlertNotification_ImagePlacement> {
interface nsIWindowsAlertNotification extends nsIAlertNotification, Enums<typeof nsIWindowsAlertNotification_ImagePlacement> {
imagePlacement: nsIWindowsAlertNotification.ImagePlacement;
}
}
interface nsIWindowsAlertsService extends nsIAlertsService {
interface nsIWindowsAlertsService extends nsIAlertsService {
handleWindowsTag(aWindowsTag: string): Promise<any>;
getXmlStringForWindowsAlert(aAlert: nsIAlertNotification, aWindowsTag?: string): string;
removeAllNotificationsForInstall(): void;
}
}
// https://searchfox.org/mozilla-central/source/toolkit/mozapps/defaultagent/nsIDefaultAgent.idl
// https://searchfox.org/mozilla-central/source/toolkit/mozapps/defaultagent/nsIDefaultAgent.idl
interface nsIDefaultAgent extends nsISupports {
interface nsIDefaultAgent extends nsISupports {
registerTask(aUniqueToken: string): void;
updateTask(aUniqueToken: string): void;
unregisterTask(aUniqueToken: string): void;
@ -72,35 +69,41 @@ interface nsIDefaultAgent extends nsISupports {
getDefaultBrowser(): string;
getReplacePreviousDefaultBrowser(aCurrentBrowser: string): string;
getDefaultPdfHandler(): string;
sendPing(aCurrentBrowser: string, aPreviousBrowser: string, aPdfHandler: string, aNotificationShown: string, aNotificationAction: string, daysSinceLastAppLaunch: u32): void;
sendPing(
aCurrentBrowser: string,
aPreviousBrowser: string,
aPdfHandler: string,
aNotificationShown: string,
aNotificationAction: string,
daysSinceLastAppLaunch: u32
): void;
setDefaultBrowserUserChoice(aAumid: string, aExtraFileExtensions: string[]): void;
setDefaultBrowserUserChoiceAsync(aAumid: string, aExtraFileExtensions: string[]): Promise<any>;
setDefaultExtensionHandlersUserChoice(aAumid: string, aFileExtensions: string[]): void;
agentDisabled(): boolean;
}
}
// https://searchfox.org/mozilla-central/source/toolkit/mozapps/defaultagent/nsIWindowsMutex.idl
// https://searchfox.org/mozilla-central/source/toolkit/mozapps/defaultagent/nsIWindowsMutex.idl
interface nsIWindowsMutex extends nsISupports {
interface nsIWindowsMutex extends nsISupports {
tryLock(): void;
isLocked(): boolean;
unlock(): void;
}
}
interface nsIWindowsMutexFactory extends nsISupports {
interface nsIWindowsMutexFactory extends nsISupports {
createMutex(aName: string): nsIWindowsMutex;
}
}
// https://searchfox.org/mozilla-central/source/dom/geolocation/nsIGeolocationUIUtilsWin.idl
// https://searchfox.org/mozilla-central/source/dom/geolocation/nsIGeolocationUIUtilsWin.idl
interface nsIGeolocationUIUtilsWin extends nsISupports {
interface nsIGeolocationUIUtilsWin extends nsISupports {
dismissPrompts(aBC: BrowsingContext): void;
}
}
// https://searchfox.org/mozilla-central/source/netwerk/socket/nsINamedPipeService.idl
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIWindowsShellService.idl
// https://searchfox.org/mozilla-central/source/netwerk/socket/nsINamedPipeService.idl
// https://searchfox.org/mozilla-central/source/browser/components/shell/nsIWindowsShellService.idl
} // global
declare enum nsIWindowsShellService_LaunchOnLoginEnabledEnumerator {
@ -111,13 +114,23 @@ declare enum nsIWindowsShellService_LaunchOnLoginEnabledEnumerator {
}
declare global {
namespace nsIWindowsShellService {
namespace nsIWindowsShellService {
type LaunchOnLoginEnabledEnumerator = nsIWindowsShellService_LaunchOnLoginEnabledEnumerator;
}
}
interface nsIWindowsShellService extends nsIShellService, Enums<typeof nsIWindowsShellService_LaunchOnLoginEnabledEnumerator> {
createShortcut(aBinary: nsIFile, aArguments: string[], aDescription: string, aIconFile: nsIFile, aIconIndex: u16, aAppUserModelId: string, aShortcutFolder: string, aShortcutName: string): Promise<any>;
interface nsIWindowsShellService
extends nsIShellService,
Enums<typeof nsIWindowsShellService_LaunchOnLoginEnabledEnumerator> {
createShortcut(
aBinary: nsIFile,
aArguments: string[],
aDescription: string,
aIconFile: nsIFile,
aIconIndex: u16,
aAppUserModelId: string,
aShortcutFolder: string,
aShortcutName: string
): Promise<any>;
getLaunchOnLoginShortcuts(): string[];
pinCurrentAppToStartMenuAsync(aCheckOnly: boolean): Promise<any>;
isCurrentAppPinnedToStartMenuAsync(): Promise<any>;
@ -139,11 +152,11 @@ interface nsIWindowsShellService extends nsIShellService, Enums<typeof nsIWindow
checkBrowserUserChoiceHashes(): boolean;
isDefaultHandlerFor(aFileExtensionOrProtocol: string): boolean;
queryCurrentDefaultHandlerFor(aFileExtensionOrProtocol: string): string;
}
}
// https://searchfox.org/mozilla-central/source/toolkit/components/taskscheduler/nsIWinTaskSchedulerService.idl
// https://searchfox.org/mozilla-central/source/toolkit/components/taskscheduler/nsIWinTaskSchedulerService.idl
interface nsIWinTaskSchedulerService extends nsISupports {
interface nsIWinTaskSchedulerService extends nsISupports {
registerTask(aFolderName: string, aTaskName: string, aDefinitionXML: string, aUpdateExisting?: boolean): void;
validateTaskDefinition(aDefinitionXML: string): i32;
getTaskXML(aFolderName: string, aTaskName: string): string;
@ -152,55 +165,55 @@ interface nsIWinTaskSchedulerService extends nsISupports {
getFolderTasks(aFolderName: string): string[];
createFolder(aParentFolderName: string, aSubFolderName: string): void;
deleteFolder(aParentFolderName: string, aSubFolderName: string): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIJumpListBuilder.idl
// https://searchfox.org/mozilla-central/source/widget/nsIJumpListBuilder.idl
interface nsIJumpListBuilder extends nsISupports {
interface nsIJumpListBuilder extends nsISupports {
obtainAndCacheFavicon(faviconURL: nsIURI): string;
obtainAndCacheFaviconAsync(faviconURL: nsIURI): Promise<any>;
isAvailable(): Promise<any>;
checkForRemovals(): Promise<any>;
populateJumpList(aTaskDescriptions: any, aCustomTitle: string, aCustomDescriptions: any): Promise<any>;
clearJumpList(): Promise<any>;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIPrintSettingsWin.idl
// https://searchfox.org/mozilla-central/source/widget/nsIPrintSettingsWin.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarOverlayIconController.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarOverlayIconController.idl
interface nsITaskbarOverlayIconController extends nsISupports {
interface nsITaskbarOverlayIconController extends nsISupports {
setOverlayIcon(statusIcon: imgIContainer, statusDescription: string, paintContext?: nsISVGPaintContext): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreview.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreview.idl
interface nsITaskbarPreview extends nsISupports {
interface nsITaskbarPreview extends nsISupports {
controller: nsITaskbarPreviewController;
tooltip: string;
visible: boolean;
active: boolean;
invalidate(): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreviewButton.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreviewButton.idl
interface nsITaskbarPreviewButton extends nsISupports {
interface nsITaskbarPreviewButton extends nsISupports {
tooltip: string;
dismissOnClick: boolean;
hasBorder: boolean;
disabled: boolean;
image: imgIContainer;
visible: boolean;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreviewController.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarPreviewController.idl
type nsITaskbarPreviewCallback = Callable<{
type nsITaskbarPreviewCallback = Callable<{
done(aCanvas: nsISupports, aDrawBorder: boolean): void;
}>
}>;
interface nsITaskbarPreviewController extends nsISupports {
interface nsITaskbarPreviewController extends nsISupports {
readonly width: u32;
readonly height: u32;
readonly thumbnailAspectRatio: float;
@ -209,11 +222,11 @@ interface nsITaskbarPreviewController extends nsISupports {
onClose(): void;
onActivate(): boolean;
onClick(button: nsITaskbarPreviewButton): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarProgress.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarProgress.idl
interface nsITaskbarProgress extends nsISupports {
interface nsITaskbarProgress extends nsISupports {
readonly STATE_NO_PROGRESS?: 0;
readonly STATE_INDETERMINATE?: 1;
readonly STATE_NORMAL?: 2;
@ -221,28 +234,28 @@ interface nsITaskbarProgress extends nsISupports {
readonly STATE_PAUSED?: 4;
setProgressState(state: nsTaskbarProgressState, currentValue?: u64, maxValue?: u64): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarTabPreview.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarTabPreview.idl
interface nsITaskbarTabPreview extends nsITaskbarPreview {
interface nsITaskbarTabPreview extends nsITaskbarPreview {
title: string;
icon: imgIContainer;
move(aNext: nsITaskbarTabPreview): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarWindowPreview.idl
// https://searchfox.org/mozilla-central/source/widget/nsITaskbarWindowPreview.idl
interface nsITaskbarWindowPreview extends nsITaskbarPreview {
interface nsITaskbarWindowPreview extends nsITaskbarPreview {
readonly NUM_TOOLBAR_BUTTONS?: 7;
getButton(index: u32): nsITaskbarPreviewButton;
enableCustomDrawing: boolean;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIWinTaskbar.idl
// https://searchfox.org/mozilla-central/source/widget/nsIWinTaskbar.idl
interface nsIWinTaskbar extends nsISupports {
interface nsIWinTaskbar extends nsISupports {
readonly available: boolean;
readonly defaultGroupId: string;
readonly defaultPrivateGroupId: string;
@ -253,11 +266,11 @@ interface nsIWinTaskbar extends nsISupports {
createJumpListBuilder(aPrivateBrowsing: boolean): nsIJumpListBuilder;
getGroupIdForWindow(aParent: mozIDOMWindow): string;
setGroupIdForWindow(aParent: mozIDOMWindow, aIdentifier: string): void;
}
}
// https://searchfox.org/mozilla-central/source/widget/nsIWindowsUIUtils.idl
// https://searchfox.org/mozilla-central/source/widget/nsIWindowsUIUtils.idl
interface nsIWindowsUIUtils extends nsISupports {
interface nsIWindowsUIUtils extends nsISupports {
readonly systemSmallIconSize: i32;
readonly systemLargeIconSize: i32;
setWindowIcon(aWindow: mozIDOMWindowProxy, aSmallIcon: imgIContainer, aLargeIcon: imgIContainer): void;
@ -266,19 +279,19 @@ interface nsIWindowsUIUtils extends nsISupports {
readonly inWin10TabletMode: boolean;
readonly inWin11TabletMode: boolean;
shareUrl(shareTitle: string, urlToShare: string): void;
}
}
// https://searchfox.org/mozilla-central/source/toolkit/system/windowsPackageManager/nsIWindowsPackageManager.idl
// https://searchfox.org/mozilla-central/source/toolkit/system/windowsPackageManager/nsIWindowsPackageManager.idl
interface nsIWindowsPackageManager extends nsISupports {
interface nsIWindowsPackageManager extends nsISupports {
findUserInstalledPackages(prefix: string[]): string[];
getInstalledDate(): u64;
campaignId(): Promise<any>;
}
}
// https://searchfox.org/mozilla-central/source/xpcom/ds/nsIWindowsRegKey.idl
// https://searchfox.org/mozilla-central/source/xpcom/ds/nsIWindowsRegKey.idl
interface nsIWindowsRegKey extends nsISupports {
interface nsIWindowsRegKey extends nsISupports {
readonly ROOT_KEY_CLASSES_ROOT?: 2147483648;
readonly ROOT_KEY_CURRENT_USER?: 2147483649;
readonly ROOT_KEY_LOCAL_MACHINE?: 2147483650;
@ -321,15 +334,15 @@ interface nsIWindowsRegKey extends nsISupports {
writeIntValue(name: string, data: u32): void;
writeInt64Value(name: string, data: u64): void;
writeBinaryValue(name: string, data: string): void;
}
}
// https://searchfox.org/mozilla-central/source/toolkit/xre/nsIWinAppHelper.idl
// https://searchfox.org/mozilla-central/source/toolkit/xre/nsIWinAppHelper.idl
interface nsIWinAppHelper extends nsISupports {
interface nsIWinAppHelper extends nsISupports {
readonly userCanElevate: boolean;
}
}
interface nsIXPCComponents_Interfaces {
interface nsIXPCComponents_Interfaces {
nsIInstalledApplication: nsJSIID<nsIInstalledApplication>;
nsIAboutThirdParty: nsJSIID<nsIAboutThirdParty>;
nsIAboutWindowsMessages: nsJSIID<nsIAboutWindowsMessages>;
@ -355,8 +368,7 @@ interface nsIXPCComponents_Interfaces {
nsIWindowsPackageManager: nsJSIID<nsIWindowsPackageManager>;
nsIWindowsRegKey: nsJSIID<nsIWindowsRegKey>;
nsIWinAppHelper: nsJSIID<nsIWinAppHelper>;
}
}
} // global
// Typedefs from xpidl.
@ -375,6 +387,6 @@ type OutParam<T> = { value?: T };
type Enums<enums> = Partial<Pick<enums, keyof enums>>;
/** Callable accepts either form of a [function] interface. */
type Callable<iface> = iface | Extract<iface[keyof iface], Function>
type Callable<iface> = iface | Extract<iface[keyof iface], Function>;
export {};

File diff suppressed because it is too large Load diff

View file

@ -15,10 +15,12 @@ interface nsID<uuid = string> {
* and expose constants defined on the class, including variants from enums.
* https://searchfox.org/mozilla-central/source/js/xpconnect/src/XPCJSID.cpp#45
*/
type nsJSIID<iface, enums = {}> = nsID & Constants<iface> & enums & {
type nsJSIID<iface, enums = {}> = nsID &
Constants<iface> &
enums & {
new (_: never): void;
prototype: iface;
}
};
/** A union type of all known interface IIDs. */
type nsIID = nsIXPCComponents_Interfaces[keyof nsIXPCComponents_Interfaces];