Alex Rickabaugh 65f4fad801 fix(service-worker): allow disabling SW while still using services
Currently, the way to not use the SW is to not install its module.
However, this means that you can't inject any of its services.

This change adds a ServiceWorkerModule.disabled() MWP, that still
registers all of the right providers but acts as if the browser does
not support Service Workers.
2017-12-01 14:18:16 -08:00

28 lines
811 B
TypeScript

/** @experimental */
export declare class ServiceWorkerModule {
static register(script: string, opts?: {
scope?: string;
enabled?: boolean;
}): ModuleWithProviders;
}
/** @experimental */
export declare class SwPush {
readonly messages: Observable<object>;
readonly subscription: Observable<PushSubscription | null>;
constructor(sw: NgswCommChannel);
requestSubscription(options: {
serverPublicKey: string;
}): Promise<PushSubscription>;
unsubscribe(): Promise<void>;
}
/** @experimental */
export declare class SwUpdate {
readonly activated: Observable<UpdateActivatedEvent>;
readonly available: Observable<UpdateAvailableEvent>;
constructor(sw: NgswCommChannel);
activateUpdate(): Promise<void>;
checkForUpdate(): Promise<void>;
}