@types/chrome 0.0.278 → 0.0.280

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 +131 -1
  3. chrome/package.json +3 -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, 14 Oct 2024 18:09:31 GMT
11
+ * Last updated: Fri, 01 Nov 2024 22:34:47 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
@@ -5150,7 +5150,7 @@ declare namespace chrome.identity {
5150
5150
  export function getProfileUserInfo(details: ProfileDetails, callback: (userInfo: UserInfo) => void): void;
5151
5151
 
5152
5152
  /** @since Chrome 84 */
5153
- export function getProfileUserInfo(details: ProfileDetails): Promise<UserInfo>;
5153
+ export function getProfileUserInfo(details?: ProfileDetails): Promise<UserInfo>;
5154
5154
 
5155
5155
  /**
5156
5156
  * Removes an OAuth2 access token from the Identity API's token cache.
@@ -7079,6 +7079,136 @@ declare namespace chrome.printing {
7079
7079
  export const onJobStatusChanged: chrome.events.Event<(jobId: string, status: JobStatus) => void>;
7080
7080
  }
7081
7081
 
7082
+ ////////////////////
7083
+ // Printing Metrics
7084
+ ////////////////////
7085
+ /**
7086
+ * Use the chrome.printingMetrics API to fetch data about printing usage.
7087
+ *
7088
+ * Permissions: "printingMetrics"
7089
+ *
7090
+ * Note: This API is only for extensions pre-installed by policy.
7091
+ * @platform ChromeOS only
7092
+ * @since Chrome 79
7093
+ */
7094
+ declare namespace chrome.printingMetrics {
7095
+ export enum ColorMode {
7096
+ /** Specifies that black and white mode was used. */
7097
+ BLACK_AND_WHITE = "BLACK_AND_WHITE",
7098
+ /** Specifies that color mode was used. */
7099
+ COLOR = "COLOR",
7100
+ }
7101
+
7102
+ export enum DuplexMode {
7103
+ /** Specifies that one-sided printing was used. */
7104
+ ONE_SIDED = "ONE_SIDED",
7105
+ /** Specifies that two-sided printing was used, flipping on long edge. */
7106
+ TWO_SIDED_LONG_EDGE = "TWO_SIDED_LONG_EDGE",
7107
+ /** Specifies that two-sided printing was used, flipping on short edge. */
7108
+ TWO_SIDED_SHORT_EDGE = "TWO_SIDED_SHORT_EDGE",
7109
+ }
7110
+
7111
+ export interface MediaSize {
7112
+ /** Height (in micrometers) of the media used for printing. */
7113
+ height: number;
7114
+ /**
7115
+ * Vendor-provided ID, e.g. "iso_a3_297x420mm" or "na_index-3x5_3x5in".
7116
+ * Possible values are values of "media" IPP attribute and can be found on [IANA page](https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xhtml).
7117
+ */
7118
+ vendorId: string;
7119
+ /** Width (in micrometers) of the media used for printing. */
7120
+ width: number;
7121
+ }
7122
+
7123
+ export interface Printer {
7124
+ /** Displayed name of the printer. */
7125
+ name: string;
7126
+ /** The source of the printer. */
7127
+ source: PrinterSource;
7128
+ /** The full path for the printer. Contains protocol, hostname, port, and queue. */
7129
+ uri: string;
7130
+ }
7131
+
7132
+ /** The source of the printer. */
7133
+ export enum PrinterSource {
7134
+ /** Specifies that the printer was added by user. */
7135
+ USER = "USER",
7136
+ /** Specifies that the printer was added via policy. */
7137
+ POLICY = "POLICY",
7138
+ }
7139
+
7140
+ export interface PrintJobInfo {
7141
+ /** The job completion time (in milliseconds past the Unix epoch). */
7142
+ completionTime: number;
7143
+ /** The job creation time (in milliseconds past the Unix epoch). */
7144
+ creationTime: number;
7145
+ /** The ID of the job. */
7146
+ id: string;
7147
+ /** The number of pages in the document. */
7148
+ numberOfPages: number;
7149
+ /** The info about the printer which printed the document. */
7150
+ printer: Printer;
7151
+ /**
7152
+ * The status of the printer.
7153
+ * @since Chrome 85
7154
+ */
7155
+ printer_status: chrome.printing.PrinterStatus;
7156
+ /** The settings of the print job. */
7157
+ settings: PrintSettings;
7158
+ /** Source showing who initiated the print job. */
7159
+ source: PrintJobSource;
7160
+ /** ID of source. Null if source is PRINT_PREVIEW or ANDROID_APP. */
7161
+ sourceId: string | null;
7162
+ /** The final status of the job. */
7163
+ status: PrintJobStatus;
7164
+ /** The title of the document which was printed. */
7165
+ title: string;
7166
+ }
7167
+
7168
+ /** The source of the print job. */
7169
+ export enum PrintJobSource {
7170
+ /** Specifies that the job was created from the Print Preview page initiated by the user. */
7171
+ PRINT_PREVIEW = "PRINT_PREVIEW",
7172
+ /** Specifies that the job was created from an Android App. */
7173
+ ANDROID_APP = "ANDROID_APP",
7174
+ /** Specifies that the job was created by extension via Chrome API. */
7175
+ EXTENSION = "EXTENSION",
7176
+ /** Specifies that the job was created by an Isolated Web App via API. */
7177
+ ISOLATED_WEB_APP = "ISOLATED_WEB_APP",
7178
+ }
7179
+
7180
+ /** Specifies the final status of the print job. */
7181
+ export enum PrintJobStatus {
7182
+ /** Specifies that the print job was interrupted due to some error. */
7183
+ FAILED = "FAILED",
7184
+ /** Specifies that the print job was canceled by the user or via API. */
7185
+ CANCELED = "CANCELED",
7186
+ /** Specifies that the print job was printed without any errors. */
7187
+ PRINTED = "PRINTED",
7188
+ }
7189
+
7190
+ export interface PrintSettings {
7191
+ /** The requested color mode. */
7192
+ color: ColorMode;
7193
+ /** The requested number of copies. */
7194
+ copies: number;
7195
+ /** The requested duplex mode. */
7196
+ duplex: DuplexMode;
7197
+ /** The requested media size. */
7198
+ mediaSize: MediaSize;
7199
+ }
7200
+
7201
+ /**
7202
+ * Returns the list of the finished print jobs.
7203
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
7204
+ */
7205
+ export function getPrintJobs(): Promise<PrintJobInfo[]>;
7206
+ export function getPrintJobs(callback: (jobs: PrintJobInfo[]) => void): void;
7207
+
7208
+ /** Event fired when the print job is finished. This includes any of termination statuses: FAILED, CANCELED and PRINTED. */
7209
+ export const onPrintJobFinished: chrome.events.Event<(jobInfo: PrintJobInfo) => void>;
7210
+ }
7211
+
7082
7212
  ////////////////////
7083
7213
  // Privacy
7084
7214
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.278",
3
+ "version": "0.0.280",
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,7 @@
93
93
  "@types/filesystem": "*",
94
94
  "@types/har-format": "*"
95
95
  },
96
- "typesPublisherContentHash": "887e3fa4cc8ffda1e14db7ffcbf365d014000b05fae878791a3ea1b2adbe8a0c",
96
+ "peerDependencies": {},
97
+ "typesPublisherContentHash": "5823c284d52d87e13d9c751f7a0688a2c5e20c0a0741d46f6b9b670ac211903c",
97
98
  "typeScriptVersion": "4.8"
98
99
  }