2017-09-28 19:18:12 -04:00
|
|
|
export declare class ServiceWorkerModule {
|
2017-11-30 16:16:37 -05:00
|
|
|
static register(script: string, opts?: {
|
|
|
|
scope?: string;
|
|
|
|
enabled?: boolean;
|
2018-09-14 17:55:16 -04:00
|
|
|
}): ModuleWithProviders<ServiceWorkerModule>;
|
2017-09-28 19:18:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
export declare class SwPush {
|
2017-11-30 11:22:41 -05:00
|
|
|
readonly 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>;
|
|
|
|
constructor(sw: NgswCommChannel);
|
|
|
|
requestSubscription(options: {
|
|
|
|
serverPublicKey: string;
|
|
|
|
}): Promise<PushSubscription>;
|
|
|
|
unsubscribe(): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export declare class SwUpdate {
|
|
|
|
readonly activated: Observable<UpdateActivatedEvent>;
|
|
|
|
readonly available: Observable<UpdateAvailableEvent>;
|
2017-11-30 11:22:41 -05:00
|
|
|
readonly isEnabled: boolean;
|
2017-09-28 19:18:12 -04:00
|
|
|
constructor(sw: NgswCommChannel);
|
|
|
|
activateUpdate(): Promise<void>;
|
|
|
|
checkForUpdate(): Promise<void>;
|
|
|
|
}
|
2018-04-02 07:51:06 -04:00
|
|
|
|
|
|
|
export interface UpdateActivatedEvent {
|
|
|
|
current: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
previous?: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
type: 'UPDATE_ACTIVATED';
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UpdateAvailableEvent {
|
|
|
|
available: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
current: {
|
|
|
|
hash: string;
|
|
|
|
appData?: Object;
|
|
|
|
};
|
|
|
|
type: 'UPDATE_AVAILABLE';
|
|
|
|
}
|