mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
chore(ckeditor5): type errors due to augmentation
This commit is contained in:
parent
26c1cbeff1
commit
395bc372ce
@ -97,7 +97,7 @@ export function loadHighlightingTheme(themeName: string) {
|
||||
*/
|
||||
export function isSyntaxHighlightEnabled() {
|
||||
const theme = options.get("codeBlockTheme");
|
||||
return theme && theme !== "none";
|
||||
return !!theme && theme !== "none";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -111,7 +111,7 @@ export function buildConfig(): EditorConfig {
|
||||
},
|
||||
mapLanguageName: getHighlightJsNameForMime,
|
||||
defaultMimeType: MIME_TYPE_AUTO,
|
||||
enabled: isSyntaxHighlightEnabled
|
||||
enabled: isSyntaxHighlightEnabled()
|
||||
},
|
||||
clipboard: {
|
||||
copy: copyText
|
||||
|
@ -22,28 +22,3 @@ declare global {
|
||||
importMarkdownInline(): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "ckeditor5" {
|
||||
interface Editor {
|
||||
getSelectedHtml(): string;
|
||||
removeSelection(): Promise<void>;
|
||||
}
|
||||
|
||||
interface EditorConfig {
|
||||
syntaxHighlighting?: {
|
||||
loadHighlightJs: () => Promise<any>;
|
||||
mapLanguageName(mimeType: string): string;
|
||||
defaultMimeType: string;
|
||||
enabled: boolean;
|
||||
},
|
||||
moveBlockUp?: {
|
||||
keystroke: string[];
|
||||
},
|
||||
moveBlockDown?: {
|
||||
keystroke: string[];
|
||||
},
|
||||
clipboard?: {
|
||||
copy(text: string): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,3 +43,28 @@ export class PopupEditor extends BalloonEditor {
|
||||
return POPUP_EDITOR_PLUGINS;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "ckeditor5" {
|
||||
interface Editor {
|
||||
getSelectedHtml(): string;
|
||||
removeSelection(): Promise<void>;
|
||||
}
|
||||
|
||||
interface EditorConfig {
|
||||
syntaxHighlighting?: {
|
||||
loadHighlightJs: () => Promise<any>;
|
||||
mapLanguageName(mimeType: string): string;
|
||||
defaultMimeType: string;
|
||||
enabled: boolean;
|
||||
},
|
||||
moveBlockUp?: {
|
||||
keystroke: string[];
|
||||
},
|
||||
moveBlockDown?: {
|
||||
keystroke: string[];
|
||||
},
|
||||
clipboard?: {
|
||||
copy(text: string): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user