feat: 🎸 Fix ts compile error

This commit is contained in:
Jin 2025-03-22 14:35:37 +01:00
parent c8164c81be
commit 9d49546bc9
4 changed files with 11 additions and 3 deletions

View File

@ -204,6 +204,7 @@ declare global {
tabindex: number;
dragDrop: boolean;
placeholder: string;
readOnly: boolean;
}
var CodeMirror: {

View File

@ -50,6 +50,13 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
matchTags: { bothTags: true },
highlightSelectionMatches: { showToken: false, annotateScrollbar: false },
lineNumbers: true,
keyMap: "default",
lint: false,
gutters: [],
tabindex: 0,
dragDrop: true,
placeholder: "",
readOnly: false,
// we line wrap partly also because without it horizontal scrollbar displays only when you scroll
// all the way to the bottom of the note. With line wrap, there's no horizontal scrollbar so no problem
lineWrapping: options.is("codeLineWrapEnabled"),

View File

@ -36,7 +36,7 @@ export default class BackendLogWidget extends AbstractCodeTypeWidget {
await this.load();
}
getExtraOpts() {
getExtraOpts(): Partial<CodeMirrorOpts> {
return {
lineWrapping: false,
readOnly: true

View File

@ -43,7 +43,7 @@ export default class ReadOnlyCodeTypeWidget extends AbstractCodeTypeWidget {
this.show();
}
getExtraOpts() {
getExtraOpts(): Partial<CodeMirrorOpts> {
return {
readOnly: true
};