@types/chrome 0.1.22 → 0.1.24

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 +75 -28
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 03 Oct 2025 21:32:25 GMT
11
+ * Last updated: Sat, 11 Oct 2025 07:32:14 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
@@ -7899,13 +7899,25 @@ declare namespace chrome {
7899
7899
  id: string;
7900
7900
  /** Printer's human readable name. */
7901
7901
  name: string;
7902
- /** Optional. Printer's human readable description. */
7902
+ /** Printer's human readable description. */
7903
7903
  description?: string | undefined;
7904
7904
  }
7905
7905
 
7906
+ /** Error codes returned in response to {@link onPrintRequested} event. */
7907
+ export enum PrintError {
7908
+ /** Specifies that the operation was completed successfully. */
7909
+ OK = "OK",
7910
+ /** Specifies that a general failure occured. */
7911
+ FAILED = "FAILED",
7912
+ /** Specifies that the print ticket is invalid. For example, the ticket is inconsistent with some capabilities, or the extension is not able to handle all settings from the ticket. */
7913
+ INVALID_TICKET = "INVALID_TICKET",
7914
+ /** Specifies that the document is invalid. For example, data may be corrupted or the format is incompatible with the extension. */
7915
+ INVALID_DATA = "INVALID_DATA",
7916
+ }
7917
+
7906
7918
  export interface PrinterCapabilities {
7907
7919
  /** Device capabilities in CDD format. */
7908
- capabilities: any;
7920
+ capabilities: { [key: string]: unknown };
7909
7921
  }
7910
7922
 
7911
7923
  export interface PrintJob {
@@ -7913,44 +7925,68 @@ declare namespace chrome {
7913
7925
  printerId: string;
7914
7926
  /** The print job title. */
7915
7927
  title: string;
7916
- /** Print ticket in CJT format. */
7928
+ /** Print ticket in CJT format. */
7917
7929
  ticket: { [key: string]: unknown };
7918
- /** The document content type. Supported formats are "application/pdf" and "image/pwg-raster". */
7930
+ /** The document content type. Supported formats are `application/pdf` and `image/pwg-raster`. */
7919
7931
  contentType: string;
7920
- /** Blob containing the document data to print. Format must match |contentType|. */
7932
+ /** Blob containing the document data to print. Format must match `contentType`. */
7921
7933
  document: Blob;
7922
7934
  }
7923
7935
 
7924
- export interface PrinterRequestedEvent
7925
- extends chrome.events.Event<(resultCallback: (printerInfo: PrinterInfo[]) => void) => void>
7926
- {}
7927
-
7928
- export interface PrinterInfoRequestedEvent
7929
- extends chrome.events.Event<(device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void>
7930
- {}
7931
-
7932
- export interface CapabilityRequestedEvent extends
7933
- chrome.events.Event<
7934
- (printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void
7935
- >
7936
- {}
7937
-
7938
- export interface PrintRequestedEvent
7939
- extends chrome.events.Event<(printJob: PrintJob, resultCallback: (result: string) => void) => void>
7940
- {}
7936
+ /** from https://developer.chrome.com/docs/apps/reference/usb#type-Device */
7937
+ export interface Device {
7938
+ /** An opaque ID for the USB device. It remains unchanged until the device is unplugged. */
7939
+ device: number;
7940
+ /**
7941
+ * The iManufacturer string read from the device, if available.
7942
+ * @since Chrome 46
7943
+ */
7944
+ manufacturerName: string;
7945
+ /** The product ID. */
7946
+ productId: number;
7947
+ /**
7948
+ * The iProduct string read from the device, if available.
7949
+ * @since Chrome 46
7950
+ */
7951
+ productName: string;
7952
+ /**
7953
+ * The iSerialNumber string read from the device, if available.
7954
+ * @since Chrome 46
7955
+ */
7956
+ serialNumber: string;
7957
+ /** The device vendor ID. */
7958
+ vendorId: number;
7959
+ /**
7960
+ * The device version (bcdDevice field).
7961
+ * @since Chrome 51
7962
+ */
7963
+ version: number;
7964
+ }
7941
7965
 
7942
7966
  /** Event fired when print manager requests printers provided by extensions. */
7943
- export var onGetPrintersRequested: PrinterRequestedEvent;
7967
+ export const onGetPrintersRequested: events.Event<
7968
+ (resultCallback: (printerInfo: PrinterInfo[]) => void) => void
7969
+ >;
7970
+
7944
7971
  /**
7945
7972
  * Event fired when print manager requests information about a USB device that may be a printer.
7946
- * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event.
7973
+ *
7974
+ * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the {@link onGetPrintersRequested} event.
7947
7975
  * @since Chrome 45
7948
7976
  */
7949
- export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent;
7977
+ export const onGetUsbPrinterInfoRequested: events.Event<
7978
+ (device: Device, resultCallback: (printerInfo?: PrinterInfo) => void) => void
7979
+ >;
7980
+
7950
7981
  /** Event fired when print manager requests printer capabilities. */
7951
- export var onGetCapabilityRequested: CapabilityRequestedEvent;
7982
+ export const onGetCapabilityRequested: events.Event<
7983
+ (printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void
7984
+ >;
7985
+
7952
7986
  /** Event fired when print manager requests printing. */
7953
- export var onPrintRequested: PrintRequestedEvent;
7987
+ export const onPrintRequested: events.Event<
7988
+ (printJob: PrintJob, resultCallback: (result: `${PrintError}`) => void) => void
7989
+ >;
7954
7990
  }
7955
7991
 
7956
7992
  ////////////////////
@@ -9296,7 +9332,18 @@ declare namespace chrome {
9296
9332
  optional_permissions?: ManifestOptionalPermissions[] | undefined;
9297
9333
  optional_host_permissions?: string[] | undefined;
9298
9334
  permissions?: ManifestPermissions[] | undefined;
9299
- web_accessible_resources?: Array<{ resources: string[]; matches: string[] }> | undefined;
9335
+ web_accessible_resources?:
9336
+ | Array<
9337
+ & {
9338
+ resources: string[];
9339
+ use_dynamic_url?: boolean | undefined;
9340
+ }
9341
+ & (
9342
+ | { extension_ids: string[]; matches?: string[] | undefined }
9343
+ | { matches: string[]; extension_ids?: string[] | undefined }
9344
+ )
9345
+ >
9346
+ | undefined;
9300
9347
  }
9301
9348
 
9302
9349
  export type Manifest = ManifestV2 | ManifestV3;
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
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": "eada04150c1c42679c4730cf050e1fb35c08aeda9efc7f58416c976c363236bb",
97
+ "typesPublisherContentHash": "730d0c18220e1638428b77185a71f68f956e1e59195316ce218a90aef4255a1a",
98
98
  "typeScriptVersion": "5.2"
99
99
  }