Skip to main content

Namespace: Option

Type Aliases

None

Ƭ None: None

Defined in

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


Resolvable

Ƭ Resolvable<T>: T | null | undefined | Option<T>

Type parameters

Name
T

Defined in

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


Some

Ƭ Some<T>: Some

Type parameters

Name
T

Defined in

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


UnwrapSome

Ƭ UnwrapSome<T>: T extends Some<infer S> ? S : never

Type parameters

NameType
Textends Option<any>

Defined in

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


UnwrapSomeArray

Ƭ UnwrapSomeArray<T>: { -readonly [P in keyof T]: UnwrapSome<T[P]> }

Type parameters

NameType
Textends readonly Option<any>[] | []

Defined in

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

Variables

none

Const none: None

Defined in

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

Functions

all

all<T>(options): Option<UnwrapSomeArray<T>>

Type parameters

NameType
Textends readonly Option<any>[]

Parameters

NameTypeDescription
options[...T[]]

Returns

Option<UnwrapSomeArray<T>>

Defined in

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


any

any<T>(options): Option<UnwrapSomeArray<T>[number]>

Type parameters

NameType
Textends readonly Option<any>[]

Parameters

NameTypeDescription
options[...T[]]

Returns

Option<UnwrapSomeArray<T>[number]>

Defined in

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


from

from<T>(op): Option<T>

Type parameters

NameDescription
T-

Parameters

NameType
opResolvable<T> | () => Resolvable<T>

Returns

Option<T>

Defined in

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


fromAsync

fromAsync<T>(op): Promise<Option<T>>

Type parameters

NameDescription
T-

Parameters

NameType
opAwaitable<Resolvable<T>> | () => Awaitable<Resolvable<T>>

Returns

Promise<Option<T>>

Defined in

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


is

is<T>(value): true

Type parameters

Name
T

Parameters

NameType
valueOption<T>

Returns

true

Defined in

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

is(value): value is Option<unknown>

Parameters

NameType
valueany

Returns

value is Option<unknown>

Defined in

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


some

some<T>(value): Some<T>

Type parameters

Name
T

Parameters

NameType
valueT

Returns

Some<T>

Defined in

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