import { ElementProps } from "../../../types/shared.mjs"; import { Component } from "../../../internal/factory/factory.mjs"; import { BaseFormElementProps } from "../../core/form-group/FormGroup.mjs"; import { CharacterCountTranslations } from "nhsuk-frontend"; //#region src/components/form-elements/textarea/Textarea.d.ts type TextareaBaseProps = BaseFormElementProps & ElementProps<'textarea'> & { i18n?: CharacterCountTranslations; }; type CharacterCountConfigProps = { variant: 'character-count'; maxCharacterLength: number; maxWords?: never; /** * How the text is counted: `length` (code units), `characters` (grapheme * clusters via `Intl.Segmenter`) or `words`. Defaults to `length`. */ countType?: 'characters' | 'length' | 'words'; /** * Custom counting function, for example to mirror server-side counting. */ countFunction?: (text: string) => number; } | { /** * @deprecated Use `variant: 'character-count'` with `countType: 'words'`. */ variant: 'word-count'; maxWords: number; maxCharacterLength?: never; countType?: never; countFunction?: never; }; type TextareaProps = TextareaBaseProps & (CharacterCountConfigProps | { variant?: 'textarea'; maxWords?: never; maxCharacterLength?: never; countType?: never; countFunction?: never; }); declare const Textarea: Component<{ props: TextareaProps; ref: HTMLTextAreaElement; }>; //#endregion export { CharacterCountConfigProps, Textarea, TextareaBaseProps, TextareaProps };