@ts-core/angular 15.0.36 → 15.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-core/angular",
3
- "version": "15.0.36",
3
+ "version": "15.0.38",
4
4
  "description": "Modules for frontend based on angular",
5
5
  "main": "public-api.js",
6
6
  "author": {
package/public-api.d.ts CHANGED
@@ -104,6 +104,9 @@ export * from './notification/NotificationServiceEvent';
104
104
  export * from './bottomSheet/BottomSheetService';
105
105
  export * from './storage/LocalStorageService';
106
106
  export * from './storage/ValueStorage';
107
+ export * from './storage/IValueStorage';
108
+ export * from './storage/DateValueStorage';
109
+ export * from './storage/BooleanValueStorage';
107
110
  export * from './module/LazyModuleLoader';
108
111
  export * from './transport/TransportLazy';
109
112
  export * from './transport/TransportLazyModule';
@@ -0,0 +1,5 @@
1
+ import { ValueStorage } from './ValueStorage';
2
+ export declare class BooleanValueStorage extends ValueStorage<boolean> {
3
+ protected serialize(value: string): boolean;
4
+ protected deserialize(value: boolean): string;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { ValueStorage } from './ValueStorage';
2
+ export declare class DateValueStorage extends ValueStorage<Date> {
3
+ protected serialize(value: string): Date;
4
+ protected deserialize(value: Date): string;
5
+ isExpired(item?: Date): boolean;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { IDestroyable } from '@ts-core/common';
2
+ export interface IValueStorage<T> extends IDestroyable {
3
+ get(defaultValue?: T): T;
4
+ set(value: T): void;
5
+ has(): boolean;
6
+ destroy(): void;
7
+ get name(): string;
8
+ }
@@ -1,13 +1,17 @@
1
1
  import { DestroyableContainer } from '@ts-core/common';
2
2
  import { CookieService } from '../cookie/CookieService';
3
3
  import { LocalStorageService } from '../storage/LocalStorageService';
4
- export declare class ValueStorage extends DestroyableContainer {
5
- protected localStorage: LocalStorageService;
4
+ import { IValueStorage } from './IValueStorage';
5
+ export declare class ValueStorage<T = string> extends DestroyableContainer implements IValueStorage<T> {
6
+ protected storage: LocalStorageService;
6
7
  protected cookies: CookieService;
7
- protected name?: string;
8
- constructor(localStorage: LocalStorageService, cookies: CookieService, name?: string);
9
- get(defaultValue?: string): string;
8
+ protected _name: string;
9
+ constructor(name: string, storage: LocalStorageService, cookies: CookieService);
10
+ protected serialize(value: string): T;
11
+ protected deserialize(value: T): string;
12
+ get(defaultValue?: T): T;
10
13
  has(): boolean;
11
- set(value: string): void;
14
+ set(value: T): void;
12
15
  destroy(): void;
16
+ get name(): string;
13
17
  }