api.md

February 6, 2020 · View on GitHub

Modules

i18n
locales
Electron API
db

Classes

Home

Home Component

NoteEditor

NoteEditor Component

NoteList

NoteList Component

NotesPanel

NotesPanel Component

Members

classes

styles for this component

theme

theme used generally in App

t

gets current translation

history

used for navigation

createNote

adds a new note

classes

styles for this component

theme

theme used generally in App

t

gets current translation

history

used for navigation

selectedNoteID

ID of current selected note

hasNotes

used to determine if there are notes or not

fetchAllNotes

fetches notes from database into notes array

classes

styles for this component

theme

theme used generally in App

selectedNoteContent

content of selected note

editSelectedNote

update current note

saveSelectedNote

save changes for current note

t

gets current translation

classes

styles for this component

theme

theme used generally in App

selectedNoteID

index of current selected note

notes

array of notes

noteBookNotes

notes of the current active notebook

activeNoteBookID

index of active notebook

setSelectedNoteID

selects note with ID

removeSelectedNote

deletes selected note

setCustomStartupNote

set note as custom startup note

addToActiveNoteBook

adds note to active notebook

removeFromActiveNoteBook

removes note from active notebook

saveActiveNoteBook

save changes for active notebook

classes

styles for this component

theme

theme used generally in App

id

id of current item

text

text will be shown in this item

modified

Modification date of this item

selected

is current item selected or not

onClick

callback called when user clicks on this item

onDelete

callback called when user clicks on delete button

onImportant

callback called when user clicks on important button

onNoteBook

callback called when user clicks on notebook button

classes

styles for this component

theme

theme used generally in App

activeNoteBookID

ID of active notebook

noteIDs

array of note IDs of active notebook

nameList

list of notebook names

noteBooks

array of notebooks

hasNoteBooks

used to determine if there are notebooks or not

hasNoteList

used to determine if there are notebook notes or not

noteBookIsOpened

used to determine if a notebook is opened or not

fetchAllNoteBooks

fetches notebooks from database into notebooks array

createNoteBook

adds a new notebook

setActiveNoteBookID

selects active notebook with ID

setSelectedNoteBookID

selects notebook with ID

removeSelectedNoteBook

deletes selected notebook

openNoteBook

sets notebook is opened prop to true

closeNoteBook

sets notebook is opened prop to false

createNoteList

creates list of notebook notes

deleteNoteList

deletes list of notebook notes

classes

styles for this component

theme

theme used generally in App

t

gets current translation

history

used for navigation after saving

createNote

adds a new note

showDashboard

shows dashboard

searchNote

searches for a note

clearSearch

clears results of search

classes

styles for this component

theme

theme used generally in App

classes

styles for this component

icon

icon that will be shown

text

shown when user hovers on this component

callback

called when user clicks on this component

saveSettings

save new settings

setReadyStatus

changes status of settings

settingsStatus

indictator for current status

classes

styles for this component

theme

theme used generally in App

t

gets current translation

history

used for navigation after saving

classes

styles for this component

theme

theme used generally in App

Constants

addNewNote

Used for adding a new note.

addNewNoteBook

Used for adding a new notebook.

ACTIONS

Supported ACTIONS.

SETTINGS_STATUS

Supported SETTINGS STATUS.

jss

Configure JSS

store

Configure redux store

NAME

A middleware which acts like a service, because it is stateful and "long-running" in the background. It provides the ability for actions to install a function to be run once when a specific condition is met by an action coming through the system. Think of it as a thunk that blocks until the condition is met. Example:

const services = { WAIT_UNTIL: require('wait-service').NAME };

{ type: services.WAIT_UNTIL, predicate: action => action.type === constants.ADD_ITEM, run: (dispatch, getState, action) => { // Do anything here. You only need to accept the arguments // if you need them. action is the action that satisfied // the predicate. } }

routes

Declare routes for components.

Functions

createNote()

Async method, used for saving note to database.

saveSelectedNote()

Async method, used for updating note in database.

removeSelectedNote()

Async method, used for removing active note from database.

searchNoteContains()

Async method, user for searching for note with query

createNoteBook()

Async method, used for saving notebook to database.

saveActiveNoteBook()

Async method, used for updating notebook in database.

removeSelectedNoteBook()

Async method, used for removing active notebook from database.

removeNoteFromAllNoteBooks()

Async method, used for removing the destroyed note from notebook database.

renderApp()

Renders Apps with proper direction

i18n

locales

locales.SUPPORTED_LANGS

Supported Languages.

Kind: static constant of locales

Electron API

  • [Electron API](#module_Electron API)
    • [~setNotFirstTimeFlag()](#module_Electron API..setNotFirstTimeFlag)
    • [~getDefaultLanguage()](#module_Electron API..getDefaultLanguage)
    • [~getLastSelectedNoteBook()](#module_Electron API..getLastSelectedNoteBook)
    • [~getDefaultStartupMode()](#module_Electron API..getDefaultStartupMode)
    • [~getDefaultstartupNoteId()](#module_Electron API..getDefaultstartupNoteId)
    • [~setDefaultLanguage()](#module_Electron API..setDefaultLanguage)
    • [~setLastSelectedNoteBook()](#module_Electron API..setLastSelectedNoteBook)
    • [~setDefaultStartupMode()](#module_Electron API..setDefaultStartupMode)
    • [~openExternalLink()](#module_Electron API..openExternalLink)

Electron API~setNotFirstTimeFlag()

called to mark that the user has already opened Deer once. sets the show-welcome flag in electron store to false.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~getDefaultLanguage()

returns user's saved language if it's set, otherwise returns fallback language.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~getLastSelectedNoteBook()

returns last selected notebook if it's set, otherwise returns fallback notebook.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~getDefaultStartupMode()

returns user's saved startup mode if it's set, otherwise returns fallback startup mode.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~getDefaultstartupNoteId()

returns user's saved startup note id if it's set, otherwise returns null.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~setDefaultLanguage()

called to save user's language preference by providing defaultLanguage.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~setLastSelectedNoteBook()

called to save the last selected notebook by providing last selected notebook.

Kind: inner method of [Electron API](#module_Electron API)

Electron API~setDefaultStartupMode()

called to save user 's default startup mode preference by providing defaultStartupMode.

Kind: inner method of [Electron API](#module_Electron API)

called to ask main process to open a url in browser.

Kind: inner method of [Electron API](#module_Electron API)

db

module.exports ⏏

export the functions defined here

Kind: Exported member

module.exports~fetchNotes() ⇒ Promise

Fetches all notes from database

Kind: inner method of module.exports
Returns: Promise - of the result

module.exports~addNote(id, title, content, modified, rev) ⇒ Promise

Adds / Updates a note to database.

Kind: inner method of module.exports
Returns: Promise - of the result

ParamTypeDescription
idstringfor the note
titlestringfor the note
contentstringfor the note
modifiedstringdate for the note
revstringused in case of updating existing note

module.exports~getNote(id) ⇒ Promise

Gets a note from database using it's ID.

Kind: inner method of module.exports
Returns: Promise - of the result

ParamTypeDescription
idstringfor the note

module.exports~removeNote(id, rev) ⇒ Promise

Deletes a note from database using it's ID and rev.

Kind: inner method of module.exports
Returns: Promise - of the result

ParamTypeDescription
idstringfor the note
revstringfor the note

module.exports~searchNote(query) ⇒ Promise

Searches for a note using query string.

Kind: inner method of module.exports
Returns: Promise - of the result

ParamTypeDescription
querystringtext of query

module.exports~fetchNoteBooks() ⇒ Promise

Fetches all notebooks from database

Kind: inner method of module.exports
Returns: Promise - of the result

module.exports~addNoteBook(id, name, notes, modified, rev) ⇒ Promise

Adds / Updates a notebook to database.

Kind: inner method of module.exports
Returns: Promise - of the result

ParamTypeDescription
idstringfor the notebook
namestringfor the notebook
notesobjectfor the notebook
modifiedstringdate for the notebook
revstringused in case of updating existing notebook

module.exports~removeNoteBook(id, rev) ⇒ Promise

Deletes a notebook from database using it's ID and rev.

Kind: inner method of module.exports
Returns: Promise - of the result

ParamTypeDescription
idstringfor the notebook
revstringfor the notebook

Home

Home Component

Kind: global class

home.componentDidMount()

Called after mounting component.

Kind: instance method of Home

home.getHomeContent() ⇒ element

Decides whether to show NoteEditor or Dashboard component.

Kind: instance method of Home

home.render()

Rendering method

Kind: instance method of Home

NoteEditor

NoteEditor Component

Kind: global class

noteEditor.handleChange()

Called when there is a change in content of current note

Kind: instance method of NoteEditor

noteEditor.componentWillUnmount()

called before un-mounting component.

Kind: instance method of NoteEditor

noteEditor.render()

Rendering method

Kind: instance method of NoteEditor

NoteList

NoteList Component

Kind: global class

noteList.handleOnNoteSelect()

Called when user selects a note

Kind: instance method of NoteList

noteList.handleOnNoteDelete()

Called when user clicks for deleting selected note

Kind: instance method of NoteList

noteList.handleOnCustom()

Called when user clicks on custom note

Kind: instance method of NoteList

noteList.handleOnNoteBookClick()

Called when user clicks on notebook icon

Kind: instance method of NoteList

noteList.render()

Rendering method

Kind: instance method of NoteList

NotesPanel

NotesPanel Component

Kind: global class

notesPanel.handleOnClickNewNote()

Called when user clicks on new note button.

Kind: instance method of NotesPanel

notesPanel.handleViewDashboard()

Called when user clicks on view dashboard button.

Kind: instance method of NotesPanel

notesPanel.handleOnSearch()

Called when user writes in searchbox.

Kind: instance method of NotesPanel

notesPanel.render()

Rendering method

Kind: instance method of NotesPanel

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

t

gets current translation

Kind: global variable

history

used for navigation

Kind: global variable

createNote

adds a new note

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

t

gets current translation

Kind: global variable

history

used for navigation

Kind: global variable

selectedNoteID

ID of current selected note

Kind: global variable

hasNotes

used to determine if there are notes or not

Kind: global variable

fetchAllNotes

fetches notes from database into notes array

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

selectedNoteContent

content of selected note

Kind: global variable

editSelectedNote

update current note

Kind: global variable

saveSelectedNote

save changes for current note

Kind: global variable

t

gets current translation

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

selectedNoteID

index of current selected note

Kind: global variable

notes

array of notes

Kind: global variable

noteBookNotes

notes of the current active notebook

Kind: global variable

activeNoteBookID

index of active notebook

Kind: global variable

setSelectedNoteID

selects note with ID

Kind: global variable

removeSelectedNote

deletes selected note

Kind: global variable

setCustomStartupNote

set note as custom startup note

Kind: global variable

addToActiveNoteBook

adds note to active notebook

Kind: global variable

removeFromActiveNoteBook

removes note from active notebook

Kind: global variable

saveActiveNoteBook

save changes for active notebook

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

id

id of current item

Kind: global variable

text

text will be shown in this item

Kind: global variable

modified

Modification date of this item

Kind: global variable

selected

is current item selected or not

Kind: global variable

onClick

callback called when user clicks on this item

Kind: global variable

onDelete

callback called when user clicks on delete button

Kind: global variable

onImportant

callback called when user clicks on important button

Kind: global variable

onNoteBook

callback called when user clicks on notebook button

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

activeNoteBookID

ID of active notebook

Kind: global variable

noteIDs

array of note IDs of active notebook

Kind: global variable

nameList

list of notebook names

Kind: global variable

noteBooks

array of notebooks

Kind: global variable

hasNoteBooks

used to determine if there are notebooks or not

Kind: global variable

hasNoteList

used to determine if there are notebook notes or not

Kind: global variable

noteBookIsOpened

used to determine if a notebook is opened or not

Kind: global variable

fetchAllNoteBooks

fetches notebooks from database into notebooks array

Kind: global variable

createNoteBook

adds a new notebook

Kind: global variable

setActiveNoteBookID

selects active notebook with ID

Kind: global variable

setSelectedNoteBookID

selects notebook with ID

Kind: global variable

removeSelectedNoteBook

deletes selected notebook

Kind: global variable

openNoteBook

sets notebook is opened prop to true

Kind: global variable

closeNoteBook

sets notebook is opened prop to false

Kind: global variable

createNoteList

creates list of notebook notes

Kind: global variable

deleteNoteList

deletes list of notebook notes

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

t

gets current translation

Kind: global variable

history

used for navigation after saving

Kind: global variable

createNote

adds a new note

Kind: global variable

showDashboard

shows dashboard

Kind: global variable

searchNote

searches for a note

Kind: global variable

clearSearch

clears results of search

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

classes

styles for this component

Kind: global variable

icon

icon that will be shown

Kind: global variable

text

shown when user hovers on this component

Kind: global variable

callback

called when user clicks on this component

Kind: global variable

saveSettings

save new settings

Kind: global variable

setReadyStatus

changes status of settings

Kind: global variable

settingsStatus

indictator for current status

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

t

gets current translation

Kind: global variable

history

used for navigation after saving

Kind: global variable

classes

styles for this component

Kind: global variable

theme

theme used generally in App

Kind: global variable

addNewNote

Used for adding a new note.

Kind: global constant

addNewNoteBook

Used for adding a new notebook.

Kind: global constant

ACTIONS

Supported ACTIONS.

Kind: global constant

ACTIONS.NOTES_FETCH_SUCCESS

Notes operations

Kind: static property of ACTIONS

ACTIONS.NOTE_BOOKS_FETCH_SUCCESS

NoteBooks operations

Kind: static property of ACTIONS

SETTINGS_STATUS

Supported SETTINGS STATUS.

Kind: global constant

jss

Configure JSS

Kind: global constant

store

Configure redux store

Kind: global constant

NAME

A middleware which acts like a service, because it is stateful and "long-running" in the background. It provides the ability for actions to install a function to be run once when a specific condition is met by an action coming through the system. Think of it as a thunk that blocks until the condition is met. Example:

const services = { WAIT_UNTIL: require('wait-service').NAME };

{ type: services.WAIT_UNTIL,
  predicate: action => action.type === constants.ADD_ITEM,
  run: (dispatch, getState, action) => {
    // Do anything here. You only need to accept the arguments
    // if you need them. `action` is the action that satisfied
    // the predicate.
  }
}

Kind: global constant

routes

Declare routes for components.

Kind: global constant

createNote()

Async method, used for saving note to database.

Kind: global function

saveSelectedNote()

Async method, used for updating note in database.

Kind: global function

removeSelectedNote()

Async method, used for removing active note from database.

Kind: global function

searchNoteContains()

Async method, user for searching for note with query

Kind: global function

createNoteBook()

Async method, used for saving notebook to database.

Kind: global function

saveActiveNoteBook()

Async method, used for updating notebook in database.

Kind: global function

removeSelectedNoteBook()

Async method, used for removing active notebook from database.

Kind: global function

removeNoteFromAllNoteBooks()

Async method, used for removing the destroyed note from notebook database.

Kind: global function

renderApp()

Renders Apps with proper direction

Kind: global function