@gphone/sdk
    Preparing search index...

    Interface PersistedOptions<T>

    interface PersistedOptions<T> {
        sanitize?: (value: unknown) => T;
        sync?: boolean;
    }

    Type Parameters

    • T
    Index
    sanitize?: (value: unknown) => T

    Repair or reject a value before it is stored or handed out.

    Runs on the value read at startup and on every write, so a store cannot be talked into holding something the app would refuse. Stored data outlives the code that wrote it: a key whose shape changed between versions, or one a player edited by hand, comes back as whatever it was. volumeStep has needed this from the start.

    sync?: boolean

    Keep this key on the phone instead of syncing it to the player's character.

    The exception, not the rule — the point of server-backed storage is that a preference follows the player. wallpaperStore is the one that needs it: a custom wallpaper is a base64 data URL of unbounded size, and syncing it would put megabytes across the NUI bridge and into MySQL every time a color changed.

    Declared at the store rather than in a list inside the sync layer, because a hardcoded list somewhere else is one nobody thinks to update when they add a store.