import { Observable } from 'rxjs'; import { TypeForm } from '../enums'; import { ColumnForms } from './columns/column'; export interface Group { number: number; name: string; feedbackOptions?: HeaderFeedbackGroupOptions; headerOptions?: HeaderGroupOptions; subHeaderOptions?: SubHeaderGroupOptions; sections: Array
; } export interface Section { header?: HeaderSectionOptions; columns: Array; numberColumns?: number; } export declare enum HeaderGroupType { VERTICAL = 0, HORIZONTAL = 1, VERTICAL_REVERSE = 2, HORIZONTAL_REVERSE = 3 } export interface HeaderGroupOptions { disabled?: boolean; type: HeaderGroupType; icon?: string | null; title: string | null; description: string | null; } export interface SubHeaderGroupOptions { disabled?: boolean; icon?: string; title: string | null; } export interface HeaderSectionOptions { disabled?: boolean; icon?: string; title: string | null; } export interface HeaderFeedbackGroupOptions { disabled?: boolean; title: string | null; description: string | null; } export interface FilterTableForms { value: any | Array; /** * attribute name */ attribute: string; } /** * poll interval */ export interface PollIntervalForms { /** * enable flag */ enable: boolean; /** * time to retry */ time: number; } export interface ArgumentForms { attribute: string; value?: string | (() => string); } export interface Data { /** * key and value type */ [key: string]: T; } /** * Form */ export interface Form { id: string; title: string; url: string | (() => string); filters?: Array | (() => Array); mapHttpSubscribe?: ({ response, component }: any) => any; type?: TypeForm; submitForm?: ({ data, groups }: RequestData) => Observable; callbackSubmitForm: ({ data, groups, error }: RequestData) => void; } export interface ErrorFormResponse { field: string; message: string; } export interface RequestData { data: Data; groups: Array; response?: Data; error?: Data; } export interface FormGraphQl extends Form { dto: string | (() => string); content: string | (() => string); arguments: Array; pollInterval?: PollIntervalForms; fetchPolicy?: string; mapHttpSubscribe?: ({ response, component }: any) => any; } export interface FormMs extends Form { httpSubscribe?: (event: any) => Observable; mapHttpSubscribe?: ({ response, component }: any) => any; } export declare type TypeForms = Form | FormGraphQl | FormMs;