import { type AliasEntry } from "./core/aliases.js"; import { type BaseQueryResult, type BaseView } from "./core/bases.js"; import { type Bookmark } from "./core/bookmarks.js"; import { type Canvas } from "./core/canvas.js"; import { type CreateOptions, type CreateResult, type DeleteResult, type MoveResult, type ReadResult } from "./core/crud.js"; import { type FileInfo, type FolderInfo } from "./core/files.js"; import { type AddTemplateResult, type ScaffoldResult, type TemplateInfo } from "./core/init.js"; import { type OverviewOptions, type VaultOverview } from "./core/overview.js"; import { type SearchOptions, type SearchResult } from "./core/search.js"; import { type TagInfo } from "./core/tags.js"; import { type TaskShowResult, type TaskWithFile } from "./core/tasks.js"; import { type VaultMetadata } from "./core/vault.js"; import { type WordCount } from "./core/wordcount.js"; import type { VaultTemplate } from "./templates/types.js"; import { type NapkinConfig } from "./utils/config.js"; import type { Heading } from "./utils/markdown.js"; import { type VaultInfo } from "./utils/vault.js"; export interface NapkinOptions { /** * Configuration supplied in code. When given it is the whole * configuration for this instance — including the vault layout, whose * `vault` key is read from here rather than from disk — and * .napkin/config.json is never read on any of its code paths. Per-call * options still win per field, falling back to this instead of the file. * * The object is copied and frozen, so neither later edits to the caller's * object nor edits to the vault file change what this instance does. */ config?: NapkinConfig; } export declare class Napkin { readonly vault: VaultInfo; constructor(path: string, options?: NapkinOptions); info(): VaultMetadata; overview(opts?: OverviewOptions): VaultOverview; search(query: string, opts?: SearchOptions): SearchResult[]; read(file: string): ReadResult; create(opts: CreateOptions): CreateResult; append(file: string, content: string, inline?: boolean): string; prepend(file: string, content: string, inline?: boolean): string; move(file: string, destination: string): MoveResult; rename(file: string, newName: string): MoveResult; delete(file: string, permanent?: boolean): DeleteResult; fileInfo(file: string): FileInfo; fileList(opts?: { folder?: string; ext?: string; }): string[]; folders(parentFolder?: string): string[]; folderInfo(folderPath: string): FolderInfo; outline(file: string): Heading[]; wordcount(file: string): WordCount; dailyPath(date?: Date): string; dailyEnsure(): { path: string; created: boolean; }; dailyRead(): { path: string; content: string; }; dailyAppend(content: string, inline?: boolean): string; dailyPrepend(content: string, inline?: boolean): string; tags(fileFilter?: string): { tagCounts: Map; tagFiles: Map; }; tagInfo(tagName: string): TagInfo; aliases(fileFilter?: string): AliasEntry[]; properties(fileFilter?: string): Map; propertyGet(file: string, name: string): { property: string; value: unknown; }; propertySet(file: string, name: string, value: string): { path: string; property: string; value: unknown; }; propertyRemove(file: string, name: string): { path: string; removed: string; }; tasks(opts?: { file?: string; daily?: boolean; done?: boolean; todo?: boolean; status?: string; }): TaskWithFile[]; taskShow(file: string, line: number): { currentStatus: string; text: string; }; taskUpdate(file: string, line: number, newStatus: string): TaskShowResult; linksOut(file: string): string[]; linksBack(file: string): string[]; linksUnresolved(): [string, string[]][]; orphans(): string[]; deadends(): string[]; templates(): string[]; templateRead(name: string, opts?: { resolve?: boolean; title?: string; }): { template: string; content: string; }; templateInsert(templateName: string, file: string): { file: string; template: string; inserted: boolean; }; bookmarks(): Bookmark[]; bookmarkAdd(entry: Bookmark): { added: Bookmark; }; config(): NapkinConfig; configGet(key: string): unknown; configSet(key: string, value: string): { config: NapkinConfig; parsed: unknown; }; bases(): string[]; baseViews(opts: { file?: string; path?: string; }): BaseView[]; baseQuery(opts: { file?: string; path?: string; }, viewName?: string): Promise; baseCreate(opts: { name: string; path?: string; content?: string; }): { path: string; created: boolean; }; canvases(): string[]; canvasRead(file: string): { canvas: Canvas; filePath: string; }; canvasCreate(fileName: string, folder?: string): { path: string; created: boolean; }; canvasAddNode(file: string, opts: { type?: string; text?: string; noteFile?: string; subpath?: string; url?: string; label?: string; x?: string; y?: string; width?: string; height?: string; color?: string; }): { id: string; type: string; added: boolean; }; canvasAddEdge(file: string, opts: { from: string; to: string; fromSide?: string; toSide?: string; label?: string; color?: string; }): { id: string; from: string; to: string; added: boolean; }; canvasRemoveNode(file: string, nodeId: string): { id: string; removed: boolean; }; static scaffold(path: string, opts?: { template?: string; }): ScaffoldResult; static vaultTemplates(): TemplateInfo[]; static registerTemplate(template: VaultTemplate): void; static addTemplate(path: string, template: string): AddTemplateResult; }