@types/chrome 0.0.274 → 0.0.276

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +191 -6
  3. chrome/package.json +2 -2
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (http://developer.chrome.com/e
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 02 Oct 2024 18:10:02 GMT
11
+ * Last updated: Thu, 03 Oct 2024 06:10:42 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
@@ -486,6 +486,160 @@ declare namespace chrome.alarms {
486
486
  export var onAlarm: AlarmEvent;
487
487
  }
488
488
 
489
+ ////////////////////
490
+ // Audio
491
+ ////////////////////
492
+ /**
493
+ * The chrome.audio API is provided to allow users to get information about and control the audio devices attached to the system.
494
+ * This API is currently only available in kiosk mode for ChromeOS.
495
+ *
496
+ * Permissions: "audio"
497
+ *
498
+ * @platform ChromeOS only
499
+ * @since Chrome 59
500
+ */
501
+ declare namespace chrome.audio {
502
+ export interface AudioDeviceInfo {
503
+ /** Device name */
504
+ deviceName: string;
505
+ /** Type of the device */
506
+ deviceType: DeviceType;
507
+ /** The user-friendly name (e.g. "USB Microphone"). */
508
+ displayName: string;
509
+ /** The unique identifier of the audio device. */
510
+ id: string;
511
+ /** True if this is the current active device. */
512
+ isActive: boolean;
513
+ /** The sound level of the device, volume for output, gain for input. */
514
+ level: number;
515
+ /** The stable/persisted device id string when available. */
516
+ stableDeviceId?: string;
517
+ /** Stream type associated with this device. */
518
+ streamType: StreamType;
519
+ }
520
+
521
+ export interface DeviceFilter {
522
+ /** If set, only audio devices whose active state matches this value will satisfy the filter. */
523
+ isActive?: boolean;
524
+ /** If set, only audio devices whose stream type is included in this list will satisfy the filter. */
525
+ streamTypes?: StreamType[];
526
+ }
527
+
528
+ export interface DeviceIdLists {
529
+ /**
530
+ * List of input devices specified by their ID.
531
+ * To indicate input devices should be unaffected, leave this property unset.
532
+ */
533
+ input?: string[];
534
+ /**
535
+ * List of output devices specified by their ID.
536
+ * To indicate output devices should be unaffected, leave this property unset.
537
+ */
538
+ output?: string[];
539
+ }
540
+
541
+ export interface DeviceProperties {
542
+ /**
543
+ * The audio device's desired sound level. Defaults to the device's current sound level.
544
+ * If used with audio input device, represents audio device gain.
545
+ * If used with audio output device, represents audio device volume.
546
+ */
547
+ level?: number;
548
+ }
549
+
550
+ /** Available audio device types. */
551
+ export enum DeviceType {
552
+ ALSA_LOOPBACK = "ALSA_LOOPBACK",
553
+ BLUETOOTH = "BLUETOOTH",
554
+ FRONT_MIC = "FRONT_MIC",
555
+ HDMI = "HDMI",
556
+ HEADPHONE = "HEADPHONE",
557
+ HOTWORD = "HOTWORD",
558
+ INTERNAL_MIC = "INTERNAL_MIC",
559
+ INTERNAL_SPEAKER = "INTERNAL_SPEAKER",
560
+ KEYBOARD_MIC = "KEYBOARD_MIC",
561
+ LINEOUT = "LINEOUT",
562
+ MIC = "MIC",
563
+ OTHER = "OTHER",
564
+ POST_DSP_LOOPBACK = "POST_DSP_LOOPBACK",
565
+ POST_MIX_LOOPBACK = "POST_MIX_LOOPBACK",
566
+ REAR_MIC = "REAR_MIC",
567
+ USB = "USB",
568
+ }
569
+
570
+ export interface LevelChangedEvent {
571
+ /** ID of device whose sound level has changed. */
572
+ deviceId: string;
573
+ /** The device's new sound level. */
574
+ level: number;
575
+ }
576
+
577
+ export interface MuteChangedEvent {
578
+ /** Whether or not the stream is now muted. */
579
+ isMuted: boolean;
580
+ /** The type of the stream for which the mute value changed. The updated mute value applies to all devices with this stream type. */
581
+ streamType: StreamType;
582
+ }
583
+
584
+ /** Type of stream an audio device provides. */
585
+ export enum StreamType {
586
+ INPUT = "INPUT",
587
+ OUTPUT = "OUTPUT",
588
+ }
589
+
590
+ /**
591
+ * Gets a list of audio devices filtered based on filter.
592
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
593
+ */
594
+ export function getDevices(filter?: DeviceFilter): Promise<AudioDeviceInfo[]>;
595
+ export function getDevices(filter: DeviceFilter, callback: (devices: AudioDeviceInfo[]) => void): void;
596
+ export function getDevices(callback: (devices: AudioDeviceInfo[]) => void): void;
597
+
598
+ /**
599
+ * Gets the system-wide mute state for the specified stream type.
600
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
601
+ */
602
+ export function getMute(streamType: `${StreamType}`): Promise<boolean>;
603
+ export function getMute(streamType: `${StreamType}`, callback: (value: boolean) => void): void;
604
+
605
+ /**
606
+ * Sets lists of active input and/or output devices.
607
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
608
+ */
609
+ export function setActiveDevices(ids: DeviceIdLists): Promise<void>;
610
+ export function setActiveDevices(ids: DeviceIdLists, callback: () => void): void;
611
+
612
+ /**
613
+ * Sets mute state for a stream type. The mute state will apply to all audio devices with the specified audio stream type.
614
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
615
+ */
616
+ export function setMute(streamType: `${StreamType}`, isMuted: boolean): Promise<void>;
617
+ export function setMute(streamType: `${StreamType}`, isMuted: boolean, callback: () => void): void;
618
+
619
+ /**
620
+ * Sets the properties for the input or output device.
621
+ * Can return its result via Promise in Manifest V3 or later since Chrome 116.
622
+ */
623
+ export function setProperties(id: string, properties: DeviceProperties): Promise<void>;
624
+ export function setProperties(id: string, properties: DeviceProperties, callback: () => void): void;
625
+
626
+ /**
627
+ * Fired when audio devices change, either new devices being added, or existing devices being removed.
628
+ */
629
+ export const onDeviceListChanged: chrome.events.Event<(devices: AudioDeviceInfo[]) => void>;
630
+
631
+ /**
632
+ * Fired when sound level changes for an active audio device.
633
+ */
634
+ export const onLevelChanged: chrome.events.Event<(event: LevelChangedEvent) => void>;
635
+
636
+ /**
637
+ * Fired when the mute state of the audio input or output changes.
638
+ * Note that mute state is system-wide and the new value applies to every audio device with specified stream type.
639
+ */
640
+ export const onMuteChanged: chrome.events.Event<(event: MuteChangedEvent) => void>;
641
+ }
642
+
489
643
  ////////////////////
490
644
  // Browser
491
645
  ////////////////////
@@ -1822,6 +1976,11 @@ declare namespace chrome.cookies {
1822
1976
  domain: string;
1823
1977
  /** The name of the cookie. */
1824
1978
  name: string;
1979
+ /**
1980
+ * The partition key for reading or modifying cookies with the Partitioned attribute.
1981
+ * @since Chrome 119
1982
+ */
1983
+ partitionKey?: CookiePartitionKey;
1825
1984
  /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */
1826
1985
  storeId: string;
1827
1986
  /** The value of the cookie. */
@@ -1845,6 +2004,12 @@ declare namespace chrome.cookies {
1845
2004
  sameSite: SameSiteStatus;
1846
2005
  }
1847
2006
 
2007
+ /** Represents a partitioned cookie's partition key. */
2008
+ export interface CookiePartitionKey {
2009
+ /** The top-level site the partitioned cookie is available in. */
2010
+ topLevelSite?: string | undefined;
2011
+ }
2012
+
1848
2013
  /** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */
1849
2014
  export interface CookieStore {
1850
2015
  /** The unique identifier for the cookie store. */
@@ -1858,6 +2023,11 @@ declare namespace chrome.cookies {
1858
2023
  domain?: string | undefined;
1859
2024
  /** Optional. Filters the cookies by name. */
1860
2025
  name?: string | undefined;
2026
+ /**
2027
+ * The partition key for reading or modifying cookies with the Partitioned attribute.
2028
+ * @since Chrome 119
2029
+ */
2030
+ partitionKey?: CookiePartitionKey | undefined;
1861
2031
  /** Optional. Restricts the retrieved cookies to those that would match the given URL. */
1862
2032
  url?: string | undefined;
1863
2033
  /** Optional. The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. */
@@ -1875,6 +2045,11 @@ declare namespace chrome.cookies {
1875
2045
  domain?: string | undefined;
1876
2046
  /** Optional. The name of the cookie. Empty by default if omitted. */
1877
2047
  name?: string | undefined;
2048
+ /**
2049
+ * The partition key for reading or modifying cookies with the Partitioned attribute.
2050
+ * @since Chrome 119
2051
+ */
2052
+ partitionKey?: CookiePartitionKey | undefined;
1878
2053
  /** The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. */
1879
2054
  url: string;
1880
2055
  /** Optional. The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. */
@@ -1896,10 +2071,19 @@ declare namespace chrome.cookies {
1896
2071
  sameSite?: SameSiteStatus | undefined;
1897
2072
  }
1898
2073
 
1899
- export interface Details {
2074
+ /** Details to identify the cookie. */
2075
+ export interface CookieDetails {
2076
+ /** The name of the cookie to access. */
1900
2077
  name: string;
1901
- url: string;
2078
+ /**
2079
+ * The partition key for reading or modifying cookies with the Partitioned attribute.
2080
+ * @since Chrome 119
2081
+ */
2082
+ partitionKey?: CookiePartitionKey | undefined;
2083
+ /** The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used. */
1902
2084
  storeId?: string | undefined;
2085
+ /** The URL with which the cookie to access is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail. */
2086
+ url: string;
1903
2087
  }
1904
2088
 
1905
2089
  export interface CookieChangeInfo {
@@ -1955,24 +2139,24 @@ declare namespace chrome.cookies {
1955
2139
  * @param details Information to identify the cookie to remove.
1956
2140
  * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only).
1957
2141
  */
1958
- export function remove(details: Details): Promise<Details>;
2142
+ export function remove(details: CookieDetails): Promise<CookieDetails>;
1959
2143
  /**
1960
2144
  * Deletes a cookie by name.
1961
2145
  * @param details Information to identify the cookie to remove.
1962
2146
  */
1963
- export function remove(details: Details, callback?: (details: Details) => void): void;
2147
+ export function remove(details: CookieDetails, callback?: (details: CookieDetails) => void): void;
1964
2148
  /**
1965
2149
  * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
1966
2150
  * @param details Details to identify the cookie being retrieved.
1967
2151
  * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
1968
2152
  */
1969
- export function get(details: Details, callback: (cookie: Cookie | null) => void): void;
2153
+ export function get(details: CookieDetails, callback: (cookie: Cookie | null) => void): void;
1970
2154
  /**
1971
2155
  * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
1972
2156
  * @param details Details to identify the cookie being retrieved.
1973
2157
  * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
1974
2158
  */
1975
- export function get(details: Details): Promise<Cookie | null>;
2159
+ export function get(details: CookieDetails): Promise<Cookie | null>;
1976
2160
 
1977
2161
  /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */
1978
2162
  export var onChanged: CookieChangedEvent;
@@ -7434,6 +7618,7 @@ declare namespace chrome.runtime {
7434
7618
  export type ManifestPermissions =
7435
7619
  | "activeTab"
7436
7620
  | "alarms"
7621
+ | "audio"
7437
7622
  | "background"
7438
7623
  | "bookmarks"
7439
7624
  | "browsingData"
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.274",
3
+ "version": "0.0.276",
4
4
  "description": "TypeScript definitions for chrome",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -93,6 +93,6 @@
93
93
  "@types/filesystem": "*",
94
94
  "@types/har-format": "*"
95
95
  },
96
- "typesPublisherContentHash": "cd89f522cf6bb0e688b9d3791fa8dba9cee8bbceeb0ee9d6897aa3d3b54d83aa",
96
+ "typesPublisherContentHash": "cab771353bda4e0ddf6c12acf47fab033aa50196f074a7329164cb7a907fee27",
97
97
  "typeScriptVersion": "4.8"
98
98
  }