Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents the base common API all URIStorage Adapters ad-here to

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

Represents the standardized options passed into the constructor

Static can_hotlink

can_hotlink: boolean = false

Represents if the Adapter can utilize BaseAdapter.create_url_object

Static can_watch

can_watch: boolean = false

Represents if the Adapter can utilize BaseAdapter.watch

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

Represents a static identifier useful for handling of Adapters

Static is_available

is_available: boolean = false

Represents if the Adapter is available in the current Javascript environment

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
  • Returns if the Adapter is currently mounted

    NOTE: There is no base concept of "mounting", it could be establishing a connection to a FTP server, mounting a local SQLite3 database, etc, etc

    Returns boolean

mount

  • mount(): Promise<void>
  • Mounts the Adapter if currently unmounted

    NOTE: There is no base concept of "mounting", it could be establishing a connection to a FTP server, mounting a local SQLite3 database, etc, etc

    Returns 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: Not all Adapters utilize mime_type input, depending on backend, it might automatically be handled

    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>
  • Returns the binary payload of the requested path, or null if non-existant

    Parameters

    • path: string

    Returns Promise<Uint8Array | null>

reload

  • reload(): Promise<void>

remove

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

unmount

  • unmount(): Promise<void>
  • Unmounts the Adapter if currently mounted

    NOTE: There is no base concept of "mounting", it could be establishing a connection to a FTP server, mounting a local SQLite3 database, etc, etc

    Returns Promise<void>

watch

write

  • write(path: string, payload: Uint8Array): Promise<void>
  • Persists a binary payload to an existing Node.

    NOTE: The BaseAdapter.put must be called before this method to create a Node

    Parameters

    • path: string
    • payload: Uint8Array

    Returns 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
  • Enumeration
  • Static property

Generated using TypeDoc