Skip to content

PrimitiveValue<T>

Official

Base type for Values which wrap a single primitive.

Import:

import { PrimitiveValue } from 'obsidian';

Signature:

export class PrimitiveValue<T> extends NotNullValue

Extends: NotNullValue

Constructor

new PrimitiveValue(value: T)

Constructor.

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

Properties

PropertyTypeDescription
dataTThe wrapped primitive value.
iconstringThe lucide icon name representing this value's type.
(Inherited from NotNullValue)
typestring
(Inherited from NotNullValue)

Methods

MethodReturnsDescription
equals(a, b)boolean
(Inherited from NotNullValue)
equals(other)booleanReturns a boolean indicating whether this Value is equal to the provided Value.
(Inherited from NotNullValue)
isTruthy()booleanReturns a boolean indicating whether this obsidian#PrimitiveValue is truthy.
keys()string[]Returns the property keys accessible on this value via Value.objectAccess.
(Inherited from NotNullValue)
looseEquals(a, b)boolean
(Inherited from NotNullValue)
looseEquals(other)booleanReturns a boolean indicating whether this Value is loosely equal to the provided Value.
(Inherited from NotNullValue)
objectAccess(key)null | ValueAccesses a named sub-property of this value.
(Inherited from NotNullValue)
renderTo(el, ctx)voidRender this value into the provided HTMLElement.
(Inherited from NotNullValue)
toString()stringGet the string representation of this obsidian#PrimitiveValue.

Links to this page: