argForm
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
argForm
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2module edui.argForm The typed argument form — a declared argument list becomes a form of REAL controls, and the filled form becomes the typed values a call takes. A person never types a Luau literal: strings get a text field, numbers a numeric field, booleans a checkbox, string-literal unions a chip row, colours a colour swatch, Vec3 three axis fields, and an options table expands one level into typed rows of its own. Only a type outside the model falls back to the literal field. The command palette renders every tool through this; the Inspector renders an asset type's operations through the same form, so any surface that knows a signature can offer it. require ~edui.argForm
parseSignature(sig: string) →
Parse a method signature string — `"(self, name: string, opts: T?)"` — into the argument list a form renders: `{ { name, type, optional } }`. A leading `self` is the receiver, not an argument, and is dropped. The arguments are the balanced parenthesised run at the head of the text, so a signature that goes on to declare what the call hands back — `"(self, name: string): boolean"` — renders the same form as one that stops at the arguments.
| arg | type | description |
|---|---|---|
| sig | string | The signature text. |
flush( ) → void
make(W: any) → any
Bind the form builder to the widgets barrel `W`. The barrel calls this once; consumers reach the result as `edui.argForm`.
| arg | type | description |
|---|---|---|
| W | any |
new(o: { [string]: any }) → any
A new form instance. `o.ns` (REQUIRED — the id namespace every control keys under), `o.typeDefs` (the schema's named definitions, `{ { name, definition } }`), `o.onSubmit` (fired when Enter lands in a text field — the run affordance), `o.onChanged` (fired after any control writes a value, for hosts that gate rebuilds on an epoch).
| arg | type | description |
|---|---|---|
| o | { [string]: any } |
reset(self: any) → void
| arg | type | description |
|---|---|---|
| self | any |
set(self: any, path: string, v: string?) → void
| arg | type | description |
|---|---|---|
| self | any | |
| path | string | |
| v | string? |
get(self: any, path: string) → string
| arg | type | description |
|---|---|---|
| self | any | |
| path | string |
typeDefFor(self: any, name: string) → string
| arg | type | description |
|---|---|---|
| self | any | |
| name | string |
enumOptions(self: any, t: string) → void
`"a" | "b" | "c"` (directly or through a named def) → its literals.
| arg | type | description |
|---|---|---|
| self | any | |
| t | string |
tableFields(self: any, t: string) → void
`{ field: Type?, ... }` → its fields, top-level commas/newlines only.
| arg | type | description |
|---|---|---|
| self | any | |
| t | string |
flush( ) → void
isVec3(self: any, t: string) → boolean
| arg | type | description |
|---|---|---|
| self | any | |
| t | string |
isColorType(self: any, t: string, name: string?) → boolean
A colour: a type NAMED as one (`Color`, `shared.ColorInput`), or a plain numeric array whose field name says colour. Registry colours come in two channel ranges — `ColorInput` reads 0-255, everything else 0-1 — and `values` emits the range the type reads.
| arg | type | description |
|---|---|---|
| self | any | |
| t | string | |
| name | string? |
controlKind(self: any, t: string, name: string?) → string
What kind of control a type gets. The `path` keys the field's value; its last segment is the field name, which the colour rule reads.
| arg | type | description |
|---|---|---|
| self | any | |
| t | string | |
| name | string? |
fieldValue(self: any, path: string, t: string, optional: boolean) → void
One field's typed value from the stored state. Returns (ok, value | error).
| arg | type | description |
|---|---|---|
| self | any | |
| path | string | |
| t | string | |
| optional | boolean |
ch(h: string) → number
| arg | type | description |
|---|---|---|
| h | string |
values(self: any, args: { any }) → void
Assemble the positional values for `args` from the filled form. Returns `(true, values, n)` — `n` the last non-nil position for `table.unpack(values, 1, n)` — or `(false, message)`.
| arg | type | description |
|---|---|---|
| self | any | |
| args | { any } |
numberField(self: any, path: string, placeholder: string) → any
One number field, 84px, parsed at values() time.
| arg | type | description |
|---|---|---|
| self | any | |
| path | string | |
| placeholder | string |
onChange(v: ?) → void
| arg | type | description |
|---|---|---|
| v | ? |
onClick( ) → void
onChange(v: ?) → void
| arg | type | description |
|---|---|---|
| v | ? |
onSubmit(v: ?) → void
| arg | type | description |
|---|---|---|
| v | ? |
rows(self: any, args: { any }) → void
The rows for a whole argument list (each `{ name, type, optional, description? }`), in order.
| arg | type | description |
|---|---|---|
| self | any | |
| args | { any } |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.