Skip to content

Build your personal knowledge base with Trilium Notes

chore: solve a few more type errors

Elian Doran11461221ba7c
diff --git a/apps/client/src/widgets/PromotedAttributes.tsx b/apps/client/src/widgets/PromotedAttributes.tsx
index 6a1a8640f2..f86cbeb5cd 100644
--- a/apps/client/src/widgets/PromotedAttributes.tsx
+++ b/apps/client/src/widgets/PromotedAttributes.tsx
@@ -1,6 +1,6 @@
import "./PromotedAttributes.css";
-import { UpdateAttributeResponse } from "@triliumnext/commons";
+import { DefinitionObject, LabelType, UpdateAttributeResponse } from "@triliumnext/commons";
import clsx from "clsx";
import { ComponentChild, createElement, HTMLInputTypeAttribute, InputHTMLAttributes, MouseEventHandler, TargetedEvent, TargetedInputEvent } from "preact";
import { Dispatch, StateUpdater, useCallback, useEffect, useRef, useState } from "preact/hooks";
@@ -11,7 +11,7 @@ import FNote from "../entities/fnote";
import { Attribute } from "../services/attribute_parser";
import attributes from "../services/attributes";
import { t } from "../services/i18n";
-import { DefinitionObject, extractAttributeDefinitionTypeAndName, LabelType } from "../services/promoted_attribute_definition_parser";
+import { extractAttributeDefinitionTypeAndName } from "../services/promoted_attribute_definition_parser";
import server from "../services/server";
import { randomString } from "../services/utils";
import ws from "../services/ws";
diff --git a/apps/server/src/services/export/zip/abstract_provider.ts b/apps/server/src/services/export/zip/abstract_provider.ts
index edb5777c95..dd2fdcafa2 100644
--- a/apps/server/src/services/export/zip/abstract_provider.ts
+++ b/apps/server/src/services/export/zip/abstract_provider.ts
@@ -1,4 +1,5 @@
import { NoteType } from "@triliumnext/commons";
+import { ExportFormat } from "@triliumnext/core";
import { Archiver } from "archiver";
import mimeTypes from "mime-types";
diff --git a/apps/server/src/test/becca_mocking.ts b/apps/server/src/test/becca_mocking.ts
index 34ec36c3c8..0428582983 100644
--- a/apps/server/src/test/becca_mocking.ts
+++ b/apps/server/src/test/becca_mocking.ts
@@ -1,10 +1,11 @@
-import BNote from "../becca/entities/bnote.js";
-import BBranch from "../becca/entities/bbranch.js";
-import BAttribute from "../becca/entities/battribute.js";
-import becca from "../becca/becca.js";
-import randtoken from "rand-token";
-import type SearchResult from "../services/search/search_result.js";
import type { NoteRow, NoteType } from "@triliumnext/commons";
+import { SearchResult } from "@triliumnext/core";
+import randtoken from "rand-token";
+
+import becca from "../becca/becca.js";
+import BAttribute from "../becca/entities/battribute.js";
+import BBranch from "../becca/entities/bbranch.js";
+import BNote from "../becca/entities/bnote.js";
randtoken.generator({ source: "crypto" });
export function findNoteByTitle(searchResults: Array<SearchResult>, title: string): BNote | undefined {
@@ -63,7 +64,7 @@ export function note(title: string, extraParams: Partial<NoteRow> = {}) {
const row = Object.assign(
{
noteId: id(),
- title: title,
+ title,
type: "text" as NoteType,
mime: "text/html"
},
diff --git a/packages/trilium-core/src/index.ts b/packages/trilium-core/src/index.ts
index 1b7a181392..1f24f2cfb7 100644
--- a/packages/trilium-core/src/index.ts
+++ b/packages/trilium-core/src/index.ts
@@ -77,7 +77,8 @@ export type { NotePojo } from "./becca/becca-interface";
export { default as NoteSet } from "./services/search/note_set";
export { default as SearchContext } from "./services/search/search_context";
-export { default as search } from "./services/search/services/search";
+export { default as search, } from "./services/search/services/search";
+export { type default as SearchResult } from "./services/search/search_result";
export { type SearchParams } from "./services/search/services/types";
export { default as note_service } from "./services/notes";
export type { NoteParams } from "./services/notes";