@@ -17,9 +17,8 @@ import dateNoteService from "../services/date_notes.js";
1717 * accepted by `note_create`.
1818 *
1919 * ## Overview
20- * Each variant (e.g. `CreateNoteIntoUrlOpts`, `CreateNoteBeforeUrlOpts`, etc.)
21- * extends `CreateNoteOpts` and enforces specific constraints to ensure only
22- * valid note creation options are allowed at compile time.
20+ * Each variant extends `CreateNoteOpts` and enforces specific constraints to
21+ * ensure only valid note creation options are allowed at compile time.
2322 *
2423 * ## Type Safety
2524 * The `PromptingRule` ensures that `promptForType` and `type` stay mutually
@@ -36,10 +35,7 @@ import dateNoteService from "../services/date_notes.js";
3635 *
3736 * Hierarchy (general → specific):
3837 * - CreateNoteOpts
39- * - CreateNoteAtUrlOpts
40- * - CreateNoteIntoUrlOpts
41- * - CreateNoteBeforeUrlOpts
42- * - CreateNoteAfterUrlOpts
38+ * - CreateNoteWithUrlOpts
4339 * - CreateNoteIntoInboxOpts
4440 */
4541
@@ -81,7 +77,7 @@ export type CreateNoteOpts = {
8177 * Serves as a base for "into", "before", and "after" variants,
8278 * sharing common URL-related fields.
8379 */
84- type CreateNoteWithUrlOpts = CreateNoteOpts & {
80+ export type CreateNoteWithUrlOpts = CreateNoteOpts & {
8581 // `Url` may refer to either parentNotePath or parentNoteId.
8682 // The vocabulary is inspired by existing function getNoteIdFromUrl.
8783 parentNoteUrl : string ;
@@ -90,10 +86,6 @@ type CreateNoteWithUrlOpts = CreateNoteOpts & {
9086 targetBranchId : string ;
9187}
9288
93- export type CreateNoteIntoUrlOpts = CreateNoteWithUrlOpts ;
94- export type CreateNoteBeforeUrlOpts = CreateNoteWithUrlOpts ;
95- export type CreateNoteAfterUrlOpts = CreateNoteWithUrlOpts ;
96-
9789type NeverDefineParentNoteUrlRule = {
9890 parentNoteUrl ?: never ;
9991} ;
@@ -155,12 +147,12 @@ async function promptForType(
155147 } as CreateNoteOpts ;
156148
157149 if ( notePath ) {
158- resolvedOptions = resolvedOptions as CreateNoteIntoUrlOpts ;
150+ resolvedOptions = resolvedOptions as CreateNoteWithUrlOpts ;
159151 resolvedOptions = {
160152 ...resolvedOptions ,
161153 target : "into" ,
162154 parentNoteUrl : notePath ,
163- } as CreateNoteIntoUrlOpts ;
155+ } as CreateNoteWithUrlOpts ;
164156 }
165157
166158 return resolvedOptions ;
@@ -274,7 +266,7 @@ async function createNoteIntoInbox(
274266 {
275267 ...options ,
276268 parentNoteUrl : inboxNote . noteId ,
277- } as CreateNoteIntoUrlOpts
269+ } as CreateNoteWithUrlOpts
278270 ) ;
279271
280272 return result ;
0 commit comments