2017-09-28 19:18:12 -04:00
|
|
|
export declare class ServiceWorkerModule {
|
2019-04-25 09:51:07 -04:00
|
|
|
static register(script: string, opts?: SwRegistrationOptions): ModuleWithProviders<ServiceWorkerModule>;
|
2017-09-28 19:18:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare class SwPush {
|
2019-11-09 13:36:22 -05:00
|
|
|
get isEnabled(): boolean;
|
2017-09-28 19:18:12 -04:00
|
|
|
readonly messages: Observable<object>;
|
2018-09-28 04:28:53 -04:00
|
|
|
readonly notificationClicks: Observable<{
|
|
|
|
action: string;
|
|
|
|
notification: NotificationOptions & {
|
|
|
|
title: string;
|
|
|
|
};
|
|
|
|
}>;
|
2017-09-28 19:18:12 -04:00
|
|
|
readonly subscription: Observable<PushSubscription | null>;
|
2020-02-26 12:09:35 -05:00
|
|
|
constructor(sw: ɵangular_packages_service_worker_service_worker_a);
|
2017-09-28 19:18:12 -04:00
|
|
|
requestSubscription(options: {
|
|
|
|
serverPublicKey: string;
|
|
|
|
}): Promise<PushSubscription>;
|
|
|
|
unsubscribe(): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2019-04-25 09:51:07 -04:00
|
|
|
export declare abstract class SwRegistrationOptions {
|
|
|
|
enabled?: boolean;
|
2018-11-07 15:45:40 -05:00
|
|
|
registrationStrategy?: string | (() => Observable<unknown>);
|
2019-04-25 09:51:07 -04:00
|
|
|
scope?: string;
|
|
|
|
}
|
|
|
|
|
2017-09-28 19:18:12 -04:00
|
|
|
export declare class SwUpdate {
|
|
|
|
readonly activated: Observable<UpdateActivatedEvent>;
|
|
|
|
readonly available: Observable<UpdateAvailableEvent>;
|
2019-11-09 13:36:22 -05:00
|
|
|
get isEnabled(): boolean;
|
2020-02-26 12:09:35 -05:00
|
|
|
constructor(sw: ɵangular_packages_service_worker_service_worker_a);
|
2017-09-28 19:18:12 -04:00
|
|
|
activateUpdate(): Promise<void>;
|
|
|
|
checkForUpdate(): Promise<void>;
|
|
|
|
}
|
2018-04-02 07:51:06 -04:00
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface UpdateActivatedEvent {
|
2018-04-02 07:51:06 -04:00
|
|
|
current: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
previous?: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
type: 'UPDATE_ACTIVATED';
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface UpdateAvailableEvent {
|
2018-04-02 07:51:06 -04:00
|
|
|
available: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
current: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
type: 'UPDATE_AVAILABLE';
|
|
|
|
}
|