Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FlatNotepad

A FlatNotepad is similar to the Notepad class, but it stores all the notes/sections as in flat structures. FlatNotepads will likely be better for internal use in many situations.

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

  • FlatNotepad

Index

Constructors

constructor

Properties

Optional Readonly crypto

Readonly lastModified

lastModified: string

Readonly notepadAssets

notepadAssets: string[]

Readonly notes

notes: {}

Type declaration

  • [internalRef: string]: Note

Readonly sections

sections: {}

Type declaration

Readonly title

title: string

Methods

addAsset

  • Parameters

    • uuid: string

    Returns FlatNotepad

addNote

  • Parameters

    Returns FlatNotepad

addSection

clone

  • Parameters

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

    Returns FlatNotepad

modified

  • Parameters

    • Default value lastModified: Date = new Date()

    Returns FlatNotepad

pathFrom

search

  • search(trie: Trie, query: string): Note[]
  • Unlike the Notepad, this uses an indexed lookup system. This should be faster than a traditional notepad search.

    Parameters

    • trie: Trie

      The search trie for the notepad

    • query: string

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

    Returns Note[]

toNotepad

  • This will convert everything into the formal Notepad structure, however no Assets will be restored. The client should rebuild the assets after this using the values in notepadAssets

    Returns Notepad

Static makeFlatSection

  • makeFlatSection(title: string, parentRef?: undefined | string): FlatSection
  • Parameters

    • title: string
    • Optional parentRef: undefined | string

    Returns FlatSection

Generated using TypeDoc