SDK
API Documentation
core
variables
Result

Variable: Result

Result: object

Type declaration

Err()

Err: <T, E>(error?) => Result<T, E>

Type Parameters

Type ParameterDescription
TThe type of the value to not contain.
EThe type of the error to contain.

Parameters

ParameterType
error?E

Returns

Result<T, E>

Result

Ok()

Ok: <T, E>(value?) => Result<T, E>

Type Parameters

Type ParameterDescription
TThe type of the value to contain.
EThe type of the error to not contain.

Parameters

ParameterType
value?T

Returns

Result<T, E>

Result

isErr()

isErr: <T, E>(result) => result is Object

Type Parameters

Type Parameter
T
E

Parameters

ParameterType
resultResult<T, E>

Returns

result is Object

true if the Result is an error, otherwise false.

isOk()

isOk: <T, E>(result) => result is Object

Type Parameters

Type Parameter
T
E

Parameters

ParameterType
resultResult<T, E>

Returns

result is Object

true if the Result is OK, otherwise false.

isUnknownError()

isUnknownError: <T, E>(result) => result is Object

Type Parameters

Type Parameter
T
E

Parameters

ParameterType
resultResult<T, E>

Returns

result is Object

true if the Result is an unknwon error, otherwise false.

Defined in

lib/types.ts:77 (opens in a new tab)