Skip to content

createTFileInstance

Unofficial

Creates and properly initializes the instance of obsidian#TFile even the underlying file does not exist. This doesn’t create the missing file on the file system.

Import:

import { createTFileInstance } from '@obsidian-typings/obsidian-public-latest/implementations';

Signature:

function createTFileInstance(app: App, path: string): TFile

Parameters:

ParameterTypeDescription
appAppThe Obsidian app instance.
pathstringThe path to the file.

Returns: TFile — The created obsidian#TFile instance.