Skip to content

FileValue

Official

Value wrapping a file in Obsidian.

Import:

import { FileValue } from 'obsidian';

Signature:

export class FileValue extends NotNullValue

Extends: NotNullValue

Constructor

new FileValue(app: App, file: TFile)

Constructor.

To get the constructor instance, use getFileValueConstructor from obsidian-typings/implementations.

Properties

PropertyTypeDescription
appAppReference to the app instance.
fileTFileThe wrapped file.

Methods

MethodReturnsDescription
getBacklinks()ListValueGets the backlinks to the file as a list of LinkValues.
getEmbeds()ListValueGets the embeds in the file as a list of LinkValues.
getLinks()ListValueGets the outgoing links in the file as a list of LinkValues.
getProps()ObjectValueGets the file's frontmatter properties.
getTags()ListValueGets the tags in the file as a list of TagValues.
isTruthy()booleanReturns a boolean indicating whether this obsidian#FileValue is truthy.
toString()stringString representation of this obsidian#FileValue.

Links to this page: