ClassStorage & Replay@public
LocalStorageBackend
localStorage-backed storage implementation.
Keys are namespaced as flixel:{name} to avoid collisions with other web applications. Quota failures are detected via DOMException and surfaced through the FlxSaveResult type. Malformed stored JSON returns null and logs a console warning rather than throwing.
ts
export declare class LocalStorageBackend implements FlxStorageBackendMethods
close()
ts
close(key: string): voidParameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
Returns: void
erase()
ts
erase(key: string): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
Returns: boolean
read()
ts
read(key: string): Record<string, unknown> | nullParameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
Returns: Record<string, unknown> | null
write()
ts
write(key: string, data: Record<string, unknown>): FlxSaveResultParameters:
| Parameter | Type | Description |
|---|---|---|
key | string | - |
data | Record<string, unknown> | - |
Returns: FlxSaveResult