Skip to content

Commit

Permalink
🏷️ Fix types for nsIChannel, nsIRequest and nsIWebProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
kierandrewett committed Dec 16, 2023
1 parent c7cca98 commit 1b0996d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions base/content/browser-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class nsIXULBrowserWindow {

/**
* Fired when the state of the browser changes
* @param {nsIWebProgress} webProgress
* @param {nsIRequest} request
* @param {import("third_party/dothq/gecko-types/lib").nsIWebProgress} webProgress
* @param {import("third_party/dothq/gecko-types/lib").nsIRequest} request
* @param {number} stateFlags
* @param {number} status
*/
Expand Down Expand Up @@ -178,8 +178,8 @@ class nsIXULBrowserWindow {

/**
* Fired when the status of the browser changes
* @param {nsIWebProgress} webProgress
* @param {nsIRequest} request
* @param {import("third_party/dothq/gecko-types/lib").nsIWebProgress} webProgress
* @param {import("third_party/dothq/gecko-types/lib").nsIRequest} request
* @param {number} status
* @param {string} message
*/
Expand Down
4 changes: 2 additions & 2 deletions components/commands/TabCommand.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class TabCommand extends Command {
* Fired when the state changes the browser in context
* @param {object} data
* @param {ChromeBrowser} data.browser
* @param {nsIWebProgress} data.webProgress
* @param {nsIRequest} data.request
* @param {import("third_party/dothq/gecko-types/lib").nsIWebProgress} data.webProgress
* @param {import("third_party/dothq/gecko-types/lib").nsIRequest} data.request
* @param {number} data.stateFlags
* @param {string} data.status
*/
Expand Down
8 changes: 5 additions & 3 deletions components/commands/content/reload-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class ReloadTabCommand extends TabCommand {
* Fired when the state changes a browser
* @param {object} data
* @param {ChromeBrowser} data.browser
* @param {nsIWebProgress} data.webProgress
* @param {nsIRequest} data.request
* @param {import("third_party/dothq/gecko-types/lib").nsIWebProgress} data.webProgress
* @param {import("third_party/dothq/gecko-types/lib").nsIRequest} data.request
* @param {number} data.stateFlags
* @param {string} data.status
*/
Expand All @@ -67,7 +67,9 @@ export class ReloadTabCommand extends TabCommand {
Ci.nsIWebProgressListener;

const shouldShowProgress = BrowserTabsUtils.shouldShowProgress(
/** @type {nsIChannel} */ (request)
/** @type {import("third_party/dothq/gecko-types/lib").nsIChannel} */ (
request
)
);

this.isLoading =
Expand Down
4 changes: 2 additions & 2 deletions components/identity/TabIdentityHandler.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ export class TabIdentityHandler {
* Handles Gecko security change events from the browser
* @param {object} data
* @param {ChromeBrowser} data.browser
* @param {nsIWebProgress} data.webProgress
* @param {nsIRequest} data.request
* @param {import("third_party/dothq/gecko-types/lib").nsIWebProgress} data.webProgress
* @param {import("third_party/dothq/gecko-types/lib").nsIRequest} data.request
* @param {number} data.state
*/
onSecurityChange({ browser, webProgress, request, state }) {
Expand Down
2 changes: 2 additions & 0 deletions third_party/dothq/gecko-types/lib/NetUtil.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { nsIChannel } from ".";

export interface NetUtil {
newURI(target: any, originCharset?: string, baseURI?: nsIURI): nsIURI;
newChannel(whatToLoad: object): nsIChannel;
Expand Down
2 changes: 2 additions & 0 deletions third_party/dothq/gecko-types/lib/nsIAboutModule.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { nsIChannel } from ".";

export interface nsIAboutModule extends nsIChannel {
/**
* Constructs a new channel for the about protocol module.
Expand Down
1 change: 1 addition & 0 deletions third_party/dothq/gecko-types/lib/services/prompt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { BrowsingContext } from "../BrowsingContext";
import { nsIAuthInformation } from "../nsIAuthInformation";
import { nsIChannel } from "../nsIChannel";

export interface ServicesPrompt {
/**
Expand Down

0 comments on commit 1b0996d

Please sign in to comment.