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:44


Ok

Ƭ Ok<T>: Ok

Type parameters

Name
T

Defined in

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


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:47


UnwrapErrArray

Ƭ UnwrapErrArray<T>: { -readonly [P in keyof T]: UnwrapErr<T[P]> }

Type parameters

NameType
Textends readonly Result<any, any>[] | []

Defined in

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


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:46


UnwrapOkArray

Ƭ UnwrapOkArray<T>: { -readonly [P in keyof T]: UnwrapOk<T[P]> }

Type parameters

NameType
Textends readonly Result<any, any>[] | []

Defined in

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

Functions

all

all<T>(results): Result<UnwrapOkArray<T>, UnwrapErrArray<T>[number]>

Type parameters

NameType
Textends readonly Result<any, any>[]

Parameters

NameTypeDescription
results[...T[]]

Returns

Result<UnwrapOkArray<T>, UnwrapErrArray<T>[number]>

Defined in

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


any

any<T>(results): Result<UnwrapOkArray<T>[number], UnwrapErrArray<T>>

Type parameters

NameType
Textends readonly Result<any, any>[]

Parameters

NameTypeDescription
results[...T[]]

Returns

Result<UnwrapOkArray<T>[number], UnwrapErrArray<T>>

Defined in

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


err

err(): Err<unknown>

Returns

Err<unknown>

Defined in

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

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:42


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:43

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:43