Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Files

Files is an API module for managing Textile files

extends

{API}

Hierarchy

  • API
    • Files

Index

Constructors

constructor

Properties

block

block: string

caption

caption: string

comments

comments: Comment[]

date

date: string

files

files: File[]

likes

likes: Like[]

mills

mills: Mills

target

target: string

threads

threads: Threads

user

user: User

Methods

add

  • add(file: any, caption: string, thread?: undefined | string): Promise<FilesType>
  • Add a file to a thread in your Textile node

    Parameters

    • file: any

      A FormData object or a function for creating a FormData object

    • caption: string

      Caption to associated with the added file object

    • Optional thread: undefined | string

      Id of the thread

    Returns Promise<FilesType>

    An array of created File objects

ignore

  • ignore(id: string): Promise<Block>
  • Ignores a thread file by its block ID

    This adds an 'ignore' thread block targeted at the file. Ignored blocks are by default not returned when listing.

    Parameters

    • id: string

      ID of the thread file

    Returns Promise<Block>

    The added ignore block

keys

  • keys(target: string): Promise<Keys>
  • Retrieves file encryption/decryption keys under the given target

    Note that the target id is not the same as the block id. The target is the actual target file object.

    Parameters

    • target: string

      ID of the target file

    Returns Promise<Keys>

    An array of file keys

list

  • list(thread?: undefined | string, offset?: undefined | string, limit?: undefined | number): Promise<FilesList>
  • Get a paginated array of files.

    Parameters

    • Optional thread: undefined | string

      Thread ID (can also use ‘default’). Omit for all

    • Optional offset: undefined | string

      Offset ID to start listing from. Omit for latest

    • Optional limit: undefined | number

      List page size (default 5)

    Returns Promise<FilesList>

    An array of Thread objects