import { Data } from '@angular/router'; import { Observable } from 'rxjs'; import { SubTypeSelectColumnTable } from '../../enums/columns/SubTypeSelectColumnTable.enum'; import { ColumnTable } from './column'; import { Icon } from '../../../tul-form/interfaces/icon'; import { TagColor } from '../../../tul-tag/types/tag-color.type'; /** * Column general select */ export interface SelectColumnTable extends ColumnTable { /** * subtype of column select */ subType?: SubTypeSelectColumnTable | (({ data, column }: { data: any; column: any; }) => SubTypeSelectColumnTable); } /** * List column */ export interface ListColumnTable extends SelectColumnTable { /** * List of values */ listValues: Array<{ text: string; value: string; color?: string; tag?: SelectTag; }>; /** * @deprecated use tag in listValues */ hasBackgroundColor?: boolean; } /** * Entity column */ export interface EntityColumnTable extends SelectColumnTable { /** * Url to request an get list */ url?: string | ((column: any) => string); /** * custom http subscriber */ httpSubscribe?: ({ page, pageSize, filters, column, }: { page: any; pageSize: any; filters: any; column: any; }) => Observable; /** * custom map to http subscriber */ mapHttpSubscribe?: ({ page, pageSize, filters, response, column, }: { page: any; pageSize: any; filters: any; response: any; column: any; }) => any; /** * value to send data */ attributeValue?: string; /** * list to keys attributes */ listAttributtes?: Array; } /** * Tree entity column */ export interface TreeEntityColumn extends SelectColumnTable { /** * Url to request an get list */ url?: string | ((column: any) => string); /** * tree data */ data?: Data; /** * value to send data */ attributeId?: string; /** * custom http subscriber */ httpSubscribe?: ({ column }: { column: any; }) => Observable; /** * custom map to http subscriber */ mapHttpSubscribe?: (response: any) => any; } /** * Select tag */ export interface SelectTag { /** * Enum color */ color?: TagColor; /** * Icon */ icon?: Icon; } /** * All export types selects */ export declare type TypeSelectsTable = EntityColumnTable | ListColumnTable | TreeEntityColumn;