Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "files"

Index

Functions

addData

  • addData(base64: string, threadId: string, caption?: undefined | string): Promise<IBlock>
  • Add raw data to a Textile thread

    Parameters

    • base64: string

      Raw data as a base64 string

    • threadId: string

      The thread id the data will be added to

    • Optional caption: undefined | string

      A caption to associate with the data

    Returns Promise<IBlock>

    A Promise that will resolve with the Block result

addFiles

  • addFiles(paths: string, threadId: string, caption?: undefined | string): Promise<IBlock>
  • Add files to a Textile thread

    Parameters

    • paths: string

      Comma separated list of file paths to add, can be file system paths, IPFS hashes, or existing hashes

    • threadId: string

      The thread id the files will be added to

    • Optional caption: undefined | string

      A caption to associate with the files

    Returns Promise<IBlock>

    A Promise that will resolve with the Block result

content

  • content(hash: string): Promise<object>
  • Get the raw data for a file at an IPFS hash.

    Textile.files.content(hash);

    Parameters

    • hash: string

    Returns Promise<object>

imageContentForMinWidth

  • imageContentForMinWidth(pth: string, minWidth: number): Promise<object>
  • Get the best size image from a Thread with MEDIA type thread given a minimum width.

    Note: pth is /, e.g., "Qm.../0"

    Textile.files.imageContentForMinWidth(path, minWidth);

    Parameters

    • pth: string
    • minWidth: number

    Returns Promise<object>

list

  • list(threadId: string, offset: string, limit: number): Promise<IFilesList>
  • List all files or files in a known Thread.

    Textile.files.list(threadId, offset, limit);

    Parameters

    • threadId: string
    • offset: string
    • limit: number

    Returns Promise<IFilesList>

shareFiles

  • shareFiles(target: string, threadId: string, caption?: undefined | string): Promise<IBlock>
  • Share files already aded to a Textile thread to a Textile thread

    Parameters

    • target: string

      The source thread target of the files to share

    • threadId: string

      The thread id the files will be shared to

    • Optional caption: undefined | string

      A caption to associate with the files

    Returns Promise<IBlock>

    A Promise that will resolve with the Block result