Skip to content

5.4 API Documents

Amos Wong edited this page Apr 17, 2017 · 2 revisions

Storage.js

Initialize Database

Functions Parameters Details Returns
initializeDatabase Optional String newDatabaseName Initialize indexedDB with default database name and fill up table only at first instance. @return {Promise}

Query

Functions Parameters Details Returns
loadAllFilesAndFolders none retrieve all files and folders in database @return {Promise}, @return files],[folders
partialSearch String searchString searching files and folders with partial phrase @return {Promise}, @return files],[folders
getList number folderID get all files and folders inside this folder @return {Promise}, @return files],[folders
loadFile number fileID retrieve md string in file @return {Promise}, @return String

Creation

Functions Parameters Details Returns
createFile number organizationID, String filePath, number folderID create a new file @return {Promise}
createFolder number organizationID, String folderPath, number currentFolderID creates a new folder in database @return {Promise}

Database Modification

Functions Parameters Details Returns
saveFile number fileId, String fileString save md string to file @return {Promise}
moveFile number fileID, String newPath relocate a file to a new location @return {Promise}
copyFile number fileID duplicate a file @return {Promise}
renameFile number fileID, String newFileName rename a file @return {Promise}
renameFolder number folderID, String newFolderName rename a folder and all its children @return {Promise}
deleteFile number fileID removes a file from database @return {Promise}
deleteFolder number folderID removes a folder and cascade delete @return {Promise}

Exceptions

Functions Parameters Details Returns
exceptions none exceptions to check if called @return exceptions

FileManager.js

Initialize File Manager

Functions Parameters Details Returns
start none Initialize Filemanager @return {Promise}

Get Operation

Functions Parameters Details Returns
getFileByID String fileID Given an ID, return the File @return {File}
getFolderByID String folderID Given an ID, return the Folder @return {Folder}

Search Operation

Functions Parameters Details Returns
searchAll String searchString Return a Folder containing files and folders matching the search string @return {Folder}
searchFileOnly String searchString Return a Folder containing files matching the search string @return {Folder}
searchFolderOnly String searchString Return a Folder containing folders matching the search string @return {Folder}

History Operation

Functions Parameters Details Returns
createHistory {Folder} folder Return a History with the current folder initialized as the given folder @return {History}

Input Handlers

🚧

Clone this wiki locally