api.md
February 6, 2020 · View on GitHub
Modules
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.actionis 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)
Electron API~openExternalLink()
called to ask main process to open a url in browser.
Kind: inner method of [Electron API](#module_Electron API)
db
- db
- module.exports ⏏
- ~fetchNotes() ⇒
Promise - ~addNote(id, title, content, modified, rev) ⇒
Promise - ~getNote(id) ⇒
Promise - ~removeNote(id, rev) ⇒
Promise - ~searchNote(query) ⇒
Promise - ~fetchNoteBooks() ⇒
Promise - ~addNoteBook(id, name, notes, modified, rev) ⇒
Promise - ~removeNoteBook(id, rev) ⇒
Promise
- ~fetchNotes() ⇒
- module.exports ⏏
module.exports ⏏
export the functions defined here
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
| Param | Type | Description |
|---|---|---|
| id | string | for the note |
| title | string | for the note |
| content | string | for the note |
| modified | string | date for the note |
| rev | string | used 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
| Param | Type | Description |
|---|---|---|
| id | string | for 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
| Param | Type | Description |
|---|---|---|
| id | string | for the note |
| rev | string | for 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
| Param | Type | Description |
|---|---|---|
| query | string | text 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
| Param | Type | Description |
|---|---|---|
| id | string | for the notebook |
| name | string | for the notebook |
| notes | object | for the notebook |
| modified | string | date for the notebook |
| rev | string | used 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
| Param | Type | Description |
|---|---|---|
| id | string | for the notebook |
| rev | string | for the notebook |
Home
Home Component
Kind: global class
- Home
- .componentDidMount()
- .getHomeContent() ⇒
element - .render()
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
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
addNewNote
Used for adding a new note.
addNewNoteBook
Used for adding a new notebook.
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.
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.
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
Kind: global function