import { DocumentNode } from 'graphql'; import { ReactNode } from 'react'; import { Companies_Bool_Exp, Order_By, People_Bool_Exp, Users_Bool_Exp, } from '../../../generated/graphql'; export type SortType = | { _type: 'default_sort'; label: string; key: keyof OrderByTemplate & string; icon?: ReactNode; } | { _type: 'custom_sort'; label: string; key: string; icon?: ReactNode; orderByTemplate: (order: Order_By) => OrderByTemplate; }; export type SelectedSortType = SortType & { order: 'asc' | 'desc'; }; export type FilterType> = { operands: FilterOperandType[]; label: string; key: string; icon: ReactNode; whereTemplate: ( operand: FilterOperandType, value: FilterValue, ) => WhereTemplate | undefined; searchQuery: DocumentNode; searchTemplate: ( searchInput: string, ) => People_Bool_Exp | Companies_Bool_Exp | Users_Bool_Exp; searchResultMapper: (data: any) => { displayValue: string; value: FilterValue; }; }; export type FilterOperandType = { label: string; id: string; keyWord: 'ilike' | 'not_ilike' | 'equal' | 'not_equal'; }; export type SelectedFilterType = FilterType & { value: string; operand: FilterOperandType; where: WhereTemplate; };