Skip to content

SaveManager

Constructors

new SaveManager()

new SaveManager(app): SaveManager

Parameters

app: Application<any>

Returns

SaveManager

Source

src/save/SaveManager.ts:15

Accessors

debug

set debug(pValue): void

Parameters

pValue: boolean

Source

src/save/SaveManager.ts:28


hasCookieData

get hasCookieData(): boolean

Returns

boolean

Source

src/save/SaveManager.ts:24


hasLocalStorageData

get hasLocalStorageData(): boolean

Returns

boolean

Source

src/save/SaveManager.ts:20

Methods

deleteAllData()

deleteAllData(): void

Deletes all data saved in both the cookies and local storage

Returns

void

Source

src/save/SaveManager.ts:185


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

src/save/SaveManager.ts:147


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

src/save/SaveManager.ts:171


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

src/save/SaveManager.ts:59


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

src/save/SaveManager.ts:95


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

src/save/SaveManager.ts:131


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

src/save/SaveManager.ts:163


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

src/save/SaveManager.ts:41


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

src/save/SaveManager.ts:77


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

Source

src/save/SaveManager.ts:113