import { ValidatorFn } from '@angular/forms'; import { IdentitySelectorComponentPropsInterface } from '../lib/ui/indentity-selector/identity-selector.component'; import { SelectComponentPropsInterface } from '../lib/ui/select/select.component'; import { TextboxComponentPropsInterface } from '../lib/ui/textbox/textbox.component'; import { CheckboxComponentPropsInterface } from '../lib/ui/checkbox/checkbox.component'; import { DataGridComponent } from '../lib/components/organisms/data-grid/data-grid.component'; import { TextboxCurrencyConfigInterface } from './textbox-currency-config.interface'; interface CallbackParamsInterface { value: any; row: RowType; instance: DataGridComponent; } declare type DynamicPropertyType = DynamicPropertyType | ((params: CallbackParamsInterface) => DynamicPropertyType) | ((params: CallbackParamsInterface) => Promise); export interface ChangeCallbackParamsInterface extends CallbackParamsInterface { selectedItem?: any | null; } export interface EnterCallbackParamsInterface extends CallbackParamsInterface { } declare type HiddenFieldType = { type: 'hiddenField'; }; declare type LabelType = { type: 'label'; }; declare type TextboxType = { type: 'textbox'; config?: Omit & { currencyConfig?: DynamicPropertyType; }; }; declare type SelectType = { type: 'select'; config: Omit & { options: DynamicPropertyType; }; }; declare type CheckboxType = { type: 'checkbox'; config?: Omit; }; declare type IdentitySelectorType = { type: 'identity-selector'; config: Omit & Required> & { oDataHttpHeaders: DynamicPropertyType<{ [key: string]: string; }>; }; }; export declare type DataGridEditConfig = { validators?: DynamicPropertyType<{ type: ValidatorFn; message?: string; }[], RowType>; isUnique?: boolean; disabled?: DynamicPropertyType; beforeChange?: { canChange: DynamicPropertyType; errorMessage?: string; }; changeCallback?: (params: ChangeCallbackParamsInterface) => void; enterCallback?: ((params: EnterCallbackParamsInterface) => boolean) | ((params: EnterCallbackParamsInterface) => Promise); } & (HiddenFieldType | LabelType | TextboxType | SelectType | CheckboxType | IdentitySelectorType); export interface DataGridColumnInterface { title?: string; binding: string; displayBindingFields?: [string, string?]; width?: string; editConfig?: DataGridEditConfig; } export {};