import { Header } from './header';
import { Page } from './page';

export class Result {
  headers: Header[];
  data: Record<string, any>[];
  total: number;
  page?: Page;

  constructor(data: Partial<Result>) {
    this.headers = data?.headers ?? [];
    this.data = data?.data ?? [];
    this.total = data?.total ?? 0;
    if (data?.page) this.page = new Page(data.page);
  }
}
