Skip to content

LinkValue

Official

Value wrapping an internal wikilink.

Import:

import { LinkValue } from 'obsidian';

Signature:

export class LinkValue extends StringValue

Extends: StringValue

Constructor

new LinkValue(app: App, value: string, sourcePath: string, display?: string | null | undefined)

Constructor.

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

Properties

PropertyTypeDescription
appAppReference to the app instance.
displaynull | StringValueThe display text of the link, or null if none.
sourcePathstringThe source path the link is resolved relative to.
typestring
(Inherited from StringValue)

Methods

MethodReturnsDescription
parseFromString(app, input, sourcePath)LinkValue | nullCreate a new LinkValue from wikilink syntax.
resolve()null | TFileResolves the link to its target file.

Links to this page: