Skip to main content

Namespace: Result

result/src.Result

Type Aliases

Err

Ƭ Err<E>: Err

Type parameters

Name
E

Defined in

projects/utilities/packages/result/src/lib/Result.ts:60


Ok

Ƭ Ok<T>: Ok

Type parameters

Name
T

Defined in

projects/utilities/packages/result/src/lib/Result.ts:61


Resolvable

Ƭ Resolvable<T, E>: T | Result<T, E>

Type parameters

Name
T
E

Defined in

projects/utilities/packages/result/src/lib/Result.ts:17


UnwrapErr

Ƭ UnwrapErr<T>: T extends Err<infer S> ? S : never

Type parameters

NameType
Textends Result<any, any>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:64


UnwrapOk

Ƭ UnwrapOk<T>: T extends Ok<infer S> ? S : never

Type parameters

NameType
Textends Result<any, any>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:63

Functions

err

err(): Err<unknown>

Returns

Err<unknown>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:57

err<E>(x): Err<E>

Type parameters

Name
E

Parameters

NameType
xE

Returns

Err<E>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:57


from

from<T, E>(op): Result<T, E>

Type parameters

NameTypeDescription
TT-
Eunknown-

Parameters

NameType
opResolvable<T, E> | () => Resolvable<T, E>

Returns

Result<T, E>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:34


fromAsync

fromAsync<T, E>(op): Promise<Result<T, E>>

Type parameters

NameTypeDescription
TT-
Eunknown-

Parameters

NameType
opAwaitable<Resolvable<T, E>> | () => Awaitable<Resolvable<T, E>>

Returns

Promise<Result<T, E>>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:49


is

is<T, E>(value): true

Type parameters

Name
T
E

Parameters

NameType
valueResult<T, E>

Returns

true

Defined in

projects/utilities/packages/result/src/lib/Result.ts:23

is(value): value is Result<unknown, unknown>

Parameters

NameType
valueany

Returns

value is Result<unknown, unknown>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:24


ok

ok(): Ok<unknown>

Returns

Ok<unknown>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:58

ok<T>(x): Ok<T>

Type parameters

Name
T

Parameters

NameType
xT

Returns

Ok<T>

Defined in

projects/utilities/packages/result/src/lib/Result.ts:58