mirror of
https://github.com/zadam/trilium.git
synced 2026-01-15 19:14:30 +01:00
chore(core): get rid of note_interface
This commit is contained in:
parent
5508b505c8
commit
de4d07e904
@ -1,27 +0,0 @@
|
||||
import type { NoteType } from "@triliumnext/commons";
|
||||
|
||||
export interface NoteParams {
|
||||
/** optionally can force specific noteId */
|
||||
noteId?: string;
|
||||
branchId?: string;
|
||||
parentNoteId: string;
|
||||
templateNoteId?: string;
|
||||
title: string;
|
||||
content: string | Buffer;
|
||||
/** text, code, file, image, search, book, relationMap, canvas, webView */
|
||||
type: NoteType;
|
||||
/** default value is derived from default mimes for type */
|
||||
mime?: string;
|
||||
/** default is false */
|
||||
isProtected?: boolean;
|
||||
/** default is false */
|
||||
isExpanded?: boolean;
|
||||
/** default is empty string */
|
||||
prefix?: string;
|
||||
/** default is the last existing notePosition in a parent + 10 */
|
||||
notePosition?: number;
|
||||
dateCreated?: string;
|
||||
utcDateCreated?: string;
|
||||
ignoreForbiddenParents?: boolean;
|
||||
target?: "into";
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
import type { AttachmentRow, AttributeRow, BranchRow, NoteRow } from "@triliumnext/commons";
|
||||
import type { AttachmentRow, AttributeRow, BranchRow, NoteRow, NoteType } from "@triliumnext/commons";
|
||||
import { dayjs } from "@triliumnext/commons";
|
||||
import { date_utils, events as eventService, ValidationError } from "@triliumnext/core";
|
||||
import fs from "fs";
|
||||
@ -39,6 +39,32 @@ interface Attachment {
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface NoteParams {
|
||||
/** optionally can force specific noteId */
|
||||
noteId?: string;
|
||||
branchId?: string;
|
||||
parentNoteId: string;
|
||||
templateNoteId?: string;
|
||||
title: string;
|
||||
content: string | Uint8Array;
|
||||
/** text, code, file, image, search, book, relationMap, canvas, webView */
|
||||
type: NoteType;
|
||||
/** default value is derived from default mimes for type */
|
||||
mime?: string;
|
||||
/** default is false */
|
||||
isProtected?: boolean;
|
||||
/** default is false */
|
||||
isExpanded?: boolean;
|
||||
/** default is empty string */
|
||||
prefix?: string;
|
||||
/** default is the last existing notePosition in a parent + 10 */
|
||||
notePosition?: number;
|
||||
dateCreated?: string;
|
||||
utcDateCreated?: string;
|
||||
ignoreForbiddenParents?: boolean;
|
||||
target?: "into";
|
||||
}
|
||||
|
||||
function getNewNotePosition(parentNote: BNote) {
|
||||
if (parentNote.isLabelTruthy("newNotesOnTop")) {
|
||||
const minNotePos = parentNote
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user