Airgram

Guides
/
/
Methods

api.cancelDownloadFile()

Stops the downloading of a file. If a file has already been downloaded, does nothing

Parameters CancelDownloadFileParams:

NameTypeDescription
fileIdnumber Identifier of a file to stop downloading
onlyIfPendingboolean Pass true to stop downloading only if it hasn't been started, i.e. request hasn't been sent to server
Returns ApiResponse interface:
interface ApiResponse {
  _: 'cancelDownloadFile' | 'error'
  airgram: Airgram
  request: {
    method: 'cancelDownloadFile'
    params: CancelDownloadFileParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}