import { PreloadingStrategy, Route } from '@angular/router'; import { Observable } from 'rxjs'; export declare var navigator: any; export declare class CoreNetworkAwarePreloadStrategy implements PreloadingStrategy { constructor(); /** * This method will decide if preloading of lazy loaded module can be enabled or not * @param route - route details * @param load - load() function */ preload(route: Route, load: () => Observable): Observable; /** * This method checks the navigator.connection object's saveData property first. * Some mobile devices have a setting for "data saver". When this is enabled, this property will be true. * Therefore, if the user has decided to save their data, they did so by choice and we should not be * preloading bundles (which consumes data). * Next the code checks if the connection's effectiveType is one of the connection speeds that * you feel are too slow to preload the bundles. * The code below decides that 2g and slow-2g don;t qualify for preloading, but 3g and better do. * Therefore, as long as the saveData is true and the connection speed is 3g or better, * the bundle will be preloaded. */ hasGoodConnection(): boolean; }