/* * Copyright (c) 2025, Salesforce, Inc. * All rights reserved. * For full license text, see the LICENSE.txt file */ /** * The `lightning/inputField` component represents an editable input for a Salesforce object field. * @see {@link https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/documentation | Lightning Input Field Documentation} */ declare module "lightning/inputField" { import type { LightningElement } from "lwc"; /** * A component that represents an editable input for a Salesforce object field. */ export default class LightningInputField extends LightningElement { /** * Controls auto-filling of the input field based on the value. */ autocomplete: string; /** * The variant changes the label position of an input field. Accepted variants include standard, label-hidden, label-inline, and label-stacked. Defaults to standard. */ variant: string; /** * The field value, which overrides the existing value. */ value: string; /** * The API name of the field to be displayed. */ fieldName: string; /** * Specifies whether an input field is read-only. Not supported for rich text, picklist, multi-select picklist, and lookup. */ readOnly: boolean; /** * If present, the input field must be filled out before the form is submitted. */ required: boolean; /** * If present, the field is grayed out and users can't interact with it. */ disabled: boolean; /** * A boolean value that controls whether assistive technologies read empty required textboxes as invalid. Default value is false. */ //@ts-expect-error: Property 'ariaInvalid' in type 'LightningInputField' is not assignable to the same property in base type 'LightningElement'. ariaInvalid: boolean; /** * Reserved for internal use. If present, the field has been modified by the user but not saved or submitted. */ get dirty(): boolean; /** * Reserved for internal use. Returns true if the field is externally required. */ get externalRequired(): boolean; /** * Reserved for internal use. Wires record UI data to the field. * @param data Reserved for internal use. */ wireRecordUi(data: Record): void; /** * Reserved for internal use. Wires picklist values to the field. * @param picklistValues Reserved for internal use. */ wirePicklistValues(picklistValues: string[]): void; /** * Resets the form fields to their initial values. */ reset(): void; /** * Reserved for internal use. Updates dependent field options. * @param fieldName Reserved for internal use. * @param options Reserved for internal use. */ updateDependentField(fieldName: string, options: string[]): void; /** * Reserved for internal use. Sets error messages for the field. * @param errors Reserved for internal use. */ setErrors(errors: unknown): void; /** * Focuses the underlying input. */ focus(): void; /** * Checks if the input is valid and displays error messages if invalid. * @returns Indicates whether the element meets all constraint validations. */ reportValidity(): boolean; /** * Reserved for internal use. Cleans up the field dirty state. */ clean(): void; } }