ngx-pwa
Version:
Provides functionality around the progressive web app functionality in angular. Most notably the an approach to cache POST, UPDATE and DELETE requests.
49 lines (48 loc) • 2.19 kB
TypeScript
import { OnInit } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { DomSanitizer } from '@angular/platform-browser';
import { PurifyUtilities } from '../../encapsulation/purify.utilities';
import { SynchronizeDialogDataInternal } from '../../models/synchronize-dialog-data-internal.model';
import { SynchronizeDialogData } from '../../models/synchronize-dialog-data.model';
import { CachedRequest, NgxPwaOfflineService } from '../../services/offline.service';
import * as i0 from "@angular/core";
/**
* The dialog for syncing cached requests to the server.
*/
export declare class NgxPwaSynchronizeDialogComponent<OfflineServiceType extends NgxPwaOfflineService> implements OnInit {
readonly offlineService: OfflineServiceType;
readonly sanitizer: DomSanitizer;
private readonly dialogRef;
readonly data: SynchronizeDialogData;
PurifyUtilities: typeof PurifyUtilities;
/**
* The provided dialog data filled up with default values.
*/
dialogData: SynchronizeDialogDataInternal;
constructor(offlineService: OfflineServiceType, sanitizer: DomSanitizer, dialogRef: MatDialogRef<NgxPwaSynchronizeDialogComponent<OfflineServiceType>>, data: SynchronizeDialogData);
ngOnInit(): void;
/**
* Sends a specific cached request to the server.
* @param request - The request that should be synced.
*/
syncSingleRequest(request: CachedRequest<unknown>): Promise<void>;
/**
* Removes a single request from the cache.
* @param request - The request that should be removed.
*/
removeSingleRequest(request: CachedRequest<unknown>): void;
/**
* Sends all cached requests to the server. Tries to handle dependencies of requests on each other.
*/
syncAll(): Promise<void>;
/**
* Removes all locally cached requests.
*/
undoAll(): void;
/**
* Closes the dialog.
*/
close(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPwaSynchronizeDialogComponent<any>, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NgxPwaSynchronizeDialogComponent<any>, "ngx-pwa-synchronize-dialog", never, {}, {}, never, never, true, never>;
}