Skip to content

Duration

Duration type that implements ref.Val and supports add, compare, negate, and subtract operators. This type is also a receiver which means it can participate in dispatch to receiver functions.

new Duration(inner): Duration

bigint

Duration

add(other): Val

Add returns a combination of the current value and other value.

Val

Val

Adder.add


compare(other): Val

Compare this value to the input other value.

Val

Val

Comparer.compare


convertToNative(typeDesc?): unknown

ConvertToNative converts the Value to a native TypeScript value according to the provided type description, or throws if the conversion is not feasible.

unknown

unknown

Val.convertToNative


convertToType(typeValue): Val

ConvertToType supports type conversions between CEL value types supported by the expression language.

RefType

Val

Val.convertToType


equal(other): Val

Equal returns true if the other value has the same type and content as the implementing value.

Val

Val

Val.equal


format(sb): void

Format appends the human-readable representation.

string[]

void


isZeroValue(): boolean

IsZeroValue returns true if the duration value is zero

boolean


negate(): Val

Negate returns the complement of the current value.

Val

Negater.negate


receive(functionName, _overload, args): Val

Receive accepts a function name, overload id, and arguments and returns a value.

string

string

Val[]

Val

Receiver.receive


subtract(subtrahend): Val

Subtract returns the result of subtracting the input from the current value.

Val

Val

Subtractor.subtract


type(): RefType

Type returns the TypeValue of the value.

RefType

Val.type


value(): bigint

Value returns the raw value of the instance which may not be directly compatible with the expression language types.

bigint

Val.value