@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.

Defined in#

src/thing/set.ts:333

Functions#

setBoolean#

setBoolean<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

boolean

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.

Defined in#

src/thing/set.ts:333


setDate#

setDate<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

Date

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.

Defined in#

src/thing/set.ts:333


setDatetime#

setDatetime<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

Date

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.

Defined in#

src/thing/set.ts:333


setDecimal#

setDecimal<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

number

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.

Defined in#

src/thing/set.ts:333


setInteger#

setInteger<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

number

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.

Defined in#

src/thing/set.ts:333


setIri#

setIri<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

string | Url | Readonly<{}>

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.

Defined in#

src/thing/set.ts:333


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.

Since

1.13.0

Type parameters#

Name

Type

T

extends Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a localised string value on.

property

string | Url

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.

Defined in#

src/thing/set.ts:195


setStringNoLocale#

setStringNoLocale<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

string

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.

Defined in#

src/thing/set.ts:333


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<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a localised string value on.

property

string | Url

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.

Defined in#

src/thing/set.ts:216


setTime#

setTime<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

Time

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.

Defined in#

src/thing/set.ts:333


setUrl#

setUrl<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 Readonly<{}>

Parameters#

Name

Type

Description

thing

T

Thing to set a value on.

property

string | Url

Property for which to set the given value.

value

string | Url | Readonly<{}>

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.

Defined in#

src/thing/set.ts:333