Skip to content

AIDC Toolkit / Core / RemoteAppDataStorage

Class: RemoteAppDataStorage

Defined in: remote-app-data-storage.ts:8

Remote application data storage using HTTP.

Extends

Properties

BINARY_EXTENSION

protected readonly static BINARY_EXTENSION: ".bin" = ".bin"

Defined in: app-data-storage.ts:11

Extension to identify binary data.

Inherited from

ReadOnlyAppDataStorage.BINARY_EXTENSION


JSON_EXTENSION

protected readonly static JSON_EXTENSION: ".json" = ".json"

Defined in: app-data-storage.ts:16

Extension to identify JSON data.

Inherited from

ReadOnlyAppDataStorage.JSON_EXTENSION

Constructors

Constructor

new RemoteAppDataStorage(baseURL, httpFetch): RemoteAppDataStorage

Defined in: remote-app-data-storage.ts:20

Constructor.

Parameters

baseURL

string

Base URL. The URL must not end with a slash.

httpFetch

HTTPFetch = defaultHTTPFetch

HTTP fetch function.

Returns

RemoteAppDataStorage

Overrides

ReadOnlyAppDataStorage.constructor

Accessors

supportsBinary

Get Signature

get supportsBinary(): SupportsBinary

Defined in: app-data-storage.ts:45

Determine if binary data is supported.

Returns

SupportsBinary

Inherited from

ReadOnlyAppDataStorage.supportsBinary


path

Get Signature

get path(): string

Defined in: app-data-storage.ts:52

Get the storage path, prepended to each key.

Returns

string

Inherited from

ReadOnlyAppDataStorage.path

Methods

doRead()

protected doRead(key, asBinary): Promise<string | Uint8Array<ArrayBufferLike> | undefined>

Defined in: remote-app-data-storage.ts:29

Read a string or binary data from persistent storage.

Parameters

key

string

Storage key (file path in Node.js, key in localStorage).

asBinary

True if binary data is requested, false or undefined if string data is requested. Ignored if binary data is not supported.

boolean | undefined

Returns

Promise<string | Uint8Array<ArrayBufferLike> | undefined>

String or binary data or undefined if not found.

Overrides

ReadOnlyAppDataStorage.doRead


fullKey()

protected fullKey(pathKey, isBinary): string

Defined in: app-data-storage.ts:68

Build the full storage key.

Parameters

pathKey

string

Key relative to path.

isBinary

boolean

True if key is to binary data, false or undefined if to string data. Ignored if binary data is not supported.

Returns

string

Full storage key.

Inherited from

ReadOnlyAppDataStorage.fullKey


read()

read(pathKey, asBinary?): Promise<AppData | undefined>

Defined in: app-data-storage.ts:105

Read application data from storage.

Parameters

pathKey

string

Key relative to path.

asBinary?

boolean

True if binary data is requested, false or undefined if string data is requested. Ignored if binary data is not supported.

Returns

Promise<AppData | undefined>

Application data or undefined if not found.

Inherited from

ReadOnlyAppDataStorage.read