rmapi-js
    Preparing search index...

    Class Client

    the reMarkable cloud, read and written one call at a time

    Each call takes the reference of the item at the state it was read, and an edit fails with a HashChangedError if another device changed the item since. Calls for one kind of item take its reference: a DocumentRef, FolderRef or TemplateRef, which a listing, a create and checkKind give.

    const device = await DeviceToken.register("abcdefgh");
    const client = new Client(device);
    const listing = await client.listItems();
    for (const { item, metadata } of listing.items) {
    console.log(item.kind, metadata.name);
    }
    Index
    • get deviceId(): string

      the device the client is signed in as

      Returns string

    • the account's copy of a page, not held, or undefined if it has no .rm

      Parameters

      Returns Promise<Page | undefined>

    • hold content as page page of a document, taking it: content cannot be used after; an AlreadyOpenError while another copy is held, which leaves content as it was

      Parameters

      Returns ClientPage

    • every file of a document, zipped under the names the account gives them

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • a page of a document, held by the client, or undefined if it has no .rm; an AlreadyOpenError while another copy of it is held

      Parameters

      Returns Promise<ClientPage | undefined>

    • drop what the client caches of items the account no longer lists

      Returns Promise<void>

    • delete a folder and everything in it for good, resolving to the ids of what went

      Parameters

      Returns Promise<string[]>

    • delete everything in the trash for good, resolving to the ids of what went

      Returns Promise<string[]>

    • delete exactly the items ids for good, each in the trash or in a folder there, and not what is inside them, in one root write

      Parameters

      • ids: readonly string[]

      Returns Promise<void>

      a NotFoundError for an id the account does not list, and a NotInTrashError for one not in the trash; nothing is deleted then

    • write many pages' highlights in one root write, each made on the page's as it is now; each file then holds what was written. Until this settles, an edit of a file or another put of it throws a PutRunningError, and a file object or a page listed twice throws a FileTwiceError.

      Parameters

      Returns Promise<DocumentRef>

    • write many pages' layer names in one root write, each made on the page's as it is now; each file then holds what was written. Until this settles, an edit of a file or another put of it throws a PutRunningError, and a file object or a page listed twice throws a FileTwiceError.

      Parameters

      Returns Promise<DocumentRef>

    • write metadata's edits, made on the item's .metadata as it is now; metadata then holds what was written. Until this settles, an edit of metadata or another put of it throws a PutRunningError. push does the same, and can merge onto a newer copy.

      Type Parameters

      Parameters

      Returns Promise<Same<R>>

    • rename an item

      Type Parameters

      Parameters

      • item: R
      • name: string

      Returns Promise<Same<R>>

    • take an item out of the trash, to the root

      Type Parameters

      Parameters

      • item: R

      Returns Promise<Same<R>>

    • every item in the account now, reading the root each call and the root index only when it changed

      Returns Promise<RootIndex>

    • star or unstar an item

      Type Parameters

      Parameters

      • item: R
      • starred: boolean

      Returns Promise<Same<R>>

    • move an item to the trash

      Type Parameters

      Parameters

      • item: R

      Returns Promise<Same<R>>