mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
fix(client/ts): fix rest of build errors
This commit is contained in:
parent
1ab87be0e6
commit
b876f98d69
2
src/public/app/types.d.ts
vendored
2
src/public/app/types.d.ts
vendored
@ -301,7 +301,7 @@ declare global {
|
||||
});
|
||||
removeMarker(name: string);
|
||||
createRange(start: number, end: number): Range;
|
||||
createElement(type: string, opts: Record<string, string>);
|
||||
createElement(type: string, opts: Record<string, string | null | undefined>);
|
||||
}
|
||||
interface TextNode {
|
||||
previousSibling?: TextNode;
|
||||
|
@ -80,13 +80,13 @@ export default class AddLinkDialog extends BasicWidget {
|
||||
if (this.$autoComplete.getSelectedNotePath()) {
|
||||
this.$widget.modal("hide");
|
||||
|
||||
const linkTitle = this.getLinkType() === "reference-link" ? null : this.$linkTitle.val();
|
||||
const linkTitle = this.getLinkType() === "reference-link" ? null : this.$linkTitle.val() as string;
|
||||
|
||||
this.textTypeWidget?.addLink(this.$autoComplete.getSelectedNotePath()!, linkTitle);
|
||||
} else if (this.$autoComplete.getSelectedExternalLink()) {
|
||||
this.$widget.modal("hide");
|
||||
|
||||
this.textTypeWidget?.addLink(this.$autoComplete.getSelectedExternalLink()!, this.$linkTitle.val(), true);
|
||||
this.textTypeWidget?.addLink(this.$autoComplete.getSelectedExternalLink()!, this.$linkTitle.val() as string, true);
|
||||
} else {
|
||||
logError("No link to add.");
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ export default class IncludeNoteDialog extends BasicWidget {
|
||||
return;
|
||||
}
|
||||
const note = await froca.getNote(noteId);
|
||||
const boxSize = $("input[name='include-note-box-size']:checked").val();
|
||||
const boxSize = $("input[name='include-note-box-size']:checked").val() as string;
|
||||
|
||||
if (["image", "canvas", "mermaid"].includes(note?.type ?? "")) {
|
||||
// there's no benefit to use insert note functionlity for images,
|
||||
|
@ -368,7 +368,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
this.addTextToEditor(text);
|
||||
}
|
||||
|
||||
async addLink(notePath: string, linkTitle: string, externalLink: boolean = false) {
|
||||
async addLink(notePath: string, linkTitle: string | null, externalLink: boolean = false) {
|
||||
await this.initialized;
|
||||
|
||||
if (linkTitle) {
|
||||
@ -459,7 +459,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
this.triggerCommand("showIncludeNoteDialog", { textTypeWidget: this });
|
||||
}
|
||||
|
||||
addIncludeNote(noteId: string, boxSize: string) {
|
||||
addIncludeNote(noteId: string, boxSize?: string) {
|
||||
this.watchdog.editor.model.change((writer) => {
|
||||
// Insert <includeNote>*</includeNote> at the current selection position
|
||||
// in a way that will result in creating a valid model structure
|
||||
|
@ -114,7 +114,9 @@ export default class ReadOnlyTextTypeWidget extends AbstractTextTypeWidget {
|
||||
this.$content.find("section").each((_, el) => {
|
||||
const noteId = $(el).attr("data-note-id");
|
||||
|
||||
this.loadIncludedNote(noteId, $(el));
|
||||
if (noteId) {
|
||||
this.loadIncludedNote(noteId, $(el));
|
||||
}
|
||||
});
|
||||
|
||||
if (this.$content.find("span.math-tex").length > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user