/*! * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ import { ExtendedHTMLElement } from '../../helper/dom'; import { ValidationPattern } from '../../static'; import { MynahIcons, MynahIconsType } from '../icon'; export interface TextInputProps { classNames?: string[]; attributes?: Record; label?: HTMLElement | ExtendedHTMLElement | string; autoFocus?: boolean; description?: ExtendedHTMLElement; icon?: MynahIcons | MynahIconsType; mandatory?: boolean; fireModifierAndEnterKeyPress?: () => void; placeholder?: string; type?: 'text' | 'number' | 'email'; validationPatterns?: { operator?: 'and' | 'or'; patterns: ValidationPattern[]; }; validateOnChange?: boolean; value?: string; onChange?: (value: string) => void; onKeyPress?: (event: KeyboardEvent) => void; testId?: string; } export declare abstract class TextInputAbstract { render: ExtendedHTMLElement; setValue: (value: string) => void; getValue: () => string; setEnabled: (enabled: boolean) => void; checkValidation: () => void; } export declare class TextInputInternal extends TextInputAbstract { private readonly inputElement; private readonly validationErrorBlock; private readonly props; private readyToValidate; private touched; render: ExtendedHTMLElement; constructor(props: TextInputProps); setValue: (value: string) => void; getValue: () => string; setEnabled: (enabled: boolean) => void; checkValidation: () => void; } export declare class TextInput extends TextInputAbstract { render: ExtendedHTMLElement; constructor(props: TextInputProps); setValue: (value: string) => void; getValue: () => string; setEnabled: (enabled: boolean) => void; checkValidation: () => void; }