@types/chrome 0.0.249 → 0.0.251

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +112 -4
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (http://developer.chrome.com/e
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 06 Nov 2023 04:17:54 GMT
11
+ * Last updated: Thu, 09 Nov 2023 17:36:25 GMT
12
12
  * Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
13
13
 
14
14
  # Credits
chrome/index.d.ts CHANGED
@@ -12565,31 +12565,139 @@ declare namespace chrome.declarativeNetRequest {
12565
12565
  */
12566
12566
  declare namespace chrome.sidePanel {
12567
12567
  export interface GetPanelOptions {
12568
+ /**
12569
+ * If specified, the side panel options for the given tab will be returned.
12570
+ * Otherwise, returns the default side panel options (used for any tab that doesn't have specific settings).
12571
+ */
12568
12572
  tabId?: number;
12569
12573
  }
12570
12574
 
12575
+ /**
12576
+ * @since Chrome 116
12577
+ */
12578
+ export type OpenOptions =
12579
+ & {
12580
+ /** The tab in which to open the side panel.
12581
+ * If the corresponding tab has a tab-specific side panel, the panel will only be open for that tab.
12582
+ * If there is not a tab-specific panel, the global panel will be open in the specified tab and any other tabs without a currently-open tab- specific panel.
12583
+ * This will override any currently-active side panel (global or tab-specific) in the corresponding tab.
12584
+ * At least one of this and windowId must be provided. */
12585
+ tabId?: number;
12586
+ /**
12587
+ * The window in which to open the side panel.
12588
+ * This is only applicable if the extension has a global (non-tab-specific) side panel or tabId is also specified.
12589
+ * This will override any currently-active global side panel the user has open in the given window.
12590
+ * At least one of this and tabId must be provided.
12591
+ */
12592
+ windowId?: number;
12593
+ }
12594
+ & ({
12595
+ tabId: number;
12596
+ } | {
12597
+ windowId: number;
12598
+ });
12599
+
12571
12600
  export interface PanelBehavior {
12601
+ /** Whether clicking the extension's icon will toggle showing the extension's entry in the side panel. Defaults to false. */
12572
12602
  openPanelOnActionClick?: boolean;
12573
12603
  }
12574
12604
 
12575
12605
  export interface PanelOptions {
12606
+ /** Whether the side panel should be enabled. This is optional. The default value is true. */
12576
12607
  enabled?: boolean;
12608
+ /** The path to the side panel HTML file to use. This must be a local resource within the extension package. */
12577
12609
  path?: string;
12610
+ /**
12611
+ * If specified, the side panel options will only apply to the tab with this id.
12612
+ * If omitted, these options set the default behavior (used for any tab that doesn't have specific settings).
12613
+ * Note: if the same path is set for this tabId and the default tabId, then the panel for this tabId will be a different instance than the panel for the default tabId.
12614
+ */
12578
12615
  tabId?: number;
12579
12616
  }
12580
12617
 
12581
12618
  export interface SidePanel {
12619
+ /** Developer specified path for side panel display. */
12582
12620
  default_path: string;
12583
12621
  }
12584
12622
 
12623
+ /**
12624
+ * Returns the active panel configuration.
12625
+ * Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility.
12626
+ * You cannot use both on the same function call.
12627
+ * The promise resolves with the same type that is passed to the callback.
12628
+ */
12629
+ export function getOptions(
12630
+ /** Specifies the context to return the configuration for. */
12631
+ options: GetPanelOptions,
12632
+ callback: (options: PanelOptions) => void,
12633
+ ): void;
12634
+
12585
12635
  export function getOptions(
12636
+ /** Specifies the context to return the configuration for. */
12586
12637
  options: GetPanelOptions,
12587
- callback?: (options: PanelOptions) => void,
12588
12638
  ): Promise<PanelOptions>;
12589
12639
 
12590
- export function getPanelBehavior(callback?: (behavior: PanelBehavior) => void): Promise<PanelBehavior>;
12640
+ /**
12641
+ * Returns the extension's current side panel behavior.
12642
+ * Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility.
12643
+ * You cannot use both on the same function call.
12644
+ * The promise resolves with the same type that is passed to the callback.
12645
+ */
12646
+ export function getPanelBehavior(
12647
+ callback: (behavior: PanelBehavior) => void,
12648
+ ): void;
12649
+
12650
+ export function getPanelBehavior(): Promise<PanelBehavior>;
12651
+
12652
+ /**
12653
+ * @since Chrome 116
12654
+ * Opens the side panel for the extension. This may only be called in response to a user action.
12655
+ * Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility.
12656
+ * You cannot use both on the same function call.
12657
+ * The promise resolves with the same type that is passed to the callback.
12658
+ */
12659
+ export function open(
12660
+ /** Specifies the context in which to open the side panel. */
12661
+ options: OpenOptions,
12662
+ callback: () => void,
12663
+ ): void;
12664
+
12665
+ export function open(
12666
+ /** Specifies the context in which to open the side panel. */
12667
+ options: OpenOptions,
12668
+ ): Promise<void>;
12591
12669
 
12592
- export function setOptions(options: PanelOptions, callback?: () => void): Promise<void>;
12670
+ /**
12671
+ * Configures the side panel.
12672
+ * Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility.
12673
+ * You cannot use both on the same function call.
12674
+ * The promise resolves with the same type that is passed to the callback.
12675
+ */
12676
+ export function setOptions(
12677
+ /** The configuration options to apply to the panel. */
12678
+ options: PanelOptions,
12679
+ callback: () => void,
12680
+ ): void;
12681
+
12682
+ export function setOptions(
12683
+ /** The configuration options to apply to the panel. */
12684
+ options: PanelOptions,
12685
+ ): Promise<void>;
12686
+
12687
+ /**
12688
+ * Configures the extension's side panel behavior. This is an upsert operation.
12689
+ * Promises are supported in Manifest V3 and later, but callbacks are provided for backward compatibility.
12690
+ * You cannot use both on the same function call.
12691
+ * The promise resolves with the same type that is passed to the callback.
12692
+ */
12693
+ export function setPanelBehavior(
12694
+ /** The new behavior to be set. */
12695
+ behavior: PanelBehavior,
12696
+ callback: () => void,
12697
+ ): void;
12593
12698
 
12594
- export function setPanelBehavior(behavior: PanelBehavior, callback?: () => void): Promise<void>;
12699
+ export function setPanelBehavior(
12700
+ /** The new behavior to be set. */
12701
+ behavior: PanelBehavior,
12702
+ ): Promise<void>;
12595
12703
  }
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.249",
3
+ "version": "0.0.251",
4
4
  "description": "TypeScript definitions for chrome",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -93,6 +93,6 @@
93
93
  "@types/filesystem": "*",
94
94
  "@types/har-format": "*"
95
95
  },
96
- "typesPublisherContentHash": "959c4fddc2ba530d4e6fb5827335ea056d9a7ca9143041ebf421f18168571d16",
96
+ "typesPublisherContentHash": "c573dbaafc6ec5b81d1e2706b1c732aaeb55cf9541939c5ff4ea29c521af1abb",
97
97
  "typeScriptVersion": "4.5"
98
98
  }