import { Attributes, Options } from '../models/types'; import { IFormControl } from './iform-control'; export interface FormControlParams { id: string; name: string; label: string; description: string; attributes: Attributes; options: Options; } /** * The base Component class declares an interface for all concrete components, * both simple and complex. * */ export declare abstract class FormControl implements IFormControl { protected id: string; protected name: string; protected label: string; protected description: string; protected value: any; protected attributes: Attributes; protected options: Options; protected nativeElement: HTMLElement; constructor(params: FormControlParams); /** * Use to attach event listeners like click, change...etc. * It is called inside createNativeElement */ abstract attachEventListeners(): void; /** * A callback method that is called before destory to remove all attached event listeners. */ abstract removeEventListeners(): void; /** * Each concrete DOM element must provide its rendering implementation, but * we can safely assume that all of them are returning strings. */ abstract render(): HTMLElement; /** Returns native element type. Ex: input, select */ abstract getNativeElementType(): string; /** * Initialize component, creates native element, attach event listners */ init(): void; /** * Cleanup form control and removes all event listeners */ destroy(): void; /** * Creates native element and attach event listeners */ createNatveElement(): void; getAttributes(): Attributes; getId(): string; getName(): string; getDescription(): string; getNativeElement(): HTMLElement; getLabel(): string; getOptions(): Options; getValue(): any; setValue(value: any): void; }