Skip to content

Class: AskNumberField

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

Number field descriptor — ask.number('Age').min(18).max(120)

Extends

Constructors

Constructor

ts
new AskNumberField(description): AskNumberField;

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

Parameters

ParameterType
descriptionstring | undefined

Returns

AskNumberField

Inherited from

ts
AskField<number>.constructor

Properties

__type

ts
readonly __type: number;

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
valuenumberDefault 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


max()

ts
max(n): this;

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

Set the maximum value constraint.

Parameters

ParameterTypeDescription
nnumberMaximum (inclusive)

Returns

this

this for chaining


min()

ts
min(n): this;

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

Set the minimum value constraint.

Parameters

ParameterTypeDescription
nnumberMinimum (inclusive)

Returns

this

this for chaining