Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a URIStorage Adapter that persists all data into volatile memory

NOTE: As this Adapter backend persists data into memory, it is not shared between tabs, pages, nor browsing sessions

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: NodeMap = new NodeMap()

Represents the in-memory storage for Nodes

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 = "memory"

Static is_available

is_available: boolean = true

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

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>
  • Persists a new or updates an existing Node with new metadata. Optionally can specify the Node's NODE_TYPES

    NOTE: Will try to guess the Mime Type if mime_type is undefined

    Parameters

    • path: string
    • Default value type: NODE_TYPES = NODE_TYPES.undefined
    • Optional mime_type: undefined | string

    Returns 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

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

Generated using TypeDoc