Skip to content

Documentation / @agentick/core / KnobDescriptor

Interface: KnobDescriptor<T, R> ​

Defined in: core/src/hooks/knob.ts:70

Descriptor carrying a knob's default value, constraints, and optional resolver. Created by knob(), consumed by useKnob() and <Knobs />.

Stores the superset of all constraint fields (the user-facing KnobOpts<T> provides compile-time safety; the descriptor is a runtime carrier).

Type Parameters ​

T ​

T extends KnobPrimitive = KnobPrimitive

R ​

R = T

Properties ​

[KNOB_SYMBOL] ​

[KNOB_SYMBOL]: true

Defined in: core/src/hooks/knob.ts:71


defaultValue ​

defaultValue: T

Defined in: core/src/hooks/knob.ts:72


description ​

description: string

Defined in: core/src/hooks/knob.ts:73


group? ​

optional group: string

Defined in: core/src/hooks/knob.ts:77


inline? ​

optional inline: boolean

Defined in: core/src/hooks/knob.ts:81


max? ​

optional max: number

Defined in: core/src/hooks/knob.ts:85


maxLength? ​

optional maxLength: number

Defined in: core/src/hooks/knob.ts:88


min? ​

optional min: number

Defined in: core/src/hooks/knob.ts:84


momentary? ​

optional momentary: boolean

Defined in: core/src/hooks/knob.ts:80


options? ​

optional options: T[]

Defined in: core/src/hooks/knob.ts:74


pattern? ​

optional pattern: string

Defined in: core/src/hooks/knob.ts:89


readOnly? ​

optional readOnly: boolean

Defined in: core/src/hooks/knob.ts:82


required? ​

optional required: boolean

Defined in: core/src/hooks/knob.ts:78


resolve()? ​

optional resolve: (value) => R

Defined in: core/src/hooks/knob.ts:76

Parameters ​

value ​

T

Returns ​

R


step? ​

optional step: number

Defined in: core/src/hooks/knob.ts:86


validate()? ​

optional validate: (value) => string | true

Defined in: core/src/hooks/knob.ts:79

Parameters ​

value ​

T

Returns ​

string | true


valueType ​

valueType: "string" | "number" | "boolean"

Defined in: core/src/hooks/knob.ts:75

Released under the ISC License.