systelab-preferences
Version:
Library to manage your application preferences.
80 lines (72 loc) • 2.93 kB
TypeScript
import * as i0 from '@angular/core';
declare class StorageService {
private storage;
protected prefix: string;
constructor(storage: Storage);
usePrefix(prefix: string): void;
getPrefix(): string;
clear(): void;
put(key: string, value: any): void;
get(key: string, defaultValue?: any): any;
remove(key: string): void;
removeStartsWith(startWith: string): void;
removeEndsWith(endsWith: string): void;
private parse;
}
declare class LocalStorageService extends StorageService {
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<LocalStorageService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<LocalStorageService>;
}
declare class MemoryStorageService {
private preferences;
clear(): void;
put(key: string, value: any): void;
get(key: string, defaultValue?: any): any;
remove(key: string): void;
removeStartsWith(startWith: string): void;
removeEndsWith(endsWith: string): void;
getInCompressFormat(): string;
getInStringFormat(): string;
putFromCompressFormat(compressed: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration<MemoryStorageService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<MemoryStorageService>;
}
declare class SessionStorageService extends StorageService {
constructor();
static ɵfac: i0.ɵɵFactoryDeclaration<SessionStorageService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<SessionStorageService>;
}
declare enum StorageType {
IN_MEMORY_STORAGE = 1,
LOCAL_STORAGE = 2,
SESSION_STORAGE = 3
}
declare class PreferencesService {
memoryService: MemoryStorageService;
localService: LocalStorageService;
sessionService: SessionStorageService;
private storage;
constructor(memoryService: MemoryStorageService, localService: LocalStorageService, sessionService: SessionStorageService);
setStorage(storage: StorageType): void;
getStorage(): number;
usePrefix(prefix: string): void;
getPrefix(): string;
clear(): void;
put(key: string, value: any): void;
get(key: string, defaultValue?: any): any;
remove(key: string): void;
removeStartsWith(startWith: string): void;
removeEndsWith(endsWith: string): void;
getInStringFormat(): string;
getInCompressFormat(): any;
putFromCompressFormat(compressed: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration<PreferencesService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<PreferencesService>;
}
declare class SystelabPreferencesModule {
static ɵfac: i0.ɵɵFactoryDeclaration<SystelabPreferencesModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<SystelabPreferencesModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<SystelabPreferencesModule>;
}
export { LocalStorageService, MemoryStorageService, PreferencesService, SessionStorageService, StorageType, SystelabPreferencesModule };