Appearance
@namakina/landing-page/extract
Interfaces
| Interface | Description |
|---|---|
| ExtractedField | One snapshot field plus the live elements behind it. |
| ExtractedForm | - |
| SnapshotState | - |
Type Aliases
| Type Alias | Description |
|---|---|
| ValueControl | - |
Functions
| Function | Description |
|---|---|
| applyMask | Formats raw slot characters the way jQuery-mask does while typing: literals appear as soon as they are reached, surplus characters are dropped. |
| buildSnapshot | Builds the FormSnapshot sent with every inbound message. |
| collapseWhitespace | - |
| digitsForMask | Prepares an agent-supplied value for a masked input: keeps slot characters and drops a repeated literal prefix (a phone typed with its leading 1 against a 1-000-000-0000 mask). |
| extractForm | Reads a tagged form into fields the SDK can snapshot and write. Hidden, submit, button, password and file inputs are omitted; radios and checkboxes sharing a name collapse into one field. |
| fieldSnapshot | The wire-shaped field; includeValues: false yields the schema form for the CLI. |
| findWrapper | The element hidden in place of a field: the highest ancestor below the form that holds none of the form's other controls, hidden inputs or protected text. data-nam-wrapper on an ancestor names it outright. |
| humanize | first_name → First name, homeOwner → Home owner, Firstname → Firstname. |
| isMaskComplete | True when value fills every required slot of mask exactly as the mask lays it out. |
| labelOf | Field label precedence: data-nam-label, <label for>, wrapping label, aria-label, aria-labelledby, placeholder, then the humanized name. |
| optionLabelOf | Label for one radio or checkbox: its own label, else its value. |
| readValue | The current value of a field as a string; '' when empty. |
| requiredSlotCount | Number of required slots; optional and repeating slots do not count. |
| stripMask | The characters of value that can occupy a slot of mask, in order. |