For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/types/Option.OptionFor.md.

Type Alias: OptionFor<O, T>

OptionFor<O, T> = true extends HasPromise<O> ? OptionAsync<T> : Option<T>

Resolves to the appropriate Option type (sync or async) based on the input type.

Type Parameters

O

O

The reference type to inspect for a Promise.

T

T

The type of the Some value.