noggin-cli 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/noggin-api.d.mts +34 -2
- package/package.json +1 -1
package/noggin-api.d.mts
CHANGED
|
@@ -318,18 +318,50 @@ export interface DeleteOptions { path: ItemPath; recursive?: boolean }
|
|
|
318
318
|
* appends a close note and surfaces to parent, etc.) live here.
|
|
319
319
|
* Backends do not implement verbs.
|
|
320
320
|
*/
|
|
321
|
-
export
|
|
321
|
+
export interface Verbs {
|
|
322
|
+
/** Create a child of active and immediately become it. */
|
|
322
323
|
push(noggin: Noggin, opts: PushOptions, ctx?: VerbContext): Promise<CurrentTreeView>;
|
|
324
|
+
/** Create a child without making it active (capture a deferred todo). */
|
|
323
325
|
add(noggin: Noggin, opts: AddOptions, ctx?: VerbContext): Promise<CurrentTreeView>;
|
|
326
|
+
/** Relocate an item under a new parent / among siblings. */
|
|
324
327
|
move(noggin: Noggin, opts: MoveOptions): Promise<CurrentTreeView>;
|
|
328
|
+
/** Make the item at the given path active. */
|
|
325
329
|
goto(noggin: Noggin, opts: GotoOptions): Promise<CurrentTreeView>;
|
|
330
|
+
/** Mark target done and surface to its parent. Idempotent. */
|
|
326
331
|
done(noggin: Noggin, opts?: DoneOptions, ctx?: VerbContext): Promise<CurrentTreeView>;
|
|
332
|
+
/** Shorthand for done on the active item. */
|
|
327
333
|
pop(noggin: Noggin, opts?: PopOptions, ctx?: VerbContext): Promise<CurrentTreeView>;
|
|
334
|
+
/** Idempotent mutation of an item's done state and/or title. */
|
|
328
335
|
edit(noggin: Noggin, opts: EditOptions, ctx?: VerbContext): Promise<CurrentTreeView>;
|
|
336
|
+
/** Render the current-position view (spine + peers + first-level children). */
|
|
329
337
|
show(noggin: Noggin, opts?: ShowOptions): Promise<CurrentTreeView | null>;
|
|
338
|
+
/** Append a timestamped note to an item. */
|
|
330
339
|
note(noggin: Noggin, opts: NoteOptions, ctx?: VerbContext): Promise<CurrentTreeView>;
|
|
340
|
+
/** Remove an item (and optionally its subtree). */
|
|
331
341
|
delete(noggin: Noggin, opts: DeleteOptions): Promise<DeleteResult>;
|
|
332
|
-
|
|
342
|
+
/**
|
|
343
|
+
* Append every item from `source` into `dest` (whole-noggin,
|
|
344
|
+
* append-only). New keys are generated; notes (including system
|
|
345
|
+
* "closed" notes), `done` state, and `createdAt` are preserved
|
|
346
|
+
* verbatim. Source is read-only; dest's active pointer is unchanged.
|
|
347
|
+
* Same-noggin copy is supported.
|
|
348
|
+
*/
|
|
349
|
+
copy(source: Noggin, dest: Noggin, opts?: CopyOptions): Promise<CopyResult>;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** @public Options for {@link Verbs.copy}. Reserved for forward-compat — v1 has no options. */
|
|
353
|
+
export interface CopyOptions {}
|
|
354
|
+
|
|
355
|
+
/** @public Result of {@link Verbs.copy}. */
|
|
356
|
+
export interface CopyResult {
|
|
357
|
+
/** Number of items appended to dest. */
|
|
358
|
+
copied: number;
|
|
359
|
+
/** Map from source item key → new key in dest. */
|
|
360
|
+
mapping: Record<string, string>;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** @public The singleton verbs object. See {@link Verbs}. */
|
|
364
|
+
export const verbs: Verbs;
|
|
333
365
|
|
|
334
366
|
// ── Factory registry ───────────────────────────────────────────────────────
|
|
335
367
|
|