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

Property Type Description
deleted boolean Whether the file or folder is being deleted.
name string The name of the file.
parent null | TFolder The parent folder of the file.
path string The path of the file.
vault Vault The vault.

Methods

Method Returns Description
getNewPathAfterRename(newName) string Gets the path after renaming the file or folder.
setPath(path) void Sets the path of the file or folder.

Links to this page: