mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 02:22:26 +08:00
chore(client): fix more type errors
This commit is contained in:
parent
3e468d7960
commit
726797b13d
@ -9,6 +9,7 @@ import { t } from "./i18n.js";
|
|||||||
import type FNote from "../entities/fnote.js";
|
import type FNote from "../entities/fnote.js";
|
||||||
import type FBranch from "../entities/fbranch.js";
|
import type FBranch from "../entities/fbranch.js";
|
||||||
import type { ChooseNoteTypeResponse } from "../widgets/dialogs/note_type_chooser.js";
|
import type { ChooseNoteTypeResponse } from "../widgets/dialogs/note_type_chooser.js";
|
||||||
|
import type { CKTextEditor } from "@triliumnext/ckeditor5";
|
||||||
|
|
||||||
interface CreateNoteOpts {
|
interface CreateNoteOpts {
|
||||||
isProtected?: boolean;
|
isProtected?: boolean;
|
||||||
@ -22,7 +23,7 @@ interface CreateNoteOpts {
|
|||||||
focus?: "title" | "content";
|
focus?: "title" | "content";
|
||||||
target?: string;
|
target?: string;
|
||||||
targetBranchId?: string;
|
targetBranchId?: string;
|
||||||
textEditor?: TextEditor;
|
textEditor?: CKTextEditor;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Response {
|
interface Response {
|
||||||
|
@ -8,11 +8,12 @@
|
|||||||
* TODO: Generally this class can be done directly in the CKEditor repository.
|
* TODO: Generally this class can be done directly in the CKEditor repository.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import type { CKTextEditor } from "@triliumnext/ckeditor5";
|
||||||
import library_loader from "../../../services/library_loader.js";
|
import library_loader from "../../../services/library_loader.js";
|
||||||
import mime_types from "../../../services/mime_types.js";
|
import mime_types from "../../../services/mime_types.js";
|
||||||
import { isSyntaxHighlightEnabled } from "../../../services/syntax_highlight.js";
|
import { isSyntaxHighlightEnabled } from "../../../services/syntax_highlight.js";
|
||||||
|
|
||||||
export async function initSyntaxHighlighting(editor: TextEditor) {
|
export async function initSyntaxHighlighting(editor: CKTextEditor) {
|
||||||
if (!isSyntaxHighlightEnabled) {
|
if (!isSyntaxHighlightEnabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -54,7 +55,7 @@ function assert(e: boolean, msg?: string) {
|
|||||||
// TODO: Should this be scoped to note?
|
// TODO: Should this be scoped to note?
|
||||||
let markerCounter = 0;
|
let markerCounter = 0;
|
||||||
|
|
||||||
function initTextEditor(textEditor: TextEditor) {
|
function initTextEditor(textEditor: CKTextEditor) {
|
||||||
log("initTextEditor");
|
log("initTextEditor");
|
||||||
|
|
||||||
const document = textEditor.model.document;
|
const document = textEditor.model.document;
|
||||||
|
@ -7,7 +7,10 @@ export { EditorWatchdog } from "ckeditor5";
|
|||||||
* Short-hand for the CKEditor classes supported by Trilium for text editing.
|
* Short-hand for the CKEditor classes supported by Trilium for text editing.
|
||||||
* Specialized editors such as the {@link AttributeEditor} are not included.
|
* Specialized editors such as the {@link AttributeEditor} are not included.
|
||||||
*/
|
*/
|
||||||
export type CKTextEditor = ClassicEditor | PopupEditor;
|
export type CKTextEditor = (ClassicEditor | PopupEditor) & {
|
||||||
|
getSelectedHtml(): string;
|
||||||
|
removeSelection(): Promise<void>;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The text editor that can be used for editing attributes and relations.
|
* The text editor that can be used for editing attributes and relations.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user