rmapi-js
    Preparing search index...

    Class TemplateContent

    a template's .content, whose keys the core does not read

    Hierarchy (View Summary)

    Index
    • get hasEdits(): boolean

      whether an edit changes the file from the version as read

      Returns boolean

    • every key the core does not read

      Returns Record<string, Json>

    • 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

    • 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>

    • read a template's .content from what toJSON gave, or a copy of it, as read from the account at at; the core checks every field

      Parameters

      • value: unknown
      • at: Date = ...

      Returns TemplateContent

      TypeError if value is not an object