@inrupt/solid-client / thing/set

Module: thing/set

Type aliases

SetOfType

Ƭ SetOfType<Type>: <T>(thing: T, property: Url | UrlString, value: Type) => T

Type parameters

Name

Type

Type declaration

▸ <T>(thing, property, value): T

Create a new Thing with existing values replaced by the given value for the given Property.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Thing

Parameters

Name

Type

Description

thing

T

Thing to set a value on.

property

Url | UrlString

Property for which to set the given value.

value

Type

Value to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.

Functions

setBoolean

Const setBoolean<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given boolean for the given Property.

To preserve existing values, see addBoolean.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set a boolean value on.

property

string | Url

Property for which to set the given boolean value.

value

boolean

Boolean to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setDate

Const setDate<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given date for the given Property.

To preserve existing values, see addDate.

The original thing is not modified; this function returns a cloned Thing with updated values.

since 1.10.0

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set an date value on.

property

string | Url

Property for which to set the given date value.

value

Date

Date to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setDatetime

Const setDatetime<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given datetime for the given Property.

To preserve existing values, see addDatetime.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set an datetime value on.

property

string | Url

Property for which to set the given datetime value.

value

Date

Datetime to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setDecimal

Const setDecimal<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given decimal for the given Property.

To preserve existing values, see addDecimal.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set a decimal value on.

property

string | Url

Property for which to set the given decimal value.

value

number

Decimal to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setInteger

Const setInteger<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given integer for the given Property.

To preserve existing values, see addInteger.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set an integer value on.

property

string | Url

Property for which to set the given integer value.

value

number

Integer to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setStringEnglish

setStringEnglish<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given English string for the given Property.

To preserve existing values, see addStringEnglish.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set a localised string value on.

property

Url | UrlString

Property for which to set the given localised string value.

value

string

Localised string to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setStringNoLocale

Const setStringNoLocale<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given unlocalised string for the given Property.

To preserve existing values, see addStringNoLocale.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set an unlocalised string value on.

property

string | Url

Property for which to set the given unlocalised string value.

value

string

Unlocalised string to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setStringWithLocale

setStringWithLocale<T>(thing, property, value, locale): T

Create a new Thing with existing values replaced by the given localised string for the given Property.

To preserve existing values, see addStringWithLocale.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set a localised string value on.

property

Url | UrlString

Property for which to set the given localised string value.

value

string

Localised string to set on thing for the given property.

locale

string

Locale of the added string.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setTime

Const setTime<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given time for the given Property.

To preserve existing values, see addTime.

The original thing is not modified; this function returns a cloned Thing with updated values.

since 1.10.0

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set an time value on.

property

string | Url

Property for which to set the given time value.

value

Time

time to set on thing for the given property.

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.


setUrl

Const setUrl<T>(thing, property, value): T

Create a new Thing with existing values replaced by the given URL for the given Property.

To preserve existing values, see addUrl.

The original thing is not modified; this function returns a cloned Thing with updated values.

Type parameters

Name

Type

T

extends Readonly<Object>

Parameters

Name

Type

Description

thing

T

Thing to set a URL value on.

property

string | Url

Property for which to set the given URL value.

value

string | Readonly<Object> | Url

-

Returns

T

A new Thing equal to the input Thing with existing values replaced by the given value for the given Property.