forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chrome-app.d.ts
719 lines (635 loc) · 26.4 KB
/
chrome-app.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
// Type definitions for Chrome packaged application development
// Project: http://developer.chrome.com/apps/
// Definitions by: Adam Lay <https://github.com/AdamLay>, MIZUNE Pine <https://github.com/pine613>, MIZUSHIMA Junki <https://github.com/mzsm>, Ingvar Stepanyan <https://github.com/RReverser>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="chrome.d.ts"/>
/// <reference path='../filesystem/filesystem.d.ts'/>
////////////////////
// App
////////////////////
declare namespace chrome.app {
interface AppDetails extends chrome.runtime.Manifest {
id: string;
}
export function getDetails(): AppDetails;
}
////////////////////
// App Runtime
////////////////////
declare namespace chrome.app.runtime {
interface LaunchData {
id?: string;
items?: LaunchDataItem[];
url?: string;
referrerUrl?: string;
isKioskSession?: boolean;
}
interface LaunchDataItem {
entry: FileEntry;
type: string;
}
interface LaunchedEvent extends chrome.events.Event<(launchData: LaunchData) => void> {}
interface RestartedEvent extends chrome.events.Event<() => void> {}
var onLaunched: LaunchedEvent;
var onRestarted: RestartedEvent;
}
////////////////////
// App Window
////////////////////
declare namespace chrome.app.window {
interface ContentBounds {
left?: number;
top?: number;
width?: number;
height?: number;
}
interface BoundsSpecification {
left?: number;
top?: number;
width?: number;
height?: number;
minWidth?: number;
minHeight?: number;
maxWidth?: number;
maxHeight?: number;
}
interface Bounds {
left: number;
top: number;
width: number;
height: number;
minWidth?: number;
minHeight?: number;
maxWidth?: number;
maxHeight?: number;
setPosition(left: number, top: number): void;
setSize(width: number, height: number): void;
setMinimumSize(minWidth: number, minHeight: number): void;
setMaximumSize(maxWidth: number, maxHeight: number): void;
}
interface FrameOptions {
type?: string;
color?: string;
activeColor?: string;
inactiveColor?: string;
}
interface CreateWindowOptions {
id?: string;
innerBounds?: BoundsSpecification;
outerBounds?: BoundsSpecification;
minWidth?: number;
minHeight?: number;
maxWidth?: number;
maxHeight?: number;
frame?: any; // string ("none", "chrome") or FrameOptions
bounds?: ContentBounds;
alphaEnabled?: boolean;
state?: string; // "normal", "fullscreen", "maximized", "minimized"
hidden?: boolean;
resizable?: boolean;
singleton?: boolean;
alwaysOnTop?: boolean;
focused?: boolean;
visibleOnAllWorkspaces?: boolean;
}
interface AppWindow {
focus: () => void;
fullscreen: () => void;
isFullscreen: () => boolean;
minimize: () => void;
isMinimized: () => boolean;
maximize: () => void;
isMaximized: () => boolean;
restore: () => void;
moveTo: (left: number, top: number) => void;
resizeTo: (width: number, height: number) => void;
drawAttention: () => void;
clearAttention: () => void;
close: () => void;
show: () => void;
hide: () => void;
getBounds: () => ContentBounds;
setBounds: (bounds: ContentBounds) => void;
isAlwaysOnTop: () => boolean;
setAlwaysOnTop: (alwaysOnTop: boolean) => void;
setVisibleOnAllWorkspaces: (alwaysVisible: boolean) => void;
contentWindow: Window;
id: string;
innerBounds: Bounds;
outerBounds: Bounds;
onBoundsChanged: WindowEvent;
onClosed: WindowEvent;
onFullscreened: WindowEvent;
onMaximized: WindowEvent;
onMinimized: WindowEvent;
onRestored: WindowEvent;
}
export function create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void;
export function current(): AppWindow;
export function get(id: string): AppWindow;
export function getAll(): AppWindow[];
export function canSetVisibleOnAllWorkspaces(): boolean;
interface WindowEvent extends chrome.events.Event<() => void> {}
var onBoundsChanged: WindowEvent;
var onClosed: WindowEvent;
var onFullscreened: WindowEvent;
var onMaximized: WindowEvent;
var onMinimized: WindowEvent;
var onRestored: WindowEvent;
}
////////////////////
// fileSystem
////////////////////
declare namespace chrome.fileSystem {
interface AcceptOptions {
description?: string;
mimeTypes?: string[];
extensions?: string[];
}
interface ChooseEntryOptions {
type?: string;
suggestedName?: string;
accepts?: AcceptOptions[];
acceptsAllTypes?: boolean;
acceptsMultiple?: boolean;
}
export function getDisplayPath(entry: Entry, callback: (displayPath: string) => void): void;
export function getWritableEntry(entry: Entry, callback: (entry: Entry) => void): void;
export function isWritableEntry(entry: Entry, callback: (isWritable: boolean) => void): void;
export function chooseEntry(callback: (entry: Entry) => void): void;
export function chooseEntry(callback: (fileEntries: FileEntry[]) => void): void;
export function chooseEntry(options: ChooseEntryOptions, callback: (entry: Entry) => void): void;
export function chooseEntry(options: ChooseEntryOptions, callback: (fileEntries: FileEntry[]) => void): void;
export function restoreEntry(id: string, callback: (entry: Entry) => void): void;
export function isRestorable(id: string, callback: (isRestorable: boolean) => void): void;
export function retainEntry(entry: Entry): string;
}
////////////////////
// Media Galleries
////////////////////
declare namespace chrome.mediaGalleries {
interface MediaFileSystemsOptions {
interactive?: 'no' | 'yes' | 'if_needed';
}
interface MediaFileSystemMetadata {
name: string;
galleryId: string;
deviceId?: string;
isRemovable: boolean;
isMediaDevice: boolean;
isAvailable: boolean;
}
interface MetadataOptions {
metadataType: 'all' | 'mimeTypeAndTags' | 'mimeTypeOnly';
}
interface RawTag {
type: string;
tags: { [name: string]: string; };
}
interface Metadata {
// The browser sniffed mime type.
mimeType: string;
// Defined for images and video. In pixels.
height?: number;
width?: number;
// Defined for images only.
xResolution?: number;
yResolution?: number;
// Defined for audio and video. In seconds.
duration?: number;
// Defined for images and video. In degrees.
rotation?: number;
// Defined for images only.
cameraMake?: string;
cameraModel?: string;
exposureTimeSeconds?: number;
flashFired?: boolean;
fNumber?: number;
focalLengthMm?: number;
isoEquivalent?: number;
// Defined for audio and video only.
album?: string;
artist?: string;
comment?: string;
copyright?: string;
disc?: number;
genre?: string;
language?: string;
title?: string;
track?: number;
// All the metadata in the media file. For formats with multiple streams, stream order will be preserved. Container metadata is the first element.
rawTags: RawTag[];
// The images embedded in the media file's metadata. This is most often used for album art or video thumbnails.
attachedImages: Blob[];
}
interface GalleryWatchResult {
galleryId: string;
success: boolean;
}
interface GalleryChangedEventArgs {
type: 'contents_changed' | 'watch_dropped';
galleryId: string;
}
interface ScanProgressEventArgs {
// The type of progress event, i.e. start, finish, etc.
type: 'start' | 'cancel' | 'finish' | 'error';
// The number of Galleries found.
galleryCount?: number;
// Appoximate number of media files found; some file types can be either audio or video and are included in both counts.
audioCount?: number;
imageCount?: number;
videoCount?: number;
}
export function getMediaFileSystems(callback: (mediaFileSystems: FileSystem[]) => void): void;
export function getMediaFileSystems(options: MediaFileSystemsOptions, callback: (mediaFileSystems: FileSystem[]) => void): void;
export function addUserSelectedFolder(callback: (mediaFileSystems: FileSystem[], selectedFileSystemName: string) => void): void;
export function dropPermissionForMediaFileSystem(galleryId: string, callback?: () => void): void;
export function startMediaScan(): void;
export function cancelMediaScan(): void;
export function addScanResults(callback: (mediaFileSystems: FileSystem[]) => void): void;
export function getMediaFileSystemMetadata(mediaFileSystem: FileSystem): MediaFileSystemMetadata;
export function getAllMediaFileSystemMetadata(callback: (metadatas: MediaFileSystemMetadata[]) => void): void;
export function getMetadata(mediaFile: Blob, callback: (metadata: Metadata) => void): void;
export function getMetadata(mediaFile: Blob, options: MetadataOptions, callback: (metadata: Metadata) => void): void;
export function addGalleryWatch(galleryId: string, callback: (result: GalleryWatchResult) => void): void;
export function removeGalleryWatch(galleryId: string): void;
export function getAllGalleryWatch(callback: (galleryIds: string[]) => void): void;
export function removeAllGalleryWatch(): void;
var onGalleryChanged: chrome.events.Event<(args: GalleryChangedEventArgs) => void>;
var onScanProgress: chrome.events.Event<(args: ScanProgressEventArgs) => void>;
}
////////////////////
// Sockets
////////////////////
declare namespace chrome.sockets.tcp {
interface CreateInfo {
socketId: number;
}
interface SendInfo {
resultCode: number;
bytesSent?: number;
}
interface ReceiveEventArgs {
socketId: number;
data: ArrayBuffer;
}
interface ReceiveErrorEventArgs {
socketId: number;
resultCode: number;
}
interface SocketProperties {
persistent?: boolean;
name?: string;
bufferSize?: number;
}
interface SocketInfo {
socketId: number;
persistent: boolean;
name?: string;
bufferSize?: number;
paused: boolean;
connected: boolean;
localAddress?: string;
localPort?: number;
peerAddress?: string;
peerPort?: number;
}
export function create(callback: (createInfo: CreateInfo) => void): void;
export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void;
export function update(socketId: number, properties: SocketProperties, callback?: () => void): void;
export function setPaused(socketId: number, paused: boolean, callback?: () => void): void;
export function setKeepAlive(socketId: number,
enable: boolean, callback: (result: number) => void): void;
export function setKeepAlive(socketId: number,
enable: boolean, delay: number, callback: (result: number) => void): void;
export function setNoDelay(socketId: number, noDelay: boolean, callback: (result: number) => void): void;
export function connect(socketId: number,
peerAddress: string, peerPort: number, callback: (result: number) => void): void;
export function disconnect(socketId: number, callback?: () => void): void;
export function send(socketId: number, data: ArrayBuffer, callback: (sendInfo: SendInfo) => void): void;
export function close(socketId: number, callback?: () => void): void;
export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void;
export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void;
var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>;
var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>;
}
declare namespace chrome.sockets.udp {
interface CreateInfo {
socketId: number;
}
interface SendInfo {
resultCode: number;
bytesSent?: number;
}
interface ReceiveEventArgs {
socketId: number;
data: ArrayBuffer;
remoteAddress: string;
remotePort: number;
}
interface ReceiveErrorEventArgs {
socketId: number;
resultCode: number;
}
interface SocketProperties {
persistent?: boolean;
name?: string;
bufferSize?: number;
}
interface SocketInfo {
socketId: number;
persistent: boolean;
name?: string;
bufferSize?: number;
paused: boolean;
localAddress?: string;
localPort?: number;
}
export function create(callback: (createInfo: CreateInfo) => void): void;
export function create(properties: SocketProperties,
callback: (createInfo: CreateInfo) => void): void;
export function update(socketId: number, properties: SocketProperties, callback?: () => void): void;
export function setPaused(socketId: number, paused: boolean, callback?: () => void): void;
export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void;
export function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void;
export function close(socketId: number, callback?: () => void): void;
export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void;
export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void;
export function joinGroup(socketId: number, address: string, callback: (result: number) => void): void;
export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void;
export function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void;
export function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void;
export function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void;
var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>;
var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>;
}
declare namespace chrome.sockets.tcpServer {
interface CreateInfo {
socketId: number;
}
interface AcceptEventArgs {
socketId: number;
clientSocketId: number;
}
interface AcceptErrorEventArgs {
socketId: number;
resultCode: number;
}
interface SocketProperties {
persistent?: boolean;
name?: string;
}
interface SocketInfo {
socketId: number;
persistent: boolean;
name?: string;
paused: boolean;
localAddress?: string;
localPort?: number;
}
export function create(callback: (createInfo: CreateInfo) => void): void;
export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void;
export function update(socketId: number, properties: SocketProperties, callback?: () => void): void;
export function setPaused(socketId: number, paused: boolean, callback?: () => void): void;
export function listen(socketId: number, address: string,
port: number, backlog: number, callback: (result: number) => void): void;
export function listen(socketId: number, address: string,
port: number, callback: (result: number) => void): void;
export function disconnect(socketId: number, callback?: () => void): void;
export function close(socketId: number, callback?: () => void): void;
export function getInfo(socketId: number, callback: (socketInfos: SocketInfo[]) => void): void;
var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>;
var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>;
}
////////////////////
// System Display
////////////////////
/**
* Use the system.display API to query display metadata.
* Permissions: "system.display"
* @since Chrome 30.
*/
declare namespace chrome.system.display {
interface Bounds {
/** The x-coordinate of the upper-left corner. */
left: number;
/** The y-coordinate of the upper-left corner. */
top: number;
/** The width of the display in pixels. */
width: number;
/** The height of the display in pixels. */
height: number;
}
interface Insets {
/** The x-axis distance from the left bound. */
left: number;
/** The y-axis distance from the top bound. */
top: number;
/** The x-axis distance from the right bound. */
right: number;
/** The y-axis distance from the bottom bound. */
bottom: number;
}
interface DisplayInfo {
/** The unique identifier of the display. */
id: string;
/** The user-friendly name (e.g. "HP LCD monitor"). */
name: string;
/** Identifier of the display that is being mirrored on the display unit. If mirroring is not in progress, set to an empty string. Currently exposed only on ChromeOS. Will be empty string on other platforms. */
mirroringSourceId: string;
/** True if this is the primary display. */
isPrimary: boolean;
/** True if this is an internal display. */
isInternal: boolean;
/** True if this display is enabled. */
isEnabled: boolean;
/** The number of pixels per inch along the x-axis. */
dpiX: number;
/** The number of pixels per inch along the y-axis. */
dpiY: number;
/** The display's clockwise rotation in degrees relative to the vertical position. Currently exposed only on ChromeOS. Will be set to 0 on other platforms. */
rotation: number;
/** The display's logical bounds. */
bounds: Bounds;
/** The display's insets within its screen's bounds. Currently exposed only on ChromeOS. Will be set to empty insets on other platforms. */
overscan: Insets;
/** The usable work area of the display within the display bounds. The work area excludes areas of the display reserved for OS, for example taskbar and launcher. */
workArea: Bounds;
}
/** The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|. */
interface DisplayProps {
/** If set and not empty, starts mirroring between this and the display with the provided id (the system will determine which of the displays is actually mirrored). If set and not empty, stops mirroring between this and the display with the specified id (if mirroring is in progress). If set, no other parameter may be set. */
mirroringSourceId?: string;
/** If set to true, makes the display primary. No-op if set to false. */
isPrimary?: boolean;
/** If set, sets the display's overscan insets to the provided values. Note that overscan values may not be negative or larger than a half of the screen's size. Overscan cannot be changed on the internal monitor. It's applied after isPrimary parameter. */
overscan?: Insets;
/** If set, updates the display's rotation. Legal values are [0, 90, 180, 270]. The rotation is set clockwise, relative to the display's vertical position. It's applied after overscan paramter. */
rotation?: number;
/** If set, updates the display's logical bounds origin along x-axis. Applied together with boundsOriginY, if boundsOriginY is set. Note that, when updating the display origin, some constraints will be applied, so the final bounds origin may be different than the one set. The final bounds can be retrieved using getInfo. The bounds origin is applied after rotation. The bounds origin cannot be changed on the primary display. Note that is also invalid to set bounds origin values if isPrimary is also set (as isPrimary parameter is applied first). */
boundsOriginX?: number;
/** If set, updates the display's logical bounds origin along y-axis. See documentation for boundsOriginX parameter. */
boundsOriginY?: number;
}
interface DisplayChangedEvent extends chrome.events.Event<() => void> { }
/** Queries basic CPU information of the system. */
export function getInfo(callback: (info: DisplayInfo[]) => void): void;
/** Updates the properties for the display specified by |id|, according to the information provided in |info|. On failure, runtime.lastError will be set. */
export function setDisplayProperties(id: string, info: DisplayInfo, callback?: () => void): void;
export var onDisplayChanged: DisplayChangedEvent;
}
////////////////////
// System - Network
////////////////////
declare namespace chrome.system.network {
interface NetworkInterface {
name: string;
address: string;
prefixLength: number;
}
export function getNetworkInterfaces(callback: (networkInterfaces: NetworkInterface[]) => void): void;
}
declare namespace chrome.runtime {
interface Manifest {
app?: {
background?: {
scripts?: string[];
}
},
bluetooth?: {
uuids?: string[];
socket?: boolean;
low_energy?: boolean;
peripheral?: boolean;
},
file_handlers?: {
[name: string]: {
types?: string[];
extensions?: string[];
title?: string;
}
},
kiosk_enabled?: boolean,
kiosk_only?: boolean,
url_handlers?: {
[name: string]: {
matches: string[];
title?: string;
}
},
usb_printers?: {
filters: {
vendorId?: number;
productId?: number;
interfaceClass?: number;
interfaceSubclass?: number;
interfaceProtocol?: number;
}[]
},
webview?: {
partitions?: {
name: string;
accessible_resources: string[];
}[]
}
}
}
////////////////////
// USB
////////////////////
declare namespace chrome.usb {
type Direction = 'in' | 'out';
interface Device {
device: number,
vendorId: number,
productId: number,
productName: string,
manufacturerName: string,
serialNumber: string
}
interface ConnectionHandle {
handle: number,
vendorId: number,
productId: number
}
interface EndpointDescriptor {
address: number,
type: 'control' | 'interrupt' | 'isochronous' | 'bulk',
direction: Direction,
maximumPacketSize: number,
synchronization?: 'asynchronous' | 'adaptive' | 'synchronous',
usage?: 'data' | 'feedback' | 'explicitFeedback',
pollingInterval?: number,
extra_data: ArrayBuffer
}
interface InterfaceDescriptor {
interfaceNumber: number,
alternateSetting: number,
interfaceClass: number,
interfaceSubclass: number,
interfaceProtocol: number,
description?: string,
endpoints: EndpointDescriptor[],
extra_data: ArrayBuffer
}
interface ConfigDescriptor {
active: boolean,
configurationValue: number,
description?: string,
selfPowered: boolean,
remoteWakeup: boolean,
maxPower: number,
interfaces: InterfaceDescriptor[],
extra_data: ArrayBuffer
}
interface GenericTransferInfo {
direction: Direction,
endpoint: number,
length?: number,
data?: ArrayBuffer,
timeout?: number
}
interface TransferResultInfo {
resultCode: number,
data?: ArrayBuffer
}
interface DeviceFilter {
vendorId?: number,
productId?: number,
interfaceClass?: number,
interfaceSubclass?: number,
interfaceProtocol?: number
}
interface TransferInfo {
direction: Direction;
recipient: 'device' | 'interface' | 'endpoint' | 'other';
requestType: 'standard' | 'class' | 'vendor' | 'reserved';
request: number;
value: number;
index: number;
length?: number;
data?: ArrayBuffer;
timeout?: number;
}
interface DeviceEvent extends chrome.events.Event<(device: Device) => void> {}
export var onDeviceAdded: DeviceEvent;
export var onDeviceRemoved: DeviceEvent;
export function getDevices(options: { vendorId?: number, productId?: number, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void;
export function getUserSelectedDevices(options: { multiple?: boolean, filters?: DeviceFilter[] }, callback: (devices: Device[]) => void): void;
export function getConfigurations(device: Device, callback: (configs: ConfigDescriptor[]) => void): void;
export function requestAccess(device: Device, interfaceId: number, callback: (success: boolean) => void): void;
export function openDevice(device: Device, callback: (handle: ConnectionHandle) => void): void;
export function findDevices(options: { vendorId: number, productId: number, interfaceId?: number }, callback: (handles: ConnectionHandle[]) => void): void;
export function closeDevice(handle: ConnectionHandle, callback?: () => void): void;
export function setConfiguration(handle: ConnectionHandle, configurationValue: number, callback: () => void): void;
export function getConfiguration(handle: ConnectionHandle, callback: (config: ConfigDescriptor) => void): void;
export function listInterfaces(handle: ConnectionHandle, callback: (descriptors: InterfaceDescriptor[]) => void): void;
export function claimInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void;
export function releaseInterface(handle: ConnectionHandle, interfaceNumber: number, callback: () => void): void;
export function setInterfaceAlternateSetting(handle: ConnectionHandle, interfaceNumber: number, alternateSetting: number, callback: () => void): void;
export function controlTransfer(handle: ConnectionHandle, transferInfo: TransferInfo, callback: (info: TransferResultInfo) => void): void;
export function bulkTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void;
export function interruptTransfer(handle: ConnectionHandle, transferInfo: GenericTransferInfo, callback: (info: TransferResultInfo) => void): void;
export function isochronousTransfer(handle: ConnectionHandle, transferInfo: { transferInfo: GenericTransferInfo, packets: number, packetLength: number }, callback: (info: TransferResultInfo) => void): void;
export function resetDevice(handle: ConnectionHandle, callback: (success: boolean) => void): void;
}