forked from fedspendingtransparency/data-transparency-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
170 lines (150 loc) · 4.53 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
163
164
165
166
167
168
169
170
/** Declaration file generated by dts-gen */
import * as React from 'react';
/*~ You can declare types that are available via importing the module */
export interface PaginationProps {
changePage: (page: number) => void,
totalItems: number,
currentPage?: number,
pageSize?: number,
resultsText?: boolean | JSX.Element,
limitSelector?: boolean,
changeLimit?: (limit: number) => void,
goToPage?: boolean
}
interface tooltipWrapperControlledProps {
isControlled?: boolean,
showTooltip?: (bool: boolean) => void,
closeTooltip?: (bool: boolean) => void,
isVisible?: boolean
}
interface tooltipWrapperOffsetAdjustmentsProps {
top?: number,
right?: number,
left?: number
}
export interface TooltipWrapperProps {
className?: string,
children?: JSX.Element,
tooltipComponent?: JSX.Element,
left?: boolean,
wide?: boolean,
icon?: string,
controlledProps?: tooltipWrapperControlledProps,
offsetAdjustments?: tooltipWrapperOffsetAdjustmentsProps,
styles?: any
}
export interface QuarterPickerProps {
handleSelection: (quarter: number) => void,
selectedQuarters: Array<string>,
disabledQuarters: Array<string>,
selectedPeriods: Array<string>,
disabledPeriods: Array<string>,
periodsPerQuarter: Array<[object]>,
isCumulative: boolean,
showPeriods: boolean
}
interface LoadingMessageProps {
loadingText: string
};
interface PickerPropsOptions {
name: string | number,
value: string | number
onClick: (value: string | number) => void,
classNames?: string
}
export interface PickerProps {
sortFn: (a:any, b:any) => Array<any>,
icon: JSX.Element,
selectedOption: string,
className: string,
id: string,
options: PickerPropsOptions,
dropdownDirection: string,
isFixedWidth: boolean,
children: Array<JSX.Element> | JSX.Element
}
interface SearchBarProps {
onSearch: (value: string) => void,
minChars: number,
isDisabled: boolean,
throttleOnChange: number,
inputTitle: string
}
export interface SearchBarProps {
onSearch: (value: string) => void,
minChars: number,
isDisabled: boolean,
throttleOnChange: number,
inputTitle: string
}
interface TabsProps {
types: Array<[object]>
active: string,
switchTab: (value: string) => void
}
export interface TabsProps {
types: Array<[object]>
active: string,
switchTab: (value: string) => void
}
interface TooltipComponentTextAlign {
title?: string,
text?: string
}
export interface TooltipComponentProps {
title: string,
children: Array<JSX.Element> | JSX.Element,
className: string,
textAlign: TooltipComponentTextAlign
}
interface tableCurrentSortProps {
direction: string,
field: string
}
export interface TableProps {
columns: Array<Object>,
rows: Array<Object|[]>,
currentSort: tableCurrentSortProps,
updateSort: (title: string, direction: string) => void,
expandable: boolean,
divider: string,
classNames: string
}
export interface GenericMessageProps {
title: string,
description: string,
icon: object,
className: string
}
export interface ErrorMessageProps {
description: string
}
/*~ If this module has methods, declare them as functions like so.
*/
export class Pagination extends React.Component<PaginationProps>{}
export class TooltipWrapper extends React.Component<TooltipWrapperProps>{}
export class QuarterPicker extends React.Component<QuarterPickerProps>{}
export function Picker(props: PickerProps): JSX.Element;
export function SearchBar(props: SearchBarProps): JSX.Element;
export function Tabs(props: TabsProps): JSX.Element;
export function TooltipComponent(props: TooltipComponentProps): JSX.Element;
export function Table(props: TableProps): JSX.Element;
export function GenericMessage(props: GenericMessageProps): JSX.Element;
export function LoadingMessage(props: LoadingMessageProps): JSX.Element;
export function ErrorMessage(props: ErrorMessageProps): JSX.Element;
export function useCumulativeQuarterPicker(initialState: Array<string>): [Array<string>, () => void]
/*~ If there are types, properties, or methods inside dotted names
*~ of the module, declare them inside a 'namespace'.
*/
// export namespace Helpers {
// /*~ For example, given this definition, someone could write:
// *~ import { subProp } from 'yourModule';
// *~ subProp.foo();
// *~ or
// *~ import * as yourMod from 'yourModule';
// *~ yourMod.subProp.foo();
// */
// namespace MoneyFormatter {
// function foo(): void;
// }
// }