Base class to manage writing and reading to and from the local storage of the browser. The concept is to write and read info from a key, each class has a fixed key. This avoids knowing the key and misspelling it and creating multiple instances in the local storage. Read and writes are implemented in this class. The information is processed and managed by the child class. Creating instances of LocalStorageWriter makes no sense. Derive from it if you want to save some value to the local storage of the browser.

Hierarchy (View Summary)

Constructors

Properties

key: string

Methods

  • Returns number

    returns 1 if key was not found, returns 0 if key was deleted

  • Returns (string | boolean)[]

    [success, value], success true if value was in storage and read, value is the read string

  • write a value with to the local storage of the browser with the class specific key (this.key)

    Parameters

    • value: string

      {string} string to write to the local storage of the browser

    Returns void

  • Returns Promise<Map<string, ScannedCircuit>>

  • Parameters

    • netlist: any = undefined
    • hash: any = undefined

    Returns Promise<void>

  • Returns Promise<void>

  • saves the netlist of a circuit to the local storage of the browser, value is appended to existing ones

    Parameters

    • netlist: string

      {string} the netlist of the circuit to save

    • trackingId: string

      {string} the id that the server usees for tracking

    • identifier: string | { kirchhoff: string; stepwise: string; symbolic: string } = Scanner.identifier

      {window.definitions.qrCodeSelectorIDs | Scanner.identifier} the identifier of the circuit from window.definitions.selectorIDs

    Returns Promise<void>

  • saves the netlists to the local storage of the browser, values are appended to existing onex

    Parameters

    • scannedCircuits: ScannedCircuit[]

      {Array} the netlists of the circuits to save

    Returns Promise<void>