From 37247316a72462507a809f062f1659a2ee648b94 Mon Sep 17 00:00:00 2001 From: Samuel Campos Date: Thu, 8 Dec 2016 20:05:32 +0000 Subject: [PATCH] Fixes #12414 (#13076) * Fixes #12414 * Make applicationServerKey optional --- service_worker_api/service_worker_api.d.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/service_worker_api/service_worker_api.d.ts b/service_worker_api/service_worker_api.d.ts index 6084efc4a0..62d864ca18 100644 --- a/service_worker_api/service_worker_api.d.ts +++ b/service_worker_api/service_worker_api.d.ts @@ -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; + subscribe(options?: PushSubscriptionOptions): Promise; /** * Returns a promise that resolves to a PushSubscription details of