summaryrefslogtreecommitdiff
path: root/src/custom.d.ts
blob: 8e1274209616bfa9af1925cef076b77f720379e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/// <reference types="react/experimental" />
/// <reference types="react-dom/experimental" />

// for css modules
declare module '*.module.css' {
  const classes: { [key: string]: string };
  export default classes;
}
declare module '*.module.scss' {
  const classes: { [key: string]: string };
  export default classes;
}

interface Window {
  i18n: any;
}

// webpack definePlugin replacing variables
declare const __VERSION__: string;
declare const process = {
  env: {
    NODE_ENV: string,
    PUBLIC_URL: string,
  },
};

declare module 'react-table' {
  interface TableOptions {}

  interface Empty {}

  interface SortByToggleProps {}

  interface Header {
    getHeaderProps(p: SortByToggleProps): { role?: string };
    getSortByToggleProps(): SortByToggleProps;
    render(x: string): string;
    isSorted: boolean;
    isSortedDesc: boolean;
  }

  interface HeaderGroup {
    getHeaderGroupProps(): { role?: string };
    headers: Header[];
  }

  interface Cell {
    getCellProps(): { role?: string };

    column: { id: string };
    value: number;
  }

  interface Row {
    cells: Cell[];
  }

  export function useTable(
    options: TableOptions,
    useSortBy: useSortBy
  ): {
    headerGroups: HeaderGroup[];
    getTableProps(): { role?: string };
    rows: Row[];
    prepareRow(r: Row): void;
  };

  export function useSortBy(): Empty;
}