/** * @file * * Mock of Obsidian's `TExternalFile`, a file outside the vault that the vault API can still open. */ import type { TExternalFile as TExternalFileOriginal } from 'obsidian'; import type { Vault } from './Vault.cjs'; import { TFile } from './TFile.cjs'; /** * Mock of Obsidian's `TExternalFile`: a `TFile` whose `path` is its filesystem path behind a `file:` prefix, as * Obsidian 1.14.4's `setPath` forms it. The mock does not watch the file and keeps no list of its users. */ export declare class TExternalFile extends TFile { /** * Creates an external file for a filesystem path. * * @param vault - The vault the file is opened through. * @param realPath - The file's physical path in the filesystem. */ protected constructor(vault: Vault, realPath: string); /** * Mock-only factory: creates an external file, spyable via `vi.spyOn(TExternalFile, 'create2__')`. Obsidian creates * these itself when a file outside the vault is opened, so a test builds one here instead. It does not add the * file to the vault. * * @param vault - The vault the file is opened through. * @param realPath - The file's physical path in the filesystem. * @returns The new external file. */ static create2__(vault: Vault, realPath: string): TExternalFile; /** * Mock-only: views a value typed as Obsidian's `TExternalFile` as this mock. * * @param value - The value typed as the original `TExternalFile`. * @returns The same object, typed as the mock. */ static fromOriginalType3__(value: TExternalFileOriginal): TExternalFile; /** * Mock-only: views this mock as Obsidian's `TExternalFile` type. * * @returns The same object, typed as the original `TExternalFile`. */ asOriginalType3__(): TExternalFileOriginal; /** * Mock-only construction hook, called at the end of the constructor; a no-op meant for * `vi.spyOn(TExternalFile.prototype, 'constructor3__')`. * * @param _vault - The vault the file was created with. * @param _realPath - The filesystem path the file was created with. */ constructor3__(_vault: Vault, _realPath: string): void; /** * Gets the file's physical path in the filesystem. * * @returns The `path` with its `file:` prefix removed, as Obsidian's own `path.substring(5)` does. */ getRealPath(): string; }