Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a URIStorage Adapter that targets the Browsers' localStorage

NOTE: Some Browsers may delete localStorage contents after a period of in-activity and may enforce harsh storage limits, e.g. 5 MB max

Hierarchy

Index

Constructors

constructor

Properties

EVENT_MOUNTED

EVENT_MOUNTED: IEvent<IMountedEvent> = event<IMountedEvent>()

Event that dispatches whenever the Adapter is mounted

EVENT_UNMOUNTED

EVENT_UNMOUNTED: IEvent<IMountedEvent> = event<IMountedEvent>()

Event that dispatches whenever the Adapter is unmounted

options

storage

storage: WebStorage

Static can_hotlink

can_hotlink: boolean = true

Static can_watch

can_watch: boolean = true

Static can_watch_reload

can_watch_reload: boolean = false

Represents if the Adapter can utilize BaseAdapter.watch but requires periodic calls to BaseAdapter.reload

Static identifier

identifier: string = "localstorage"

Static is_available

is_available: boolean = !!(typeof window === "object" && window.localStorage)

Static is_readonly

is_readonly: boolean = false

Represents if the Adapter is read-only

Static requires_mount

requires_mount: boolean = false

Represents if the Adapter requires mounting first, to be used

Static storage

storage: Storage | null = null

Represents the target Web Storage API to utilize

Methods

create_url_object

  • create_url_object(path: string): Promise<IURLObject>

get

  • get(path: string): Promise<INode | null>

is_mounted

  • is_mounted(): boolean

mount

  • mount(): Promise<void>

put

  • put(path: string, type?: NODE_TYPES, mime_type?: undefined | string): Promise<void>

query

read

  • read(path: string): Promise<Uint8Array | null>

reload

  • reload(): Promise<void>

remove

  • remove(path: string): Promise<boolean>

unmount

  • unmount(): Promise<void>

watch

write

  • write(path: string, payload: Uint8Array): Promise<void>

Legend

  • Variable
  • Function
  • Type alias
  • Type alias with type parameter
  • Class
  • Class with type parameter
  • Constructor
  • Interface
  • Interface with type parameter
  • Inherited property
  • Inherited method
  • Enumeration
  • Static property

Generated using TypeDoc