Skip to content

TAbstractFile

Official

This can be either a obsidian#TFile or a obsidian#TFolder.

Import:

import { TAbstractFile } from 'obsidian';

Signature:

export class TAbstractFile

Constructor

new TAbstractFile(vault: Vault, path: string)

Constructor.

To extract the constructor type, use ExtractConstructor<TAbstractFile>.

Properties

PropertyTypeDescription
deletedbooleanWhether the file or folder is being deleted.
namestringThe name of the file.
parentnull | TFolderThe parent folder of the file.
pathstringThe path of the file.
vaultVaultThe vault.

Methods

MethodReturnsDescription
getNewPathAfterRename(newName)stringGets the path after renaming the file or folder.
setPath(path)voidSets the path of the file or folder.

Links to this page: