Options
All
  • Public
  • Public/Protected
  • All
Menu

The various types used in the system.

Index

Type aliases

DeleteVersion

DeleteVersion: Version | "*"

Version, including the special version '*'.

DirectoryHandler

DirectoryHandler: (filesystem: AFileSystem, path: string, name: string, rest: string[], tree: Tree) => PromiseOr<Tree>

A handler to dynamically add subdirectories. It is called when a directory is not found, and can create a subdirectory heirarchy on demand. A DirectoryHandler that adds itself to the returned tree as a DIRECTORY handler can create an infinite on-demand hierarchy.

Type declaration

FileHandler

FileHandler: (filesystem: AFileSystem, path: string, name: string, version: Version, rest: string[], tree: Tree) => PromiseOr<Files>

A handler to dynamically add files. It is called when a file is not found, and can add that file or more.

The handler implementation will typically return an array of a single AFile instance (or zero if no file should be added).

Advanced usages can return multiple versions in the array, or use setVersion() to tag entries in the array.

Type declaration

IAFileAwait

IAFileAwait: {[ k in IAFileMethods]: AddReturnType<IAFile[k], undefined> } & {[ k in IAFileOther]: IAFile[k] }

The async methods of AFileAwait should return the same values as IAFile except each Promise can also resolve to undefined.

JsonObject

JsonObject: {} | string | number | null | JsonObject[]

Objects that JSON.parse can produce.

Metadata

Metadata: { contentType?: string; eTag?: string; length?: number; modificationDate?: Date; name: string; url?: string } & {[ k in Exclude<string, "modificationDate">]: any | undefined }

The known metadata types. Additional keys may be used, without typing.

PromiseOr

PromiseOr<T>: T | Promise<T>

A value, or a Promise of a value, where either synchronous or async code may be used.

Type parameters

  • T

    the wrapped type

Tree

Tree: { [DIRECTORY]?: DirectoryHandler; [FILE]?: FileHandler }

A directory tree, denoting the hierarchy of files. Javascript Objects are the directories.

  • Entries in the directory are named by keys.
  • If the value of an entry is another Javascript Object, it is a subdirectory.
  • If the value of an entry is an Array, it is a list of file versions. See Files

Type declaration

  • [k: string]: Tree | Files

    Regular entries

  • Optional [DIRECTORY]?: DirectoryHandler

    Special symbol entry DIRECTORY provides a function that dynamically adds subdirectories on demand.

  • Optional [FILE]?: FileHandler

    Special symbol entry FILE provides a function that dynamically adds files on demand.

VFile

File entries are either a ObservableHQ-supplied FileAttachment, or an AFile

Version

Version: "latest" | "earliest" | string | number

Version numbers/tags (labels) for files.

Generated using TypeDoc