Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Notepad

This class is identical in structure to the old Notepad class from the original parser. This represents the notepad as a tree. If you're looking for a flatter structure you can use FlatNotepad.

Something to remember is that all operations on this class like addSection, will return a new object of this class, and not modify the existing one.

Hierarchy

  • Notepad

Implements

Index

Constructors

constructor

  • Parameters

    Returns Notepad

Properties

Readonly assets

assets: Asset[]

Optional Readonly crypto

Readonly lastModified

lastModified: string

Readonly notepadAssets

notepadAssets: string[]

Readonly sections

sections: Section[]

Readonly title

title: string

Methods

addAsset

  • Parameters

    Returns Notepad

addSection

  • Parameters

    Returns Notepad

clone

  • Parameters

    • Default value opts: Partial<NotepadOptions> = {}
    • Default value title: string = this.title

    Returns Notepad

flatten

modified

  • modified(lastModified?: Date): Notepad
  • This updates the lastModified date on the notepad. This date is used for syncing so it's important to call this method whenever a change is made that will need to be synced.

    Parameters

    • Default value lastModified: Date = new Date()

    Returns Notepad

search

  • search(query: string): Note[]
  • Parameters

    • query: string

      Can either be a title-search or a hashtag-search

    Returns Note[]

toJson

  • toJson(passkey?: undefined | string): Promise<string>
  • Parameters

    • Optional passkey: undefined | string

    Returns Promise<string>

toMarkdown

  • Parameters

    Returns Promise<MarkdownNote[]>

toXml

  • toXml(): Promise<string>
  • Returns Promise<string>

Generated using TypeDoc