// export type listAutocomplate = [
//   {
//     _index: string;
//     _id: string;
//     _score: number;
//     _source: {
//       ts_ref: string;
//       title: string;
//       text: string;
//       ts_date: string | number;
//     };
//     highlight: {
//       "title.ph": [string];
//       title: [string];
//     };
//   }
// ];
export type ListItem = {
  _index: string;
  _id: string;
  _score: number;
  _source: {
    title: string;
    text: string;
    ts_ref: string;
    ts_date: string | number;
  };
  highlight: {
    "title.ph": string[];
    title: string[];
  };
};

export type listAutocomplate = ListItem[];

export type searchDomain = [
  {
    label?: string;
    tag?: string;
    key?: string;
    field_collapse?: string;

    table_columns:
      | [
          {
            key: string;
            title: string;
            width: string;
            textAlign: string;
            isLink: true;
            link_route: { id: string; name: string; key: string };
            trancate_word: number;
          }
        ]
      | [];
    table_actions:
      | [
          {
            title: string;
            icon: string;
            key: string;
            "v-can": string;
            type: string;
            api_items: {
              data_type: string;
              ref_key: string;
              id: string;
              title: string;
            };
            toggle_icons: { icon1: string; icon2: string };
            link_route: { id: string; name: string; key: string };
          }
        ]
      | [];
  }
];

export type searchType = {
  key: string;
  description: string;
  label: string;
  item: {
    key: string;
    label: string;
    type: string;
    placeholder: string;
    options: [
      {
        value: string;
        title: string;
        type: string;
      }
    ];
  };
};
export type aggregations = {
  ref_key: {
    doc_count_error_upper_bound: number;
    sum_other_doc_count: number;
    buckets: [
      {
        key: string;
        doc_count: number;
      }
    ];
  };
  content_len: {
    doc_count_error_upper_bound: number;
    sum_other_doc_count: number;
    buckets: [];
  };
  eb_year: {
    doc_count_error_upper_bound: number;
    sum_other_doc_count: number;
    buckets: [];
  };
  ts_ref: {
    doc_count_error_upper_bound: number;
    sum_other_doc_count: number;
    buckets: [
      {
        key: string;
        doc_count: number;
      }
    ];
  };
  tags: {
    doc_count_error_upper_bound: number;
    sum_other_doc_count: number;
    buckets: [
      {
        key: string;
        doc_count: number;
      }
    ];
  };
  categories: {
    doc_count_error_upper_bound: number;
    sum_other_doc_count: number;
    buckets: [
      {
        key: string;
        doc_count: number;
      }
    ];
  };
};
export type hits = {
  _index: string;
  _id: string;
  _score: string;
  _source: {
    ref_id: string;
    id: string;
    ref_url: string;
    pdf_url: string;
    title: string;
    qanon_title: string;
    expire_date: string;
    ts_date: string;
    ts_year: string;
    ts_ref: string;
    state_etebar: string;
    qanon_id: string;
    parent_id: string;
    child_order: number;
    other_info: {
      level: number;
      full_path: string;
      number_text: string;
      hierarchy: string;
    };
    content_len: number;
    topics: [];
    html: string;
    version_info: {
      timestamp: number;
      operation: string;
      number: number;
    };
    sort_date_timestamp: string;
    title_type: string;
    qanon_etebar: string;
    content: string;
    main_type: string;
    sub_type: string;
    tags: [string];
    ref_key: string;
    categories: [string];
    tbookmark: number;
  };
  sort: [number];
  fields: {
    qanon_id: [string];
  };
  inner_hits: innerHits;
};

export type innerHits = {
  by_collapse: {
    hits: {
      total: {
        value: number;
        relation: string;
      };
      max_score: number;
      hits: [
        {
          _index: string;
          _id: string;
          _score: number;
          _source: {
            id: string;
            ref_id: number;
            ref_key: string;
            main_type: string;
            sub_type: string;
            content: string;
            html: string;
            version_info: {
              timestamp: number;
              operation: string;
              number: number;
            };
            qanon_title: string;
            expire_date: string;
            ts_date: string;
            ts_year: string;
            ts_ref: string;
            state_etebar: string;
            qanon_id: string;
            parent_id: string;
            child_order: number;
            other_info: {
              level: number;
              full_path: string;
              number_text: string;
              hierarchy: string;
            };
            content_len: number;
            topics: [];
            qanon_etebar: string;
            sort_date_timestamp: number;
            title_type: string;
          };
        }
      ];
    };
  };
};
