Skip to main content

Namespace: Result

Type Aliases

Err

Ƭ Err<E>: Err

Type parameters

Name
E

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:31


Ok

Ƭ Ok<T>: Ok

Type parameters

Name
T

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:32


Resolvable

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

Type parameters

Name
T
E

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:14


UnwrapErr

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

Type parameters

NameType
Textends Result<any, any>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:34


UnwrapOk

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

Type parameters

NameType
Textends Result<any, any>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:33

Functions

err

err(): Err<unknown>

Returns

Err<unknown>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:29

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

Type parameters

Name
E

Parameters

NameType
xE

Returns

Err<E>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:29


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

node_modules/@sapphire/result/dist/lib/Result.d.ts:22


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

node_modules/@sapphire/result/dist/lib/Result.d.ts:28


is

is<T, E>(value): true

Type parameters

Name
T
E

Parameters

NameType
valueResult<T, E>

Returns

true

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:15

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

Parameters

NameType
valueany

Returns

value is Result<unknown, unknown>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:16


ok

ok(): Ok<unknown>

Returns

Ok<unknown>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:30

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

Type parameters

Name
T

Parameters

NameType
xT

Returns

Ok<T>

Defined in

node_modules/@sapphire/result/dist/lib/Result.d.ts:30