rmapi-js
    Preparing search index...

    Class Metadata

    an item's .metadata: its name, folder, star and times

    An edit is recorded with when it was made; merge makes them on a newer copy read after another device's edits, and a ClientMetadata's push or the client's putMetadata writes them.

    Hierarchy (View Summary)

    Index
    • get createdTime(): Date | undefined

      when it was made

      Returns Date | undefined

    • get deleted(): boolean | undefined

      the deleted flag

      Returns boolean | undefined

    • get hasEdits(): boolean

      whether an edit changes the file from the version as read

      Returns boolean

    • get isNew(): boolean | undefined

      the new flag

      Returns boolean | undefined

    • get lastModified(): Date

      when it last changed

      Returns Date

    • get lastOpened(): Date | undefined

      when it was last opened

      Returns Date | undefined

    • get lastOpenedPage(): number | undefined

      the page it was last open at, from zero

      Returns number | undefined

    • get metadataModified(): boolean | undefined

      the metadatamodified flag

      Returns boolean | undefined

    • get modified(): boolean | undefined

      the modified flag

      Returns boolean | undefined

    • get parent(): string

      "" for the root, "trash", or the id of the folder it is in

      Returns string

    • get source(): string | undefined

      where it came from

      Returns string | undefined

    • get starred(): boolean

      whether it is starred

      Returns boolean

    • get synced(): boolean | undefined

      the synced flag

      Returns boolean | undefined

    • get version(): number | undefined

      the version count

      Returns number | undefined

    • every key the core does not read

      Returns Record<string, Json>

    • put this file's edits on newer, a copy read since, and hold that, returning the keys both changed to different values, where this side's value was kept

      Parameters

      Returns string[]

    • remove a key of the file: a key the core reads clears its field, or sets it to what a file without the key reads it as

      Parameters

      • key: string

      Returns this

      Warning: as for setExtra, this can leave the file at odds with itself. Prefer the field's own setter.

      ValidationError if key names a field the file must have; the file is left as it was

    • set a key of the file: a key the core reads sets its field, and any other is kept in extra

      Parameters

      • key: string
      • value: Json

      Returns this

      Warning: a key the core reads is written as given, past the rules its own setter keeps, so it can leave the file at odds with itself, such as a pageCount that does not count the pages listed. Prefer the field's own setter, such as setPages for the page keys.

      ValidationError if value is not a value of the field key names; the file is left as it was

    • set when it last changed

      Parameters

      • time: Date

      Returns this

      RangeError if time is an invalid date or one before 1970

    • set when it was last opened, or clear it

      Parameters

      • time: Date | undefined

      Returns this

      RangeError if time is an invalid date or one before 1970

    • set the page it was last open at, or clear it

      Parameters

      • page: number | undefined

      Returns this

      RangeError if page is not an integer from 0 to 2^32 - 1

    • rename it

      Parameters

      • name: string

      Returns this

    • star or unstar it

      Parameters

      • starred: boolean

      Returns this

    • the file with its edits made, as the account holds it

      Returns Uint8Array

    • the file with its edits made, as JSON

      Returns Record<string, Json>

    • the .metadata of a new item named name of kind, in parent: "" for the root, "trash" or a folder's id

      Parameters

      • name: string
      • parent: string
      • kind: ItemKind

      Returns Metadata

    • read a .metadata from what toJSON gave, or a copy of it; the core checks every field

      Parameters

      • value: unknown

      Returns Metadata

      TypeError if value is not an object