mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-04 20:21:31 +08:00
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import "ckeditor5";
|
|
|
|
declare global {
|
|
interface Component {
|
|
triggerCommand(command: string): void;
|
|
}
|
|
|
|
interface EditorComponent extends Component {
|
|
loadReferenceLinkTitle($el: JQuery<HTMLElement>, href: string): Promise<void>;
|
|
createNoteForReferenceLink(title: string): Promise<string>;
|
|
loadIncludedNote(noteId: string, $el: JQuery<HTMLElement>): void;
|
|
}
|
|
|
|
var glob: {
|
|
getComponentByEl<T extends Component>(el: unknown): T;
|
|
getActiveContextNote(): {
|
|
noteId: string;
|
|
};
|
|
getHeaders(): Promise<Record<string, string>>;
|
|
getReferenceLinkTitle(href: string): Promise<string>;
|
|
getReferenceLinkTitleSync(href: string): string;
|
|
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;
|
|
}
|
|
}
|
|
}
|