From 13a6fefaa27f604ffd388312c191beb912f056dc Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 18 Apr 2025 11:00:31 +0300 Subject: [PATCH] fix(monorepo/client): errors in type definition --- apps/client/src/types.d.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/client/src/types.d.ts b/apps/client/src/types.d.ts index 504ae8907..c08fd9620 100644 --- a/apps/client/src/types.d.ts +++ b/apps/client/src/types.d.ts @@ -2,13 +2,11 @@ import type FNote from "./entities/fnote"; import type { Froca } from "./services/froca-interface"; import { Suggestion } from "./services/note_autocomplete.ts"; import utils from "./services/utils.ts"; -import appContext from "./components/app_context.ts"; +import appContext, { AppContext } from "./components/app_context.ts"; import server from "./services/server.ts"; import library_loader, { Library } from "./services/library_loader.ts"; -import type { init } from "i18next"; import type { lint } from "./services/eslint.ts"; -import type { RelationType } from "./widgets/type_widgets/relation_map.ts"; -import type { Mermaid } from "mermaid"; +import type { Mermaid, MermaidConfig } from "mermaid"; interface ElectronProcess { type: string; @@ -23,7 +21,7 @@ interface CustomGlobals { getHeaders: typeof server.getHeaders; getReferenceLinkTitle: (href: string) => Promise; getReferenceLinkTitleSync: (href: string) => string; - getActiveContextNote: FNote; + getActiveContextNote: () => FNote; requireLibrary: typeof library_loader.requireLibrary; ESLINT: Library; appContext: AppContext; @@ -73,7 +71,7 @@ declare global { debug?: boolean; } - type AutoCompleteCallback = (values: AutoCompleteCallbackArg[]) => void; + type AutoCompleteCallback = (values: AutoCompleteArg[]) => void; interface AutoCompleteArg { displayKey: "name" | "value" | "notePathTitle"; @@ -85,7 +83,7 @@ declare global { }; interface JQuery { - autocomplete: (action?: "close" | "open" | "destroy" | "val" | AutoCompleteConfig, args?: AutoCompleteArg[] | string) => JQuery; + autocomplete: (action?: "close" | "open" | "destroy" | "val" | AutoCompleteConfig, args?: AutoCompleteArg[] | string) => JQuery; getSelectedNotePath(): string | undefined; getSelectedNoteId(): string | null; @@ -118,6 +116,7 @@ declare global { var logError: (message: string, e?: Error | string) => void; var logInfo: (message: string) => void; var glob: CustomGlobals; + //@ts-ignore var require: RequireMethod; var __non_webpack_require__: RequireMethod | undefined; @@ -137,6 +136,10 @@ declare global { label: string; } + interface CKEditorInstance { + + } + interface CKWatchdog { constructor(editorClass: CKEditorInstance, opts: { minimumNonErrorTimePeriod: number; @@ -172,7 +175,7 @@ declare global { var CKEditor: { BalloonEditor: CKEditorInstance; DecoupledEditor: CKEditorInstance; - EditorWatchdog: typeof CKWatchdog; + EditorWatchdog: CKWatchdog; }; var CKEditorInspector: { @@ -260,7 +263,7 @@ declare global { interface Writer { setAttribute(name: string, value: string, el: CKNode); createPositionAt(el: CKNode, opt?: "end" | number); - setSelection(pos: number, pos?: number); + setSelection(pos: number, pos2?: number); insertText(text: string, opts: Record | undefined | TextPosition, position?: TextPosition); addMarker(name: string, opts: { range: Range;