import { FoamWorkspace } from '../model/workspace'; import { Resource } from '../model/note'; import { URI } from '../model/uri'; /** * A reference to a note. Either the URI is known (the caller resolved a * path themselves) or a short Foam identifier is given and the workspace * resolves it through its identifier index. * * Callers (CLI / MCP / VS Code) translate their own inputs (CLI flags, * MCP tool args, editor selection) into this shape. */ export type NoteRef = { uri: URI; } | { identifier: string; }; /** * Returns the workspace root URI that contains the given URI, or * `workspace.roots[0]` as a fallback when nothing matches (e.g. when the * URI is a placeholder or lives outside the workspace). * * Useful when a command needs to compute a resource-relative path: in a * multi-root workspace, the correct base depends on which root the * resource lives in. */ export declare function getRootUriFor(workspace: FoamWorkspace, uri: URI): URI; /** * Returns the workspace-relative POSIX path for a URI. * * The base is the workspace root that contains the URI (or `roots[0]` * as a fallback). This makes the function safe to use in multi-root * workspaces without the caller having to figure out which root to use. * * Works on POSIX URI paths regardless of platform. */ export declare function uriToWorkspacePath(uri: URI, workspace: FoamWorkspace): string; /** * Resolves a {@link NoteRef} to a {@link Resource}. * * Throws {@link FoamError} with code: * - `resource_not_found` when no note matches * - `ambiguous_identifier` when the identifier matches multiple notes */ export declare function resolveNote(workspace: FoamWorkspace, ref: NoteRef): Resource; //# sourceMappingURL=workspace.d.ts.map