Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

chore: add documentation for export method

thecodrreca4dd267331
diff --git a/packages/core/models/note.js b/packages/core/models/note.js
index ce5150846..7768f6546 100644
--- a/packages/core/models/note.js
+++ b/packages/core/models/note.js
@@ -43,6 +43,10 @@ export default class Note {
return this._note.dateEdited;
}
+ /**
+ *
+ * @param {"html"|"md"|"txt"} format - Format to export into
+ */
async export(to = "html") {
switch (to) {
case "html":
@@ -51,8 +55,8 @@ export default class Note {
return await this.text();
case "md":
return Converter.deltaToMD(await this.delta());
- case "pdf":
- break;
+ default:
+ throw new Error("Export format not supported.");
}
}