chore(client/ts): fix build errors

This commit is contained in:
Elian Doran 2024-12-21 19:26:12 +02:00
parent 3d2d3b1106
commit c6d04b50fb
No known key found for this signature in database
4 changed files with 8 additions and 11 deletions

View File

@ -7,8 +7,9 @@ import { t } from "./i18n.js";
import { Entity } from "./frontend_script_api.js"; import { Entity } from "./frontend_script_api.js";
// TODO: Deduplicate with server. // TODO: Deduplicate with server.
interface Bundle { export interface Bundle {
script: string; script: string;
html: string;
noteId: string; noteId: string;
allNoteIds: string[]; allNoteIds: string[];
} }

View File

@ -2,12 +2,11 @@ import mimeTypesService from "./mime_types.js";
import optionsService from "./options.js"; import optionsService from "./options.js";
import { getStylesheetUrl } from "./syntax_highlight.js"; import { getStylesheetUrl } from "./syntax_highlight.js";
interface Library { export interface Library {
js?: string[] | (() => string[]); js?: string[] | (() => string[]);
css?: string[]; css?: string[];
} }
const CKEDITOR: Library = { const CKEDITOR: Library = {
js: ["libraries/ckeditor/ckeditor.js"] js: ["libraries/ckeditor/ckeditor.js"]
}; };

View File

@ -1,11 +1,7 @@
import server from "./server.js"; import server from "./server.js";
import bundleService from "./bundle.js"; import bundleService, { Bundle } from "./bundle.js";
import FNote from "../entities/fnote.js"; import FNote from "../entities/fnote.js";
interface Bundle {
html: string;
}
async function render(note: FNote, $el: JQuery<HTMLElement>) { async function render(note: FNote, $el: JQuery<HTMLElement>) {
const relations = note.getRelations('renderNote'); const relations = note.getRelations('renderNote');
const renderNoteIds = relations const renderNoteIds = relations

View File

@ -6,6 +6,7 @@ import { Suggestion } from "./services/note_autocomplete.ts";
import utils from "./services/utils.ts"; import utils from "./services/utils.ts";
import appContext from "./components/app_context.ts"; import appContext from "./components/app_context.ts";
import server from "./services/server.ts"; import server from "./services/server.ts";
import library_loader, { Library } from "./services/library_loader.ts";
interface ElectronProcess { interface ElectronProcess {
type: string; type: string;
@ -21,8 +22,8 @@ interface CustomGlobals {
getReferenceLinkTitle: (href: string) => Promise<string>; getReferenceLinkTitle: (href: string) => Promise<string>;
getReferenceLinkTitleSync: (href: string) => string; getReferenceLinkTitleSync: (href: string) => string;
getActiveContextNote: FNote; getActiveContextNote: FNote;
requireLibrary: (library: string) => Promise<void>; requireLibrary: typeof library_loader.requireLibrary;
ESLINT: { js: string[]; }; ESLINT: Library;
appContext: AppContext; appContext: AppContext;
froca: Froca; froca: Froca;
treeCache: Froca; treeCache: Froca;
@ -70,7 +71,7 @@ declare global {
displayKey: "name" | "value" | "notePathTitle"; displayKey: "name" | "value" | "notePathTitle";
cache: boolean; cache: boolean;
source: (term: string, cb: AutoCompleteCallback) => void, source: (term: string, cb: AutoCompleteCallback) => void,
templates: { templates?: {
suggestion: (suggestion: Suggestion) => string | undefined suggestion: (suggestion: Suggestion) => string | undefined
} }
}; };