import { FieldWrapper } from "./field-wrapper";
import { InjectionToken } from "@angular/core";

/**
 * Service that processes field changes.
 *
 * @export
 * @interface FieldChangeService
 */
export interface FieldChangeService {
    /**
     * Method called when on of the field changes.
     *
     * @param {string} changedFieldName The name of the field that was changed.
     * @param {*} changedValue The new value of the field.
     * @param {FieldWrapper[]} fields All fields in the form.
     * @memberof FieldsChangeService
     */
    processChange(changedFieldName: string, changedValue: any, fields: FieldWrapper[]): void;

    /**
     * Determines if this service can process the changed field.
     *
     * @param {string} typeFullName The CLR full name of the item(ex: Telerik.Sitefinity.News.Model.NewsItem)
     * @returns {boolean} Wheter the field can be processed.
     * @memberof FieldsChangeService
     */
    canProcess(typeFullName: string): boolean;
}


export declare const FIELDS_CHANGE_SERVICE_TOKEN: InjectionToken<string>;
