View as Markdown

API reference: @salmonui/chat/smart-paste

SmartPasteFieldinterface

import type { SmartPasteField } from '@salmonui/chat/smart-paste';
interface SmartPasteField {
    readonly name: string;
    readonly label?: string;
    readonly description?: string;
    readonly type: string;
    readonly options?: readonly string[];
    readonly multiple?: boolean;
}

What the adapter learns about one field.

SmartPasteField members (6)
NameSignatureDescription
namereadonly name: string;

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

labeloptionalreadonly label?: string;

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

descriptionoptionalreadonly description?: string;

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

typereadonly type: string;

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

optionsoptionalreadonly options?: readonly string[];

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

multipleoptionalreadonly multiple?: boolean;

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