@types/chrome 0.0.155 → 0.0.159

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 +32 -20
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Chrome extension development (http://
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Sat, 04 Sep 2021 00:01:23 GMT
11
+ * Last updated: Fri, 08 Oct 2021 16:31:22 GMT
12
12
  * Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
13
13
  * Global values: `chrome`
14
14
 
chrome/index.d.ts CHANGED
@@ -128,7 +128,7 @@ declare namespace chrome.action {
128
128
  popup: string;
129
129
  }
130
130
 
131
- export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {}
131
+ export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> { }
132
132
 
133
133
  export interface TabIconDetails {
134
134
  /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */
@@ -150,7 +150,7 @@ declare namespace chrome.action {
150
150
  * @param tabId The id of the tab for which you want to modify the action.
151
151
  * @return The `disable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
152
152
  */
153
- export function disable(tabId: number): Promise<void>;
153
+ export function disable(tabId?: number): Promise<void>;
154
154
 
155
155
  /**
156
156
  * Since Chrome 88.
@@ -158,7 +158,7 @@ declare namespace chrome.action {
158
158
  * @param tabId The id of the tab for which you want to modify the action.
159
159
  * @param callback
160
160
  */
161
- export function disable(tabId: number, callback?: () => void): void;
161
+ export function disable(tabId?: number, callback?: () => void): void;
162
162
 
163
163
  /**
164
164
  * Since Chrome 88.
@@ -166,7 +166,7 @@ declare namespace chrome.action {
166
166
  * @param tabId The id of the tab for which you want to modify the action.
167
167
  * @return The `enable` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
168
168
  */
169
- export function enable(tabId: number): Promise<void>;
169
+ export function enable(tabId?: number): Promise<void>;
170
170
 
171
171
  /**
172
172
  * Since Chrome 88.
@@ -174,7 +174,7 @@ declare namespace chrome.action {
174
174
  * @param tabId The id of the tab for which you want to modify the action.
175
175
  * @param callback
176
176
  */
177
- export function enable(tabId: number, callback?: () => void): void;
177
+ export function enable(tabId?: number, callback?: () => void): void;
178
178
 
179
179
  /**
180
180
  * Since Chrome 88.
@@ -2615,6 +2615,8 @@ declare namespace chrome.downloads {
2615
2615
  value: string;
2616
2616
  }
2617
2617
 
2618
+ export type FilenameConflictAction = "uniquify" | "overwrite" | "prompt";
2619
+
2618
2620
  export interface DownloadOptions {
2619
2621
  /** Optional. Post body. */
2620
2622
  body?: string | undefined;
@@ -2627,9 +2629,9 @@ declare namespace chrome.downloads {
2627
2629
  /** Optional. Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name and either value or binaryValue, restricted to those allowed by XMLHttpRequest. */
2628
2630
  headers?: HeaderNameValuePair[] | undefined;
2629
2631
  /** Optional. The HTTP method to use if the URL uses the HTTP[S] protocol. */
2630
- method?: string | undefined;
2632
+ method?: "GET" | "POST" | undefined;
2631
2633
  /** Optional. The action to take if filename already exists. */
2632
- conflictAction?: string | undefined;
2634
+ conflictAction?: FilenameConflictAction | undefined;
2633
2635
  }
2634
2636
 
2635
2637
  export interface DownloadDelta {
@@ -2643,7 +2645,7 @@ declare namespace chrome.downloads {
2643
2645
  * Optional. The change in finalUrl, if any.
2644
2646
  * @since Since Chrome 54.
2645
2647
  */
2646
- finalUrl: StringDelta;
2648
+ finalUrl?: StringDelta | undefined;
2647
2649
  /** Optional. The change in totalBytes, if any. */
2648
2650
  totalBytes?: DoubleDelta | undefined;
2649
2651
  /** Optional. The change in filename, if any. */
@@ -2684,11 +2686,17 @@ declare namespace chrome.downloads {
2684
2686
  previous?: string | undefined;
2685
2687
  }
2686
2688
 
2689
+ export type DownloadInterruptReason = "FILE_FAILED" | "FILE_ACCESS_DENIED" | "FILE_NO_SPACE" | "FILE_NAME_TOO_LONG" | "FILE_TOO_LARGE" | "FILE_VIRUS_INFECTED" | "FILE_TRANSIENT_ERROR" | "FILE_BLOCKED" | "FILE_SECURITY_CHECK_FAILED" | "FILE_TOO_SHORT" | "FILE_HASH_MISMATCH" | "FILE_SAME_AS_SOURCE" | "NETWORK_FAILED" | "NETWORK_TIMEOUT" | "NETWORK_DISCONNECTED" | "NETWORK_SERVER_DOWN" | "NETWORK_INVALID_REQUEST" | "SERVER_FAILED" | "SERVER_NO_RANGE" | "SERVER_BAD_CONTENT" | "SERVER_UNAUTHORIZED" | "SERVER_CERT_PROBLEM" | "SERVER_FORBIDDEN" | "SERVER_UNREACHABLE" | "SERVER_CONTENT_LENGTH_MISMATCH" | "SERVER_CROSS_ORIGIN_REDIRECT" | "USER_CANCELED" | "USER_SHUTDOWN" | "CRASH";
2690
+
2691
+ export type DownloadState = "in_progress" | "interrupted" | "complete";
2692
+
2693
+ export type DangerType = "file" | "url" | "content" | "uncommon" | "host" | "unwanted" | "safe" | "accepted";
2694
+
2687
2695
  export interface DownloadItem {
2688
2696
  /** Number of bytes received so far from the host, without considering file compression. */
2689
2697
  bytesReceived: number;
2690
2698
  /** Indication of whether this download is thought to be safe or known to be suspicious. */
2691
- danger: string;
2699
+ danger: DangerType;
2692
2700
  /** The absolute URL that this download initiated from, before any redirects. */
2693
2701
  url: string;
2694
2702
  /**
@@ -2703,7 +2711,7 @@ declare namespace chrome.downloads {
2703
2711
  /** True if the download has stopped reading data from the host, but kept the connection open. */
2704
2712
  paused: boolean;
2705
2713
  /** Indicates whether the download is progressing, interrupted, or complete. */
2706
- state: string;
2714
+ state: DownloadState;
2707
2715
  /** The file's MIME type. */
2708
2716
  mime: string;
2709
2717
  /** Number of bytes in the whole file post-decompression, or -1 if unknown. */
@@ -2711,7 +2719,7 @@ declare namespace chrome.downloads {
2711
2719
  /** The time when the download began in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){console.log(new Date(item.startTime))})}) */
2712
2720
  startTime: string;
2713
2721
  /** Optional. Why the download was interrupted. Several kinds of HTTP errors may be grouped under one of the errors beginning with SERVER_. Errors relating to the network begin with NETWORK_, errors relating to the process of writing the file to the file system begin with FILE_, and interruptions initiated by the user begin with USER_. */
2714
- error?: string | undefined;
2722
+ error?: DownloadInterruptReason | undefined;
2715
2723
  /** Optional. The time when the download ended in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.endTime) console.log(new Date(item.endTime))})}) */
2716
2724
  endTime?: string | undefined;
2717
2725
  /** An identifier that is persistent across browser sessions. */
@@ -2735,7 +2743,7 @@ declare namespace chrome.downloads {
2735
2743
  export interface GetFileIconOptions {
2736
2744
  /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size.
2737
2745
  */
2738
- size?: number | undefined;
2746
+ size?: 16 | 32 | undefined;
2739
2747
  }
2740
2748
 
2741
2749
  export interface DownloadQuery {
@@ -6448,6 +6456,13 @@ declare namespace chrome.runtime {
6448
6456
  /** The ID of the extension/app. */
6449
6457
  export var id: string;
6450
6458
 
6459
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformOs */
6460
+ export type PlatformOs = 'mac' | 'win' | 'android' | 'cros' | 'linux' | 'openbsd';
6461
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformArch */
6462
+ export type PlatformArch = 'arm' | 'arm64' | 'x86-32' | 'x86-64' | 'mips' | 'mips64';
6463
+ /** https://developer.chrome.com/docs/extensions/reference/runtime/#type-PlatformNaclArch */
6464
+ export type PlatformNaclArch = 'arm' | 'x86-32' | 'x86-64' | 'mips' | 'mips64';
6465
+
6451
6466
  export interface LastError {
6452
6467
  /** Optional. Details about the error which occurred. */
6453
6468
  message?: string | undefined;
@@ -6524,19 +6539,16 @@ declare namespace chrome.runtime {
6524
6539
  export interface PlatformInfo {
6525
6540
  /**
6526
6541
  * The operating system chrome is running on.
6527
- * One of: "mac", "win", "android", "cros", "linux", or "openbsd"
6528
6542
  */
6529
- os: string;
6543
+ os: PlatformOs;
6530
6544
  /**
6531
6545
  * The machine's processor architecture.
6532
- * One of: "arm", "x86-32", or "x86-64"
6533
6546
  */
6534
- arch: string;
6547
+ arch: PlatformArch;
6535
6548
  /**
6536
6549
  * The native client architecture. This may be different from arch on some platforms.
6537
- * One of: "arm", "x86-32", or "x86-64"
6538
6550
  */
6539
- nacl_arch: string;
6551
+ nacl_arch: PlatformNaclArch;
6540
6552
  }
6541
6553
 
6542
6554
  /**
@@ -10907,11 +10919,11 @@ declare namespace chrome.declarativeNetRequest {
10907
10919
  IMAGE = "image",
10908
10920
  FONT = "font",
10909
10921
  OBJECT = "object",
10910
- XML_HTTP_REQUEST = "xmlhttprequest",
10922
+ XMLHTTPREQUEST = "xmlhttprequest",
10911
10923
  PING = "ping",
10912
10924
  CSP_REPORT = "csp_report",
10913
10925
  MEDIA = "media",
10914
- WEB_SOCKET = "websocket",
10926
+ WEBSOCKET = "websocket",
10915
10927
  OTHER = "other"
10916
10928
  }
10917
10929
 
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.155",
3
+ "version": "0.0.159",
4
4
  "description": "TypeScript definitions for Chrome extension development",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -98,6 +98,6 @@
98
98
  "@types/filesystem": "*",
99
99
  "@types/har-format": "*"
100
100
  },
101
- "typesPublisherContentHash": "1df5dddf56f9ee6b4bfc0d51abfcd031329835fbc6e200220d43586ba7220bf7",
101
+ "typesPublisherContentHash": "a04bf9677124c275908329b4be2146fbc75190a247fb61ad461844199cceee40",
102
102
  "typeScriptVersion": "3.7"
103
103
  }