Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataStorage

Data storage for the active document.

Hierarchy

  • DataStorage

Index

Methods

createImage

  • createImage(imageFileName: string, cacheKey: string): HTMLImageElement | null
  • Creates an image element from an item created using the given key name.

    Parameters

    • imageFileName: string
    • cacheKey: string

    Returns HTMLImageElement | null

dispose

  • dispose(): void
  • The dispose method cleans up all stored data.

    Returns void

ensureNewImageFileName

  • ensureNewImageFileName(fileName: string, extension?: string): string
  • Auto-generate image file name.

    Parameters

    • fileName: string
    • Default value extension: string = "png"

    Returns string

getEncodedItem

  • getEncodedItem(keyName: string): string | null
  • When passed a key name, will return base64-encoded key's value, or null if the key does not exist

    Parameters

    • keyName: string

    Returns string | null

getItem

  • getItem(keyName: string | undefined): Uint8Array | any | null
  • When passed a key name, will return that key's value, or null if the key does not exist.

    Parameters

    • keyName: string | undefined

    Returns Uint8Array | any | null

releaseResources

  • releaseResources(): void
  • Releases all objects that have been created for the active document. This method is called automatically when the active document is closed.

    Returns void

removeItem

  • removeItem(keyName: string | undefined): void
  • Removes key from the given Storage object if it exists.

    Parameters

    • keyName: string | undefined

    Returns void

setItem

  • setItem(keyName: string, keyValue: Uint8Array | any): void
  • 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.

    Parameters

    • keyName: string
    • keyValue: Uint8Array | any

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Static property
  • Static method
  • Method