@types/chrome 0.0.304 → 0.0.306
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.
- chrome/README.md +1 -1
- chrome/index.d.ts +420 -12
- 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:
|
11
|
+
* Last updated: Fri, 21 Feb 2025 18:03:10 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
@@ -3080,26 +3080,430 @@ declare namespace chrome {
|
|
3080
3080
|
* @since Chrome 44
|
3081
3081
|
*/
|
3082
3082
|
export namespace documentScan {
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3083
|
+
/** @since Chrome 125 */
|
3084
|
+
export interface CancelScanResponse<T> {
|
3085
|
+
/** Provides the same job handle that was passed to {@link cancelScan}. */
|
3086
|
+
job: T;
|
3087
|
+
/** The backend's cancel scan result. If the result is `OperationResult.SUCCESS` or `OperationResult.CANCELLED`, the scan has been cancelled and the scanner is ready to start a new scan. If the result is `OperationResult.DEVICE_BUSY` , the scanner is still processing the requested cancellation; the caller should wait a short time and try the request again. Other result values indicate a permanent error that should not be retried. */
|
3088
|
+
result: `${OperationResult}`;
|
3088
3089
|
}
|
3089
3090
|
|
3090
|
-
|
3091
|
-
|
3091
|
+
/** @since Chrome 125 */
|
3092
|
+
export interface CloseScannerResponse<T> {
|
3093
|
+
/** The same scanner handle as was passed to {@link closeScanner}. */
|
3094
|
+
scannerHandle: T;
|
3095
|
+
/** The result of closing the scanner. Even if this value is not `SUCCESS`, the handle will be invalid and should not be used for any further operations. */
|
3096
|
+
result: `${OperationResult}`;
|
3097
|
+
}
|
3098
|
+
|
3099
|
+
/**
|
3100
|
+
* How an option can be changed.
|
3101
|
+
* @since Chrome 125
|
3102
|
+
*/
|
3103
|
+
export enum Configurability {
|
3104
|
+
/** The option is read-only. */
|
3105
|
+
NOT_CONFIGURABLE = "NOT_CONFIGURABLE",
|
3106
|
+
/** The option can be set in software. */
|
3107
|
+
SOFTWARE_CONFIGURABLE = "SOFTWARE_CONFIGURABLE",
|
3108
|
+
/** The option can be set by the user toggling or pushing a button on the scanner. */
|
3109
|
+
HARDWARE_CONFIGURABLE = "HARDWARE_CONFIGURABLE",
|
3110
|
+
}
|
3111
|
+
|
3112
|
+
/**
|
3113
|
+
* Indicates how the scanner is connected to the computer.
|
3114
|
+
* @since Chrome 125
|
3115
|
+
*/
|
3116
|
+
export enum ConnectionType {
|
3117
|
+
UNSPECIFIED = "UNSPECIFIED",
|
3118
|
+
USB = "USB",
|
3119
|
+
NETWORK = "NETWORK",
|
3120
|
+
}
|
3121
|
+
|
3122
|
+
/**
|
3123
|
+
* The data type of constraint represented by an {@link OptionConstraint}.
|
3124
|
+
* @since Chrome 125
|
3125
|
+
*/
|
3126
|
+
export enum ConstraintType {
|
3127
|
+
/** The constraint on a range of `OptionType.INT` values. The `min`, `max`, and `quant` properties of `OptionConstraint` will be `long`, and its `list` property will be unset. */
|
3128
|
+
INT_RANGE = "INT_RANGE",
|
3129
|
+
/** The constraint on a range of `OptionType.FIXED` values. The `min`, `max`, and `quant` properties of `OptionConstraint` will be `double`, and its `list` property will be unset. */
|
3130
|
+
FIXED_RANGE = "FIXED_RANGE",
|
3131
|
+
/** The constraint on a specific list of `OptionType.INT` values. The `OptionConstraint.list` property will contain `long` values, and the other properties will be unset. */
|
3132
|
+
INT_LIST = "INT_LIST",
|
3133
|
+
/** The constraint on a specific list of `OptionType.FIXED` values. The `OptionConstraint.list` property will contain `double` values, and the other properties will be unset. */
|
3134
|
+
FIXED_LIST = "FIXED_LIST",
|
3135
|
+
/** The constraint on a specific list of `OptionType.STRING` values. The `OptionConstraint.list` property will contain `DOMString` values, and the other properties will be unset. */
|
3136
|
+
STRING_LIST = "STRING_LIST",
|
3137
|
+
}
|
3138
|
+
|
3139
|
+
/** @since Chrome 125 */
|
3140
|
+
export interface DeviceFilter {
|
3141
|
+
/** Only return scanners that are directly attached to the computer. */
|
3142
|
+
local?: boolean;
|
3143
|
+
/** Only return scanners that use a secure transport, such as USB or TLS. */
|
3144
|
+
secure?: boolean;
|
3145
|
+
}
|
3146
|
+
|
3147
|
+
/** @since Chrome 125 */
|
3148
|
+
export interface GetOptionGroupsResponse<T> {
|
3149
|
+
/** If `result` is `SUCCESS`, provides a list of option groups in the order supplied by the scanner driver. */
|
3150
|
+
groups?: OptionGroup[];
|
3151
|
+
/** The result of getting the option groups. If the value of this is `SUCCESS`, the `groups` property will be populated. */
|
3152
|
+
result: `${OperationResult}`;
|
3153
|
+
/** The same scanner handle as was passed to {@link getOptionGroups}. */
|
3154
|
+
scannerHandle: T;
|
3155
|
+
}
|
3156
|
+
|
3157
|
+
/** @since Chrome 125 */
|
3158
|
+
export interface GetScannerListResponse {
|
3159
|
+
/** The enumeration result. Note that partial results could be returned even if this indicates an error. */
|
3160
|
+
result: `${OperationResult}`;
|
3161
|
+
/** A possibly-empty list of scanners that match the provided {@link DeviceFilter}. */
|
3162
|
+
scanners: ScannerInfo[];
|
3163
|
+
}
|
3164
|
+
|
3165
|
+
/** @since Chrome 125 */
|
3166
|
+
export interface OpenScannerResponse<T> {
|
3167
|
+
/** If `result` is `SUCCESS`, provides a key-value mapping where the key is a device-specific option and the value is an instance of {@link ScannerOption}. */
|
3168
|
+
options?: { [name: string]: unknown };
|
3169
|
+
/** The result of opening the scanner. If the value of this is `SUCCESS`, the `scannerHandle` and `options` properties will be populated. */
|
3170
|
+
result: `${OperationResult}`;
|
3171
|
+
/** If `result` is `SUCCESS`, a handle to the scanner that can be used for further operations. */
|
3172
|
+
scannerHandle?: string;
|
3173
|
+
/** The scanner ID passed to {@link openScanner}. */
|
3174
|
+
scannerId: T;
|
3175
|
+
}
|
3176
|
+
|
3177
|
+
/**
|
3178
|
+
* An enum that indicates the result of each operation.
|
3179
|
+
* @since Chrome 125
|
3180
|
+
*/
|
3181
|
+
export enum OperationResult {
|
3182
|
+
/** An unknown or generic failure occurred. */
|
3183
|
+
UNKNOWN = "UNKNOWN",
|
3184
|
+
/**The operation succeeded. */
|
3185
|
+
SUCCESS = "SUCCESS",
|
3186
|
+
/** The operation is not supported. */
|
3187
|
+
UNSUPPORTED = "UNSUPPORTED",
|
3188
|
+
/** The operation was cancelled. */
|
3189
|
+
CANCELLED = "CANCELLED",
|
3190
|
+
/** The device is busy. */
|
3191
|
+
DEVICE_BUSY = "DEVICE_BUSY",
|
3192
|
+
/** Either the data or an argument passed to the method is not valid. */
|
3193
|
+
INVALID = "INVALID",
|
3194
|
+
/** The supplied value is the wrong data type for the underlying option. */
|
3195
|
+
WRONG_TYPE = "WRONG_TYPE",
|
3196
|
+
/** No more data is available. */
|
3197
|
+
EOF = "EOF",
|
3198
|
+
/** The document feeder is jammed */
|
3199
|
+
ADF_JAMMED = "ADF_JAMMED",
|
3200
|
+
/** The document feeder is empty */
|
3201
|
+
ADF_EMPTY = "ADF_EMPTY",
|
3202
|
+
/** The flatbed cover is open. */
|
3203
|
+
COVER_OPEN = "COVER_OPEN",
|
3204
|
+
/** An error occurred while communicating with the device. */
|
3205
|
+
IO_ERROR = "IO_ERROR",
|
3206
|
+
/** The device requires authentication. */
|
3207
|
+
ACCESS_DENIED = "ACCESS_DENIED",
|
3208
|
+
/** Not enough memory is available on the Chromebook to complete the operation. */
|
3209
|
+
NO_MEMORY = "NO_MEMORY",
|
3210
|
+
/** The device is not reachable. */
|
3211
|
+
UNREACHABLE = "UNREACHABLE",
|
3212
|
+
/** The device is disconnected. */
|
3213
|
+
MISSING = "MISSING",
|
3214
|
+
/** An error has occurred somewhere other than the calling application. */
|
3215
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
3216
|
+
}
|
3217
|
+
|
3218
|
+
/** @since Chrome 125 */
|
3219
|
+
export interface OptionConstraint {
|
3220
|
+
list?: string[] | number[];
|
3221
|
+
max?: number;
|
3222
|
+
min?: number;
|
3223
|
+
quant?: number;
|
3224
|
+
type: `${ConstraintType}`;
|
3225
|
+
}
|
3226
|
+
|
3227
|
+
/** @since Chrome 125 */
|
3228
|
+
export interface OptionGroup {
|
3229
|
+
/** An array of option names in driver-provided order. */
|
3230
|
+
members: string[];
|
3231
|
+
/** Provides a printable title, for example "Geometry options". */
|
3232
|
+
title: string;
|
3233
|
+
}
|
3234
|
+
|
3235
|
+
/** @since Chrome 125 */
|
3236
|
+
export interface OptionSetting {
|
3237
|
+
/** Indicates the name of the option to set. */
|
3238
|
+
name: string;
|
3239
|
+
/** Indicates the data type of the option. The requested data type must match the real data type of the underlying option. */
|
3240
|
+
type: `${OptionType}`;
|
3241
|
+
/** Indicates the value to set. Leave unset to request automatic setting for options that have `autoSettable` enabled. The data type supplied for `value` must match `type`. */
|
3242
|
+
value?: string | number | boolean | number;
|
3243
|
+
}
|
3244
|
+
|
3245
|
+
/**
|
3246
|
+
* The data type of an option.
|
3247
|
+
* @since Chrome 125
|
3248
|
+
*/
|
3249
|
+
export enum OptionType {
|
3250
|
+
/** The option's data type is `unknown`. The value property will be unset. */
|
3251
|
+
UNKNOWN = "UNKNOWN",
|
3252
|
+
/** The `value` property will be one of `true` false. */
|
3253
|
+
BOOL = "BOOL",
|
3254
|
+
/** A signed 32-bit integer. The `value` property will be long or long[], depending on whether the option takes more than one value. */
|
3255
|
+
INT = "INT",
|
3256
|
+
/** A double in the range -32768-32767.9999 with a resolution of 1/65535. The `value` property will be double or double[] depending on whether the option takes more than one value. Double values that can't be exactly represented will be rounded to the available range and precision. */
|
3257
|
+
FIXED = "FIXED",
|
3258
|
+
/** A sequence of any bytes except NUL ('\0'). The `value` property will be a DOMString. */
|
3259
|
+
STRING = "STRING",
|
3260
|
+
/** An option of this type has no value. Instead, setting an option of this type causes an option-specific side effect in the scanner driver. For example, a button-typed option could be used by a scanner driver to provide a means to select default values or to tell an automatic document feeder to advance to the next sheet of paper. */
|
3261
|
+
BUTTON = "BUTTON",
|
3262
|
+
/** Grouping option. No value. This is included for compatibility, but will not normally be returned in `ScannerOption` values. Use `getOptionGroups()` to retrieve the list of groups with their member options. */
|
3263
|
+
GROUP = "GROUP",
|
3264
|
+
}
|
3265
|
+
|
3266
|
+
/**
|
3267
|
+
* Indicates the data type for {@link ScannerOption.unit}.
|
3268
|
+
* @since Chrome 125
|
3269
|
+
*/
|
3270
|
+
export enum OptionUnit {
|
3271
|
+
/** The value is a unitless number. For example, it can be a threshold. */
|
3272
|
+
UNITLESS = "UNITLESS",
|
3273
|
+
/** The value is a number of pixels, for example, scan dimensions. */
|
3274
|
+
PIXEL = "PIXEL",
|
3275
|
+
/** The value is the number of bits, for example, color depth. */
|
3276
|
+
BIT = "BIT",
|
3277
|
+
/** The value is measured in millimeters, for example, scan dimensions. */
|
3278
|
+
MM = "MM",
|
3279
|
+
/** The value is measured in dots per inch, for example, resolution. */
|
3280
|
+
DPI = "DPI",
|
3281
|
+
/** The value is a percent, for example, brightness. */
|
3282
|
+
PERCENT = "PERCENT",
|
3283
|
+
/** The value is measured in microseconds, for example, exposure time. */
|
3284
|
+
MICROSECOND = "MICROSECOND",
|
3285
|
+
}
|
3286
|
+
|
3287
|
+
/** @since Chrome 125 */
|
3288
|
+
export interface ReadScanDataResponse<T> {
|
3289
|
+
/** If `result` is `SUCCESS`, contains the _next_ chunk of scanned image data. If `result` is `EOF`, contains the _last_ chunk of scanned image data. */
|
3290
|
+
data?: ArrayBuffer;
|
3291
|
+
/** If `result` is `SUCCESS`, an estimate of how much of the total scan data has been delivered so far, in the range 0 to 100. */
|
3292
|
+
estimatedCompletion?: number;
|
3293
|
+
/** Provides the job handle passed to {@link readScanData}. */
|
3294
|
+
job: T;
|
3295
|
+
/** The result of reading data. If its value is `SUCCESS`, then `data` contains the _next_ (possibly zero-length) chunk of image data that is ready for reading. If its value is `EOF`, the `data` contains the _last_ chunk of image data. */
|
3296
|
+
result: `${OperationResult}`;
|
3297
|
+
}
|
3298
|
+
|
3299
|
+
/** @since Chrome 125 */
|
3300
|
+
export interface ScannerInfo {
|
3301
|
+
/** Indicates how the scanner is connected to the computer. */
|
3302
|
+
connectionType: `${ConnectionType}`;
|
3303
|
+
/** For matching against other `ScannerInfo` entries that point to the same physical device. */
|
3304
|
+
deviceUuid: string;
|
3305
|
+
/** An array of MIME types that can be requested for returned scans. */
|
3306
|
+
imageFormats: string[];
|
3307
|
+
/** The scanner manufacturer. */
|
3308
|
+
manufacturer: string;
|
3309
|
+
/** The scanner model if it is available, or a generic description. */
|
3310
|
+
model: string;
|
3311
|
+
/** A human-readable name for the scanner to display in the UI. */
|
3312
|
+
name: string;
|
3313
|
+
/** A human-readable description of the protocol or driver used to access the scanner, such as Mopria, WSD, or epsonds. This is primarily useful for allowing a user to choose between protocols if a device supports multiple protocols. */
|
3314
|
+
protocolType: string;
|
3315
|
+
/** The ID of a specific scanner. */
|
3316
|
+
scannerId: string;
|
3317
|
+
/** If true, the scanner connection's transport cannot be intercepted by a passive listener, such as TLS or USB. */
|
3318
|
+
secure: boolean;
|
3319
|
+
}
|
3320
|
+
|
3321
|
+
/** @since Chrome 125 */
|
3322
|
+
export interface ScannerOption {
|
3323
|
+
/** Indicates whether and how the option can be changed. */
|
3324
|
+
configurability: `${Configurability}`;
|
3325
|
+
/** Defines {@link OptionConstraint} on the current scanner option. */
|
3326
|
+
constraint?: OptionConstraint;
|
3327
|
+
/** A longer description of the option. */
|
3328
|
+
description: string;
|
3329
|
+
/** Indicates the option is active and can be set or retrieved. If false, the `value` property will not be set. */
|
3330
|
+
isActive: boolean;
|
3331
|
+
/** Indicates that the UI should not display this option by default. */
|
3332
|
+
isAdvanced: boolean;
|
3333
|
+
/** Can be automatically set by the scanner driver. */
|
3334
|
+
isAutoSettable: boolean;
|
3335
|
+
/** Indicates that this option can be detected from software. */
|
3336
|
+
isDetectable: boolean;
|
3337
|
+
/** Emulated by the scanner driver if true. */
|
3338
|
+
isEmulated: boolean;
|
3339
|
+
/** The option name using lowercase ASCII letters, numbers, and dashes. Diacritics are not allowed. */
|
3340
|
+
name: string;
|
3341
|
+
/** A printable one-line title. */
|
3342
|
+
title: string;
|
3343
|
+
/** The data type contained in the `value` property, which is needed for setting this option. */
|
3344
|
+
type: `${OptionType}`;
|
3345
|
+
/** The unit of measurement for this option. */
|
3346
|
+
unit: `${OptionUnit}`;
|
3347
|
+
/** The current value of the option, if relevant. Note that the data type of this property must match the data type specified in `type`. */
|
3348
|
+
value?: string | number | boolean | number[];
|
3349
|
+
}
|
3350
|
+
|
3351
|
+
export interface ScanOptions {
|
3352
|
+
/** The number of scanned images allowed. The default is 1. */
|
3353
|
+
maxImages?: number;
|
3354
|
+
/** The MIME types that are accepted by the caller. */
|
3355
|
+
mimeTypes?: string[];
|
3356
|
+
}
|
3357
|
+
|
3358
|
+
export interface ScanResults {
|
3359
|
+
/** An array of data image URLs in a form that can be passed as the "src" value to an image tag. */
|
3092
3360
|
dataUrls: string[];
|
3093
|
-
/** The MIME type of dataUrls
|
3361
|
+
/** The MIME type of the `dataUrls`. */
|
3094
3362
|
mimeType: string;
|
3095
3363
|
}
|
3096
3364
|
|
3365
|
+
/** @since Chrome 125 */
|
3366
|
+
export interface SetOptionResult {
|
3367
|
+
/** Indicates the name of the option that was set. */
|
3368
|
+
name: string;
|
3369
|
+
/** Indicates the result of setting the option. */
|
3370
|
+
result: `${OperationResult}`;
|
3371
|
+
}
|
3372
|
+
|
3373
|
+
/** @since Chrome 125 */
|
3374
|
+
export interface SetOptionsResponse<T> {
|
3375
|
+
/**
|
3376
|
+
* An updated key-value mapping from option names to {@link ScannerOption} values containing the new configuration after attempting to set all supplied options. This has the same structure as the `options` property in {@link OpenScannerResponse}.
|
3377
|
+
*
|
3378
|
+
* This property will be set even if some options were not set successfully, but will be unset if retrieving the updated configuration fails (for example, if the scanner is disconnected in the middle of scanning).
|
3379
|
+
*/
|
3380
|
+
options?: { [name: string]: unknown };
|
3381
|
+
/** An array of results, one each for every passed-in `OptionSetting`. */
|
3382
|
+
results: SetOptionResult[];
|
3383
|
+
/** Provides the scanner handle passed to {@link setOptions}. */
|
3384
|
+
scannerHandle: T;
|
3385
|
+
}
|
3386
|
+
|
3387
|
+
/** @since Chrome 125 */
|
3388
|
+
export interface StartScanOptions {
|
3389
|
+
/** Specifies the MIME type to return scanned data in. */
|
3390
|
+
format: string;
|
3391
|
+
/** If a non-zero value is specified, limits the maximum scanned bytes returned in a single {@link readScanData} response to that value. The smallest allowed value is 32768 (32 KB). If this property is not specified, the size of a returned chunk may be as large as the entire scanned image. */
|
3392
|
+
maxReadSize?: number;
|
3393
|
+
}
|
3394
|
+
|
3395
|
+
/** @since Chrome 125 */
|
3396
|
+
export interface StartScanResponse<T> {
|
3397
|
+
/** If `result` is `SUCCESS`, provides a handle that can be used to read scan data or cancel the job. */
|
3398
|
+
job?: string;
|
3399
|
+
/** The result of starting a scan. If the value of this is `SUCCESS`, the `job` property will be populated. */
|
3400
|
+
result: `${OperationResult}`;
|
3401
|
+
/** Provides the same scanner handle that was passed to {@link startScan}. */
|
3402
|
+
scannerHandle: T;
|
3403
|
+
}
|
3404
|
+
|
3405
|
+
/**
|
3406
|
+
* Cancels a started scan and returns a Promise that resolves with a {@link CancelScanResponse} object. If a callback is used, the object is passed to it instead.
|
3407
|
+
* @param job The handle of an active scan job previously returned from a call to {@link startScan}.
|
3408
|
+
* @since Chrome 125
|
3409
|
+
*/
|
3410
|
+
export function cancelScan<T = string>(job: T): Promise<CancelScanResponse<T>>;
|
3411
|
+
export function cancelScan<T = string>(job: T, callback: (response: CancelScanResponse<T>) => void): void;
|
3412
|
+
|
3097
3413
|
/**
|
3098
|
-
*
|
3099
|
-
* @param
|
3100
|
-
* @
|
3414
|
+
* Closes the scanner with the passed in handle and returns a Promise that resolves with a {@link CloseScannerResponse} object. If a callback is used, the object is passed to it instead. Even if the response is not a success, the supplied handle becomes invalid and should not be used for further operations.
|
3415
|
+
* @param scannerHandle Specifies the handle of an open scanner that was previously returned from a call to {@link openScanner}.
|
3416
|
+
* @since Chrome 125
|
3101
3417
|
*/
|
3102
|
-
export function
|
3418
|
+
export function closeScanner<T = string>(scannerHandle: T): Promise<CloseScannerResponse<T>>;
|
3419
|
+
export function closeScanner<T = string>(
|
3420
|
+
scannerHandle: T,
|
3421
|
+
callback: (response: CloseScannerResponse<T>) => void,
|
3422
|
+
): void;
|
3423
|
+
|
3424
|
+
/**
|
3425
|
+
* Gets the group names and member options from a scanner previously opened by {@link openScanner}. This method returns a Promise that resolves with a {@link GetOptionGroupsResponse} object. If a callback is passed to this function, returned data is passed to it instead.
|
3426
|
+
* @param scannerHandle The handle of an open scanner returned from a call to {@link openScanner}.
|
3427
|
+
* @since Chrome 125
|
3428
|
+
*/
|
3429
|
+
export function getOptionGroups<T = string>(scannerHandle: T): Promise<GetOptionGroupsResponse<T>>;
|
3430
|
+
export function getOptionGroups<T = string>(
|
3431
|
+
scannerHandle: T,
|
3432
|
+
callback: (response: GetOptionGroupsResponse<T>) => void,
|
3433
|
+
): void;
|
3434
|
+
|
3435
|
+
/**
|
3436
|
+
* Gets the list of available scanners and returns a Promise that resolves with a {@link GetScannerListResponse} object. If a callback is passed to this function, returned data is passed to it instead.
|
3437
|
+
* @param filter A {@link DeviceFilter} indicating which types of scanners should be returned.
|
3438
|
+
* @since Chrome 125
|
3439
|
+
*/
|
3440
|
+
export function getScannerList(filter: DeviceFilter): Promise<GetScannerListResponse>;
|
3441
|
+
export function getScannerList(
|
3442
|
+
filter: DeviceFilter,
|
3443
|
+
callback: (response: GetScannerListResponse) => void,
|
3444
|
+
): void;
|
3445
|
+
|
3446
|
+
/**
|
3447
|
+
* Opens a scanner for exclusive access and returns a Promise that resolves with an {@link OpenScannerResponse} object. If a callback is passed to this function, returned data is passed to it instead.
|
3448
|
+
* @param scannerId The ID of a scanner to be opened. This value is one returned from a previous call to {@link getScannerList}.
|
3449
|
+
* @since Chrome 125
|
3450
|
+
*/
|
3451
|
+
export function openScanner<T = string>(scannerId: T): Promise<OpenScannerResponse<T>>;
|
3452
|
+
export function openScanner<T = string>(
|
3453
|
+
scannerId: T,
|
3454
|
+
callback: (response: OpenScannerResponse<T>) => void,
|
3455
|
+
): void;
|
3456
|
+
|
3457
|
+
/**
|
3458
|
+
* Reads the next chunk of available image data from an active job handle, and returns a Promise that resolves with a {@link ReadScanDataResponse} object. If a callback is used, the object is passed to it instead.
|
3459
|
+
*
|
3460
|
+
* **Note:**It is valid for a response result to be `SUCCESS` with a zero-length `data` member. This means the scanner is still working but does not yet have additional data ready. The caller should wait a short time and try again.
|
3461
|
+
*
|
3462
|
+
* When the scan job completes, the response will have the result value of `EOF`. This response may contain a final non-zero `data` member.
|
3463
|
+
* @param job Active job handle previously returned from {@link startScan}.
|
3464
|
+
* @since Chrome 125
|
3465
|
+
*/
|
3466
|
+
export function readScanData<T = string>(job: T): Promise<ReadScanDataResponse<T>>;
|
3467
|
+
export function readScanData<T = string>(job: T, callback: (response: ReadScanDataResponse<T>) => void): void;
|
3468
|
+
|
3469
|
+
/**
|
3470
|
+
* Performs a document scan and returns a Promise that resolves with a {@link ScanResults} object. If a callback is passed to this function, the returned data is passed to it instead.
|
3471
|
+
* @param options An object containing scan parameters.
|
3472
|
+
*/
|
3473
|
+
export function scan(options: ScanOptions): Promise<ScanResults>;
|
3474
|
+
export function scan(options: ScanOptions, callback: (result: ScanResults) => void): void;
|
3475
|
+
|
3476
|
+
/**
|
3477
|
+
* Sets options on the specified scanner and returns a Promise that resolves with a {@link SetOptionsResponse} object containing the result of trying to set every value in the order of the passed-in {@link OptionSetting} object. If a callback is used, the object is passed to it instead.
|
3478
|
+
* @param scannerHandle The handle of the scanner to set options on. This should be a value previously returned from a call to {@link openScanner}.
|
3479
|
+
* @param options A list of `OptionSetting` objects to be applied to the scanner.
|
3480
|
+
* @since Chrome 125
|
3481
|
+
*/
|
3482
|
+
export function setOptions<T = string>(
|
3483
|
+
scannerHandle: T,
|
3484
|
+
options: OptionSetting[],
|
3485
|
+
): Promise<SetOptionsResponse<T>>;
|
3486
|
+
export function setOptions<T = string>(
|
3487
|
+
scannerHandle: T,
|
3488
|
+
options: OptionSetting[],
|
3489
|
+
callback: (response: SetOptionsResponse<T>) => void,
|
3490
|
+
): void;
|
3491
|
+
|
3492
|
+
/**
|
3493
|
+
* Starts a scan on the specified scanner and returns a Promise that resolves with a {@link StartScanResponse}. If a callback is used, the object is passed to it instead. If the call was successful, the response includes a job handle that can be used in subsequent calls to read scan data or cancel a scan.
|
3494
|
+
* @param scannerHandle The handle of an open scanner. This should be a value previously returned from a call to {@link openScanner}.
|
3495
|
+
* @param options A {@link StartScanOptions} object indicating the options to be used for the scan. The `StartScanOptions.format` property must match one of the entries returned in the scanner's `ScannerInfo`.
|
3496
|
+
* @since Chrome 125
|
3497
|
+
*/
|
3498
|
+
export function startScan<T = string>(
|
3499
|
+
scannerHandle: T,
|
3500
|
+
options: StartScanOptions,
|
3501
|
+
): Promise<StartScanResponse<T>>;
|
3502
|
+
export function startScan<T = string>(
|
3503
|
+
scannerHandle: T,
|
3504
|
+
options: StartScanOptions,
|
3505
|
+
callback: (response: StartScanResponse<T>) => void,
|
3506
|
+
): void;
|
3103
3507
|
}
|
3104
3508
|
|
3105
3509
|
////////////////////
|
@@ -8300,6 +8704,8 @@ declare namespace chrome {
|
|
8300
8704
|
|
8301
8705
|
// Source: https://developer.chrome.com/docs/extensions/mv3/declare_permissions/
|
8302
8706
|
export type ManifestPermissions =
|
8707
|
+
| "accessibilityFeatures.modify"
|
8708
|
+
| "accessibilityFeatures.read"
|
8303
8709
|
| "activeTab"
|
8304
8710
|
| "alarms"
|
8305
8711
|
| "audio"
|
@@ -8321,6 +8727,7 @@ declare namespace chrome {
|
|
8321
8727
|
| "desktopCapture"
|
8322
8728
|
| "documentScan"
|
8323
8729
|
| "downloads"
|
8730
|
+
| "downloads.open"
|
8324
8731
|
| "downloads.shelf"
|
8325
8732
|
| "downloads.ui"
|
8326
8733
|
| "enterprise.deviceAttributes"
|
@@ -8373,6 +8780,7 @@ declare namespace chrome {
|
|
8373
8780
|
| "userScripts"
|
8374
8781
|
| "vpnProvider"
|
8375
8782
|
| "wallpaper"
|
8783
|
+
| "webAuthenticationProxy"
|
8376
8784
|
| "webNavigation"
|
8377
8785
|
| "webRequest"
|
8378
8786
|
| "webRequestBlocking"
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.306",
|
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": "
|
97
|
+
"typesPublisherContentHash": "bb923720eea25072715f0b54926923ab06f4c7923229e632c45fda4919b4f4ab",
|
98
98
|
"typeScriptVersion": "5.0"
|
99
99
|
}
|