-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
162 lines (134 loc) · 4.21 KB
/
index.d.ts
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// TypeScript Version: 2.4
import * as React from 'react';
import { Omit } from 'react-router';
export * from './lib';
export class Datagrid extends React.Component<IDatagridProps> { }
export class SimpleShowLayout extends React.Component<IAorFieldProps> { }
export class SingleFieldList extends React.Component<IAorFieldProps & {
linkType?: boolean;
style?: React.CSSProperties;
}> { }
export class TabbedShowLayout extends React.Component<IAorFieldProps & {
innerRef?(ref: any): void;
}> { }
export class Tab extends React.Component<IAorFieldProps & {
icon?: React.ReactChild;
label?: string | JSX.Element;
}> { }
export interface IDatagridProps {
styles?: {
table?: React.CSSProperties;
tbody?: React.CSSProperties;
tr?: React.CSSProperties;
header?: {
th?: React.CSSProperties;
'th:first-child'?: React.CSSProperties;
},
cell?: {
td?: React.CSSProperties;
'td:first-child'?: React.CSSProperties;
},
};
rowStyle?: (record: {}, index: number) => React.CSSProperties;
options?: React.CSSProperties;
headerOptions?: React.CSSProperties;
bodyOptions?: React.CSSProperties;
rowOptions?: React.CSSProperties;
}
export interface IFromListDataProps<T> {
currentSort?: {
field: string;
order: string;
};
data?: { [key: number]: T };
ids?: number[];
isLoading?: boolean;
resource?: string;
setSort?(): void;
}
export interface IOwnFieldProps {
source: string;
label?: string;
addLabel?: boolean;
sortable?: boolean;
headerClassName?: string;
cellClassName?: string;
className?: string;
textAlign?: 'left' | 'right'
}
export interface IAorFieldProps<T = any> {
record?: Record<string, T>;
basePath?: string;
}
export type IFieldProps<T = any> = IOwnFieldProps & IAorFieldProps<T>;
export class TextField extends React.Component<IFieldProps> { }
export class ChipField extends React.Component<IFieldProps> { }
export class BooleanField extends React.Component<IFieldProps> { }
export class EmailField extends React.Component<IFieldProps> { }
export class DateField extends React.Component<IFieldProps> { }
export class UrlField extends React.Component<IFieldProps> { }
export class ReferenceField extends React.Component<IFieldProps & {
reference: string;
allowEmpty?: boolean;
linkType?: 'edit' | 'show' | false;
}> { }
export class ReferenceArrayField extends React.Component<IFieldProps & {
reference: string;
}> { }
export class ReferenceManyField extends React.Component<Omit<IFieldProps, 'source'> & {
reference: string;
target: string;
perPage?: number;
}> { }
export function translate<Props extends ITranslateProps>(
WrappedComponent: React.ComponentType<Props>,
): React.ComponentClass<Omit<Props, keyof ITranslateProps>>
export type TranslateFunction = (code: string, params?: object | number) => string;
export interface ITranslateProps {
translate: TranslateFunction;
}
export class MenuItemLink extends React.Component<{
to: string;
primaryText: string;
leftIcon?: React.ReactElement<any>;
onClick(): void
}> { }
export class List extends React.Component<{
title?: string | JSX.Element,
perPage?: number,
defaultSort?: { field: string, order: 'ASC' | 'DESC' },
sort?: { field: string, order: 'ASC' | 'DESC' },
actions?: React.Component<void>,
filters?: JSX.Element,
bulkActions?: boolean;
pagination?: JSX.Element
}> { }
export class Show extends React.Component<{
title?: string | JSX.Element,
actions?: JSX.Element,
}> { }
export class RefreshButton extends React.Component { }
export interface ICustomListProps<T = any> {
data?: T[];
ids?: number[];
}
export class Filter extends React.Component { }
export interface IMenuProps {
onMenuTap(): void;
logout?: React.ReactChild;
hasDashboard: boolean;
}
export class Menu extends React.Component<IMenuProps> { }
export class Sidebar extends React.Component { }
export class Notification extends React.Component { }
export interface AppBarProps {
title: string | JSX.Element;
classes?: Record<string, string>;
open?: boolean;
}
export class AppBar extends React.Component<AppBarProps> { }
export class Authenticated extends React.Component<{
authParams?: object;
location: object;
}> { }
export function getResources(state: any): string[];