mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-25 14:31:33 +08:00
feat: 🎸 Fix ts compile error
This commit is contained in:
parent
c8164c81be
commit
9d49546bc9
1
src/public/app/types.d.ts
vendored
1
src/public/app/types.d.ts
vendored
@ -204,6 +204,7 @@ declare global {
|
||||
tabindex: number;
|
||||
dragDrop: boolean;
|
||||
placeholder: string;
|
||||
readOnly: boolean;
|
||||
}
|
||||
|
||||
var CodeMirror: {
|
||||
|
@ -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"),
|
||||
|
@ -36,7 +36,7 @@ export default class BackendLogWidget extends AbstractCodeTypeWidget {
|
||||
await this.load();
|
||||
}
|
||||
|
||||
getExtraOpts() {
|
||||
getExtraOpts(): Partial<CodeMirrorOpts> {
|
||||
return {
|
||||
lineWrapping: false,
|
||||
readOnly: true
|
||||
|
@ -43,7 +43,7 @@ export default class ReadOnlyCodeTypeWidget extends AbstractCodeTypeWidget {
|
||||
this.show();
|
||||
}
|
||||
|
||||
getExtraOpts() {
|
||||
getExtraOpts(): Partial<CodeMirrorOpts> {
|
||||
return {
|
||||
readOnly: true
|
||||
};
|
||||
@ -100,7 +100,7 @@ export default class ReadOnlyCodeTypeWidget extends AbstractCodeTypeWidget {
|
||||
return ret;
|
||||
});
|
||||
|
||||
for (i = pre.length; i--; ) {
|
||||
for (i = pre.length; i--;) {
|
||||
html = html.replace("<--TEMPPRE" + i + "/-->", pre[i].tag.replace("<pre>", "<pre>\n").replace("</pre>", pre[i].indent + "</pre>"));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user