Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IAsyncFileClient

An async file client.

Hierarchy

  • EventEmitter
  • Disposable
    • IAsyncFileClient

Implemented by

Index

Constructors

constructor

  • Creates a new Disposable calling the provided function on dispose.

    Parameters

    • callOnDispose: Function

      Function that disposes something.

    Returns IAsyncFileClient

Properties

deleteFile

deleteFile: function

Deletes a file.

param

The path of the file on the remote.

returns

A promise that indicates if operation was successful or not.

Type declaration

    • (path: string): PromiseLike<boolean>
    • Parameters

      • path: string

      Returns PromiseLike<boolean>

downloadFile

downloadFile: function

Downloads a file.

param

The path of the file to download.

returns

The promise with the downloaded data.

Type declaration

    • (path: string): PromiseLike<Buffer>
    • Parameters

      • path: string

      Returns PromiseLike<Buffer>

listDirectory

listDirectory: function

Lists a directory.

param

The path of the remote directory.

returns

The promise with the file and folder list.

Type declaration

removeFolder

removeFolder: function

Deletes a folder.

param

The path of the folder on the remote.

returns

A promise that indicates if operation was successful or not.

Type declaration

    • (path: string): PromiseLike<boolean>
    • Parameters

      • path: string

      Returns PromiseLike<boolean>

type

type: string

The type.

uploadFile

uploadFile: function

Uploads a file.

param

The path of the file on the remote.

param

The data for the remote file.

Type declaration

    • (path: string, data: Buffer): PromiseLike<void>
    • Parameters

      • path: string
      • data: Buffer

      Returns PromiseLike<void>

values

values: Value[]

Stores the list of connection values.

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

dispose

  • dispose(): any
  • Dispose this object.

    Returns any

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static from

  • from(...disposableLikes: object[]): Disposable
  • Combine many disposable-likes into one. Use this method when having objects with a dispose function which are not instances of Disposable.

    Parameters

    • Rest ...disposableLikes: object[]

      Objects that have at least a dispose-function member.

    Returns Disposable

    Returns a new disposable which, upon dispose, will dispose all provided disposables.

Generated using TypeDoc