@inrupt/solid-client / thing/set

Module: thing/set

Type aliases

SetOfType

Ƭ SetOfType<Type>: <T>(thing: T, property: Url | UrlString, value: Type) => 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.

param Thing to set a value on.

param Property for which to set the given value.

param Value to set on thing for the given property.

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

Type parameters

Name

Type

Type declaration

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

Type parameters

Name

Type

T

T: Thing

Parameters

Name

Type

thing

T

property

Url | UrlString

value

Type

Returns

T

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

T: 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.


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

T: 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

T: 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

T: 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.


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

T: 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

T: 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.


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

T: 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.