@types/chrome 0.0.291 → 0.0.292

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +22 -22
  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: Wed, 08 Jan 2025 18:02:30 GMT
11
+ * Last updated: Thu, 09 Jan 2025 11:32:09 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
@@ -1980,25 +1980,7 @@ declare namespace chrome {
1980
1980
  visible?: boolean | undefined;
1981
1981
  }
1982
1982
 
1983
- export interface UpdateProperties {
1984
- documentUrlPatterns?: string[] | undefined;
1985
- checked?: boolean | undefined;
1986
- title?: string | undefined;
1987
- contexts?: ContextType[] | undefined;
1988
- /** Optional. @since Chrome 20 */
1989
- enabled?: boolean | undefined;
1990
- targetUrlPatterns?: string[] | undefined;
1991
- onclick?: Function | undefined;
1992
- /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */
1993
- parentId?: number | string;
1994
- type?: ContextItemType | undefined;
1995
- /**
1996
- * Optional.
1997
- * @since Chrome 62
1998
- * Whether the item is visible in the menu.
1999
- */
2000
- visible?: boolean | undefined;
2001
- }
1983
+ export interface UpdateProperties extends Omit<CreateProperties, "id"> {}
2002
1984
 
2003
1985
  export interface MenuClickedEvent
2004
1986
  extends chrome.events.Event<(info: OnClickData, tab?: chrome.tabs.Tab) => void>
@@ -2010,30 +1992,48 @@ declare namespace chrome {
2010
1992
  */
2011
1993
  export var ACTION_MENU_TOP_LEVEL_LIMIT: number;
2012
1994
 
1995
+ /**
1996
+ * Removes all context menu items added by this extension.
1997
+ * @since Chrome 123
1998
+ */
1999
+ export function removeAll(): Promise<void>;
2013
2000
  /**
2014
2001
  * Removes all context menu items added by this extension.
2015
2002
  * @param callback Called when removal is complete.
2016
2003
  */
2017
- export function removeAll(callback?: () => void): void;
2004
+ export function removeAll(callback: () => void): void;
2018
2005
  /**
2019
2006
  * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).
2020
2007
  * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.
2021
2008
  * @return The ID of the newly created item.
2022
2009
  */
2023
2010
  export function create(createProperties: CreateProperties, callback?: () => void): number | string;
2011
+ /**
2012
+ * Updates a previously created context menu item.
2013
+ * @param id The ID of the item to update.
2014
+ * @param updateProperties The properties to update. Accepts the same values as the create function.
2015
+ * @since Chrome 123
2016
+ */
2017
+ export function update(id: string | number, updateProperties: UpdateProperties): Promise<void>;
2024
2018
  /**
2025
2019
  * Updates a previously created context menu item.
2026
2020
  * @param id The ID of the item to update.
2027
2021
  * @param updateProperties The properties to update. Accepts the same values as the create function.
2028
2022
  * @param callback Called when the context menu has been updated.
2029
2023
  */
2030
- export function update(id: string | number, updateProperties: UpdateProperties, callback?: () => void): void;
2024
+ export function update(id: string | number, updateProperties: UpdateProperties, callback: () => void): void;
2025
+ /**
2026
+ * Removes a context menu item.
2027
+ * @param menuItemId The ID of the context menu item to remove.
2028
+ * @since Chrome 123
2029
+ */
2030
+ export function remove(menuItemId: string | number): Promise<void>;
2031
2031
  /**
2032
2032
  * Removes a context menu item.
2033
2033
  * @param menuItemId The ID of the context menu item to remove.
2034
2034
  * @param callback Called when the context menu has been removed.
2035
2035
  */
2036
- export function remove(menuItemId: string | number, callback?: () => void): void;
2036
+ export function remove(menuItemId: string | number, callback: () => void): void;
2037
2037
 
2038
2038
  /**
2039
2039
  * @since Chrome 21
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.291",
3
+ "version": "0.0.292",
4
4
  "description": "TypeScript definitions for chrome",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -94,6 +94,6 @@
94
94
  "@types/har-format": "*"
95
95
  },
96
96
  "peerDependencies": {},
97
- "typesPublisherContentHash": "dbf0463e5c551f12fa07437137f3aaf7830c2e455201602adbe89debf1dcf956",
97
+ "typesPublisherContentHash": "c9e6e484c7b9d829b6fb4d49fb96f93c498543d00292b15cc9072e938ee5b698",
98
98
  "typeScriptVersion": "5.0"
99
99
  }