@types/chrome 0.1.16 → 0.1.18
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 +313 -305
- 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:
|
11
|
+
* Last updated: Thu, 02 Oct 2025 06:39:55 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
@@ -6276,96 +6276,86 @@ declare namespace chrome {
|
|
6276
6276
|
* @platform ChromeOS only
|
6277
6277
|
*/
|
6278
6278
|
export namespace input.ime {
|
6279
|
-
/** See
|
6279
|
+
/** See https://www.w3.org/TR/uievents/#events-KeyboardEvent */
|
6280
6280
|
export interface KeyboardEvent {
|
6281
|
-
/**
|
6282
|
-
* Optional.
|
6283
|
-
* Whether or not the SHIFT key is pressed.
|
6284
|
-
*/
|
6281
|
+
/** Whether or not the SHIFT key is pressed. */
|
6285
6282
|
shiftKey?: boolean | undefined;
|
6286
|
-
/**
|
6287
|
-
* Optional.
|
6288
|
-
* Whether or not the ALT key is pressed.
|
6289
|
-
*/
|
6283
|
+
/** Whether or not the ALT key is pressed. */
|
6290
6284
|
altKey?: boolean | undefined;
|
6291
6285
|
/**
|
6292
|
-
* Optional.
|
6293
6286
|
* Whether or not the ALTGR key is pressed.
|
6294
6287
|
* @since Chrome 79
|
6295
6288
|
*/
|
6296
6289
|
altgrKey?: boolean | undefined;
|
6297
6290
|
/**
|
6298
|
-
*
|
6299
|
-
*
|
6300
|
-
* @deprecated since Chrome 79.
|
6291
|
+
* The ID of the request
|
6292
|
+
* @deprecated Use the `requestId` param from the `onKeyEvent` event instead.
|
6301
6293
|
*/
|
6302
6294
|
requestId?: string | undefined;
|
6303
|
-
/** Value of the key being pressed */
|
6295
|
+
/** Value of the key being pressed. */
|
6304
6296
|
key: string;
|
6305
|
-
/**
|
6306
|
-
* Optional.
|
6307
|
-
* Whether or not the CTRL key is pressed.
|
6308
|
-
*/
|
6297
|
+
/** Whether or not the CTRL key is pressed. */
|
6309
6298
|
ctrlKey?: boolean | undefined;
|
6310
6299
|
/** One of keyup or keydown. */
|
6311
|
-
type:
|
6312
|
-
/**
|
6313
|
-
* Optional.
|
6314
|
-
* The extension ID of the sender of this keyevent.
|
6315
|
-
* @since Chrome 34
|
6316
|
-
*/
|
6300
|
+
type: `${KeyboardEventType}`;
|
6301
|
+
/** The extension ID of the sender of this keyevent. */
|
6317
6302
|
extensionId?: string | undefined;
|
6318
|
-
/**
|
6319
|
-
* Optional.
|
6320
|
-
* Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state.
|
6321
|
-
* @since Chrome 26
|
6322
|
-
*/
|
6303
|
+
/** Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state. */
|
6323
6304
|
code: string;
|
6324
|
-
/**
|
6325
|
-
* Optional.
|
6326
|
-
* The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed.
|
6327
|
-
* @since Chrome 37
|
6328
|
-
*/
|
6305
|
+
/** The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. */
|
6329
6306
|
keyCode?: number | undefined;
|
6330
|
-
/**
|
6331
|
-
* Optional.
|
6332
|
-
* Whether or not the CAPS_LOCK is enabled.
|
6333
|
-
* @since Chrome 29
|
6334
|
-
*/
|
6307
|
+
/** Whether or not the CAPS_LOCK is enabled. */
|
6335
6308
|
capsLock?: boolean | undefined;
|
6336
6309
|
}
|
6337
6310
|
|
6311
|
+
/** @since Chrome 44 */
|
6312
|
+
export enum KeyboardEventType {
|
6313
|
+
KEYUP = "keyup",
|
6314
|
+
KEYDOWN = "keydown",
|
6315
|
+
}
|
6316
|
+
|
6338
6317
|
/**
|
6339
6318
|
* The auto-capitalize type of the text field.
|
6340
6319
|
* @since Chrome 69
|
6341
6320
|
*/
|
6342
|
-
export
|
6321
|
+
export enum AutoCapitalizeType {
|
6322
|
+
CHARACTERS = "characters",
|
6323
|
+
WORDS = "words",
|
6324
|
+
SENTENCES = "sentences",
|
6325
|
+
}
|
6326
|
+
|
6327
|
+
/**
|
6328
|
+
* Type of value this text field edits, (Text, Number, URL, etc)
|
6329
|
+
* @since Chrome 44
|
6330
|
+
*/
|
6331
|
+
export enum InputContextType {
|
6332
|
+
TEXT = "text",
|
6333
|
+
SEARCH = "search",
|
6334
|
+
TEL = "tel",
|
6335
|
+
URL = "url",
|
6336
|
+
EMAIL = "email",
|
6337
|
+
NUMBER = "number",
|
6338
|
+
PASSWORD = "password",
|
6339
|
+
NULL = "null",
|
6340
|
+
}
|
6341
|
+
|
6343
6342
|
/** Describes an input Context */
|
6344
6343
|
export interface InputContext {
|
6345
6344
|
/** This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called. */
|
6346
6345
|
contextID: number;
|
6347
6346
|
/** Type of value this text field edits, (Text, Number, URL, etc) */
|
6348
|
-
type:
|
6349
|
-
/**
|
6350
|
-
* Whether the text field wants auto-correct.
|
6351
|
-
* @since Chrome 40
|
6352
|
-
*/
|
6347
|
+
type: `${InputContextType}`;
|
6348
|
+
/** Whether the text field wants auto-correct. */
|
6353
6349
|
autoCorrect: boolean;
|
6354
|
-
/**
|
6355
|
-
* Whether the text field wants auto-complete.
|
6356
|
-
* @since Chrome 40
|
6357
|
-
*/
|
6350
|
+
/** Whether the text field wants auto-complete. */
|
6358
6351
|
autoComplete: boolean;
|
6359
|
-
/**
|
6360
|
-
* Whether the text field wants spell-check.
|
6361
|
-
* @since Chrome 40
|
6362
|
-
*/
|
6352
|
+
/** Whether the text field wants spell-check. */
|
6363
6353
|
spellCheck: boolean;
|
6364
6354
|
/**
|
6365
6355
|
* The auto-capitalize type of the text field.
|
6366
6356
|
* @since Chrome 69
|
6367
6357
|
*/
|
6368
|
-
autoCapitalize: AutoCapitalizeType
|
6358
|
+
autoCapitalize: `${AutoCapitalizeType}`;
|
6369
6359
|
/**
|
6370
6360
|
* Whether text entered into the text field should be used to improve typing suggestions for the user.
|
6371
6361
|
* @since Chrome 68
|
@@ -6373,18 +6363,15 @@ declare namespace chrome {
|
|
6373
6363
|
shouldDoLearning: boolean;
|
6374
6364
|
}
|
6375
6365
|
|
6376
|
-
/**
|
6377
|
-
* A menu item used by an input method to interact with the user from the language menu.
|
6378
|
-
* @since Chrome 30
|
6379
|
-
*/
|
6366
|
+
/** A menu item used by an input method to interact with the user from the language menu. */
|
6380
6367
|
export interface MenuItem {
|
6381
6368
|
/** String that will be passed to callbacks referencing this MenuItem. */
|
6382
6369
|
id: string;
|
6383
|
-
/**
|
6370
|
+
/** Text displayed in the menu for this item. */
|
6384
6371
|
label?: string | undefined;
|
6385
|
-
/**
|
6386
|
-
style?:
|
6387
|
-
/**
|
6372
|
+
/** The type of menu item. */
|
6373
|
+
style?: `${MenuItemStyle}` | undefined;
|
6374
|
+
/** Indicates this item is visible. */
|
6388
6375
|
visible?: boolean | undefined;
|
6389
6376
|
/** Indicates this item should be drawn with a check. */
|
6390
6377
|
checked?: boolean | undefined;
|
@@ -6392,11 +6379,14 @@ declare namespace chrome {
|
|
6392
6379
|
enabled?: boolean | undefined;
|
6393
6380
|
}
|
6394
6381
|
|
6395
|
-
|
6396
|
-
|
6397
|
-
|
6398
|
-
|
6399
|
-
|
6382
|
+
/**
|
6383
|
+
* The type of menu item. Radio buttons between separators are considered grouped.
|
6384
|
+
* @since Chrome 44
|
6385
|
+
*/
|
6386
|
+
export enum MenuItemStyle {
|
6387
|
+
CHECK = "check",
|
6388
|
+
RADIO = "radio",
|
6389
|
+
SEPARATOR = "separator",
|
6400
6390
|
}
|
6401
6391
|
|
6402
6392
|
export interface CommitTextParameters {
|
@@ -6418,25 +6408,13 @@ declare namespace chrome {
|
|
6418
6408
|
candidate: string;
|
6419
6409
|
/** The candidate's id */
|
6420
6410
|
id: number;
|
6421
|
-
/**
|
6422
|
-
* Optional.
|
6423
|
-
* The id to add these candidates under
|
6424
|
-
*/
|
6411
|
+
/** The id to add these candidates under */
|
6425
6412
|
parentId?: number | undefined;
|
6426
|
-
/**
|
6427
|
-
* Optional.
|
6428
|
-
* Short string displayed to next to the candidate, often the shortcut key or index
|
6429
|
-
*/
|
6413
|
+
/** Short string displayed to next to the candidate, often the shortcut key or index */
|
6430
6414
|
label?: string | undefined;
|
6431
|
-
/**
|
6432
|
-
* Optional.
|
6433
|
-
* Additional text describing the candidate
|
6434
|
-
*/
|
6415
|
+
/** Additional text describing the candidate */
|
6435
6416
|
annotation?: string | undefined;
|
6436
|
-
/**
|
6437
|
-
* Optional.
|
6438
|
-
* The usage or detail description of word.
|
6439
|
-
*/
|
6417
|
+
/** The usage or detail description of word. */
|
6440
6418
|
usage?: CandidateUsage | undefined;
|
6441
6419
|
}
|
6442
6420
|
|
@@ -6453,7 +6431,7 @@ declare namespace chrome {
|
|
6453
6431
|
/** Index of the character to end this segment after. */
|
6454
6432
|
end: number;
|
6455
6433
|
/** The type of the underline to modify this segment. */
|
6456
|
-
style:
|
6434
|
+
style: `${UnderlineStyle}`;
|
6457
6435
|
}
|
6458
6436
|
|
6459
6437
|
export interface CompositionParameters {
|
@@ -6461,79 +6439,111 @@ declare namespace chrome {
|
|
6461
6439
|
contextID: number;
|
6462
6440
|
/** Text to set */
|
6463
6441
|
text: string;
|
6464
|
-
/**
|
6442
|
+
/** List of segments and their associated types. */
|
6465
6443
|
segments?: CompositionParameterSegment[] | undefined;
|
6466
6444
|
/** Position in the text of the cursor. */
|
6467
6445
|
cursor: number;
|
6468
|
-
/**
|
6446
|
+
/** Position in the text that the selection starts at. */
|
6469
6447
|
selectionStart?: number | undefined;
|
6470
|
-
/**
|
6448
|
+
/** Position in the text that the selection ends at. */
|
6471
6449
|
selectionEnd?: number | undefined;
|
6472
6450
|
}
|
6473
6451
|
|
6474
|
-
|
6452
|
+
/** @since Chrome 88 */
|
6453
|
+
export interface MenuParameters {
|
6454
|
+
/** MenuItems to add or update. They will be added in the order they exist in the array. */
|
6475
6455
|
items: MenuItem[];
|
6476
|
-
|
6456
|
+
/** ID of the engine to use. */
|
6457
|
+
engineID: string;
|
6477
6458
|
}
|
6478
6459
|
|
6479
|
-
/**
|
6480
|
-
|
6460
|
+
/**
|
6461
|
+
* Which mouse buttons was clicked.
|
6462
|
+
* @since Chrome 44
|
6463
|
+
*/
|
6464
|
+
export enum MouseButton {
|
6465
|
+
LEFT = "left",
|
6466
|
+
MIDDLE = "middle",
|
6467
|
+
RIGHT = "right",
|
6468
|
+
}
|
6481
6469
|
|
6482
|
-
/**
|
6483
|
-
|
6470
|
+
/**
|
6471
|
+
* The screen type under which the IME is activated.
|
6472
|
+
* @since Chrome 44
|
6473
|
+
*/
|
6474
|
+
export enum ScreenType {
|
6475
|
+
NORMAL = "normal",
|
6476
|
+
LOGIN = "login",
|
6477
|
+
LOCK = "lock",
|
6478
|
+
SECONDARY_LOGIN = "secondary-login",
|
6479
|
+
}
|
6480
|
+
|
6481
|
+
/**
|
6482
|
+
* The type of the underline to modify this segment.
|
6483
|
+
* @since Chrome 44
|
6484
|
+
*/
|
6485
|
+
export enum UnderlineStyle {
|
6486
|
+
UNDERLINE = "underline",
|
6487
|
+
DOUBLE_UNDERLINE = "doubleUnderline",
|
6488
|
+
NO_UNDERLINE = "noUnderline",
|
6489
|
+
}
|
6484
6490
|
|
6485
|
-
/**
|
6491
|
+
/**
|
6492
|
+
* Where to display the candidate window. If set to 'cursor', the window follows the cursor. If set to 'composition', the window is locked to the beginning of the composition.
|
6493
|
+
* @since Chrome 44
|
6494
|
+
*/
|
6495
|
+
export enum WindowPosition {
|
6496
|
+
CURSOR = "cursor",
|
6497
|
+
COMPOSITION = "composition",
|
6498
|
+
}
|
6499
|
+
|
6500
|
+
/** Type of assistive window. */
|
6501
|
+
export enum AssistiveWindowType {
|
6502
|
+
UNDO = "undo",
|
6503
|
+
}
|
6504
|
+
|
6505
|
+
/**
|
6506
|
+
* ID of a button in an assistive window.
|
6507
|
+
* @since Chrome 85
|
6508
|
+
*/
|
6509
|
+
export enum AssistiveWindowButton {
|
6510
|
+
UNDO = "undo",
|
6511
|
+
ADD_TO_DICTIONARY = "addToDictionary",
|
6512
|
+
}
|
6513
|
+
|
6514
|
+
/**
|
6515
|
+
* Properties of the assistive window.
|
6516
|
+
* @since Chrome 85
|
6517
|
+
*/
|
6486
6518
|
export interface AssistiveWindowProperties {
|
6487
|
-
type: AssistiveWindowType
|
6519
|
+
type: `${AssistiveWindowType}`;
|
6520
|
+
/** Sets true to show AssistiveWindow, sets false to hide. */
|
6488
6521
|
visible: boolean;
|
6522
|
+
/** Strings for ChromeVox to announce */
|
6489
6523
|
announceString?: string | undefined;
|
6490
6524
|
}
|
6491
6525
|
|
6492
6526
|
export interface CandidateWindowParameterProperties {
|
6493
|
-
/**
|
6494
|
-
* Optional.
|
6495
|
-
* True to show the cursor, false to hide it.
|
6496
|
-
*/
|
6527
|
+
/** True to show the cursor, false to hide it. */
|
6497
6528
|
cursorVisible?: boolean | undefined;
|
6498
|
-
/**
|
6499
|
-
* Optional.
|
6500
|
-
* True if the candidate window should be rendered vertical, false to make it horizontal.
|
6501
|
-
*/
|
6529
|
+
/** True if the candidate window should be rendered vertical, false to make it horizontal. */
|
6502
6530
|
vertical?: boolean | undefined;
|
6503
|
-
/**
|
6504
|
-
* Optional.
|
6505
|
-
* The number of candidates to display per page.
|
6506
|
-
*/
|
6531
|
+
/** The number of candidates to display per page. */
|
6507
6532
|
pageSize?: number | undefined;
|
6508
|
-
/**
|
6509
|
-
* Optional.
|
6510
|
-
* True to display the auxiliary text, false to hide it.
|
6511
|
-
*/
|
6533
|
+
/** True to display the auxiliary text, false to hide it. */
|
6512
6534
|
auxiliaryTextVisible?: boolean | undefined;
|
6513
|
-
/**
|
6514
|
-
* Optional.
|
6515
|
-
* Text that is shown at the bottom of the candidate window.
|
6516
|
-
*/
|
6535
|
+
/** Text that is shown at the bottom of the candidate window. */
|
6517
6536
|
auxiliaryText?: string | undefined;
|
6518
|
-
/**
|
6519
|
-
* Optional.
|
6520
|
-
* True to show the Candidate window, false to hide it.
|
6521
|
-
*/
|
6537
|
+
/** True to show the Candidate window, false to hide it. */
|
6522
6538
|
visible?: boolean | undefined;
|
6539
|
+
/** Where to display the candidate window. */
|
6540
|
+
windowPosition?: `${WindowPosition}` | undefined;
|
6523
6541
|
/**
|
6524
|
-
* Optional.
|
6525
|
-
* Where to display the candidate window.
|
6526
|
-
* @since Chrome 28
|
6527
|
-
*/
|
6528
|
-
windowPosition?: string | undefined;
|
6529
|
-
/**
|
6530
|
-
* Optional.
|
6531
6542
|
* The index of the current chosen candidate out of total candidates.
|
6532
6543
|
* @since Chrome 84
|
6533
6544
|
*/
|
6534
6545
|
currentCandidateIndex?: number | undefined;
|
6535
6546
|
/**
|
6536
|
-
* Optional.
|
6537
6547
|
* The total number of candidates for the candidate window.
|
6538
6548
|
* @since Chrome 84
|
6539
6549
|
*/
|
@@ -6576,179 +6586,215 @@ declare namespace chrome {
|
|
6576
6586
|
length: number;
|
6577
6587
|
}
|
6578
6588
|
|
6589
|
+
export interface AssistiveWindowButtonHighlightedParameters {
|
6590
|
+
/** The text for the screenreader to announce. */
|
6591
|
+
announceString?: string | undefined;
|
6592
|
+
/** The ID of the button */
|
6593
|
+
buttonID: `${AssistiveWindowButton}`;
|
6594
|
+
/** ID of the context owning the assistive window. */
|
6595
|
+
contextID: number;
|
6596
|
+
/** Whether the button should be highlighted. */
|
6597
|
+
highlighted: boolean;
|
6598
|
+
/** The window type the button belongs to. */
|
6599
|
+
windowType: `${AssistiveWindowType}`;
|
6600
|
+
}
|
6601
|
+
|
6602
|
+
export interface AssistiveWindowPropertiesParameters {
|
6603
|
+
/** ID of the context owning the assistive window. */
|
6604
|
+
contextID: number;
|
6605
|
+
/** Properties of the assistive window. */
|
6606
|
+
properties: AssistiveWindowProperties;
|
6607
|
+
}
|
6608
|
+
|
6579
6609
|
export interface SurroundingTextInfo {
|
6580
|
-
/** The text around cursor. */
|
6610
|
+
/** The text around the cursor. This is only a subset of all text in the input field. */
|
6581
6611
|
text: string;
|
6582
6612
|
/** The ending position of the selection. This value indicates caret position if there is no selection. */
|
6583
6613
|
focus: number;
|
6584
|
-
/**
|
6614
|
+
/**
|
6615
|
+
* The offset position of `text`. Since `text` only includes a subset of text around the cursor, offset indicates the absolute position of the first character of `text`.
|
6616
|
+
* @since Chrome 46
|
6617
|
+
*/
|
6618
|
+
offset: number;
|
6619
|
+
/** The beginning position of the selection. This value indicates caret position if there is no selection. */
|
6585
6620
|
anchor: number;
|
6586
6621
|
}
|
6587
6622
|
|
6588
6623
|
export interface AssistiveWindowButtonClickedDetails {
|
6589
6624
|
/** The ID of the button clicked. */
|
6590
|
-
buttonID: AssistiveWindowButton
|
6625
|
+
buttonID: `${AssistiveWindowButton}`;
|
6591
6626
|
/** The type of the assistive window. */
|
6592
|
-
windowType: AssistiveWindowType
|
6627
|
+
windowType: `${AssistiveWindowType}`;
|
6593
6628
|
}
|
6594
6629
|
|
6595
|
-
export interface BlurEvent extends chrome.events.Event<(contextID: number) => void> {}
|
6596
|
-
|
6597
|
-
export interface AssistiveWindowButtonClickedEvent
|
6598
|
-
extends chrome.events.Event<(details: AssistiveWindowButtonClickedDetails) => void>
|
6599
|
-
{}
|
6600
|
-
|
6601
|
-
export interface CandidateClickedEvent
|
6602
|
-
extends chrome.events.Event<(engineID: string, candidateID: number, button: string) => void>
|
6603
|
-
{}
|
6604
|
-
|
6605
|
-
export interface KeyEventEvent
|
6606
|
-
extends chrome.events.Event<(engineID: string, keyData: KeyboardEvent, requestId: string) => void>
|
6607
|
-
{}
|
6608
|
-
|
6609
|
-
export interface DeactivatedEvent extends chrome.events.Event<(engineID: string) => void> {}
|
6610
|
-
|
6611
|
-
export interface InputContextUpdateEvent extends chrome.events.Event<(context: InputContext) => void> {}
|
6612
|
-
|
6613
|
-
export interface ActivateEvent extends chrome.events.Event<(engineID: string, screen: string) => void> {}
|
6614
|
-
|
6615
|
-
export interface FocusEvent extends chrome.events.Event<(context: InputContext) => void> {}
|
6616
|
-
|
6617
|
-
export interface MenuItemActivatedEvent extends chrome.events.Event<(engineID: string, name: string) => void> {}
|
6618
|
-
|
6619
|
-
export interface SurroundingTextChangedEvent
|
6620
|
-
extends chrome.events.Event<(engineID: string, surroundingInfo: SurroundingTextInfo) => void>
|
6621
|
-
{}
|
6622
|
-
|
6623
|
-
export interface InputResetEvent extends chrome.events.Event<(engineID: string) => void> {}
|
6624
|
-
|
6625
6630
|
/**
|
6626
6631
|
* Adds the provided menu items to the language menu when this IME is active.
|
6632
|
+
*
|
6633
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6627
6634
|
*/
|
6628
|
-
export function setMenuItems(parameters:
|
6635
|
+
export function setMenuItems(parameters: MenuParameters): Promise<void>;
|
6636
|
+
export function setMenuItems(parameters: MenuParameters, callback: () => void): void;
|
6637
|
+
|
6629
6638
|
/**
|
6630
6639
|
* Commits the provided text to the current input.
|
6631
|
-
*
|
6640
|
+
*
|
6641
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6632
6642
|
*/
|
6633
|
-
export function commitText(parameters: CommitTextParameters
|
6643
|
+
export function commitText(parameters: CommitTextParameters): Promise<boolean>;
|
6644
|
+
export function commitText(parameters: CommitTextParameters, callback: (success: boolean) => void): void;
|
6645
|
+
|
6634
6646
|
/**
|
6635
6647
|
* Sets the current candidate list. This fails if this extension doesn't own the active IME
|
6636
|
-
*
|
6648
|
+
*
|
6649
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6637
6650
|
*/
|
6638
|
-
export function setCandidates(parameters: CandidatesParameters
|
6651
|
+
export function setCandidates(parameters: CandidatesParameters): Promise<boolean>;
|
6652
|
+
export function setCandidates(parameters: CandidatesParameters, callback: (success: boolean) => void): void;
|
6653
|
+
|
6639
6654
|
/**
|
6640
6655
|
* Set the current composition. If this extension does not own the active IME, this fails.
|
6641
|
-
*
|
6656
|
+
*
|
6657
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6642
6658
|
*/
|
6643
|
-
export function setComposition(parameters: CompositionParameters
|
6659
|
+
export function setComposition(parameters: CompositionParameters): Promise<boolean>;
|
6660
|
+
export function setComposition(parameters: CompositionParameters, callback: (success: boolean) => void): void;
|
6661
|
+
|
6644
6662
|
/**
|
6645
6663
|
* Updates the state of the MenuItems specified
|
6646
|
-
*
|
6664
|
+
*
|
6665
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6647
6666
|
*/
|
6648
|
-
export function updateMenuItems(parameters:
|
6667
|
+
export function updateMenuItems(parameters: MenuParameters): Promise<void>;
|
6668
|
+
export function updateMenuItems(parameters: MenuParameters, callback: () => void): void;
|
6669
|
+
|
6649
6670
|
/**
|
6650
6671
|
* Shows/Hides an assistive window with the given properties.
|
6651
|
-
*
|
6652
|
-
*
|
6672
|
+
*
|
6673
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6653
6674
|
*/
|
6654
6675
|
export function setAssistiveWindowProperties(
|
6655
|
-
parameters:
|
6656
|
-
|
6657
|
-
|
6658
|
-
|
6659
|
-
callback
|
6676
|
+
parameters: AssistiveWindowPropertiesParameters,
|
6677
|
+
): Promise<boolean>;
|
6678
|
+
export function setAssistiveWindowProperties(
|
6679
|
+
parameters: AssistiveWindowPropertiesParameters,
|
6680
|
+
callback: (success: boolean) => void,
|
6660
6681
|
): void;
|
6682
|
+
|
6661
6683
|
/**
|
6662
6684
|
* Highlights/Unhighlights a button in an assistive window.
|
6663
|
-
*
|
6664
|
-
*
|
6685
|
+
*
|
6686
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6665
6687
|
*/
|
6666
6688
|
export function setAssistiveWindowButtonHighlighted(
|
6667
|
-
parameters:
|
6668
|
-
|
6669
|
-
|
6670
|
-
|
6671
|
-
|
6672
|
-
highlighted: boolean;
|
6673
|
-
},
|
6674
|
-
callback?: () => void,
|
6689
|
+
parameters: AssistiveWindowButtonHighlightedParameters,
|
6690
|
+
): Promise<void>;
|
6691
|
+
export function setAssistiveWindowButtonHighlighted(
|
6692
|
+
parameters: AssistiveWindowButtonHighlightedParameters,
|
6693
|
+
callback: () => void,
|
6675
6694
|
): void;
|
6695
|
+
|
6676
6696
|
/**
|
6677
6697
|
* Sets the properties of the candidate window. This fails if the extension doesn't own the active IME
|
6678
|
-
*
|
6698
|
+
*
|
6699
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6679
6700
|
*/
|
6701
|
+
export function setCandidateWindowProperties(parameters: CandidateWindowParameter): Promise<boolean>;
|
6680
6702
|
export function setCandidateWindowProperties(
|
6681
6703
|
parameters: CandidateWindowParameter,
|
6682
|
-
callback
|
6704
|
+
callback: (success: boolean) => void,
|
6683
6705
|
): void;
|
6706
|
+
|
6684
6707
|
/**
|
6685
6708
|
* Clear the current composition. If this extension does not own the active IME, this fails.
|
6686
|
-
*
|
6709
|
+
*
|
6710
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6687
6711
|
*/
|
6712
|
+
export function clearComposition(parameters: ClearCompositionParameters): Promise<boolean>;
|
6688
6713
|
export function clearComposition(
|
6689
6714
|
parameters: ClearCompositionParameters,
|
6690
|
-
callback
|
6715
|
+
callback: (success: boolean) => void,
|
6691
6716
|
): void;
|
6717
|
+
|
6692
6718
|
/**
|
6693
6719
|
* Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.
|
6694
|
-
*
|
6720
|
+
*
|
6721
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6695
6722
|
*/
|
6696
6723
|
export function setCursorPosition(
|
6697
6724
|
parameters: CursorPositionParameters,
|
6698
|
-
|
6725
|
+
): Promise<boolean>;
|
6726
|
+
export function setCursorPosition(
|
6727
|
+
parameters: CursorPositionParameters,
|
6728
|
+
callback: (success: boolean) => void,
|
6699
6729
|
): void;
|
6730
|
+
|
6700
6731
|
/**
|
6701
6732
|
* Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.
|
6702
|
-
*
|
6703
|
-
*
|
6704
|
-
*/
|
6705
|
-
export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void;
|
6706
|
-
/**
|
6707
|
-
* Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing.
|
6708
|
-
* @since Chrome 34
|
6733
|
+
*
|
6734
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6709
6735
|
*/
|
6736
|
+
export function sendKeyEvents(parameters: SendKeyEventParameters): Promise<void>;
|
6737
|
+
export function sendKeyEvents(parameters: SendKeyEventParameters, callback: () => void): void;
|
6738
|
+
|
6739
|
+
/** Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing. */
|
6710
6740
|
export function hideInputView(): void;
|
6741
|
+
|
6711
6742
|
/**
|
6712
6743
|
* Deletes the text around the caret.
|
6713
|
-
*
|
6744
|
+
*
|
6745
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 111.
|
6714
6746
|
*/
|
6715
|
-
export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters
|
6747
|
+
export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters): Promise<void>;
|
6748
|
+
export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters, callback: () => void): void;
|
6749
|
+
|
6716
6750
|
/**
|
6717
6751
|
* Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous.
|
6718
|
-
* @since Chrome 25
|
6719
6752
|
* @param requestId Request id of the event that was handled. This should come from keyEvent.requestId
|
6720
6753
|
* @param response True if the keystroke was handled, false if not
|
6721
6754
|
*/
|
6722
6755
|
export function keyEventHandled(requestId: string, response: boolean): void;
|
6723
6756
|
|
6724
6757
|
/** This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */
|
6725
|
-
export
|
6726
|
-
|
6727
|
-
|
6728
|
-
|
6729
|
-
|
6758
|
+
export const onBlur: events.Event<(contextID: number) => void>;
|
6759
|
+
|
6760
|
+
/**
|
6761
|
+
* This event is sent when a button in an assistive window is clicked.
|
6762
|
+
* @since Chrome 85
|
6763
|
+
*/
|
6764
|
+
export const onAssistiveWindowButtonClicked: events.Event<
|
6765
|
+
(details: AssistiveWindowButtonClickedDetails) => void
|
6766
|
+
>;
|
6767
|
+
|
6730
6768
|
/** This event is sent if this extension owns the active IME. */
|
6731
|
-
export
|
6769
|
+
export const onCandidateClicked: events.Event<
|
6770
|
+
(engineID: string, candidateID: number, button: `${MouseButton}`) => void
|
6771
|
+
>;
|
6772
|
+
|
6773
|
+
/** Fired when a key event is sent from the operating system. The event will be sent to the extension if this extension owns the active IME. The listener function should return true if the event was handled false if it was not. If the event will be evaluated asynchronously, this function must return undefined and the IME must later call keyEventHandled() with the result. */
|
6774
|
+
export const onKeyEvent: events.Event<(engineID: string, keyData: KeyboardEvent, requestId: string) => void>;
|
6775
|
+
|
6732
6776
|
/** This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. */
|
6733
|
-
export
|
6734
|
-
|
6735
|
-
|
6777
|
+
export const onDeactivated: events.Event<(engineID: string) => void>;
|
6778
|
+
|
6779
|
+
/** This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user. */
|
6780
|
+
export const onInputContextUpdate: events.Event<(context: InputContext) => void>;
|
6781
|
+
|
6736
6782
|
/** This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. */
|
6737
|
-
export
|
6738
|
-
|
6739
|
-
|
6783
|
+
export const onActivate: events.Event<(engineID: string, screen: `${ScreenType}`) => void>;
|
6784
|
+
|
6785
|
+
// /** This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */
|
6786
|
+
export const onFocus: events.Event<(context: InputContext) => void>;
|
6787
|
+
|
6740
6788
|
/** Called when the user selects a menu item */
|
6741
|
-
export
|
6742
|
-
|
6743
|
-
|
6744
|
-
|
6745
|
-
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
*/
|
6751
|
-
export var onReset: InputResetEvent;
|
6789
|
+
export const onMenuItemActivated: events.Event<(engineID: string, name: string) => void>;
|
6790
|
+
|
6791
|
+
/** Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. */
|
6792
|
+
export const onSurroundingTextChanged: events.Event<
|
6793
|
+
(engineID: string, surroundingInfo: SurroundingTextInfo) => void
|
6794
|
+
>;
|
6795
|
+
|
6796
|
+
/** This event is sent when chrome terminates ongoing text input session. */
|
6797
|
+
export const onReset: events.Event<(engineID: string) => void>;
|
6752
6798
|
}
|
6753
6799
|
|
6754
6800
|
////////////////////
|
@@ -10069,14 +10115,13 @@ declare namespace chrome {
|
|
10069
10115
|
availableCapacity: number;
|
10070
10116
|
}
|
10071
10117
|
|
10072
|
-
/** Get physical memory information. */
|
10073
|
-
export function getInfo(callback: (info: MemoryInfo) => void): void;
|
10074
|
-
|
10075
10118
|
/**
|
10076
10119
|
* Get physical memory information.
|
10077
|
-
*
|
10120
|
+
*
|
10121
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
|
10078
10122
|
*/
|
10079
10123
|
export function getInfo(): Promise<MemoryInfo>;
|
10124
|
+
export function getInfo(callback: (info: MemoryInfo) => void): void;
|
10080
10125
|
}
|
10081
10126
|
|
10082
10127
|
////////////////////
|
@@ -14103,27 +14148,26 @@ declare namespace chrome {
|
|
14103
14148
|
* If specified, the side panel options for the given tab will be returned.
|
14104
14149
|
* Otherwise, returns the default side panel options (used for any tab that doesn't have specific settings).
|
14105
14150
|
*/
|
14106
|
-
tabId?: number;
|
14151
|
+
tabId?: number | undefined;
|
14107
14152
|
}
|
14108
14153
|
|
14109
|
-
/**
|
14110
|
-
* @since Chrome 116
|
14111
|
-
*/
|
14154
|
+
/** @since Chrome 116 */
|
14112
14155
|
export type OpenOptions =
|
14113
14156
|
& {
|
14114
|
-
/**
|
14157
|
+
/**
|
14158
|
+
* The tab in which to open the side panel.
|
14115
14159
|
* If the corresponding tab has a tab-specific side panel, the panel will only be open for that tab.
|
14116
14160
|
* If there is not a tab-specific panel, the global panel will be open in the specified tab and any other tabs without a currently-open tab- specific panel.
|
14117
14161
|
* This will override any currently-active side panel (global or tab-specific) in the corresponding tab.
|
14118
|
-
* At least one of this and windowId must be provided. */
|
14119
|
-
tabId?: number;
|
14162
|
+
* At least one of this and `windowId` must be provided. */
|
14163
|
+
tabId?: number | undefined;
|
14120
14164
|
/**
|
14121
14165
|
* The window in which to open the side panel.
|
14122
|
-
* This is only applicable if the extension has a global (non-tab-specific) side panel or tabId is also specified.
|
14166
|
+
* This is only applicable if the extension has a global (non-tab-specific) side panel or `tabId` is also specified.
|
14123
14167
|
* This will override any currently-active global side panel the user has open in the given window.
|
14124
|
-
* At least one of this and tabId must be provided.
|
14168
|
+
* At least one of this and `tabId` must be provided.
|
14125
14169
|
*/
|
14126
|
-
windowId?: number;
|
14170
|
+
windowId?: number | undefined;
|
14127
14171
|
}
|
14128
14172
|
& ({
|
14129
14173
|
tabId: number;
|
@@ -14133,7 +14177,7 @@ declare namespace chrome {
|
|
14133
14177
|
|
14134
14178
|
export interface PanelBehavior {
|
14135
14179
|
/** Whether clicking the extension's icon will toggle showing the extension's entry in the side panel. Defaults to false. */
|
14136
|
-
openPanelOnActionClick?: boolean;
|
14180
|
+
openPanelOnActionClick?: boolean | undefined;
|
14137
14181
|
}
|
14138
14182
|
|
14139
14183
|
/** @since Chrome 140 */
|
@@ -14143,15 +14187,15 @@ declare namespace chrome {
|
|
14143
14187
|
|
14144
14188
|
export interface PanelOptions {
|
14145
14189
|
/** Whether the side panel should be enabled. This is optional. The default value is true. */
|
14146
|
-
enabled?: boolean;
|
14190
|
+
enabled?: boolean | undefined;
|
14147
14191
|
/** The path to the side panel HTML file to use. This must be a local resource within the extension package. */
|
14148
|
-
path?: string;
|
14192
|
+
path?: string | undefined;
|
14149
14193
|
/**
|
14150
14194
|
* If specified, the side panel options will only apply to the tab with this id.
|
14151
14195
|
* If omitted, these options set the default behavior (used for any tab that doesn't have specific settings).
|
14152
14196
|
* Note: if the same path is set for this tabId and the default tabId, then the panel for this tabId will be a different instance than the panel for the default tabId.
|
14153
14197
|
*/
|
14154
|
-
tabId?: number;
|
14198
|
+
tabId?: number | undefined;
|
14155
14199
|
}
|
14156
14200
|
|
14157
14201
|
/**
|
@@ -14177,84 +14221,48 @@ declare namespace chrome {
|
|
14177
14221
|
|
14178
14222
|
/**
|
14179
14223
|
* Returns the active panel configuration.
|
14180
|
-
*
|
14181
|
-
*
|
14182
|
-
*
|
14183
|
-
*/
|
14184
|
-
export function getOptions(
|
14185
|
-
|
14186
|
-
options: GetPanelOptions,
|
14187
|
-
callback: (options: PanelOptions) => void,
|
14188
|
-
): void;
|
14189
|
-
|
14190
|
-
export function getOptions(
|
14191
|
-
/** Specifies the context to return the configuration for. */
|
14192
|
-
options: GetPanelOptions,
|
14193
|
-
): Promise<PanelOptions>;
|
14224
|
+
*
|
14225
|
+
* Can return its result via Promise.
|
14226
|
+
* @param options Specifies the context to return the configuration for.
|
14227
|
+
*/
|
14228
|
+
export function getOptions(options: GetPanelOptions): Promise<PanelOptions>;
|
14229
|
+
export function getOptions(options: GetPanelOptions, callback: (options: PanelOptions) => void): void;
|
14194
14230
|
|
14195
14231
|
/**
|
14196
14232
|
* Returns the extension's current side panel behavior.
|
14197
|
-
*
|
14198
|
-
*
|
14199
|
-
* The promise resolves with the same type that is passed to the callback.
|
14233
|
+
*
|
14234
|
+
* Can return its result via Promise.
|
14200
14235
|
*/
|
14201
|
-
export function getPanelBehavior(
|
14202
|
-
callback: (behavior: PanelBehavior) => void,
|
14203
|
-
): void;
|
14204
|
-
|
14205
14236
|
export function getPanelBehavior(): Promise<PanelBehavior>;
|
14237
|
+
export function getPanelBehavior(callback: (behavior: PanelBehavior) => void): void;
|
14206
14238
|
|
14207
14239
|
/**
|
14208
|
-
* @since Chrome 116
|
14209
14240
|
* Opens the side panel for the extension. This may only be called in response to a user action.
|
14210
|
-
*
|
14211
|
-
*
|
14212
|
-
*
|
14241
|
+
*
|
14242
|
+
* Can return its result via Promise.
|
14243
|
+
* @param options Specifies the context in which to open the side panel.
|
14244
|
+
* @since Chrome 116
|
14213
14245
|
*/
|
14214
|
-
export function open(
|
14215
|
-
|
14216
|
-
options: OpenOptions,
|
14217
|
-
callback: () => void,
|
14218
|
-
): void;
|
14219
|
-
|
14220
|
-
export function open(
|
14221
|
-
/** Specifies the context in which to open the side panel. */
|
14222
|
-
options: OpenOptions,
|
14223
|
-
): Promise<void>;
|
14246
|
+
export function open(options: OpenOptions): Promise<void>;
|
14247
|
+
export function open(options: OpenOptions, callback: () => void): void;
|
14224
14248
|
|
14225
14249
|
/**
|
14226
14250
|
* Configures the side panel.
|
14227
|
-
*
|
14228
|
-
*
|
14229
|
-
*
|
14251
|
+
*
|
14252
|
+
* Can return its result via Promise.
|
14253
|
+
* @param options The configuration options to apply to the panel.
|
14230
14254
|
*/
|
14231
|
-
export function setOptions(
|
14232
|
-
|
14233
|
-
options: PanelOptions,
|
14234
|
-
callback: () => void,
|
14235
|
-
): void;
|
14236
|
-
|
14237
|
-
export function setOptions(
|
14238
|
-
/** The configuration options to apply to the panel. */
|
14239
|
-
options: PanelOptions,
|
14240
|
-
): Promise<void>;
|
14255
|
+
export function setOptions(options: PanelOptions): Promise<void>;
|
14256
|
+
export function setOptions(options: PanelOptions, callback: () => void): void;
|
14241
14257
|
|
14242
14258
|
/**
|
14243
14259
|
* Configures the extension's side panel behavior. This is an upsert operation.
|
14244
|
-
*
|
14245
|
-
*
|
14246
|
-
*
|
14260
|
+
*
|
14261
|
+
* Can return its result via Promise.
|
14262
|
+
* @param behavior The new behavior to be set.
|
14247
14263
|
*/
|
14248
|
-
export function setPanelBehavior(
|
14249
|
-
|
14250
|
-
behavior: PanelBehavior,
|
14251
|
-
callback: () => void,
|
14252
|
-
): void;
|
14253
|
-
|
14254
|
-
export function setPanelBehavior(
|
14255
|
-
/** The new behavior to be set. */
|
14256
|
-
behavior: PanelBehavior,
|
14257
|
-
): Promise<void>;
|
14264
|
+
export function setPanelBehavior(behavior: PanelBehavior): Promise<void>;
|
14265
|
+
export function setPanelBehavior(behavior: PanelBehavior, callback: () => void): void;
|
14258
14266
|
}
|
14259
14267
|
|
14260
14268
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.18",
|
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": "29c78aebedd7b318174f7216589325a219bf672ea2647e846d05e9ab4bb3bf43",
|
98
98
|
"typeScriptVersion": "5.2"
|
99
99
|
}
|