Options
All
  • Public
  • Public/Protected
  • All
Menu

Functions to store and load basic values (strings or numbers), organized into objects:

  • Each object has a name
  • Each value can be accessed using a path-like string (for example: Root/Some folder/MyValueName), where each segment is separated by a slash.

These objects are persisted into the environment localStorage - which might not always be available (if not, objects won't be persisted).

Index

Functions

  • clearJSONFile(name: string): any
  • Parameters

    • name: string

    Returns any

  • deleteElementFromJSONFile(name: string, elementPath: string): any
  • Parameters

    • name: string
    • elementPath: string

    Returns any

  • elementExistsInJSONFile(name: string, elementPath: string): any
  • Parameters

    • name: string
    • elementPath: string

    Returns any

  • loadJSONFileFromStorage(name: string): void
  • Load into memory a JSON serialized object, from the local storage provided by the browser/environment.

    The object name is prefixed with GDJS_ in localStorage.

    Parameters

    • name: string

      The name of the object to load

    Returns void

  • unloadJSONFile(name: string): void
  • Unload from memory an object, which is then serialized as JSON and stored in the local storage provided by the browser/environment.

    The object name is prefixed with GDJS_ in localStorage.

    Parameters

    • name: string

      The name of the object to load

    Returns void

  • writeNumberInJSONFile(name: string, elementPath: string, val: any): any
  • Parameters

    • name: string
    • elementPath: string
    • val: any

    Returns any

  • writeStringInJSONFile(name: string, elementPath: string, str: any): any
  • Parameters

    • name: string
    • elementPath: string
    • str: any

    Returns any

Generated using TypeDoc