@@ -29,9 +29,9 @@ import dateNoteService from "../services/date_notes.js";
2929 *
3030 * * Hierarchy of general to specific categories(hypernyms -> hyponyms):
3131 *
32- * * BaseCreateNoteSharedOpts
32+ * * CreateNoteEntity
3333 * |
34- * \-- BaseCreateNoteOpts
34+ * \-- CreateNoteOpts
3535 * |
3636 * +-- CreateNoteAtUrlOpts
3737 * | +-- CreateNoteIntoURLOpts
@@ -46,7 +46,7 @@ import dateNoteService from "../services/date_notes.js";
4646 * this is the shared basis for all types. Every other type is child (hyponym)
4747 * of it (domain hypernym).
4848 */
49- type BaseCreateNoteSharedOpts = {
49+ type CreateNoteEntity = {
5050 target : CreateNoteTarget ;
5151 isProtected ?: boolean ;
5252 saveSelection ?: boolean ;
@@ -60,12 +60,12 @@ type BaseCreateNoteSharedOpts = {
6060 textEditor ?: CKTextEditor ;
6161}
6262
63- export type BaseCreateNoteOpts =
64- | ( BaseCreateNoteSharedOpts & {
63+ export type CreateNoteOpts =
64+ | ( CreateNoteEntity & {
6565 promptForType : true ;
6666 type ?: never ;
6767 } )
68- | ( BaseCreateNoteSharedOpts & {
68+ | ( CreateNoteEntity & {
6969 promptForType ?: false ;
7070 type ?: string ;
7171 } ) ;
@@ -75,7 +75,7 @@ export type BaseCreateNoteOpts =
7575 * of "into" and "as siblings". It is not exported because it only exists, to
7676 * have its legal values propagated to its children (types inheriting from it).
7777 */
78- type CreateNoteAtUrlOpts = BaseCreateNoteOpts & {
78+ type CreateNoteAtUrlOpts = CreateNoteOpts & {
7979 // `Url` means either parentNotePath or parentNoteId.
8080 // The vocabulary is inspired by its loose semantics of getNoteIdFromUrl.
8181 parentNoteUrl : string ;
@@ -92,7 +92,7 @@ type CreateNoteSiblingURLOpts = CreateNoteAtUrlOpts;
9292export type CreateNoteBeforeURLOpts = CreateNoteSiblingURLOpts ;
9393export type CreateNoteAfterURLOpts = CreateNoteSiblingURLOpts ;
9494
95- export type CreateNoteIntoInboxURLOpts = BaseCreateNoteOpts & {
95+ export type CreateNoteIntoInboxURLOpts = CreateNoteOpts & {
9696 parentNoteUrl ?: never ;
9797}
9898
@@ -132,7 +132,7 @@ async function createNote(
132132) : Promise < { note : FNote | null ; branch : FBranch | undefined } > ;
133133
134134async function createNote (
135- options : BaseCreateNoteOpts
135+ options : CreateNoteOpts
136136) : Promise < { note : FNote | null ; branch : FBranch | undefined } > {
137137
138138 let resolvedOptions = { ...options } ;
@@ -150,7 +150,7 @@ async function createNote(
150150 promptForType : false ,
151151 type : noteType ,
152152 templateNoteId,
153- } as BaseCreateNoteOpts ;
153+ } as CreateNoteOpts ;
154154
155155 if ( notePath ) {
156156 resolvedOptions = resolvedOptions as CreateNoteIntoURLOpts ;
@@ -187,7 +187,7 @@ async function createNote(
187187 * Core function that creates a new note under the specified parent note path.
188188 *
189189 * @param target - Duplicates apps/server/src/routes/api/notes.ts createNote
190- * @param {BaseCreateNoteSharedOpts } [options] - Options controlling note creation (title, content, type, template, focus, etc.).
190+ * @param {CreateNoteEntity } [options] - Options controlling note creation (title, content, type, template, focus, etc.).
191191 * with parentNotePath - The parent note path where the new note will be created.
192192 * @returns {Promise<{ note: FNote | null; branch: FBranch | undefined }> }
193193 * Resolves with the created note and branch entities.
@@ -290,7 +290,7 @@ async function createNoteAfterNote(
290290/**
291291 * Creates a new note inside the user's Inbox.
292292 *
293- * @param {BaseCreateNoteSharedOpts } [options] - Optional settings such as title, type, template, or content.
293+ * @param {CreateNoteEntity } [options] - Optional settings such as title, type, template, or content.
294294 * @returns {Promise<{ note: FNote | null; branch: FBranch | undefined }> }
295295 * Resolves with the created note and its branch, or `{ note: null, branch: undefined }` if the inbox is missing.
296296 */
0 commit comments