Skip to content

Commit afeeefd

Browse files
committed
[fix] fix type declarations
1 parent 019a0f4 commit afeeefd

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

index.d.ts

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
import chromep from 'chrome-promise'
22

3-
// Type definitions for @extend-chrome/notify
4-
// Definitions by: Jack and Amy Steam <https://jackandamy.rocks>
5-
/// <reference types="chrome" />
6-
7-
// TODO: fix NotifyOptions
8-
// export interface NotifyOptions
9-
// extends chrome.notifications.NotificationOptions {
10-
// message: string
11-
// /**
12-
// * This only works if the background page is persistent.
13-
// */
14-
// onClick?: (id: string) => void
15-
// /**
16-
// * This only works if the background page is persistent.
17-
// */
18-
// buttons?: [(id: string) => void, (id: string) => void]
19-
// }
20-
21-
export function notify(message: string): Promise<string>
22-
export namespace notify {
23-
/**
24-
* Resolves to the notification id (either supplied or generated) that represents the created notification.
25-
*/
26-
export function create(NotifyOptions): Promise<string>
3+
export interface NotifyOptions
4+
extends Partial<chrome.notifications.NotificationOptions> {
5+
message: string
276
}
7+
8+
export const notify: ((message: string) => Promise<string>) &
9+
typeof chromep.notifications & {
10+
/**
11+
* Resolves to the notification id (either supplied or generated) that represents the created notification.
12+
*/
13+
create(options: NotifyOptions): Promise<string>
14+
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ const create = ({
4848

4949
export const notify = (message: string): Promise<string> => create({ message })
5050

51-
Object.assign(notify, chrome.notifications, chromep.notifications, { create })
51+
Object.assign(notify, chromep.notifications, { create })

0 commit comments

Comments
 (0)