/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/textarea` component represents a multiline text input field. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-textarea/documentation |Lightning Textarea Documentation} */ declare module "lightning/textarea" { import { LightningElement } from "lwc"; /** * Represents a multiline text input field. */ export default class LightningTextarea extends LightningElement { /** * Controls auto-filling of the field. Set the attribute to pass * through autocomplete values to be interpreted by the browser. */ autocomplete: string; /** * Text that describes the textarea input field. */ label: string; /** * Text that is displayed when the field is empty, * to prompt the user for a valid entry. */ placeholder: string; /** * Specifies the name of an input element. */ name: string; /** * Error message to be displayed when a bad input is detected. */ messageWhenBadInput: string; /** * Error message to be displayed when the value is too short. */ messageWhenTooShort: string; /** * Error message to be displayed when the value is too long. */ messageWhenTooLong: string; /** * Error message to be displayed when the value is missing. */ messageWhenValueMissing: string; /** * The keyboard shortcut for input field. */ accessKey: string; /** * Aria Described by value on parent lighting-textarea */ ariaDescribedBy: string; /** * A space-separated list of element IDs that provide labels for the * aria-labelled-by value on parent lighting-textarea. */ ariaLabelledBy: string; /** * The maximum number of characters allowed in the textarea. */ maxLength: number | undefined; /** * The minimum number of characters allowed in the textarea. */ minLength: number | undefined; /** * The value of the textarea input, also used as the default value during init. */ value: string | undefined; /** * If present, the textarea field is disabled and users cannot interact with it. */ disabled: boolean; /** * The help text that appears in a popover. * Set field-level help to provide an informational tooltip on the textarea input field. */ fieldLevelHelp: string | undefined; /** * If present, the textarea field is read-only and cannot be edited. */ readOnly: boolean; /** * If present, the textarea field must be filled out before the form can be submitted. */ required: boolean; /** * The variant changes the appearance of the textarea. * Accepted variants include standard, label-hidden, label-inline, and label-stacked. * This value defaults to standard. * Use label-hidden to hide the label but make it available to assistive technology. * Use label-inline to horizontally align the label and textarea. * Use label-stacked to place the label above the textarea. */ variant: "standard" | "label-hidden" | "label-inline" | "label-stacked"; /** * Represents the validity states of the textarea input, with respect to constraint validation. */ validity: ValidityState; /** * Returns the valid attribute value (Boolean) on the ValidityState object. */ checkValidity(): boolean; /** * Displays the error messages and returns false if the input is invalid. * If the input is valid, reportValidity() clears displayed error messages and returns true. */ reportValidity(): boolean; /** * Sets a custom error message to be displayed when the textarea value is submitted. */ setCustomValidity(message: string): void; /** * Displays error messages on invalid fields. * An invalid field fails at least one constraint validation and returns false when checkValidity() is called. */ showHelpMessageIfInvalid(): void; /** * Sets focus on the textarea field. */ focus(): void; /** * Removes focus from the textarea field. */ blur(): void; /** * Replace a range of text in textarea with a new string. * Possible values for selectMode: * - 'select': selects the newly inserted text. * - 'start': moves the selection to just before the inserted text. * - 'end': moves the selection to just after the inserted text. * - 'preserve': attempts to preserve the selection. This is the default. */ setRangeText( replacement: string, start: number, end: number, selectMode: string, ): void; } }