2021-06-28 13:54:20 -04:00
|
|
|
## API Report File for "@angular/service-worker"
|
|
|
|
|
|
|
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
|
|
|
|
|
|
```ts
|
|
|
|
|
|
|
|
import { ModuleWithProviders } from '@angular/core';
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
export 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
|
|
|
}
|
|
|
|
|
2021-06-28 13:54:20 -04:00
|
|
|
// @public
|
|
|
|
export class SwPush {
|
|
|
|
constructor(sw: ɵangular_packages_service_worker_service_worker_a);
|
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
|
|
|
requestSubscription(options: {
|
|
|
|
serverPublicKey: string;
|
|
|
|
}): Promise<PushSubscription>;
|
2021-06-28 13:54:20 -04:00
|
|
|
readonly subscription: Observable<PushSubscription | null>;
|
2017-09-28 19:18:12 -04:00
|
|
|
unsubscribe(): Promise<void>;
|
|
|
|
}
|
|
|
|
|
2021-06-28 13:54:20 -04:00
|
|
|
// @public
|
|
|
|
export abstract class SwRegistrationOptions {
|
2019-04-25 09:51:07 -04:00
|
|
|
enabled?: boolean;
|
2018-11-07 15:45:40 -05:00
|
|
|
registrationStrategy?: string | (() => Observable<unknown>);
|
2019-04-25 09:51:07 -04:00
|
|
|
scope?: string;
|
|
|
|
}
|
|
|
|
|
2021-06-28 13:54:20 -04:00
|
|
|
// @public
|
|
|
|
export class SwUpdate {
|
|
|
|
constructor(sw: ɵangular_packages_service_worker_service_worker_a);
|
2017-09-28 19:18:12 -04:00
|
|
|
readonly activated: Observable<UpdateActivatedEvent>;
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
|
|
|
activateUpdate(): Promise<void>;
|
2017-09-28 19:18:12 -04:00
|
|
|
readonly available: Observable<UpdateAvailableEvent>;
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
|
|
|
checkForUpdate(): Promise<void>;
|
2019-11-09 13:36:22 -05:00
|
|
|
get isEnabled(): boolean;
|
2020-04-28 07:45:18 -04:00
|
|
|
readonly unrecoverable: Observable<UnrecoverableStateEvent>;
|
2017-09-28 19:18:12 -04:00
|
|
|
}
|
2018-04-02 07:51:06 -04:00
|
|
|
|
2021-06-28 13:54:20 -04:00
|
|
|
// @public
|
|
|
|
export interface UnrecoverableStateEvent {
|
|
|
|
// (undocumented)
|
2020-04-28 07:45:18 -04:00
|
|
|
reason: string;
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
2020-04-28 07:45:18 -04:00
|
|
|
type: 'UNRECOVERABLE_STATE';
|
|
|
|
}
|
|
|
|
|
2021-06-28 13:54:20 -04:00
|
|
|
// @public
|
|
|
|
export interface UpdateActivatedEvent {
|
|
|
|
// (undocumented)
|
2018-04-02 07:51:06 -04:00
|
|
|
current: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
2018-04-02 07:51:06 -04:00
|
|
|
previous?: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
2018-04-02 07:51:06 -04:00
|
|
|
type: 'UPDATE_ACTIVATED';
|
|
|
|
}
|
|
|
|
|
2021-06-28 13:54:20 -04:00
|
|
|
// @public
|
|
|
|
export interface UpdateAvailableEvent {
|
|
|
|
// (undocumented)
|
2018-04-02 07:51:06 -04:00
|
|
|
available: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
2018-04-02 07:51:06 -04:00
|
|
|
current: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
2021-06-28 13:54:20 -04:00
|
|
|
// (undocumented)
|
2018-04-02 07:51:06 -04:00
|
|
|
type: 'UPDATE_AVAILABLE';
|
|
|
|
}
|
2021-06-28 13:54:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
// (No @packageDocumentation comment for this package)
|
|
|
|
|
|
|
|
```
|