import type { DataAdapter as DataAdapterOriginal, DataWriteOptions as DataWriteOptionsOriginal, Vault as VaultOriginal } from 'obsidian'; import type { TAbstractFile } from './TAbstractFile.mjs'; import { Events } from './Events.mjs'; import { TFile } from './TFile.mjs'; import { TFolder } from './TFolder.mjs'; export declare class Vault extends Events { adapter: DataAdapterOriginal; /** * Backs `getConfig__` / `setConfig__`. Only `attachmentFolderPath` carries a modeled default — * every other key reads as `undefined` until a test sets it. */ config__: Record; configDir: string; fileMap__: Record; private fileMapLowerCase; protected constructor(adapter: DataAdapterOriginal); static create2__(adapter: DataAdapterOriginal): Vault; static fromOriginalType2__(value: VaultOriginal): Vault; static recurseChildren(folder: TFolder, callback: (f: TAbstractFile) => unknown): void; append(file: TFile, data: string, options?: DataWriteOptionsOriginal): Promise; appendBinary(file: TFile, data: ArrayBuffer, options?: DataWriteOptionsOriginal): Promise; asOriginalType2__(): VaultOriginal; cachedRead(file: TFile): Promise; constructor2__(_adapter: DataAdapterOriginal): void; copy(file: TFile, newPath: string): Promise; create(path: string, data: string, options?: DataWriteOptionsOriginal): Promise; createBinary(path: string, data: ArrayBuffer, options?: DataWriteOptionsOriginal): Promise; createFolder(path: string): Promise; createFolderSync__(path: string): TFolder; createSync__(path: string, content: string): TFile; delete(file: TAbstractFile, _force?: boolean): Promise; deleteVaultAbstractFile__(path: string): void; getAbstractFileByPath(path: string): null | TAbstractFile; getAbstractFileByPathInsensitive__(path: string): null | TAbstractFile; getAllFolders(_includeRoot?: boolean): TFolder[]; getAllLoadedFiles(): TAbstractFile[]; /** * Obsidian's de-duplicator: the plain name first, then ` 1`, ` 2`, … until one is free. * * @param basePath - The desired path without extension. * @param extension - The file extension without the leading dot. * @returns A path that no existing file occupies. */ getAvailablePath__(basePath: string, extension: string): string; /** * Resolves where an attachment of `file` goes, per the `attachmentFolderPath` setting, creating the * target folder when it is missing. Confirmed against a real Obsidian 1.13.4: for a note * `Docs/api/get.md` the setting `/` yields `img.png`, `./` yields `Docs/api/img.png`, `./assets` * yields `Docs/api/assets/img.png` (creating `Docs/api/assets`), and `Files` yields `Files/img.png` * (creating `Files`). A `null` file resolves as a root-level note does. * * @param fileName - The attachment base name without extension. * @param extension - The attachment extension without the leading dot. * @param file - The note the attachment belongs to, or `null`. * @returns A {@link Promise} that resolves to the available attachment path. */ getAvailablePathForAttachments__(fileName: string, extension: string, file: null | TFile): Promise; /** * Reads a vault setting. * * @param key - The setting key. * @returns The setting value, or `undefined` when the key was never set. */ getConfig__(key: string): unknown; getFileByPath(path: string): null | TFile; getFiles(): TFile[]; getFolderByPath(path: string): null | TFolder; getMarkdownFiles(): TFile[]; getName(): string; getResourcePath(_file: TFile): string; getRoot(): TFolder; modify(file: TFile, data: string, options?: DataWriteOptionsOriginal): Promise; modifyBinary(file: TFile, data: ArrayBuffer, options?: DataWriteOptionsOriginal): Promise; process(file: TFile, $function: (data: string) => string, options?: DataWriteOptionsOriginal): Promise; read(file: TFile): Promise; readBinary(file: TFile): Promise; readSync__(file: TFile): string; reconcile__(): void; rename(file: TAbstractFile, newPath: string): Promise; /** * Writes a vault setting. * * @param key - The setting key. * @param value - The setting value. */ setConfig__(key: string, value: unknown): void; setVaultAbstractFile__(path: string, file: TAbstractFile): void; trash(file: TAbstractFile, _system: boolean): Promise; private registerFolderTree; }