@types/chrome 0.0.322 → 0.0.323
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 +141 -142
- 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: Fri, 16 May 2025 23:33:24 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
@@ -2,6 +2,9 @@
|
|
2
2
|
/// <reference path="./har-format/index.d.ts" />
|
3
3
|
/// <reference path="./chrome-cast/index.d.ts" />
|
4
4
|
|
5
|
+
// Helpers
|
6
|
+
type SetRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
7
|
+
|
5
8
|
////////////////////
|
6
9
|
// Global object
|
7
10
|
////////////////////
|
@@ -7019,181 +7022,177 @@ declare namespace chrome {
|
|
7019
7022
|
* Permissions: "notifications"
|
7020
7023
|
*/
|
7021
7024
|
export namespace notifications {
|
7022
|
-
export
|
7023
|
-
|
7024
|
-
|
7025
|
+
export interface NotificationButton {
|
7026
|
+
/** @deprecated since Chrome 59. Button icons not visible for Mac OS X users. */
|
7027
|
+
iconUrl?: string;
|
7025
7028
|
title: string;
|
7026
|
-
iconUrl?: string | undefined;
|
7027
7029
|
}
|
7028
7030
|
|
7029
|
-
export interface
|
7030
|
-
/** Title of one item of a list notification. */
|
7031
|
-
title: string;
|
7031
|
+
export interface NotificationItem {
|
7032
7032
|
/** Additional details about this item. */
|
7033
7033
|
message: string;
|
7034
|
+
/** Title of one item of a list notification. */
|
7035
|
+
title: string;
|
7034
7036
|
}
|
7035
7037
|
|
7036
|
-
export
|
7037
|
-
|
7038
|
-
|
7039
|
-
|
7040
|
-
|
7041
|
-
|
7042
|
-
|
7043
|
-
|
7044
|
-
|
7045
|
-
|
7046
|
-
|
7047
|
-
|
7048
|
-
|
7049
|
-
|
7050
|
-
|
7051
|
-
|
7052
|
-
|
7053
|
-
|
7054
|
-
|
7055
|
-
|
7056
|
-
|
7057
|
-
|
7058
|
-
|
7059
|
-
|
7060
|
-
|
7061
|
-
|
7062
|
-
|
7063
|
-
|
7064
|
-
|
7065
|
-
|
7066
|
-
|
7067
|
-
|
7068
|
-
|
7069
|
-
|
7070
|
-
|
7071
|
-
|
7072
|
-
|
7073
|
-
|
7074
|
-
|
7075
|
-
|
7076
|
-
|
7077
|
-
|
7078
|
-
|
7079
|
-
|
7080
|
-
|
7081
|
-
|
7082
|
-
|
7083
|
-
|
7084
|
-
|
7085
|
-
|
7086
|
-
|
7087
|
-
|
7088
|
-
|
7089
|
-
|
7090
|
-
|
7091
|
-
|
7092
|
-
|
7093
|
-
|
7094
|
-
|
7095
|
-
|
7096
|
-
|
7097
|
-
|
7098
|
-
|
7099
|
-
/**
|
7100
|
-
* Optional.
|
7101
|
-
* A URL to the sender's avatar, app icon, or a thumbnail for image notifications.
|
7102
|
-
* URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file. Required for notifications.create method.
|
7103
|
-
*/
|
7104
|
-
iconUrl?: string | undefined;
|
7105
|
-
/** Optional. Main notification content. Required for notifications.create method. */
|
7106
|
-
message?: string | undefined;
|
7107
|
-
/** Optional. Which type of notification to display. Required for notifications.create method. */
|
7108
|
-
type?: TemplateType | undefined;
|
7109
|
-
/** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */
|
7110
|
-
title?: string | undefined;
|
7111
|
-
});
|
7112
|
-
|
7113
|
-
export interface NotificationClosedEvent
|
7114
|
-
extends chrome.events.Event<(notificationId: string, byUser: boolean) => void>
|
7115
|
-
{}
|
7116
|
-
|
7117
|
-
export interface NotificationClickedEvent extends chrome.events.Event<(notificationId: string) => void> {}
|
7038
|
+
export interface NotificationOptions {
|
7039
|
+
/**
|
7040
|
+
* A URL to the app icon mask. URLs have the same restrictions as {@link notifications.NotificationOptions.iconUrl iconUrl}.
|
7041
|
+
*
|
7042
|
+
* The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered.
|
7043
|
+
* @deprecated since Chrome 59. The app icon mask is not visible for Mac OS X users.
|
7044
|
+
*/
|
7045
|
+
appIconMaskUrl?: string;
|
7046
|
+
/** Text and icons for up to two notification action buttons. */
|
7047
|
+
buttons?: NotificationButton[];
|
7048
|
+
/** Alternate notification content with a lower-weight font. */
|
7049
|
+
contextMessage?: string;
|
7050
|
+
/** A timestamp associated with the notification, in milliseconds past the epoch (e.g. `Date.now() + n`). */
|
7051
|
+
eventTime?: number;
|
7052
|
+
/**
|
7053
|
+
* A URL to the sender's avatar, app icon, or a thumbnail for image notifications.
|
7054
|
+
*
|
7055
|
+
* URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file
|
7056
|
+
*
|
7057
|
+
* **Note:** This value is required for the {@link notifications.create}() method.
|
7058
|
+
*/
|
7059
|
+
iconUrl?: string;
|
7060
|
+
/**
|
7061
|
+
* A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as {@link notifications.NotificationOptions.iconUrl iconUrl}.
|
7062
|
+
* @deprecated since Chrome 59. The image is not visible for Mac OS X users.
|
7063
|
+
*/
|
7064
|
+
imageUrl?: string;
|
7065
|
+
/** @deprecated since Chrome 67. This UI hint is ignored as of Chrome 67 */
|
7066
|
+
isClickable?: boolean;
|
7067
|
+
/** Items for multi-item notifications. Users on Mac OS X only see the first item. */
|
7068
|
+
items?: NotificationItem[];
|
7069
|
+
/**
|
7070
|
+
* Main notification content.
|
7071
|
+
*
|
7072
|
+
* **Note:** This value is required for the {@link notifications.create}() method.
|
7073
|
+
*/
|
7074
|
+
message?: string;
|
7075
|
+
/** Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. On platforms that don't support a notification center (Windows, Linux & Mac), -2 and -1 result in an error as notifications with those priorities will not be shown at all. */
|
7076
|
+
priority?: number;
|
7077
|
+
/** Current progress ranges from 0 to 100. */
|
7078
|
+
progress?: number;
|
7079
|
+
/**
|
7080
|
+
* Indicates that the notification should remain visible on screen until the user activates or dismisses the notification. This defaults to false.
|
7081
|
+
* @since Chrome 50
|
7082
|
+
*/
|
7083
|
+
requireInteraction?: boolean;
|
7084
|
+
/**
|
7085
|
+
* Indicates that no sounds or vibrations should be made when the notification is being shown. This defaults to false.
|
7086
|
+
* @since Chrome 70
|
7087
|
+
*/
|
7088
|
+
silent?: boolean;
|
7089
|
+
/**
|
7090
|
+
* Title of the notification (e.g. sender name for email).
|
7091
|
+
*
|
7092
|
+
* **Note:** This value is required for the {@link notifications.create}() method.
|
7093
|
+
*/
|
7094
|
+
title?: string;
|
7095
|
+
/** Which type of notification to display.
|
7096
|
+
*
|
7097
|
+
* **Note:** This value is required for the {@link notifications.create}() method.
|
7098
|
+
*/
|
7099
|
+
type?: `${TemplateType}`;
|
7100
|
+
}
|
7118
7101
|
|
7119
|
-
|
7120
|
-
extends chrome.events.Event<(notificationId: string, buttonIndex: number) => void>
|
7121
|
-
{}
|
7102
|
+
type NotificationCreateOptions = SetRequired<NotificationOptions, "type" | "title" | "message" | "iconUrl">;
|
7122
7103
|
|
7123
|
-
export
|
7104
|
+
export enum PermissionLevel {
|
7105
|
+
/** Specifies that the user has elected to show notifications from the app or extension. This is the default at install time. */
|
7106
|
+
GRANTED = "granted",
|
7107
|
+
/** Specifies that the user has elected not to show notifications from the app or extension. */
|
7108
|
+
DENIED = "denied",
|
7109
|
+
}
|
7124
7110
|
|
7125
|
-
export
|
7111
|
+
export enum TemplateType {
|
7112
|
+
/** Contains an icon, title, message, expandedMessage, and up to two buttons. */
|
7113
|
+
BASIC = "basic",
|
7114
|
+
/** Contains an icon, title, message, expandedMessage, image, and up to two buttons. */
|
7115
|
+
IMAGE = "image",
|
7116
|
+
/** Contains an icon, title, message, items, and up to two buttons. Users on Mac OS X only see the first item. */
|
7117
|
+
LIST = "list",
|
7118
|
+
/** Contains an icon, title, message, progress, and up to two buttons. */
|
7119
|
+
PROGRESS = "progress",
|
7120
|
+
}
|
7126
7121
|
|
7127
|
-
/** The notification closed, either by the system or by user action. */
|
7128
|
-
export var onClosed: NotificationClosedEvent;
|
7129
|
-
/** The user clicked in a non-button area of the notification. */
|
7130
|
-
export var onClicked: NotificationClickedEvent;
|
7131
|
-
/** The user pressed a button in the notification. */
|
7132
|
-
export var onButtonClicked: NotificationButtonClickedEvent;
|
7133
|
-
/**
|
7134
|
-
* The user changes the permission level.
|
7135
|
-
* @since Chrome 32
|
7136
|
-
*/
|
7137
|
-
export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent;
|
7138
7122
|
/**
|
7139
|
-
*
|
7140
|
-
* @
|
7123
|
+
* Clears the specified notification.
|
7124
|
+
* @param notificationId The id of the notification to be cleared. This is returned by {@link notifications.create} method.
|
7125
|
+
*
|
7126
|
+
* Can return its result via Promise since Chrome 116
|
7141
7127
|
*/
|
7142
|
-
export
|
7128
|
+
export function clear(notificationId: string): Promise<boolean>;
|
7129
|
+
export function clear(notificationId: string, callback: (wasCleared: boolean) => void): void;
|
7143
7130
|
|
7144
7131
|
/**
|
7145
7132
|
* Creates and displays a notification.
|
7146
|
-
* @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation.
|
7147
|
-
*
|
7133
|
+
* @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. The identifier may not be longer than 500 characters.
|
7134
|
+
*
|
7135
|
+
* The `notificationId` parameter is required before Chrome 42.
|
7148
7136
|
* @param options Contents of the notification.
|
7149
|
-
*
|
7150
|
-
*
|
7137
|
+
*
|
7138
|
+
* Can return its result via Promise since Chrome 116
|
7151
7139
|
*/
|
7140
|
+
export function create(notificationId: string, options: NotificationCreateOptions): Promise<string>;
|
7141
|
+
export function create(options: NotificationCreateOptions): Promise<string>;
|
7152
7142
|
export function create(
|
7153
7143
|
notificationId: string,
|
7154
|
-
options:
|
7155
|
-
callback
|
7144
|
+
options: NotificationCreateOptions,
|
7145
|
+
callback: (notificationId: string) => void,
|
7156
7146
|
): void;
|
7147
|
+
export function create(options: NotificationCreateOptions, callback: (notificationId: string) => void): void;
|
7148
|
+
|
7157
7149
|
/**
|
7158
|
-
*
|
7159
|
-
*
|
7160
|
-
*
|
7161
|
-
|
7162
|
-
|
7163
|
-
|
7150
|
+
* Retrieves all the notifications of this app or extension.
|
7151
|
+
*
|
7152
|
+
* Can return its result via Promise since Chrome 116
|
7153
|
+
*/
|
7154
|
+
export function getAll(): Promise<{ [key: string]: true }>;
|
7155
|
+
export function getAll(callback: (notifications: { [key: string]: true }) => void): void;
|
7156
|
+
|
7157
|
+
/**
|
7158
|
+
* Retrieves whether the user has enabled notifications from this app or extension.
|
7159
|
+
*
|
7160
|
+
* Can return its result via Promise since Chrome 116
|
7164
7161
|
*/
|
7165
|
-
export function
|
7162
|
+
export function getPermissionLevel(): Promise<`${PermissionLevel}`>;
|
7163
|
+
export function getPermissionLevel(callback: (level: `${PermissionLevel}`) => void): void;
|
7164
|
+
|
7166
7165
|
/**
|
7167
7166
|
* Updates an existing notification.
|
7168
|
-
* @param notificationId The id of the notification to be updated. This is returned by notifications.create method.
|
7167
|
+
* @param notificationId The id of the notification to be updated. This is returned by {@link notifications.create} method.
|
7169
7168
|
* @param options Contents of the notification to update to.
|
7170
|
-
*
|
7171
|
-
*
|
7169
|
+
*
|
7170
|
+
* Can return its result via Promise since Chrome 116
|
7172
7171
|
*/
|
7172
|
+
export function update(notificationId: string, options: NotificationOptions): Promise<boolean>;
|
7173
7173
|
export function update(
|
7174
7174
|
notificationId: string,
|
7175
7175
|
options: NotificationOptions,
|
7176
|
-
callback
|
7176
|
+
callback: (wasUpdated: boolean) => void,
|
7177
7177
|
): void;
|
7178
|
+
|
7179
|
+
/** The user pressed a button in the notification. */
|
7180
|
+
export const onButtonClicked: events.Event<(notificationId: string, buttonIndex: number) => void>;
|
7181
|
+
|
7182
|
+
/** The user clicked in a non-button area of the notification. */
|
7183
|
+
export const onClicked: events.Event<(notificationId: string) => void>;
|
7184
|
+
|
7185
|
+
/** The notification closed, either by the system or by user action. */
|
7186
|
+
export const onClosed: events.Event<(notificationId: string, byUser: boolean) => void>;
|
7187
|
+
|
7188
|
+
/** The user changes the permission level. As of Chrome 47, only ChromeOS has UI that dispatches this event. */
|
7189
|
+
export const onPermissionLevelChanged: events.Event<(level: `${PermissionLevel}`) => void>;
|
7190
|
+
|
7178
7191
|
/**
|
7179
|
-
*
|
7180
|
-
* @
|
7181
|
-
* @param callback Called to indicate whether a matching notification existed.
|
7182
|
-
* The callback is required before Chrome 42.
|
7183
|
-
*/
|
7184
|
-
export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void;
|
7185
|
-
/**
|
7186
|
-
* Retrieves all the notifications.
|
7187
|
-
* @since Chrome 29
|
7188
|
-
* @param callback Returns the set of notification_ids currently in the system.
|
7189
|
-
*/
|
7190
|
-
export function getAll(callback: (notifications: { [key: string]: true }) => void): void;
|
7191
|
-
/**
|
7192
|
-
* Retrieves whether the user has enabled notifications from this app or extension.
|
7193
|
-
* @since Chrome 32
|
7194
|
-
* @param callback Returns the current permission level.
|
7192
|
+
* The user clicked on a link for the app's notification settings. As of Chrome 47, only ChromeOS has UI that dispatches this event. As of Chrome 65, that UI has been removed from ChromeOS, too.
|
7193
|
+
* @deprecated since Chrome 65. Custom notification settings button is no longer supported.
|
7195
7194
|
*/
|
7196
|
-
export
|
7195
|
+
export const onShowSettings: events.Event<() => void>;
|
7197
7196
|
}
|
7198
7197
|
|
7199
7198
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.323",
|
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": "074305d089f256f5db9ac97d229525e353e1da24eac729acc00f00f3cbd462e1",
|
98
98
|
"typeScriptVersion": "5.1"
|
99
99
|
}
|