melonJS
    Preparing search index...

    Interface CloudStorage

    A storage for save.setStorage() that keeps the items in memory and saves them to a platform's cloud save, made by save.createCloudStorage().

    interface CloudStorage {
        flush(): Promise<void>;
        getItem(key: string): string | null;
        removeItem(key: string): void;
        setItem(key: string, value: string): void;
    }

    Hierarchy (View Summary)

    Index
    • Save what has changed now, rather than with the next change, and resolve once every change made so far is saved: before the game is paused or closed, for example. A write that fails is logged, and the promise still resolves.

      Returns Promise<void>

    • The getItem() method of the Storage interface, when passed a key name, will return that key's value, or null if the key does not exist, in the given Storage object.

      MDN Reference

      Parameters

      • key: string

      Returns string | null

    • The removeItem() method of the Storage interface, when passed a key name, will remove that key from the given Storage object if it exists. The Storage interface of the Web Storage API provides access to a particular domain's session or local storage.

      MDN Reference

      Parameters

      • key: string

      Returns void

    • The setItem() method of the Storage interface, when passed a key name and value, will add that key to the given Storage object, or update that key's value if it already exists.

      MDN Reference

      Parameters

      • key: string
      • value: string

      Returns void