Skip to main content

Interface: IResult<T, E>

Type parameters

NameDescription
T-
E-

Methods

[iterator]

[iterator](): Generator<T, any, unknown>

Returns

Generator<T, any, unknown>

Defined in

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


and

and<U>(result): Result<U, E>

Type parameters

Name
U

Parameters

NameTypeDescription
resultResult<U, E>

Returns

Result<U, E>

Defined in

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


andThen

andThen<U>(cb): Result<U, E>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => Result<U, E>

Returns

Result<U, E>

Defined in

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


contains

contains(value): boolean

Parameters

NameTypeDescription
valueT

Returns

boolean

Defined in

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


containsErr

containsErr(error): boolean

Parameters

NameTypeDescription
errorE

Returns

boolean

Defined in

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


eq

eq(other): boolean

Parameters

NameTypeDescription
otherResult<T, E>

Returns

boolean

Defined in

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


err

err(): Option<E>

Returns

Option<E>

Defined in

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


expect

expect(message): T

Parameters

NameTypeDescription
messagestring

Returns

T

Defined in

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


expectErr

expectErr(message): E

Parameters

NameTypeDescription
messagestring

Returns

E

Defined in

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


flatten

flatten<IT>(this): Result<IT, E>

Type parameters

Name
IT

Parameters

NameType
thisResult<Result<IT, E>, E>

Returns

Result<IT, E>

Defined in

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


inspect

inspect(cb): IResult<T, E>

Parameters

NameTypeDescription
cb(value: T) => void

Returns

IResult<T, E>

Defined in

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


inspectAsync

inspectAsync(cb): Promise<IResult<T, E>>

Parameters

NameTypeDescription
cb(value: T) => Awaitable<void>

Returns

Promise<IResult<T, E>>

Defined in

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


inspectErr

inspectErr(cb): IResult<T, E>

Parameters

NameTypeDescription
cb(error: E) => void

Returns

IResult<T, E>

Defined in

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


inspectErrAsync

inspectErrAsync(cb): Promise<IResult<T, E>>

Parameters

NameTypeDescription
cb(error: E) => Awaitable<void>

Returns

Promise<IResult<T, E>>

Defined in

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


intoOkOrErr

intoOkOrErr(): T | E

Returns

T | E

Defined in

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


isErr

isErr(): this is Err<E>

Returns

this is Err<E>

Defined in

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


isErrAnd

isErrAnd<R>(cb): this is Err<E> & R

Type parameters

NameType
Rextends boolean

Parameters

NameTypeDescription
cb(error: E) => R

Returns

this is Err<E> & R

Defined in

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


isOk

isOk(): this is Ok<T>

Returns

this is Ok<T>

Defined in

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


isOkAnd

isOkAnd<R>(cb): this is Ok<T> & R

Type parameters

NameType
Rextends boolean

Parameters

NameType
cb(value: T) => R

Returns

this is Ok<T> & R

Defined in

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


iter

iter(): Generator<T, any, unknown>

Returns

Generator<T, any, unknown>

Defined in

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


map

map<U>(cb): Result<U, E>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => U

Returns

Result<U, E>

Defined in

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


mapErr

mapErr<F>(cb): Result<T, F>

Type parameters

Name
F

Parameters

NameTypeDescription
cb(error: E) => F

Returns

Result<T, F>

Defined in

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


mapErrInto

mapErrInto<IT, IE>(cb): Result<T | IT, IE>

Type parameters

Name
IT
IE

Parameters

NameTypeDescription
cb(error: E) => Result<IT, IE>

Returns

Result<T | IT, IE>

Defined in

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


mapInto

mapInto<IT, IE>(cb): Result<IT, E | IE>

Type parameters

Name
IT
IE

Parameters

NameTypeDescription
cb(value: T) => Result<IT, IE>

Returns

Result<IT, E | IE>

Defined in

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


mapOr

mapOr<U>(defaultValue, cb): U

Type parameters

Name
U

Parameters

NameTypeDescription
defaultValueU
cb(value: T) => U

Returns

U

Defined in

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


mapOrElse

mapOrElse<U>(op, cb): U

Type parameters

Name
U

Parameters

NameTypeDescription
op(error: E) => U
cb(value: T) => U

Returns

U

Defined in

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


match

match<OkValue, ErrValue>(branches): OkValue | ErrValue

Type parameters

Name
OkValue
ErrValue

Parameters

NameTypeDescription
branchesObject
branches.err(error: E) => ErrValue-
branches.ok(value: T) => OkValue-

Returns

OkValue | ErrValue

Defined in

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


ne

ne(other): boolean

Parameters

NameTypeDescription
otherResult<T, E>

Returns

boolean

Defined in

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


ok

ok(): Option<T>

Returns

Option<T>

Defined in

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


or

or<F>(result): Result<T, F>

Type parameters

Name
F

Parameters

NameTypeDescription
resultResult<T, F>

Returns

Result<T, F>

Defined in

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


orElse

orElse<F>(cb): Result<T, F>

Type parameters

Name
F

Parameters

NameTypeDescription
cb(error: E) => Result<T, F>

Returns

Result<T, F>

Defined in

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


transpose

transpose<IT>(this): Option<Result<IT, E>>

Type parameters

Name
IT

Parameters

NameType
thisResult<Option<IT>, E>

Returns

Option<Result<IT, E>>

Defined in

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


unwrap

unwrap(): T

Returns

T

Defined in

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


unwrapErr

unwrapErr(): E

Returns

E

Defined in

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


unwrapOr

unwrapOr<V>(defaultValue): T | V

Type parameters

Name
V

Parameters

NameTypeDescription
defaultValueV

Returns

T | V

Defined in

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


unwrapOrElse

unwrapOrElse<V>(op): T | V

Type parameters

Name
V

Parameters

NameTypeDescription
op(error: E) => V

Returns

T | V

Defined in

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