8.7 released—WinterCG Compliance Part 1
Learn more

Summary

Functions

clear

clear(): void
Removes all values.
Returns void

flush

flush(): boolean
Flush all changes to disk synchronously.
Returns boolean

getAllKeys

getAllKeys(): string[]
Get all stored keys
Returns string[]

getBoolean

getBoolean(key: string, defaultValue?: boolean): boolean
Gets a value (if existing) for a key as a Boolean Object. A default value can be provided in case there is no existing value.
Parameter Default Description
key
string

The key to check for.

defaultValue
boolean

An optional value to be returned in case there is no existing value.

Returns boolean

getNumber

getNumber(key: string, defaultValue?: number): number
Gets a value (if existing) for a key as a Number Object. A default value can be provided in case there is no existing value.
Parameter Default Description
key
string

The key to check for.

defaultValue
number

An optional value to be returned in case there is no existing value.

Returns number

getString

getString(key: string, defaultValue?: string): string
Gets a value (if existing) for a key as a String Object. A default value can be provided in case there is no existing value.
Parameter Default Description
key
string

The key to check for.

defaultValue
string

An optional value to be returned in case there is no existing value.

Returns string

hasKey

hasKey(key: string): boolean
Checks whether such a key exists.
Parameter Default Description
key
string

The key to check for.

Returns boolean

remove

remove(key: string): void
Removes a value (if existing) for a key.
Parameter Default Description
key
string

The key to check for.

Returns void

setBoolean

setBoolean(key: string, value: boolean): void
Sets a Boolean Object for a key.
Parameter Default Description
key
string

The key.

value
boolean

The value.

Returns void

setNumber

setNumber(key: string, value: number): void
Sets a Number Object for a key.
Parameter Default Description
key
string

The key.

value
number

The value.

Returns void

setString

setString(key: string, value: string): void
Sets a String Object for a key.
Parameter Default Description
key
string

The key.

value
string

The value.

Returns void