Skip to main content

Interface: IOption<T>

Type parameters

Name
T

Methods

[iterator]

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

Returns

Generator<T, any, unknown>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:695


and

and<U>(option): Option<U>

Type parameters

Name
U

Parameters

NameTypeDescription
optionOption<U>

Returns

Option<U>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:379


andThen

andThen<U>(cb): Option<U>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => Option<U>

Returns

Option<U>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:399


contains

contains(value): boolean

Parameters

NameTypeDescription
valueT

Returns

boolean

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:526


eq

eq(other): boolean

Parameters

NameTypeDescription
otherOption<T>

Returns

boolean

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:637


expect

expect(message): T

Parameters

NameTypeDescription
messagestring

Returns

T

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:85


filter

filter(predicate): Option<T>

Parameters

NameTypeDescription
predicate(value: T) => boolean

Returns

Option<T>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:503


flatten

flatten<IT>(this): Option<IT>

Type parameters

Name
IT

Parameters

NameType
thisOption<Option<IT>>

Returns

Option<IT>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:630


inspect

inspect(cb): IOption<T>

Parameters

NameTypeDescription
cb(value: T) => void

Returns

IOption<T>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:263


inspectAsync

inspectAsync(cb): Promise<IOption<T>>

Parameters

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

Returns

Promise<IOption<T>>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:282


isNone

isNone(): this is None

Returns

this is None

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:63


isSome

isSome(): this is Some<T>

Returns

this is Some<T>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:23


isSomeAnd

isSomeAnd(cb): boolean

Parameters

NameTypeDescription
cb(value: T) => boolean

Returns

boolean

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:46


iter

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

Returns

Generator<T, any, unknown>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:347


map

map<U>(cb): Option<U>

Type parameters

Name
U

Parameters

NameTypeDescription
cb(value: T) => U

Returns

Option<U>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:157


mapInto

mapInto<Inner>(cb): Option<Inner>

Type parameters

Name
Inner

Parameters

NameTypeDescription
cb(value: T) => Option<Inner>

Returns

Option<Inner>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:180


mapNoneInto

mapNoneInto<Inner>(cb): Option<T | Inner>

Type parameters

Name
Inner

Parameters

NameTypeDescription
cb() => Option<Inner>

Returns

Option<T | Inner>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:244


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/Option/IOption.d.ts:202


mapOrElse

mapOrElse<U>(defaultValue, cb): U

Type parameters

Name
U

Parameters

NameTypeDescription
defaultValue() => U
cb(value: T) => U

Returns

U

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:221


match

match<SomeValue, NoneValue>(branches): SomeValue | NoneValue

Type parameters

Name
SomeValue
NoneValue

Parameters

NameTypeDescription
branchesObject
branches.none() => NoneValue-
branches.some(value: T) => SomeValue-

Returns

SomeValue | NoneValue

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:666


ne

ne(other): boolean

Parameters

NameTypeDescription
otherOption<T>

Returns

boolean

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:644


okOr

okOr<E>(err): Result<T, E>

Type parameters

Name
E

Parameters

NameTypeDescription
errE

Returns

Result<T, E>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:303


okOrElse

okOrElse<E>(cb): Result<T, E>

Type parameters

Name
E

Parameters

NameTypeDescription
cb() => E

Returns

Result<T, E>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:321


or

or(option): Option<T>

Parameters

NameTypeDescription
optionOption<T>

Returns

Option<T>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:431


orElse

orElse(cb): Option<T>

Parameters

NameTypeDescription
cb() => Option<T>

Returns

Option<T>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:450


transpose

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

Type parameters

Name
IT
E

Parameters

NameType
thisOption<Result<IT, E>>

Returns

Result<Option<IT>, E>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:608


unwrap

unwrap(): T

Returns

T

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:109


unwrapOr

unwrapOr<V>(defaultValue): T | V

Type parameters

Name
V

Parameters

NameType
defaultValueV

Returns

T | V

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:127


unwrapOrElse

unwrapOrElse<V>(cb): T | V

Type parameters

Name
V

Parameters

NameType
cb() => V

Returns

T | V

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:142


unzip

unzip<Inner, U>(this): [Option<Inner>, Option<U>]

Type parameters

Name
Inner
U

Parameters

NameType
thisOption<readonly [Inner, U]>

Returns

[Option<Inner>, Option<U>]

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:593


xor

xor(option): Option<T>

Parameters

NameTypeDescription
optionOption<T>

Returns

Option<T>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:482


zip

zip<U>(other): Option<[T, U]>

Type parameters

Name
U

Parameters

NameTypeDescription
otherOption<U>

Returns

Option<[T, U]>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:545


zipWith

zipWith<U, R>(other, f): Option<R>

Type parameters

Name
U
R

Parameters

NameTypeDescription
otherOption<U>
f(s: T, o: U) => R

Returns

Option<R>

Defined in

node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:574