View as Markdown

API reference: @salmonui/chat/smart-paste

SmartPasteCustomFieldinterface

import type { SmartPasteCustomField } from '@salmonui/chat/smart-paste';
interface SmartPasteCustomField extends SmartPasteField {
    readonly fill: (value: unknown) => boolean | void;
}

A field the hook cannot reach as a native control (for example a Salmon Select): described and filled by the application.

SmartPasteCustomField members (7, 6 inherited)
NameSignatureDescription
fillreadonly fill: (value: unknown) => boolean | void;

Applies the adapter's value; return false when it does not fit, so the field is reported as skipped.

nameinheritedname: string;

The field's name (or id when it has no name); the key of the adapter's answer.

labeloptionalinheritedlabel?: string;

Text of the associated <label>, aria-labelledby, aria-label or group <legend>.

descriptionoptionalinheriteddescription?: string;

data-salmon-paste-description, else the aria-describedby text (the Field description).

typeinheritedtype: string;

Input type, or 'textarea', 'select', 'checkbox', 'radio', or the custom field's type.

optionsoptionalinheritedoptions?: readonly string[];

Allowed values: <option> values, radio values, or the values of a checkbox group.

multipleoptionalinheritedmultiple?: boolean;

A multiple <select> or a checkbox group: the answer is an array.