Interface RemarkableApi

the api for accessing remarkable functions

interface RemarkableApi {
    bulkDelete(hashes: readonly string[], opts?: GetOptions): Promise<HashesEntry>;
    bulkMove(hashes: readonly string[], parent: string, opts?: GetOptions): Promise<HashesEntry>;
    createFolder(visibleName: string, opts?: UploadOptions): Promise<UploadEntry>;
    delete(hash: string, opts?: GetOptions): Promise<HashEntry>;
    listFiles(ops?: GetOptions): Promise<Entry[]>;
    move(hash: string, parent: string, opts?: GetOptions): Promise<HashEntry>;
    rename(hash: string, visibleName: string, opts?: GetOptions): Promise<HashEntry>;
    uploadEpub(visibleName: string, buffer: ArrayBuffer, opts?: UploadOptions): Promise<UploadEntry>;
    uploadPdf(visibleName: string, buffer: ArrayBuffer, opts?: UploadOptions): Promise<UploadEntry>;
}

Methods

  • delete many entries

    Parameters

    • hashes: readonly string[]

      the hashes of the entries to delete

    • Optionalopts: GetOptions

    Returns Promise<HashesEntry>

    await api.bulkDelete([file.hash]);
    
  • move many entries

    Parameters

    • hashes: readonly string[]

      an array of entry hashes to move

    • parent: string

      the directory id to move the entries to, "" (root) and "trash" are special ids

    • Optionalopts: GetOptions

    Returns Promise<HashesEntry>

    await api.bulkMove([file.hash], dir.id);
    
  • delete an entry

    Parameters

    • hash: string

      the hash of the entry to delete

    • Optionalopts: GetOptions

    Returns Promise<HashEntry>

    await api.delete(file.hash);
    
  • list all files

    Parameters

    Returns Promise<Entry[]>

    await api.listFiles();
    
  • move an entry

    Parameters

    • hash: string

      the hash of the file to move

    • parent: string

      the id of the directory to move the entry to, "" (root) and "trash" are special parents

    • Optionalopts: GetOptions

    Returns Promise<HashEntry>

    await api.move(doc.hash, dir.id);
    
  • rename an entry

    Parameters

    • hash: string

      the hash of the entry to rename

    • visibleName: string

      the new name to assign

    • Optionalopts: GetOptions

    Returns Promise<HashEntry>

    await api.rename(file.hash, "new name");
    
  • upload an epub

    Parameters

    • visibleName: string

      the name to show for the uploaded epub

    • buffer: ArrayBuffer

      the epub contents

    • Optionalopts: UploadOptions

    Returns Promise<UploadEntry>

    await api.uploadEpub("My EPub", ...);
    
  • upload a pdf

    Parameters

    • visibleName: string

      the name to show for the uploaded epub

    • buffer: ArrayBuffer

      the epub contents

    • Optionalopts: UploadOptions

    Returns Promise<UploadEntry>

    await api.uploadPdf("My PDF", ...);