export {};

declare global {
  type Maybe<T> = T | null | undefined | [];

  type resModelOne = {
    status: number;
    message: string;
    postion: number;
    data: any[];
    meta: null;
    user_id: number;
  }
  type resModelTwo = {
    status: number;
    message: string;
    postion: number;
    meta: null;
    _index: string;
    _id: string;
    _score: number;
    _source: {};
  }
  type resModelThree = {
    status: number;
    message: string;
    postion: number;
    meta: null;
    took: number;
    timed_out: boolean;
    aggregations:[];
    _shards: {
      total: number;
      successful: number;
      skipped: number;
      failed: number;
    };
    hits: {
      total: {
        value: number;
        relation: string;
      };
      max_score: null;
      hits: Maybe<T>;
    };
  }
}

// if no chapter found, undefined will return,else a chapter.
// because of this, we need 'Maybe'.
// const chapter : Maybe<Chapter> = course.chapters.find(
//     (chapter)=> chapter.slug === chapterSlug
// );