global.ts 1.2 KB
export interface AnyObject {
  [key: string]: unknown;
}

export interface Options {
  value: unknown;
  label: string;
}

export interface MoreRowValue<T = object> {
  type: string;
  row: T;
  index?: number;
}

export interface QueryForParams {
  [key: string]: unknown;

  sortBy?: string;
  sortType?: 'desc' | 'asc' | '';
}

export interface QueryForPaginationParams extends QueryForParams {
  page?: number;
  pageSize?: number;
}

export type sizeType = 'mini' | 'small' | 'medium' | 'large';

export interface AttributeData {
  [key: string]: unknown;
}

export interface Pagination {
  current: number;
  pageSize: number;
  total: number;
  showTotal?: boolean;
  showPageSize?: boolean;
  pageSizeOptions?: number[];
}

export type SortType = 'descend' | 'ascend' | '' | string;

export interface Sort {
  column: string;
  type: SortType | string;
}

export interface GeneralChart {
  xAxis: string[];
  data: Array<{ name: string; value: number[] }>;
}

export interface HttpResponse<T = unknown> {
  status: 'success' | 'fail' | 'error';
  msg: string;
  code: number;
  data: T;
}

export interface ServiceResponse<T = unknown> extends HttpResponse<T> {
  meta: { current: number; limit: number; total: number };
}