Represents a MSC3089 branch - a reference to a file (leaf) in the tree. Note that this is UNSTABLE and subject to breaking changes without notice.

Hierarchy

  • MSC3089Branch

Constructors

Properties

client: MatrixClient
directory: MSC3089TreeSpace
indexEvent: MatrixEvent

Accessors

Methods

  • Creates a new version of this file with contents in a type that is compatible with MatrixClient.uploadContent().

    Returns

    Resolves to the file event's sent response.

    Parameters

    • name: string

      The name of the file.

    • encryptedContents: XMLHttpRequestBodyInit

      The encrypted contents.

    • info: Partial<IEncryptedFile>

      The encrypted file information.

    • Optional additionalContent: IContent

      Optional event content fields to include in the message.

    Returns Promise<ISendEventResponse>

  • Deletes the file from the tree, including all prior edits/versions.

    Returns

    Resolves when complete.

    Returns Promise<void>

  • Gets the name for this file.

    Returns

    The name, or "Unnamed File" if unknown.

    Returns string

  • Gets the file's version history, starting at this file.

    Returns

    Resolves to the file's version history, with the first element being the current version and the last element being the first version.

    Returns Promise<MSC3089Branch[]>

  • Gets whether or not a file is locked.

    Returns

    True if locked, false otherwise.

    Returns boolean

  • Sets a file as locked or unlocked.

    Returns

    Resolves when complete.

    Parameters

    • locked: boolean

      True to lock the file, false otherwise.

    Returns Promise<void>

  • Sets the name for this file.

    Returns

    Resolves when complete.

    Parameters

    • name: string

      The new name for this file.

    Returns Promise<void>

Generated using TypeDoc