-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
Copy pathstorage.swaps.ts
58 lines (58 loc) · 1.87 KB
/
storage.swaps.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* tslint:disable */
/**
* @module Storage
* @author Jonathan Casarrubias <t: johncasarrubias, gh: mean-expert-official>
* @license MIT
* @description
* The InternalStorage class is used for dependency injection swapping.
* It will be provided using factory method from different sources.
**/
export class BaseStorage {
/**
* @method get
* @param {string} key Storage key name
* @return {any}
* @description
* The getter will return any type of data persisted in storage.
**/
get(key: string): any {}
/**
* @method set
* @param {string} key Storage key name
* @param {any} value Any value
* @return {void}
* @description
* The setter will return any type of data persisted in localStorage.
**/
set(key: string, value: any, expires?: Date): void {}
/**
* @method remove
* @param {string} key Storage key name
* @return {void}
* @description
* This method will remove a localStorage item from the client.
**/
remove(key: string): void {}
}
/**
* @module InternalStorage
* @author Jonathan Casarrubias <t: johncasarrubias, gh: mean-expert-official>
* @license MIT
* @description
* The InternalStorage class is used for dependency injection swapping.
* It will be provided using factory method from different sources.
* This is mainly required because Angular Universal integration.
* It does inject a CookieStorage instead of LocalStorage.
**/
export class InternalStorage extends BaseStorage {}
/**
* @module SDKStorage
* @author Jonathan Casarrubias <t: johncasarrubias, gh: mean-expert-official>
* @license MIT
* @description
* The SDKStorage class is used for dependency injection swapping.
* It will be provided using factory method according the right environment.
* This is created for public usage, to allow persisting custom data
* Into the local storage API.
**/
export class SDKStorage extends BaseStorage {}