Represents a file's contents loaded from the server. If an etag was specified when loading, client should first test if the etag of this instance matches - if so, the contents will be empty, and the client's existing contents should be used.

Hierarchy

  • FileContents

Constructors

Accessors

Methods

Constructors

Accessors

  • get etag(): string
  • The etag associated with the contents.

    If an etag was provided when loading and the server indicates that the client's cached contents are still valid, the contents of this instance may be empty and only the etag will be returned.

    Returns string

Methods

  • Reads the contents as an ArrayBuffer.

    Returns Promise<ArrayBuffer>

    A promise that resolves to the file contents as an ArrayBuffer.

  • Reads the contents as text.

    Returns Promise<string>

    A promise that resolves to the file contents as a string.

  • Creates an instance from one or more ArrayBuffer values.

    Parameters

    • Rest ...buffers: ArrayBuffer[]

      One or more buffers to combine into a Blob.

    Returns FileContents

    A FileContents instance containing the provided data.

  • Creates an instance from an existing Blob.

    Parameters

    • blob: Blob

      The blob containing the file contents.

    Returns FileContents

    A FileContents instance containing the provided data.

  • Creates an instance from text.

    Parameters

    • Rest ...text: string[]

      One or more string parts to combine into a Blob.

    Returns FileContents

    A FileContents instance containing the provided data.