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:707
and
▸ and<U
>(option
): Option
<U
>
Type parameters
Name |
---|
U |
Parameters
Name | Type | Description |
---|---|---|
option | Option <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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
value | T |
Returns
boolean
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:526
eq
▸ eq(other
): boolean
Parameters
Name | Type | Description |
---|---|---|
other | Option <T > |
Returns
boolean
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:649
expect
▸ expect(message
): T
Parameters
Name | Type | Description |
---|---|---|
message | string |
Returns
T
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:85
filter
▸ filter(predicate
): Option
<T
>
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type |
---|---|
this | Option <Option <IT >> |
Returns
Option
<IT
>
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:630
inspect
▸ inspect(cb
): IOption
<T
>
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
cb | (value : T ) => Awaitable <void > |
Returns
Promise
<IOption
<T
>>
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:282
intoPromise
▸ intoPromise(): Promise
<Option
<Awaited
<T
>>>
Returns
Promise
<Option
<Awaited
<T
>>>
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:642
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
defaultValue | U | |
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
branches | Object | |
branches.none | () => NoneValue | - |
branches.some | (value : T ) => SomeValue | - |
Returns
SomeValue
| NoneValue
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:678
ne
▸ ne(other
): boolean
Parameters
Name | Type | Description |
---|---|---|
other | Option <T > |
Returns
boolean
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:656
okOr
▸ okOr<E
>(err
): Result
<T
, E
>
Type parameters
Name |
---|
E |
Parameters
Name | Type | Description |
---|---|---|
err | E |
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
Name | Type | Description |
---|---|---|
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
Name | Type | Description |
---|---|---|
option | Option <T > |
Returns
Option
<T
>
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:431
orElse
▸ orElse(cb
): Option
<T
>
Parameters
Name | Type | Description |
---|---|---|
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
Name | Type |
---|---|
this | Option <Result <IT , E >> |
Returns
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
Name | Type |
---|---|
defaultValue | V |
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
Name | Type |
---|---|
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
Name | Type |
---|---|
this | Option <readonly [Inner , U ]> |
Returns
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:593
xor
▸ xor(option
): Option
<T
>
Parameters
Name | Type | Description |
---|---|---|
option | Option <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
Name | Type | Description |
---|---|---|
other | Option <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
Name | Type | Description |
---|---|---|
other | Option <U > | |
f | (s : T , o : U ) => R |
Returns
Option
<R
>
Defined in
node_modules/@sapphire/result/dist/lib/Option/IOption.d.ts:574