An instance of Cloud Storage that can store data in a multiplayer experience.

interface CloudStore {
    deleteValue(key: string, readOptions: CloudStorageReadOptions, onDeleted: (() => void), onError: ((code: string, description: string) => void)): void;
    getTypeName(): string;
    getValue(key: string, readOptions: CloudStorageReadOptions, onRetrieved: ((key: string, value:
        | string
        | number
        | boolean
        | vec4
        | vec3
        | quat
        | mat4
        | vec2
        | mat3
        | mat2) => void), onError: ((code: string, description: string) => void)): void;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    listValues(listOptions: CloudStorageListOptions, onRetrieved: ((values: (
        | string
        | number
        | boolean
        | vec4
        | vec3
        | quat
        | mat4
        | vec2
        | mat3
        | mat2)[][], cursor: string) => void), onError: ((code: string, description: string) => void)): void;
    setValue(key: string, value:
        | string
        | number
        | boolean
        | vec4
        | vec3
        | quat
        | mat4
        | vec2
        | mat3
        | mat2, writeOptions: CloudStorageWriteOptions, onSaved: (() => void), onError: ((code: string, description: string) => void)): void;
}

Hierarchy (view full)

Methods

  • Deletes a value from the persistence backend. Note that the scope must match that which was used when the value was originally saved.

    Parameters

    • key: string
    • readOptions: CloudStorageReadOptions
    • onDeleted: (() => void)
        • (): void
        • Returns void

    • onError: ((code: string, description: string) => void)
        • (code, description): void
        • Parameters

          • code: string
          • description: string

          Returns void

    Returns void

  • Gets a value from the persistence backend. Note that scope must match that which was used when the value was originally saved.

    Parameters

    • key: string
    • readOptions: CloudStorageReadOptions
    • onRetrieved: ((key: string, value:
          | string
          | number
          | boolean
          | vec4
          | vec3
          | quat
          | mat4
          | vec2
          | mat3
          | mat2) => void)
        • (key, value): void
        • Parameters

          • key: string
          • value:
                | string
                | number
                | boolean
                | vec4
                | vec3
                | quat
                | mat4
                | vec2
                | mat3
                | mat2

          Returns void

    • onError: ((code: string, description: string) => void)
        • (code, description): void
        • Parameters

          • code: string
          • description: string

          Returns void

    Returns void

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Lists values from the persistence backend. Note that the scope must match that which was used when the values were originally saved.

    Parameters

    • listOptions: CloudStorageListOptions
    • onRetrieved: ((values: (
          | string
          | number
          | boolean
          | vec4
          | vec3
          | quat
          | mat4
          | vec2
          | mat3
          | mat2)[][], cursor: string) => void)
        • (values, cursor): void
        • Parameters

          • values: (
                | string
                | number
                | boolean
                | vec4
                | vec3
                | quat
                | mat4
                | vec2
                | mat3
                | mat2)[][]
          • cursor: string

          Returns void

    • onError: ((code: string, description: string) => void)
        • (code, description): void
        • Parameters

          • code: string
          • description: string

          Returns void

    Returns void

  • Sets a value in the persistence backend.

    Parameters

    • key: string
    • value:
          | string
          | number
          | boolean
          | vec4
          | vec3
          | quat
          | mat4
          | vec2
          | mat3
          | mat2
    • writeOptions: CloudStorageWriteOptions
    • onSaved: (() => void)
        • (): void
        • Returns void

    • onError: ((code: string, description: string) => void)
        • (code, description): void
        • Parameters

          • code: string
          • description: string

          Returns void

    Returns void