Skip to content

Class: AskEnumField<V>

Defined in: packages/core/src/core/elicitation/types.ts:154

Enum field descriptor — ask.enum(['a', 'b'] as const, 'Choose one')

Extends

Type Parameters

Type ParameterDescription
V extends stringLiteral union type inferred from the values array

Constructors

Constructor

ts
new AskEnumField<V>(values, description): AskEnumField<V>;

Defined in: packages/core/src/core/elicitation/types.ts:158

Parameters

ParameterType
valuesreadonly [V, V]
descriptionstring | undefined

Returns

AskEnumField<V>

Overrides

ts
AskField<V>.constructor

Properties

__type

ts
readonly __type: V;

Defined in: packages/core/src/core/elicitation/types.ts:44

Phantom brand for type inference — never accessed at runtime

Inherited from

AskField.__type

Methods

default()

ts
default(value): this;

Defined in: packages/core/src/core/elicitation/types.ts:61

Set a default value for this field.

Parameters

ParameterTypeDescription
valueVDefault value shown pre-filled in the client form

Returns

this

this for chaining

Inherited from

AskField.default


describe()

ts
describe(desc): this;

Defined in: packages/core/src/core/elicitation/types.ts:72

Set or override the field description.

Parameters

ParameterTypeDescription
descstringHuman-readable label/description

Returns

this

this for chaining

Inherited from

AskField.describe