mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-23 12:57:25 +08:00
* Fixes #12414 * Make applicationServerKey optional
This commit is contained in:
22
service_worker_api/service_worker_api.d.ts
vendored
22
service_worker_api/service_worker_api.d.ts
vendored
@@ -579,6 +579,26 @@ interface PushSubscription {
|
||||
subscriptionId: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object containing optional subscribe parameters.
|
||||
*/
|
||||
interface PushSubscriptionOptions {
|
||||
/**
|
||||
* A boolean indicating that the returned push subscription will only be used for
|
||||
* messages whose effect is made visible to the user.
|
||||
* @readonly
|
||||
*/
|
||||
userVisibleOnly: boolean;
|
||||
|
||||
/**
|
||||
* A public key your push server will use to send messages to client apps via a push server.
|
||||
* This value is part of a signing key pair generated by your application server and usable
|
||||
* with elliptic curve digital signature (ECDSA) over the P-256 curve.
|
||||
* @readonly
|
||||
*/
|
||||
applicationServerKey?: Uint8Array;
|
||||
}
|
||||
|
||||
/**
|
||||
* The PushManager interface provides a way to receive notifications from
|
||||
* third-party servers as well as request URLs for push notifications.
|
||||
@@ -590,7 +610,7 @@ interface PushManager {
|
||||
* Returns a promise that resolves to a PushSubscription with details of a
|
||||
* new push subscription.
|
||||
*/
|
||||
subscribe(): Promise<PushSubscription>;
|
||||
subscribe(options?: PushSubscriptionOptions): Promise<PushSubscription>;
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves to a PushSubscription details of
|
||||
|
||||
Reference in New Issue
Block a user