Skip to content

Abstract Interface: AskField<T>

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

Base class for all ask.* field descriptors.

Uses a phantom __type brand so TypeScript can infer the concrete type from the DSL without manual generic annotations.

Example

typescript
// The developer never interacts with this class directly.
// They use `ask.string()`, `ask.number()`, etc.

Extended by

Type Parameters

Type ParameterDescription
TThe inferred TypeScript type for this field

Properties

__type

ts
readonly __type: T;

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

Phantom brand for type inference — never accessed at runtime

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
valueTDefault value shown pre-filled in the client form

Returns

this

this for chaining


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