SaveManager
Constructors
new SaveManager()
new SaveManager(
app
):SaveManager
Parameters
• app: Application
<any
>
Returns
Source
Accessors
debug
set
debug(pValue
):void
Parameters
• pValue: boolean
Source
hasCookieData
get
hasCookieData():boolean
Returns
boolean
Source
hasLocalStorageData
get
hasLocalStorageData():boolean
Returns
boolean
Source
Methods
deleteAllData()
deleteAllData():
void
Deletes all data saved in both the cookies and local storage
Returns
void
Source
deleteItem()
deleteItem(
pID
,pStorage
):void
Deletes an Item
Parameters
• pID: string
The ID to delete
• pStorage: Storage
= Storage.Cookie
Where the item is stored
Returns
void
Source
printAll()
printAll(
pStorage
):void
Prints all values of the Storage type passed in
Parameters
• pStorage: Storage
What storage to print all values from
Returns
void
Source
readBool()
readBool(
pID
,pDefault
,pStorage
):boolean
Reads a Bool
Parameters
• pID: string
The ID to read the bool
• pDefault: boolean
= false
The default value of the returned bool
• pStorage: Storage
= Storage.Cookie
Where the bool should be stored
Returns
boolean
Source
readNumber()
readNumber(
pID
,pDefault
,pStorage
):number
Reads a Number
Parameters
• pID: string
The ID to read the number
• pDefault: number
= 0
The default value of the returned number
• pStorage: Storage
= Storage.Cookie
Where the number should be stored
Returns
number
Source
readString()
readString(
pID
,pDefault
,pStorage
):string
Reads a String
Parameters
• pID: string
The ID to read the string
• pDefault: string
= ''
The default value of the returned string
• pStorage: Storage
= Storage.Cookie
Where the string should be stored
Returns
string
Source
setCookieExpiration()
setCookieExpiration(
pID
,pExpiryDate
):void
Sets the Expiration date of a cookie
Parameters
• pID: string
The ID of the cookie
• pExpiryDate: Date
The expiry date at which this saved data will be deleted
Returns
void
Source
storeBool()
storeBool(
pID
,pValue
,pStorage
):void
Stores a Bool
Parameters
• pID: string
The ID to store the bool
• pValue: boolean
The stored bool value
• pStorage: Storage
= Storage.Cookie
Where the bool should be stored
Returns
void
Source
storeNumber()
storeNumber(
pID
,pValue
,pStorage
):void
Stores a Number
Parameters
• pID: string
The ID to store the number
• pValue: number
The stored number value
• pStorage: Storage
= Storage.Cookie
Where the number should be stored
Returns
void
Source
storeString()
storeString(
pID
,pValue
,pStorage
):void
Stores a String
Parameters
• pID: string
The ID to store the string
• pValue: string
The stored string value
• pStorage: Storage
= Storage.Cookie
Where the string should be stored
Returns
void