shared/result
Interfaces
Section titled “Interfaces”Defined in: app/src/shared/result.ts:8
A failed Result.
Type Parameters
Section titled “Type Parameters”E
Properties
Section titled “Properties”
readonlyerror:E
Defined in: app/src/shared/result.ts:10
readonlyok:false
Defined in: app/src/shared/result.ts:9
Defined in: app/src/shared/result.ts:2
A successful Result.
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”
readonlyok:true
Defined in: app/src/shared/result.ts:3
readonlyvalue:T
Defined in: app/src/shared/result.ts:4
Type Aliases
Section titled “Type Aliases”Result
Section titled “Result”Defined in: app/src/shared/result.ts:19
The outcome of an operation that can fail in an expected way.
Expected failures (invalid input, a missing file) are returned as values; exceptions are reserved for programming errors.
Type Parameters
Section titled “Type Parameters”T
E = Error
Functions
Section titled “Functions”err<
E>(error):Err<E>
Defined in: app/src/shared/result.ts:33
Creates a failed result.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”E
The reason for the failure.
Returns
Section titled “Returns”Err<E>
ok<
T>(value):Ok<T>
Defined in: app/src/shared/result.ts:25
Creates a successful result.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”T
The value of the result.
Returns
Section titled “Returns”Ok<T>