import { DestroyRef } from '@angular/core'; import { ControlValueAccessorDirective } from '../control-value-accessor.directive'; import type { InputMapFn, InputFilterFn } from '../../../../directives/input-map-filter/types'; import * as i0 from "@angular/core"; export declare class TextareaComponent extends ControlValueAccessorDirective { className: string; preventSpecailChar: boolean; maxLength: number | string; isResizable: boolean; isArText: boolean; isEnText: boolean; get textDir(): 'rtl' | 'ltr'; /** * A mapping function that modifies the input value during typing, pasting, or dropping text. * You can use it to modify the full input value **before it appears** (e.g., for auto-capitalization, * formatting, or custom replacements). * * This function is called: * - On each **key press**, to determine how the input value should change when a character is typed. * - On **paste**, to transform the pasted content before it’s applied. * - On **drop**, to transform the dropped text before it’s applied. * * **Built-in mappers are available via the `InputMappers` utility class:** * * - `InputMappers.toUpperCase` — Transforms all input to UPPERCASE. * - `InputMappers.toLowerCase` — Transforms all input to lowercase. * * @param char - The character(s) being inserted. This is: * - A single character (e.g., `'a'`) during typing. * - The full pasted string during paste events. * - The full dropped string during drop events. * @param currentValue - The current value of the input **before** the change is applied. * @param nextValue - The simulated value of the input **after** the character, paste, or drop is inserted, but before transformation. * * @returns The final string to use as the new input value. * * @example * // Use a built-in mapper to force UPPERCASE input: * this.mapFn = InputMappers.toUpperCase; * * @example * // Custom mapper: Capitalize the first letter of each word * this.mapFn = (char, current, next) => * typeof next === 'string' ? next.replace(/\b\w/g, c => c.toUpperCase()) : next; */ mapFn: InputMapFn; /** * A filtering function that determines whether a character or string should be allowed into the input. * * This function is called during: * - **Typing**: When a key is pressed to decide if the character should be accepted. * - **Paste**: When text is pasted to decide if the entire pasted string should be accepted. * - **Drop**: When text is dropped into the input to decide if it should be allowed. * * You can use it to reject unwanted characters (e.g. numbers, symbols) or block input entirely based * on the current or predicted value. * * **Built-in filters are available via the `InputFilters` utility class:** * * - `InputFilters.arabicOnly` — Allows Arabic letters and digits, as well as common symbols. * - `InputFilters.englishOnly` — Allows English letters and digits, as well as common symbols. * - `InputFilters.digitsOnly` — Allows digits only (`0–9`), no letters or symbols. * - You can also use `InputFilters.buildPattern()` to define a custom filter. * * @param char - The character(s) being inserted: * - A single typed character (e.g., `'a'`) during key presses * - The full pasted or dropped string during paste/drop * @param currentValue - The current value of the input before the character or string is applied. * @param nextValue - The simulated next value if the character or string were applied. * @param event - The originating event triggering the input change. This can be a * `KeyboardEvent` (for typing), `ClipboardEvent` (for paste), or `DragEvent` (for drop). * * @returns `true` to allow the input, or `false` to block it. * * * @example * // Use a built-in filter to restrict to digits only * this.filterFn = InputFilters.digitsOnly; * * @example * // Custom filter: Allow only letters (no numbers or symbols) * this.filterFn = (char, current, next, event) => { * return /^[a-zA-Z]+$/.test(char); * }; */ filterFn: InputFilterFn; destroyRef: DestroyRef; ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵcmp: i0.ɵɵComponentDeclaration, "app-textarea", never, { "className": { "alias": "className"; "required": false; }; "preventSpecailChar": { "alias": "preventSpecailChar"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "isResizable": { "alias": "isResizable"; "required": false; }; "isArText": { "alias": "isArText"; "required": false; }; "isEnText": { "alias": "isEnText"; "required": false; }; "mapFn": { "alias": "mapFn"; "required": false; }; "filterFn": { "alias": "filterFn"; "required": false; }; }, {}, never, never, true, never>; static ngAcceptInputType_isArText: unknown; static ngAcceptInputType_isEnText: unknown; }