import type { Component, Snippet } from 'svelte'; import type { HTMLInputAttributes, HTMLTextareaAttributes } from 'svelte/elements'; import type { ValidationContext, ValidationResult } from '../../utils/validation'; export type TextareaValidator = (context: ValidationContext) => ValidationResult; type FieldProps = { /** Generated internally for the label association. */ id?: never; /** Field label, a string or Svelte snippet. */ label: string | Snippet; /** Description shown below the field, a string or Svelte snippet. */ description?: string | Snippet; /** Configuration key and HTML name attribute. */ name?: string; /** Set the field as required. */ required?: boolean; /** Disables the field. */ disabled?: boolean; /** Prevents editing while keeping the field focusable. */ readonly?: boolean; /** Shows or hides the field without destroying it. */ show?: boolean; /** CSS class added to the form-group wrapper. */ class?: string; /** Field value. */ value?: string | number; /** Callback for the native input event with the updated value. */ onInput?: (value: string | number, event: Event) => void | Promise; /** Callback for the native change event with the updated value. */ onChange?: (value: string | number, event: Event) => void | Promise; /** Custom validator. */ validate?: TextareaValidator; /** Content rendered after the field and validation message. */ children?: Snippet; }; type TextareaProps = Omit< HTMLTextareaAttributes, keyof FieldProps | 'oninput' | 'onchange' | 'aria-describedby' | 'aria-invalid' >; export type Props = FieldProps & TextareaProps; /** * A textarea component. * See [Readme](https://docs.soleil.se/packages/config-svelte/components/textarea/). */ declare const Textarea: Component; export default Textarea;