Skip to content

TFolder

Extends

Constructors

new TFolder()

new TFolder(): TFolder

Returns

TFolder

Inherited from

TAbstractFile.constructor

Properties

children

children: TAbstractFile[]


deleted

deleted: boolean

Whether the file or folder is being deleted

Inherited from

TAbstractFile.deleted


name

name: string

Inherited from

TAbstractFile.name


parent

parent: null | TFolder

Inherited from

TAbstractFile.parent


path

path: string

Inherited from

TAbstractFile.path


vault

vault: Vault

Inherited from

TAbstractFile.vault

Methods

getFileCount()

getFileCount(): number

Gets the count of files in the folder.

Returns

number

The number of files in the folder.


getFolderCount()

getFolderCount(): number

Gets the count of subfolders in the folder.

Returns

number

The number of subfolders in the folder.


getNewPathAfterRename()

getNewPathAfterRename(newName): string

Gets the path after renaming the file or folder.

Parameters

newName: string

The new name of the file or folder.

Returns

string

The new path of the file or folder.

Inherited from

TAbstractFile.getNewPathAfterRename


getParentPrefix()

getParentPrefix(): string

Returns the prefix of the folder path. If the folder is in the root ’/’, it returns an empty string. If the folder is ‘a/b/c’, it returns ‘a/b/’.

Returns

string

The prefix of the folder.


isRoot()

isRoot(): boolean

Returns

boolean