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

  • NotepadShell

Index

Constructors

constructor

  • new Notepad(title: string, opts?: NotepadOptions): Notepad

Properties

Readonly assets

assets: Asset[]

Optional Readonly crypto

crypto: EncryptionMethod

Readonly lastModified

lastModified: string

Readonly notepadAssets

notepadAssets: string[]

Readonly sections

sections: Section[]

Readonly title

title: string

Methods

addAsset

addSection

clone

  • clone(opts?: Partial<NotepadOptions>, title?: string): Notepad
  • Parameters

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

    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

    • lastModified: 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?: string): Promise<string>
  • Parameters

    • Optional passkey: string

    Returns Promise<string>

toMarkdown

  • toMarkdown(assets: Asset[]): Promise<MarkdownNote[]>

toXml

  • toXml(): Promise<string>

Generated using TypeDoc