mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-15 22:40:21 +00:00
Merge pull request #2320 from Ch0bits/patch-2
Added support for Google Chrome Notification API
This commit is contained in:
Vendored
+62
@@ -1232,6 +1232,68 @@ declare module chrome.management {
|
||||
var onEnabled: ManagementEnabledEvent;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// Notifications
|
||||
// https://developer.chrome.com/extensions/notifications
|
||||
////////////////////
|
||||
declare module chrome.notifications {
|
||||
interface ButtonOptions {
|
||||
title: string;
|
||||
iconUrl?: string;
|
||||
}
|
||||
|
||||
interface ItemOptions {
|
||||
title: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface NotificationOptions {
|
||||
type?: string;
|
||||
iconUrl?: string;
|
||||
title?: string;
|
||||
message?: string;
|
||||
contextMessage?: string;
|
||||
priority?: number;
|
||||
eventTime?: number;
|
||||
buttons?: Array<ButtonOptions>;
|
||||
items?: Array<ItemOptions>;
|
||||
progress?: number;
|
||||
isClickable?: boolean;
|
||||
}
|
||||
|
||||
interface OnClosed {
|
||||
addListener(callback: (notificationId: string, byUser: boolean) => void): void;
|
||||
}
|
||||
|
||||
interface OnClicked {
|
||||
addListener(callback: (notificationId: string) => void): void;
|
||||
}
|
||||
|
||||
interface OnButtonClicked {
|
||||
addListener(callback: (notificationId: string, buttonIndex: number) => void): void;
|
||||
}
|
||||
|
||||
interface OnPermissionLevelChanged {
|
||||
addListener(callback: (level: string) => void): void;
|
||||
}
|
||||
|
||||
interface OnShowSettings {
|
||||
addListener(callback: Function): void;
|
||||
}
|
||||
|
||||
export var onClosed: OnClosed;
|
||||
export var onClicked: OnClicked;
|
||||
export var onButtonClicked: OnButtonClicked;
|
||||
export var onPermissionLevelChanged: OnPermissionLevelChanged;
|
||||
export var onShowSettings: OnShowSettings;
|
||||
|
||||
export function create(notificationId: string, options: NotificationOptions, callback: (notificationId: string) => void): void;
|
||||
export function update(notificationId: string, options: NotificationOptions, callback: (wasUpdated: boolean) => void): void;
|
||||
export function clear(notificationId: string, callback: (wasCleared: boolean) => void): void;
|
||||
export function getAll(callback: (notifications: any) => void): void;
|
||||
export function getPermissionLevel(callback: (level: string) => void): void;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// Omnibox
|
||||
////////////////////
|
||||
|
||||
Reference in New Issue
Block a user