Skip to content

Commit

Permalink
adding dprint for DefinitelyTyped
Browse files Browse the repository at this point in the history
  • Loading branch information
Lusito committed Jun 1, 2024
1 parent f06859b commit b6e8bd1
Show file tree
Hide file tree
Showing 27 changed files with 241 additions and 45 deletions.
23 changes: 23 additions & 0 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"prettier": {
"associations": [
"**/*.{yaml,yml}"
],
"yml.tabWidth": 2,
"yaml.tabWidth": 2,
"yml.singleQuote": true,
"yaml.singleQuote": true
},
// NOTE: if extending this list, also update settings.template.json.
"plugins": [
"https://plugins.dprint.dev/typescript-0.89.3.wasm",
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.16.4.wasm",
"https://plugins.dprint.dev/prettier-0.39.0.json@896b70f29ef8213c1b0ba81a93cee9c2d4f39ac2194040313cd433906db7bc7c"
],
"indentWidth": 4,
"lineWidth": 120,
"json": {
"trailingCommas": "never" // Our tsconfig files must be parsable by JSON.parse.
}
}
9 changes: 2 additions & 7 deletions out/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
// Project: https://github.com/mozilla/webextension-polyfill
// Definitions by: Santo Pfingsten <https://github.com/Lusito>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Generated using https://github.com/Lusito/webextension-polyfill-ts

//////////////////////////////////////////////////////
// BEWARE: DO NOT EDIT MANUALLY! Changes will be lost!
//////////////////////////////////////////////////////

import { Action as ImportedAction } from "./namespaces/action";
import { ActivityLog as ImportedActivityLog } from "./namespaces/activityLog";
import { Alarms as ImportedAlarms } from "./namespaces/alarms";
import { Bookmarks as ImportedBookmarks } from "./namespaces/bookmarks";
import { Action as ImportedAction } from "./namespaces/action";
import { BrowserAction as ImportedBrowserAction } from "./namespaces/browserAction";
import { BrowserSettings as ImportedBrowserSettings } from "./namespaces/browserSettings";
import { BrowsingData as ImportedBrowsingData } from "./namespaces/browsingData";
import { CaptivePortal as ImportedCaptivePortal } from "./namespaces/captivePortal";
import { Clipboard as ImportedClipboard } from "./namespaces/clipboard";
import { Commands as ImportedCommands } from "./namespaces/commands";
import { ContentScripts as ImportedContentScripts } from "./namespaces/contentScripts";
import { ContextMenus as ImportedContextMenus } from "./namespaces/contextMenus";
import { ContextualIdentities as ImportedContextualIdentities } from "./namespaces/contextualIdentities";
import { Cookies as ImportedCookies } from "./namespaces/cookies";
import { DeclarativeContent as ImportedDeclarativeContent } from "./namespaces/declarativeContent";
Expand All @@ -37,7 +33,6 @@ import { Identity as ImportedIdentity } from "./namespaces/identity";
import { Idle as ImportedIdle } from "./namespaces/idle";
import { Management as ImportedManagement } from "./namespaces/management";
import { Manifest as ImportedManifest } from "./namespaces/manifest";
import { ContextMenus as ImportedContextMenus } from "./namespaces/contextMenus";
import { Menus as ImportedMenus } from "./namespaces/menus";
import { NetworkStatus as ImportedNetworkStatus } from "./namespaces/networkStatus";
import { NormandyAddonStudy as ImportedNormandyAddonStudy } from "./namespaces/normandyAddonStudy";
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/action.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* a browser action can also have a tooltip, a badge, and a popup.
* Permissions: "manifest:action", "manifest:browser_action"
*/
import { Tabs } from "./tabs";
import { Events } from "./events";
import { Tabs } from "./tabs";

export namespace Action {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/activityLog.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Monitor extension activity
* Permissions: "activityLog"
*/
import { ExtensionTypes } from "./extensionTypes";
import { Events } from "./events";
import { ExtensionTypes } from "./extensionTypes";

export namespace ActivityLog {
interface OnExtensionActivityDetailsType {
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/commands.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* an action to open the browser action or send a command to the xtension.
* Permissions: "manifest:commands"
*/
import { Tabs } from "./tabs";
import { Events } from "./events";
import { Tabs } from "./tabs";

export namespace Commands {
interface Command {
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/contentScripts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/**
* Namespace: browser.contentScripts
*/
import { Manifest } from "./manifest";
import { ExtensionTypes } from "./extensionTypes";
import { Manifest } from "./manifest";

export namespace ContentScripts {
/**
Expand Down
8 changes: 4 additions & 4 deletions out/namespaces/declarativeContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ export namespace DeclarativeContent {
}

interface Static {
PageStateMatcher: { new (options?: PageStateMatcher): PageStateMatcher };
PageStateMatcher: { new(options?: PageStateMatcher): PageStateMatcher };

ShowAction: { new (options?: ShowAction): ShowAction };
ShowAction: { new(options?: ShowAction): ShowAction };

SetIcon: { new (options?: SetIcon): SetIcon };
SetIcon: { new(options?: SetIcon): SetIcon };

RequestContentScript: { new (options?: RequestContentScript): RequestContentScript };
RequestContentScript: { new(options?: RequestContentScript): RequestContentScript };

onPageChanged: RuleEvent<PageStateMatcher, RequestContentScript | SetIcon | ShowPageAction | ShowAction>;
}
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/downloads.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*
* Permissions: "downloads"
*/
import { ExtensionTypes } from "./extensionTypes";
import { Events } from "./events";
import { ExtensionTypes } from "./extensionTypes";

export namespace Downloads {
type FilenameConflictAction = "uniquify" | "overwrite" | "prompt";
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/history.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* [Override Pages].
* Permissions: "history"
*/
import { ExtensionTypes } from "./extensionTypes";
import { Events } from "./events";
import { ExtensionTypes } from "./extensionTypes";

export namespace History {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/management.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*
* The <code>browser.management</code> API provides ways to manage the list of extensions that are installed and running.
*/
import { Manifest } from "./manifest";
import { Events } from "./events";
import { Manifest } from "./manifest";

export namespace Management {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/manifest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*
* Permissions: -
*/
import { ExtensionTypes } from "./extensionTypes";
import { Experiments } from "./experiments";
import { ExtensionTypes } from "./extensionTypes";

export namespace Manifest {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/menus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* additions apply to, such as images, hyperlinks, and pages.
* Permissions: "menus"
*/
import { Events } from "./events";
import { Extension } from "./extension";
import { Tabs } from "./tabs";
import { Events } from "./events";

export namespace Menus {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/normandyAddonStudy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Normandy Study API
* Permissions: "normandyAddonStudy"
*/
import { ExtensionTypes } from "./extensionTypes";
import { Events } from "./events";
import { ExtensionTypes } from "./extensionTypes";

export namespace NormandyAddonStudy {
interface Study {
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/pageAction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* be taken on the current page, but that aren't applicable to all pages.
* Permissions: "manifest:page_action"
*/
import { Tabs } from "./tabs";
import { Events } from "./events";
import { Tabs } from "./tabs";

export namespace PageAction {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/permissions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
/**
* Namespace: browser.permissions
*/
import { Manifest } from "./manifest";
import { Events } from "./events";
import { Manifest } from "./manifest";

export namespace Permissions {
interface Permissions {
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/proxy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* Provides access to global proxy settings for Firefox and proxy event listeners to handle dynamic proxy implementations.
* Permissions: "proxy"
*/
import { WebRequest } from "./webRequest";
import { Events } from "./events";
import { Types } from "./types";
import { WebRequest } from "./webRequest";

export namespace Proxy {
/**
Expand Down
4 changes: 2 additions & 2 deletions out/namespaces/runtime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the
* relative path of URLs to fully-qualified URLs.
*/
import { Tabs } from "./tabs";
import { Manifest } from "./manifest";
import { Events } from "./events";
import { Manifest } from "./manifest";
import { Tabs } from "./tabs";

export namespace Runtime {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/scripting.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Use the scripting API to execute script in different contexts.
* Permissions: "scripting"
*/
import { Manifest } from "./manifest";
import { ExtensionTypes } from "./extensionTypes";
import { Manifest } from "./manifest";

export namespace Scripting {
/**
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* Use the <code>chrome.sessions</code> API to query and restore tabs and windows from a browsing session.
* Permissions: "sessions"
*/
import { Events } from "./events";
import { Tabs } from "./tabs";
import { Windows } from "./windows";
import { Events } from "./events";

export namespace Sessions {
interface Filter {
Expand Down
7 changes: 4 additions & 3 deletions out/namespaces/tabs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
* Use the <code>browser.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify,
* and rearrange tabs in the browser.
*/
import { Events } from "./events";
import { ExtensionTypes } from "./extensionTypes";
import { Runtime } from "./runtime";
import { Windows } from "./windows";
import { ExtensionTypes } from "./extensionTypes";
import { Events } from "./events";

export namespace Tabs {
/**
Expand Down Expand Up @@ -1017,7 +1017,8 @@ export namespace Tabs {
* Fired when a tab is updated.
*/
interface onUpdatedEvent
extends Events.Event<(tabId: number, changeInfo: OnUpdatedChangeInfoType, tab: Tab) => void> {
extends Events.Event<(tabId: number, changeInfo: OnUpdatedChangeInfoType, tab: Tab) => void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*
* The theme API allows customizing of visual elements of the browser.
*/
import { Manifest } from "./manifest";
import { Events } from "./events";
import { Manifest } from "./manifest";

export namespace Theme {
/**
Expand Down
6 changes: 4 additions & 2 deletions out/namespaces/webNavigation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ export namespace WebNavigation {
* Fired when a new window, or a new tab in an existing window, is created to host a navigation.
*/
interface onCreatedNavigationTargetEvent
extends Events.Event<(details: OnCreatedNavigationTargetDetailsType) => void> {
extends Events.Event<(details: OnCreatedNavigationTargetDetailsType) => void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand All @@ -443,7 +444,8 @@ export namespace WebNavigation {
* Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.
*/
interface onReferenceFragmentUpdatedEvent
extends Events.Event<(details: OnReferenceFragmentUpdatedDetailsType) => void> {
extends Events.Event<(details: OnReferenceFragmentUpdatedDetailsType) => void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand Down
12 changes: 8 additions & 4 deletions out/namespaces/webRequest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,8 @@ export namespace WebRequest {
* Fired when a request is about to occur.
*/
interface onBeforeRequestEvent
extends Events.Event<(details: OnBeforeRequestDetailsType) => BlockingResponseOrPromise | void> {
extends Events.Event<(details: OnBeforeRequestDetailsType) => BlockingResponseOrPromise | void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand All @@ -1520,7 +1521,8 @@ export namespace WebRequest {
* made to the server, but before any HTTP data is sent.
*/
interface onBeforeSendHeadersEvent
extends Events.Event<(details: OnBeforeSendHeadersDetailsType) => BlockingResponseOrPromise | void> {
extends Events.Event<(details: OnBeforeSendHeadersDetailsType) => BlockingResponseOrPromise | void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand Down Expand Up @@ -1558,7 +1560,8 @@ export namespace WebRequest {
* Fired when HTTP response headers of a request have been received.
*/
interface onHeadersReceivedEvent
extends Events.Event<(details: OnHeadersReceivedDetailsType) => BlockingResponseOrPromise | void> {
extends Events.Event<(details: OnHeadersReceivedDetailsType) => BlockingResponseOrPromise | void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand All @@ -1579,7 +1582,8 @@ export namespace WebRequest {
* If bad user credentials are provided, this may be called multiple times for the same request.
*/
interface onAuthRequiredEvent
extends Events.Event<(details: OnAuthRequiredDetailsType) => BlockingResponseOrPromise | void> {
extends Events.Event<(details: OnAuthRequiredDetailsType) => BlockingResponseOrPromise | void>
{
/**
* Registers an event listener <em>callback</em> to an event.
*
Expand Down
2 changes: 1 addition & 1 deletion out/namespaces/windows.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Use the <code>browser.windows</code> API to interact with browser windows. You can use this API to create, modify,
* and rearrange windows in the browser.
*/
import { Tabs } from "./tabs";
import { Events } from "./events";
import { Tabs } from "./tabs";

export namespace Windows {
/**
Expand Down
Loading

0 comments on commit b6e8bd1

Please sign in to comment.