@types/chrome 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +383 -189
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 12 Sep 2025 19:02:26 GMT
11
+ * Last updated: Tue, 16 Sep 2025 21:32:23 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
@@ -5348,212 +5348,382 @@ declare namespace chrome {
5348
5348
  fontId: string;
5349
5349
  }
5350
5350
 
5351
- export interface DefaultFontSizeDetails {
5352
- /** The font size in pixels. */
5353
- pixelSize: number;
5354
- }
5355
-
5356
- export interface FontDetails {
5357
- /** The generic font family for the font. */
5358
- genericFamily:
5359
- | "cursive"
5360
- | "fantasy"
5361
- | "fixed"
5362
- | "sansserif"
5363
- | "serif"
5364
- | "standard";
5365
- /** Optional. The script for the font. If omitted, the global script font setting is affected. */
5366
- script?: string | undefined;
5351
+ /** A CSS generic font family. */
5352
+ export enum GenericFamily {
5353
+ STANDARD = "standard",
5354
+ SANSSERIF = "sansserif",
5355
+ SERIF = "serif",
5356
+ FIXED = "fixed",
5357
+ CURSIVE = "cursive",
5358
+ FANTASY = "fantasy",
5359
+ MATH = "math",
5360
+ }
5361
+
5362
+ export enum LevelOfControl {
5363
+ /** Cannot be controlled by any extension */
5364
+ NOT_CONTROLLABLE = "not_controllable",
5365
+ /** Controlled by extensions with higher precedence */
5366
+ CONTROLLED_BY_OTHER_EXTENSIONS = "controlled_by_other_extensions",
5367
+ /** Can be controlled by this extension */
5368
+ CONTROLLABLE_BY_THIS_EXTENSION = "controllable_by_this_extension",
5369
+ /** Controlled by this extension */
5370
+ CONTROLLED_BY_THIS_EXTENSION = "controlled_by_this_extension",
5371
+ }
5372
+
5373
+ /** An ISO 15924 script code. The default, or global, script is represented by script code "Zyyy". */
5374
+ export enum ScriptCode {
5375
+ AFAK = "Afak",
5376
+ ARAB = "Arab",
5377
+ ARMI = "Armi",
5378
+ ARMN = "Armn",
5379
+ AVST = "Avst",
5380
+ BALI = "Bali",
5381
+ BAMU = "Bamu",
5382
+ BASS = "Bass",
5383
+ BATK = "Batk",
5384
+ BENG = "Beng",
5385
+ BLIS = "Blis",
5386
+ BOPO = "Bopo",
5387
+ BRAH = "Brah",
5388
+ BRAI = "Brai",
5389
+ BUGI = "Bugi",
5390
+ BUHD = "Buhd",
5391
+ CAKM = "Cakm",
5392
+ CANS = "Cans",
5393
+ CARI = "Cari",
5394
+ CHAM = "Cham",
5395
+ CHER = "Cher",
5396
+ CIRT = "Cirt",
5397
+ COPT = "Copt",
5398
+ CPRT = "Cprt",
5399
+ CYRL = "Cyrl",
5400
+ CYRS = "Cyrs",
5401
+ DEVA = "Deva",
5402
+ DSRT = "Dsrt",
5403
+ DUPL = "Dupl",
5404
+ EGYD = "Egyd",
5405
+ EGYH = "Egyh",
5406
+ EGYP = "Egyp",
5407
+ ELBA = "Elba",
5408
+ ETHI = "Ethi",
5409
+ GEOK = "Geok",
5410
+ GEOR = "Geor",
5411
+ GLAG = "Glag",
5412
+ GOTH = "Goth",
5413
+ GRAN = "Gran",
5414
+ GREK = "Grek",
5415
+ GUJR = "Gujr",
5416
+ GURU = "Guru",
5417
+ HANG = "Hang",
5418
+ HANI = "Hani",
5419
+ HANO = "Hano",
5420
+ HANS = "Hans",
5421
+ HANT = "Hant",
5422
+ HEBR = "Hebr",
5423
+ HLUW = "Hluw",
5424
+ HMNG = "Hmng",
5425
+ HUNG = "Hung",
5426
+ INDS = "Inds",
5427
+ ITAL = "Ital",
5428
+ JAVA = "Java",
5429
+ JPAN = "Jpan",
5430
+ JURC = "Jurc",
5431
+ KALI = "Kali",
5432
+ KHAR = "Khar",
5433
+ KHMR = "Khmr",
5434
+ KHOJ = "Khoj",
5435
+ KNDA = "Knda",
5436
+ KPEL = "Kpel",
5437
+ KTHI = "Kthi",
5438
+ LANA = "Lana",
5439
+ LAOO = "Laoo",
5440
+ LATF = "Latf",
5441
+ LATG = "Latg",
5442
+ LATN = "Latn",
5443
+ LEPC = "Lepc",
5444
+ LIMB = "Limb",
5445
+ LINA = "Lina",
5446
+ LINB = "Linb",
5447
+ LISU = "Lisu",
5448
+ LOMA = "Loma",
5449
+ LYCI = "Lyci",
5450
+ LYDI = "Lydi",
5451
+ MAND = "Mand",
5452
+ MANI = "Mani",
5453
+ MAYA = "Maya",
5454
+ MEND = "Mend",
5455
+ MERC = "Merc",
5456
+ MERO = "Mero",
5457
+ MLYM = "Mlym",
5458
+ MONG = "Mong",
5459
+ MOON = "Moon",
5460
+ MROO = "Mroo",
5461
+ MTEI = "Mtei",
5462
+ MYMR = "Mymr",
5463
+ NARB = "Narb",
5464
+ NBAT = "Nbat",
5465
+ NKGB = "Nkgb",
5466
+ NKOO = "Nkoo",
5467
+ NSHU = "Nshu",
5468
+ OGAM = "Ogam",
5469
+ OLCK = "Olck",
5470
+ ORKH = "Orkh",
5471
+ ORYA = "Orya",
5472
+ OSMA = "Osma",
5473
+ PALM = "Palm",
5474
+ PERM = "Perm",
5475
+ PHAG = "Phag",
5476
+ PHLI = "Phli",
5477
+ PHLP = "Phlp",
5478
+ PHLV = "Phlv",
5479
+ PHNX = "Phnx",
5480
+ PLRD = "Plrd",
5481
+ PRTI = "Prti",
5482
+ RJNG = "Rjng",
5483
+ RORO = "Roro",
5484
+ RUNR = "Runr",
5485
+ SAMR = "Samr",
5486
+ SARA = "Sara",
5487
+ SARB = "Sarb",
5488
+ SAUR = "Saur",
5489
+ SGNW = "Sgnw",
5490
+ SHAW = "Shaw",
5491
+ SHRD = "Shrd",
5492
+ SIND = "Sind",
5493
+ SINH = "Sinh",
5494
+ SORA = "Sora",
5495
+ SUND = "Sund",
5496
+ SYLO = "Sylo",
5497
+ SYRC = "Syrc",
5498
+ SYRE = "Syre",
5499
+ SYRJ = "Syrj",
5500
+ SYRN = "Syrn",
5501
+ TAGB = "Tagb",
5502
+ TAKR = "Takr",
5503
+ TALE = "Tale",
5504
+ TALU = "Talu",
5505
+ TAML = "Taml",
5506
+ TANG = "Tang",
5507
+ TAVT = "Tavt",
5508
+ TELU = "Telu",
5509
+ TENG = "Teng",
5510
+ TFNG = "Tfng",
5511
+ TGLG = "Tglg",
5512
+ THAA = "Thaa",
5513
+ THAI = "Thai",
5514
+ TIBT = "Tibt",
5515
+ TIRH = "Tirh",
5516
+ UGAR = "Ugar",
5517
+ VAII = "Vaii",
5518
+ VISP = "Visp",
5519
+ WARA = "Wara",
5520
+ WOLE = "Wole",
5521
+ XPEO = "Xpeo",
5522
+ XSUX = "Xsux",
5523
+ YIII = "Yiii",
5524
+ ZMTH = "Zmth",
5525
+ ZSYM = "Zsym",
5526
+ ZYYY = "Zyyy",
5527
+ }
5528
+
5529
+ export interface ClearFontDetails {
5530
+ /** The generic font family for which the font should be cleared. */
5531
+ genericFamily: `${GenericFamily}`;
5532
+ /** The script for which the font should be cleared. If omitted, the global script font setting is cleared. */
5533
+ script?: `${ScriptCode}` | undefined;
5534
+ }
5535
+
5536
+ export interface GetFontDetails {
5537
+ /** The generic font family for which the font should be retrieved. */
5538
+ genericFamily: `${GenericFamily}`;
5539
+ /** The script for which the font should be retrieved. If omitted, the font setting for the global script (script code "Zyyy") is retrieved. */
5540
+ script?: `${ScriptCode}` | undefined;
5541
+ }
5542
+
5543
+ export interface SetFontDetails {
5544
+ /** The font ID. The empty string means to fallback to the global script font setting. */
5545
+ fontId: string;
5546
+ /** The generic font family for which the font should be set. */
5547
+ genericFamily: `${GenericFamily}`;
5548
+ /** The script code which the font should be set. If omitted, the font setting for the global script (script code "Zyyy") is set. */
5549
+ script?: `${ScriptCode}` | undefined;
5367
5550
  }
5368
5551
 
5369
- export interface FullFontDetails {
5552
+ export interface FontChangedResult {
5370
5553
  /** The generic font family for which the font setting has changed. */
5371
- genericFamily: string;
5554
+ genericFamily: `${GenericFamily}`;
5372
5555
  /** The level of control this extension has over the setting. */
5373
- levelOfControl: string;
5556
+ levelOfControl: `${LevelOfControl}`;
5374
5557
  /** Optional. The script code for which the font setting has changed. */
5375
- script?: string | undefined;
5376
- /** The font ID. See the description in getFont. */
5558
+ script?: `${ScriptCode}`;
5559
+ /** The font ID. See the description in {@link getFont}. */
5377
5560
  fontId: string;
5378
5561
  }
5379
5562
 
5380
- export interface FontDetailsResult {
5563
+ export interface FontResult {
5381
5564
  /** The level of control this extension has over the setting. */
5382
- levelOfControl: string;
5383
- /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, fontId can differ from the font passed to setFont, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */
5565
+ levelOfControl: `${LevelOfControl}`;
5566
+ /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, `fontId` can differ from the font passed to {@link setFont}, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */
5384
5567
  fontId: string;
5385
5568
  }
5386
5569
 
5387
- export interface FontSizeDetails {
5570
+ export interface FontSizeResult {
5388
5571
  /** The font size in pixels. */
5389
5572
  pixelSize: number;
5390
5573
  /** The level of control this extension has over the setting. */
5391
- levelOfControl: string;
5574
+ levelOfControl: `${LevelOfControl}`;
5392
5575
  }
5393
5576
 
5394
- export interface SetFontSizeDetails {
5577
+ export interface FontSizeDetails {
5395
5578
  /** The font size in pixels. */
5396
5579
  pixelSize: number;
5397
5580
  }
5398
5581
 
5399
- export interface SetFontDetails extends FontDetails {
5400
- /** The font ID. The empty string means to fallback to the global script font setting. */
5401
- fontId: string;
5402
- }
5403
-
5404
- export interface DefaultFixedFontSizeChangedEvent
5405
- extends chrome.events.Event<(details: FontSizeDetails) => void>
5406
- {}
5407
-
5408
- export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
5409
-
5410
- export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: FontSizeDetails) => void> {}
5411
-
5412
- export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> {}
5413
-
5414
5582
  /**
5415
5583
  * Sets the default font size.
5416
- * @return The `setDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5417
- */
5418
- export function setDefaultFontSize(details: DefaultFontSizeDetails): Promise<void>;
5419
- /**
5420
- * Sets the default font size.
5421
- */
5422
- export function setDefaultFontSize(details: DefaultFontSizeDetails, callback: () => void): void;
5423
- /**
5424
- * Gets the font for a given script and generic font family.
5425
- * @return The `getFont` method provides its result via callback or returned as a `Promise` (MV3 only).
5584
+ *
5585
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5426
5586
  */
5427
- export function getFont(details: FontDetails): Promise<FontDetailsResult>;
5587
+ export function setDefaultFontSize(details: FontSizeDetails): Promise<void>;
5588
+ export function setDefaultFontSize(details: FontSizeDetails, callback: () => void): void;
5589
+
5428
5590
  /**
5429
5591
  * Gets the font for a given script and generic font family.
5592
+ *
5593
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5430
5594
  */
5431
- export function getFont(details: FontDetails, callback: (details: FontDetailsResult) => void): void;
5432
- /**
5433
- * Gets the default font size.
5434
- * @param details This parameter is currently unused.
5435
- * @return The `getDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
5436
- */
5437
- export function getDefaultFontSize(details?: unknown): Promise<FontSizeDetails>;
5595
+ export function getFont(details: GetFontDetails): Promise<FontResult>;
5596
+ export function getFont(details: GetFontDetails, callback: (details: FontResult) => void): void;
5597
+
5438
5598
  /**
5439
5599
  * Gets the default font size.
5440
5600
  * @param details This parameter is currently unused.
5601
+ *
5602
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5441
5603
  */
5442
- export function getDefaultFontSize(callback: (options: FontSizeDetails) => void): void;
5443
- export function getDefaultFontSize(details: unknown, callback: (options: FontSizeDetails) => void): void;
5444
- /**
5445
- * Gets the minimum font size.
5446
- * @param details This parameter is currently unused.
5447
- * @return The `getMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
5448
- */
5449
- export function getMinimumFontSize(details?: unknown): Promise<FontSizeDetails>;
5604
+ export function getDefaultFontSize(details?: { [key: string]: unknown }): Promise<FontSizeResult>;
5605
+ export function getDefaultFontSize(callback: (options: FontSizeResult) => void): void;
5606
+ export function getDefaultFontSize(
5607
+ details: { [key: string]: unknown } | undefined,
5608
+ callback: (options: FontSizeResult) => void,
5609
+ ): void;
5610
+
5450
5611
  /**
5451
5612
  * Gets the minimum font size.
5452
5613
  * @param details This parameter is currently unused.
5614
+ *
5615
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5453
5616
  */
5454
- export function getMinimumFontSize(callback: (options: FontSizeDetails) => void): void;
5455
- export function getMinimumFontSize(details: unknown, callback: (options: FontSizeDetails) => void): void;
5456
- /**
5457
- * Sets the minimum font size.
5458
- * @return The `setMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5459
- */
5460
- export function setMinimumFontSize(details: SetFontSizeDetails): Promise<void>;
5617
+ export function getMinimumFontSize(details?: { [key: string]: unknown }): Promise<FontSizeResult>;
5618
+ export function getMinimumFontSize(callback: (options: FontSizeResult) => void): void;
5619
+ export function getMinimumFontSize(
5620
+ details: { [key: string]: unknown } | undefined,
5621
+ callback: (options: FontSizeResult) => void,
5622
+ ): void;
5623
+
5461
5624
  /**
5462
5625
  * Sets the minimum font size.
5626
+ *
5627
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5463
5628
  */
5464
- export function setMinimumFontSize(details: SetFontSizeDetails, callback: () => void): void;
5465
- /**
5466
- * Gets the default size for fixed width fonts.
5467
- * @param details This parameter is currently unused.
5468
- * @return The `getDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
5469
- */
5470
- export function getDefaultFixedFontSize(details?: unknown): Promise<FontSizeDetails>;
5629
+ export function setMinimumFontSize(details: FontSizeDetails): Promise<void>;
5630
+ export function setMinimumFontSize(details: FontSizeDetails, callback: () => void): void;
5631
+
5471
5632
  /**
5472
5633
  * Gets the default size for fixed width fonts.
5473
5634
  * @param details This parameter is currently unused.
5635
+ *
5636
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5474
5637
  */
5475
- export function getDefaultFixedFontSize(callback: (details: FontSizeDetails) => void): void;
5476
- export function getDefaultFixedFontSize(details: unknown, callback: (details: FontSizeDetails) => void): void;
5477
- /**
5478
- * Clears the default font size set by this extension, if any.
5479
- * @param details This parameter is currently unused.
5480
- * @return The `clearDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5481
- */
5482
- export function clearDefaultFontSize(details?: unknown): Promise<void>;
5638
+ export function getDefaultFixedFontSize(details?: { [key: string]: unknown }): Promise<FontSizeResult>;
5639
+ export function getDefaultFixedFontSize(callback: (details: FontSizeResult) => void): void;
5640
+ export function getDefaultFixedFontSize(
5641
+ details: { [key: string]: unknown } | undefined,
5642
+ callback: (details: FontSizeResult) => void,
5643
+ ): void;
5644
+
5483
5645
  /**
5484
5646
  * Clears the default font size set by this extension, if any.
5485
5647
  * @param details This parameter is currently unused.
5648
+ *
5649
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5486
5650
  */
5651
+ export function clearDefaultFontSize(details?: { [key: string]: unknown }): Promise<void>;
5487
5652
  export function clearDefaultFontSize(callback: () => void): void;
5488
- export function clearDefaultFontSize(details: unknown, callback: () => void): void;
5489
- /**
5490
- * Sets the default size for fixed width fonts.
5491
- * @return The `setDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5492
- */
5493
- export function setDefaultFixedFontSize(details: SetFontSizeDetails): Promise<void>;
5653
+ export function clearDefaultFontSize(
5654
+ details: { [key: string]: unknown } | undefined,
5655
+ callback: () => void,
5656
+ ): void;
5657
+
5494
5658
  /**
5495
5659
  * Sets the default size for fixed width fonts.
5660
+ *
5661
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5496
5662
  */
5497
- export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback: () => void): void;
5498
- /**
5499
- * Clears the font set by this extension, if any.
5500
- * @return The `clearFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5501
- */
5502
- export function clearFont(details: FontDetails): Promise<void>;
5663
+ export function setDefaultFixedFontSize(details: FontSizeDetails): Promise<void>;
5664
+ export function setDefaultFixedFontSize(details: FontSizeDetails, callback: () => void): void;
5665
+
5503
5666
  /**
5504
5667
  * Clears the font set by this extension, if any.
5668
+ *
5669
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5505
5670
  */
5506
- export function clearFont(details: FontDetails, callback: () => void): void;
5671
+ export function clearFont(details: ClearFontDetails): Promise<void>;
5672
+ export function clearFont(details: ClearFontDetails, callback: () => void): void;
5673
+
5507
5674
  /**
5508
5675
  * Sets the font for a given script and generic font family.
5509
- * @return The `setFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5676
+ *
5677
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5510
5678
  */
5511
5679
  export function setFont(details: SetFontDetails): Promise<void>;
5512
- /**
5513
- * Sets the font for a given script and generic font family.
5514
- */
5515
5680
  export function setFont(details: SetFontDetails, callback: () => void): void;
5681
+
5516
5682
  /**
5517
5683
  * Clears the minimum font size set by this extension, if any.
5518
5684
  * @param details This parameter is currently unused.
5519
- * @return The `clearMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5520
- */
5521
- export function clearMinimumFontSize(details?: unknown): Promise<void>;
5522
- /**
5523
- * Clears the minimum font size set by this extension, if any.
5524
- * @param details This parameter is currently unused.
5685
+ *
5686
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5525
5687
  */
5688
+ export function clearMinimumFontSize(details?: { [key: string]: unknown }): Promise<void>;
5526
5689
  export function clearMinimumFontSize(callback: () => void): void;
5527
- export function clearMinimumFontSize(details: unknown, callback: () => void): void;
5690
+ export function clearMinimumFontSize(
5691
+ details: { [key: string]: unknown } | undefined,
5692
+ callback: () => void,
5693
+ ): void;
5694
+
5528
5695
  /**
5529
5696
  * Gets a list of fonts on the system.
5530
- * @return The `getFontList` method provides its result via callback or returned as a `Promise` (MV3 only).
5697
+ *
5698
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5531
5699
  */
5532
5700
  export function getFontList(): Promise<FontName[]>;
5533
- /**
5534
- * Gets a list of fonts on the system.
5535
- */
5536
5701
  export function getFontList(callback: (results: FontName[]) => void): void;
5702
+
5537
5703
  /**
5538
5704
  * Clears the default fixed font size set by this extension, if any.
5539
5705
  * @param details This parameter is currently unused.
5540
- * @return The `clearDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5541
- */
5542
- export function clearDefaultFixedFontSize(details: unknown): Promise<void>;
5543
- /**
5544
- * Clears the default fixed font size set by this extension, if any.
5545
- * @param details This parameter is currently unused.
5706
+ *
5707
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5546
5708
  */
5547
- export function clearDefaultFixedFontSize(details: unknown, callback: () => void): void;
5709
+ export function clearDefaultFixedFontSize(details?: { [key: string]: unknown }): Promise<void>;
5710
+ export function clearDefaultFixedFontSize(callback: () => void): void;
5711
+ export function clearDefaultFixedFontSize(
5712
+ details: { [key: string]: unknown } | undefined,
5713
+ callback: () => void,
5714
+ ): void;
5548
5715
 
5549
5716
  /** Fired when the default fixed font size setting changes. */
5550
- export var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent;
5717
+ export const onDefaultFixedFontSizeChanged: events.Event<(details: FontSizeResult) => void>;
5718
+
5551
5719
  /** Fired when the default font size setting changes. */
5552
- export var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent;
5720
+ export const onDefaultFontSizeChanged: events.Event<(details: FontSizeResult) => void>;
5721
+
5553
5722
  /** Fired when the minimum font size setting changes. */
5554
- export var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent;
5723
+ export const onMinimumFontSizeChanged: events.Event<(details: FontSizeResult) => void>;
5724
+
5555
5725
  /** Fired when a font setting changes. */
5556
- export var onFontChanged: FontChangedEvent;
5726
+ export const onFontChanged: events.Event<(details: FontChangedResult) => void>;
5557
5727
  }
5558
5728
 
5559
5729
  ////////////////////
@@ -5645,46 +5815,81 @@ declare namespace chrome {
5645
5815
  /** An object encapsulating one visit to a URL. */
5646
5816
  export interface VisitItem {
5647
5817
  /** The transition type for this visit from its referrer. */
5648
- transition: string;
5649
- /** Optional. When this visit occurred, represented in milliseconds since the epoch. */
5650
- visitTime?: number | undefined;
5818
+ transition: `${TransitionType}`;
5819
+ /**
5820
+ * True if the visit originated on this device. False if it was synced from a different device
5821
+ * @since Chrome 115
5822
+ */
5823
+ isLocal: boolean;
5824
+ /** When this visit occurred, represented in milliseconds since the epoch. */
5825
+ visitTime?: number;
5651
5826
  /** The unique identifier for this visit. */
5652
5827
  visitId: string;
5653
5828
  /** The visit ID of the referrer. */
5654
5829
  referringVisitId: string;
5655
- /** The unique identifier for the item. */
5830
+ /** The unique identifier for the corresponding {@link history.HistoryItem}. */
5656
5831
  id: string;
5657
5832
  }
5658
5833
 
5659
5834
  /** An object encapsulating one result of a history query. */
5660
5835
  export interface HistoryItem {
5661
- /** Optional. The number of times the user has navigated to this page by typing in the address. */
5662
- typedCount?: number | undefined;
5663
- /** Optional. The title of the page when it was last loaded. */
5664
- title?: string | undefined;
5665
- /** Optional. The URL navigated to by a user. */
5666
- url?: string | undefined;
5667
- /** Optional. When this page was last loaded, represented in milliseconds since the epoch. */
5668
- lastVisitTime?: number | undefined;
5669
- /** Optional. The number of times the user has navigated to this page. */
5670
- visitCount?: number | undefined;
5836
+ /** The number of times the user has navigated to this page by typing in the address. */
5837
+ typedCount?: number;
5838
+ /** The title of the page when it was last loaded. */
5839
+ title?: string;
5840
+ /** The URL navigated to by a user. */
5841
+ url?: string;
5842
+ /** When this page was last loaded, represented in milliseconds since the epoch. */
5843
+ lastVisitTime?: number;
5844
+ /** The number of times the user has navigated to this page. */
5845
+ visitCount?: number;
5671
5846
  /** The unique identifier for the item. */
5672
5847
  id: string;
5673
5848
  }
5674
5849
 
5850
+ /**
5851
+ * The transition type for this visit from its referrer.
5852
+ * @since Chrome 44
5853
+ */
5854
+ export enum TransitionType {
5855
+ /** The user arrived at this page by clicking a link on another page. */
5856
+ LINK = "link",
5857
+ /** The user arrived at this page by typing the URL in the address bar. This is also used for other explicit navigation actions. */
5858
+ TYPED = "typed",
5859
+ /** The user arrived at this page through a suggestion in the UI, for example, through a menu item. */
5860
+ AUTO_BOOKMARK = "auto_bookmark",
5861
+ /** The user arrived at this page through subframe navigation that they didn't request, such as through an ad loading in a frame on the previous page. These don't always generate new navigation entries in the back and forward menus. */
5862
+ AUTO_SUBFRAME = "auto_subframe",
5863
+ /** The user arrived at this page by selecting something in a subframe. */
5864
+ MANUAL_SUBFRAME = "manual_subframe",
5865
+ /** The user arrived at this page by typing in the address bar and selecting an entry that didn't look like a URL, such as a Google Search suggestion. For example, a match might have the URL of a Google Search result page, but it might appear to the user as "Search Google for ...". These are different from typed navigations because the user didn't type or see the destination URL. They're also related to keyword navigations. */
5866
+ GENERATED = "generated",
5867
+ /** The page was specified in the command line or is the start page. */
5868
+ AUTO_TOPLEVEL = "auto_toplevel",
5869
+ /** The user arrived at this page by filling out values in a form and submitting the form. Not all form submissions use this transition type. */
5870
+ FORM_SUBMIT = "form_submit",
5871
+ /** The user reloaded the page, either by clicking the reload button or by pressing Enter in the address bar. Session restore and Reopen closed tab also use this transition type. */
5872
+ RELOAD = "reload",
5873
+ /** The URL for this page was generated from a replaceable keyword other than the default search provider. */
5874
+ KEYWORD = "keyword",
5875
+ /** Corresponds to a visit generated for a keyword. */
5876
+ KEYWORD_GENERATED = "keyword_generated",
5877
+ }
5878
+
5675
5879
  export interface HistoryQuery {
5676
- /** A free-text query to the history service. Leave empty to retrieve all pages. */
5880
+ /** A free-text query to the history service. Leave this empty to retrieve all pages. */
5677
5881
  text: string;
5678
- /** Optional. The maximum number of results to retrieve. Defaults to 100. */
5882
+ /** The maximum number of results to retrieve. Defaults to 100. */
5679
5883
  maxResults?: number | undefined;
5680
- /** Optional. Limit results to those visited after this date, represented in milliseconds since the epoch. */
5884
+ /** Limit results to those visited after this date, represented in milliseconds since the epoch. If property is not specified, it will default to 24 hours. */
5681
5885
  startTime?: number | undefined;
5682
- /** Optional. Limit results to those visited before this date, represented in milliseconds since the epoch. */
5886
+ /** Limit results to those visited before this date, represented in milliseconds since the epoch. */
5683
5887
  endTime?: number | undefined;
5684
5888
  }
5685
5889
 
5686
- export interface Url {
5687
- /** The URL for the operation. It must be in the format as returned from a call to history.search. */
5890
+ /** @since Chrome 88 */
5891
+ export interface UrlDetails {
5892
+ /** The URL for the operation. It must be in the format as returned from a call to {@link history.search}. */
5688
5893
  url: string;
5689
5894
  }
5690
5895
 
@@ -5698,73 +5903,62 @@ declare namespace chrome {
5698
5903
  export interface RemovedResult {
5699
5904
  /** True if all history was removed. If true, then urls will be empty. */
5700
5905
  allHistory: boolean;
5701
- /** Optional. */
5702
- urls?: string[] | undefined;
5906
+ urls?: string[];
5703
5907
  }
5704
5908
 
5705
- export interface HistoryVisitedEvent extends chrome.events.Event<(result: HistoryItem) => void> {}
5706
-
5707
- export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> {}
5708
-
5709
5909
  /**
5710
5910
  * Searches the history for the last visit time of each page matching the query.
5711
- * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only).
5911
+ *
5912
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5712
5913
  */
5713
5914
  export function search(query: HistoryQuery): Promise<HistoryItem[]>;
5714
- /**
5715
- * Searches the history for the last visit time of each page matching the query.
5716
- */
5717
5915
  export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
5916
+
5718
5917
  /**
5719
5918
  * Adds a URL to the history at the current time with a transition type of "link".
5720
- * @return The `addUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5721
- */
5722
- export function addUrl(details: Url): Promise<void>;
5723
- /**
5724
- * Adds a URL to the history at the current time with a transition type of "link".
5919
+ *
5920
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5725
5921
  */
5726
- export function addUrl(details: Url, callback: () => void): void;
5922
+ export function addUrl(details: UrlDetails): Promise<void>;
5923
+ export function addUrl(details: UrlDetails, callback: () => void): void;
5924
+
5727
5925
  /**
5728
5926
  * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
5729
- * @return The `deleteRange` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5927
+ *
5928
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5730
5929
  */
5731
5930
  export function deleteRange(range: Range): Promise<void>;
5732
- /**
5733
- * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
5734
- */
5735
5931
  export function deleteRange(range: Range, callback: () => void): void;
5932
+
5736
5933
  /**
5737
5934
  * Deletes all items from the history.
5738
- * @return The `deleteAll` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5935
+ *
5936
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5739
5937
  */
5740
5938
  export function deleteAll(): Promise<void>;
5741
- /**
5742
- * Deletes all items from the history.
5743
- */
5744
5939
  export function deleteAll(callback: () => void): void;
5940
+
5745
5941
  /**
5746
5942
  * Retrieves information about visits to a URL.
5747
- * @return The `getVisits` method provides its result via callback or returned as a `Promise` (MV3 only).
5748
- */
5749
- export function getVisits(details: Url): Promise<VisitItem[]>;
5750
- /**
5751
- * Retrieves information about visits to a URL.
5752
- */
5753
- export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
5754
- /**
5755
- * Removes all occurrences of the given URL from the history.
5756
- * @return The `deleteUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
5943
+ *
5944
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5757
5945
  */
5758
- export function deleteUrl(details: Url): Promise<void>;
5946
+ export function getVisits(details: UrlDetails): Promise<VisitItem[]>;
5947
+ export function getVisits(details: UrlDetails, callback: (results: VisitItem[]) => void): void;
5948
+
5759
5949
  /**
5760
5950
  * Removes all occurrences of the given URL from the history.
5951
+ *
5952
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
5761
5953
  */
5762
- export function deleteUrl(details: Url, callback: () => void): void;
5954
+ export function deleteUrl(details: UrlDetails): Promise<void>;
5955
+ export function deleteUrl(details: UrlDetails, callback: () => void): void;
5956
+
5957
+ /** Fired when a URL is visited, providing the {@link HistoryItem} data for that URL. This event fires before the page has loaded. */
5958
+ export const onVisited: events.Event<(result: HistoryItem) => void>;
5763
5959
 
5764
- /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */
5765
- export var onVisited: HistoryVisitedEvent;
5766
- /** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */
5767
- export var onVisitRemoved: HistoryVisitRemovedEvent;
5960
+ /** Fired when one or more URLs are removed from history. When all visits have been removed the URL is purged from history. */
5961
+ export const onVisitRemoved: events.Event<(removed: RemovedResult) => void>;
5768
5962
  }
5769
5963
 
5770
5964
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
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": "a46e6689297c50bba1d7cc23508d14acdbf293bafc846406f96238879a6c46de",
97
+ "typesPublisherContentHash": "4be2065e800c9158a9e20019cc5cf220ee67551b642b4dcef5ea7cd2751cf4a9",
98
98
  "typeScriptVersion": "5.2"
99
99
  }