import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { EditableColumn, Section } from '../../interfaces/table-column'; import { Subscription } from 'rxjs'; import { HttpService } from '../../services/http.service'; import { NotificationService } from '../../services/notification.service'; export declare class FormComponent implements OnInit, OnChanges, OnDestroy { protected httpService: HttpService; protected notificationService: NotificationService; formGroup: FormGroup; /** * will be used as the modal title when confirming or displaying the API response */ modalTitle: string; /** * the columns to be rendered as form * note: won't be used of section has been provided */ columns: EditableColumn[]; /** * the sections to be rendered as a form * note: columns attribute will be overwritten by columns here */ sections: Section[]; /** * the url of the API that return the current values */ getUrl: string; /** * the URL to sent the PUT request to when the user save */ updateUrl: string; /** * the primary key to be used when send the PUT request * note: won't be used if data is provided */ primaryKey: string & keyof T; /** * whether the user can modify the form or just view it's current value * setting it to true will hide the save button */ readonly: true; /** * if provided then won't call the get API to fetch the current data into the form * note: getUrl will not be used if provided */ data: T; /** * whether the sections header should be h3 or h4 * note: won't have any affect if sections is not provided */ sectionLevel: 3 | 4; /** * whether the native form should offer autocomplete or not on typing */ autocomplete: 'on' | 'off'; protected getSubscription: Subscription; protected editId: string; constructor(httpService: HttpService, notificationService: NotificationService); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; getData(): void; handleData(data: T): void; update(): Promise; ngOnDestroy(): void; }