Skip to content

Build your personal knowledge base with Trilium Notes

fix(build): errors after refactoring

Elian Dorand3b55932a671
diff --git a/src/public/app/components/note_context.ts b/src/public/app/components/note_context.ts
index 77e0d04e73..fb3a691a0a 100644
--- a/src/public/app/components/note_context.ts
+++ b/src/public/app/components/note_context.ts
@@ -9,6 +9,7 @@ import hoistedNoteService from "../services/hoisted_note.js";
import options from "../services/options.js";
import type { ViewScope } from "../services/link.js";
import type FNote from "../entities/fnote.js";
+import type TypeWidget from "../widgets/type_widgets/type_widget.js";
interface SetNoteOpts {
triggerSwitchEvent?: unknown;
@@ -341,7 +342,7 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
async getTypeWidget() {
return this.timeout(
- new Promise((resolve) =>
+ new Promise<TypeWidget | null>((resolve) =>
appContext.triggerCommand("executeWithTypeWidget", {
resolve,
ntxId: this.ntxId
diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.ts
index 079d11d03b..c06d15bd88 100644
--- a/src/services/in_app_help.ts
+++ b/src/services/in_app_help.ts
@@ -36,7 +36,7 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt
let iconClass: string = "bx bx-file";
const item: HiddenSubtreeItem = {
id: `_help_${noteMeta.noteId}`,
- title: noteMeta.title,
+ title: noteMeta.title ?? "",
type: "doc", // can change
attributes: []
};
diff --git a/src/services/meta/note_meta.ts b/src/services/meta/note_meta.ts
index 39051a88eb..0aaafb6b59 100644
--- a/src/services/meta/note_meta.ts
+++ b/src/services/meta/note_meta.ts
@@ -8,10 +8,10 @@ export interface NoteMetaFile {
}
export default interface NoteMeta {
- noteId: string;
+ noteId?: string;
notePath?: string[];
isClone?: boolean;
- title: string;
+ title?: string;
notePosition?: number;
prefix?: string | null;
isExpanded?: boolean;