Skip to content

Build your personal knowledge base with Trilium Notes

chore(client/ts): port doc

Elian Doran00bb7af5bdeb
diff --git a/src/public/app/types.d.ts b/src/public/app/types.d.ts
index b1750afb40..2af1e098d0 100644
--- a/src/public/app/types.d.ts
+++ b/src/public/app/types.d.ts
@@ -39,6 +39,7 @@ interface CustomGlobals {
maxEntityChangeIdAtLoad: number;
maxEntityChangeSyncIdAtLoad: number;
assetPath: string;
+ appPath: string;
instanceName: string;
appCssNoteIds: string[];
triliumVersion: string;
diff --git a/src/public/app/widgets/type_widgets/doc.js b/src/public/app/widgets/type_widgets/doc.ts
similarity index 90%
rename from src/public/app/widgets/type_widgets/doc.js
rename to src/public/app/widgets/type_widgets/doc.ts
index 4fd2d76f0a..433abccda5 100644
--- a/src/public/app/widgets/type_widgets/doc.js
+++ b/src/public/app/widgets/type_widgets/doc.ts
@@ -1,3 +1,4 @@
+import type FNote from "../../entities/fnote.js";
import TypeWidget from "./type_widget.js";
const TPL = `<div class="note-detail-doc note-detail-printable">
@@ -5,7 +6,7 @@ const TPL = `<div class="note-detail-doc note-detail-printable">
.note-detail-doc-content {
padding: 15px;
}
-
+
.note-detail-doc-content pre {
background-color: var(--accented-background-color);
border: 1px solid var(--main-border-color);
@@ -13,11 +14,14 @@ const TPL = `<div class="note-detail-doc note-detail-printable">
border-radius: 5px;
}
</style>
-
+
<div class="note-detail-doc-content"></div>
</div>`;
export default class DocTypeWidget extends TypeWidget {
+
+ private $content!: JQuery<HTMLElement>;
+
static getType() {
return "doc";
}
@@ -29,7 +33,7 @@ export default class DocTypeWidget extends TypeWidget {
super.doRender();
}
- async doRefresh(note) {
+ async doRefresh(note: FNote) {
const docName = note.getLabelValue("docName");
if (docName) {