Skip to content

Interface

ts
type FilterType = 'text' | 'checkbox' | 'check' | 'range' | 'date' | 'tags';

// filter
interface Filter {
  schema?: FilterItem[];
  view?: "inline" | "vertical" | "popover";
  value?: ActiveFilter;
  history?: boolean;
  limit?: number;
}


// filter element 
interface FilterItem {
  type: string | FilterType;
  label: string;
  width: number;
  options?: ListItem[];
  placeholder?: string;    
  api?: string;   
  cleanable?: boolean; 
}

// checkbox, radio item
interface ListItem {
  text: string;
  id: any;
  count?: number;
  color?: string;
  icon?: string;
}

interface ActiveFilter {
  [key: string]: string | string[] | null;
}