import { type Foam } from '../model/foam'; import { FoamGraph } from '../model/graph'; import { Resource } from '../model/note'; import { FoamWorkspace } from '../model/workspace'; import { URI } from '../model/uri'; import { IDataStore } from '../services/datastore'; export interface NoteDetail { id: string; uri: URI; title: string; type: string; tags: string[]; aliases: string[]; properties: Record; links?: { outgoing: string[]; incoming: string[]; }; } export interface NoteIdResult { id: string; uri: URI; } export interface NoteCreateResult { id: string; uri: URI; /** * Which template family produced the note's content. Omitted when no * template was applied (the note got the minimal `# title` fallback body). * * - `default`: `new-note.md` or `new-note.js` from `.foam/templates/` was used. * - `daily-note`: `daily-note.md` or `daily-note.js` from `.foam/templates/` * was used (only emitted by `daily --create`, not `note create`). * - `custom`: reserved for future flows where the caller picks a named * template; the current `note create` API does not take a template name. */ templateType?: 'default' | 'daily-note' | 'custom'; /** * The format of the applied template. Omitted whenever `templateType` * is omitted (the two travel together). */ templateFormat?: 'md' | 'js'; } export interface NoteMoveResult { old_uri: URI; new_uri: URI; old_id: string; id: string; updated_links: number; } export interface NoteDeleteResult { /** Final location of the file after the operation: `.foam/trash/...` URI when trashed, or the original URI when permanently deleted. */ uri: URI; /** Original URI of the deleted resource. */ source_uri: URI; /** True if the file was moved to trash, false if permanently deleted. */ trashed: boolean; } export declare function noteShowData(workspace: FoamWorkspace, graph: FoamGraph, resource: Resource, opts: { includeLinks?: boolean; }): NoteDetail; export declare function noteIdData(workspace: FoamWorkspace, resource: Resource): NoteIdResult; /** * Creates a new note. If a `new-note.md` template exists in the workspace's * `.foam/templates/` directory, it is used to render the file; otherwise a * minimal `# title` body is written. * * The note is created under `opts.dir` if given (relative or absolute); * otherwise it goes under the first workspace root. In a multi-root * workspace the caller can pass an absolute `dir` to target a specific * root. * * `isTrusted` controls whether JavaScript templates (`new-note.js`) may * execute. Callers driven by untrusted input (MCP agents, CLI by default) * must pass `false`; the VS Code path passes `workspace.isTrusted`. * * Errors with `resource_exists` if the destination file already exists. */ export declare function noteCreate(foam: Foam, dataStore: IDataStore, opts: { title?: string; dir?: string; properties?: Record; }, isTrusted: boolean): Promise; /** * Moves/renames a note and rewrites all wikilinks pointing to it across the * workspace. * * Errors with `resource_exists` if the destination already exists, or * `invalid_input` if source equals destination. */ export declare function noteMove(workspace: FoamWorkspace, graph: FoamGraph, dataStore: IDataStore, resource: Resource, newUri: URI): Promise; /** * Deletes a note. By default, moves it to `.foam/trash/` (under the * workspace root that contains the resource), preserving the * resource's relative path. Pass `permanent: true` to hard-delete. */ export declare function noteDelete(workspace: FoamWorkspace, dataStore: IDataStore, resource: Resource, opts: { permanent?: boolean; }): Promise; //# sourceMappingURL=note.d.ts.map