dce-reactkit 3.0.1 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -546
- package/dist/cjs/index.js +1841 -0
- package/dist/cjs/index.js.map +1 -0
- package/{lib/esm → dist/cjs}/types/components/AppWrapper.d.ts +26 -1
- package/dist/cjs/types/components/ButtonInputGroup.d.ts +12 -0
- package/dist/cjs/types/components/CheckboxButton.d.ts +20 -0
- package/dist/cjs/types/components/Drawer.d.ts +10 -0
- package/{lib/cjs/lib → dist/cjs/types}/components/ErrorBox.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/components/LoadingSpinner.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/components/Modal.d.ts +0 -0
- package/dist/cjs/types/components/RadioButton.d.ts +20 -0
- package/dist/cjs/types/components/SimpleDateChooser.d.ts +22 -0
- package/{lib/esm/lib → dist/cjs/types}/components/TabBox.d.ts +1 -0
- package/{lib/cjs/lib → dist/cjs/types}/errors/ErrorWithCode.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/abbreviate.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/avg.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/ceilToNumDecimals.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/floorToNumDecimals.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/forceNumIntoBounds.d.ts +0 -0
- package/dist/cjs/types/helpers/genRouteHandler.d.ts +34 -0
- package/dist/cjs/types/helpers/getOrdinal.d.ts +8 -0
- package/dist/cjs/types/helpers/getTimeInfoInET.d.ts +17 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/handleError.d.ts +5 -1
- package/{lib/cjs/lib → dist/cjs/types}/helpers/handleSuccess.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/padDecimalZeros.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/padZerosLeft.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/roundToNumDecimals.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/sum.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/visitServerEndpoint.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/helpers/waitMs.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/index.d.ts +14 -6
- package/dist/cjs/types/server/initServer.d.ts +21 -0
- package/{lib/cjs/lib → dist/cjs/types}/types/ModalButtonType.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/types/ModalSize.d.ts +0 -0
- package/{lib/cjs/lib → dist/cjs/types}/types/ModalType.d.ts +0 -0
- package/{lib → dist}/cjs/types/types/ParamType.d.ts +1 -1
- package/{lib → dist}/cjs/types/types/ReactKitErrorCode.d.ts +3 -1
- package/{lib/cjs/lib → dist/cjs/types}/types/Variant.d.ts +0 -0
- package/dist/esm/index.js +1797 -0
- package/dist/esm/index.js.map +1 -0
- package/{lib/cjs → dist/esm}/types/components/AppWrapper.d.ts +26 -1
- package/dist/esm/types/components/ButtonInputGroup.d.ts +12 -0
- package/dist/esm/types/components/CheckboxButton.d.ts +20 -0
- package/dist/esm/types/components/Drawer.d.ts +10 -0
- package/{lib/cjs → dist/esm}/types/components/ErrorBox.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/components/LoadingSpinner.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/components/Modal.d.ts +0 -0
- package/dist/esm/types/components/RadioButton.d.ts +20 -0
- package/dist/esm/types/components/SimpleDateChooser.d.ts +22 -0
- package/{lib/cjs/lib → dist/esm/types}/components/TabBox.d.ts +1 -0
- package/{lib/cjs → dist/esm}/types/errors/ErrorWithCode.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/abbreviate.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/avg.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/ceilToNumDecimals.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/floorToNumDecimals.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/forceNumIntoBounds.d.ts +0 -0
- package/dist/esm/types/helpers/genRouteHandler.d.ts +34 -0
- package/dist/esm/types/helpers/getOrdinal.d.ts +8 -0
- package/dist/esm/types/helpers/getTimeInfoInET.d.ts +17 -0
- package/{lib/cjs → dist/esm}/types/helpers/handleError.d.ts +5 -1
- package/{lib/cjs → dist/esm}/types/helpers/handleSuccess.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/padDecimalZeros.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/padZerosLeft.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/roundToNumDecimals.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/sum.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/visitServerEndpoint.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/helpers/waitMs.d.ts +0 -0
- package/{lib/esm/lib → dist/esm/types}/index.d.ts +14 -6
- package/dist/esm/types/server/initServer.d.ts +21 -0
- package/{lib/cjs → dist/esm}/types/types/ModalButtonType.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/types/ModalSize.d.ts +0 -0
- package/{lib/cjs → dist/esm}/types/types/ModalType.d.ts +0 -0
- package/{lib/esm/lib → dist/esm/types}/types/ParamType.d.ts +1 -1
- package/{lib/esm/lib → dist/esm/types}/types/ReactKitErrorCode.d.ts +3 -1
- package/{lib/cjs → dist/esm}/types/types/Variant.d.ts +0 -0
- package/dist/index.d.ts +507 -0
- package/package.json +18 -29
- package/rollup.config.js +14 -13
- package/src/components/AppWrapper.tsx +74 -12
- package/src/components/ButtonInputGroup.tsx +89 -0
- package/src/components/CheckboxButton.tsx +100 -0
- package/src/components/Drawer.tsx +76 -0
- package/src/components/ErrorBox.tsx +4 -4
- package/src/components/LoadingSpinner.tsx +3 -3
- package/src/components/Modal.tsx +214 -97
- package/src/components/RadioButton.tsx +102 -0
- package/src/components/SimpleDateChooser.tsx +222 -0
- package/src/components/TabBox.tsx +65 -58
- package/src/helpers/genRouteHandler.ts +348 -0
- package/src/helpers/getOrdinal.tsx +13 -0
- package/src/helpers/getTimeInfoInET.tsx +56 -0
- package/src/helpers/handleError.ts +65 -0
- package/src/helpers/handleSuccess.ts +18 -0
- package/src/helpers/visitServerEndpoint.tsx +110 -0
- package/src/index.ts +29 -0
- package/src/server/initServer.ts +53 -0
- package/src/types/ParamType.ts +18 -0
- package/src/types/ReactKitErrorCode.tsx +3 -1
- package/tsconfig.json +9 -7
- package/lib/cjs/index.js +0 -2
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/lib/components/AppWrapper.d.ts +0 -35
- package/lib/cjs/lib/helpers/parseRequest.d.ts +0 -21
- package/lib/cjs/lib/types/ParamType.d.ts +0 -17
- package/lib/cjs/lib/types/ReactKitErrorCode.d.ts +0 -13
- package/lib/cjs/types/components/TabBox.d.ts +0 -11
- package/lib/cjs/types/helpers/alert.d.ts +0 -2
- package/lib/cjs/types/helpers/confirm.d.ts +0 -2
- package/lib/cjs/types/helpers/parseRequest.d.ts +0 -21
- package/lib/cjs/types/helpers/showFatalError.d.ts +0 -2
- package/lib/cjs/types/index.d.ts +0 -22
- package/lib/esm/index.js +0 -16
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/lib/components/AppWrapper.d.ts +0 -35
- package/lib/esm/lib/components/ErrorBox.d.ts +0 -12
- package/lib/esm/lib/components/LoadingSpinner.d.ts +0 -7
- package/lib/esm/lib/components/Modal.d.ts +0 -40
- package/lib/esm/lib/errors/ErrorWithCode.d.ts +0 -9
- package/lib/esm/lib/helpers/abbreviate.d.ts +0 -10
- package/lib/esm/lib/helpers/avg.d.ts +0 -8
- package/lib/esm/lib/helpers/ceilToNumDecimals.d.ts +0 -9
- package/lib/esm/lib/helpers/floorToNumDecimals.d.ts +0 -9
- package/lib/esm/lib/helpers/forceNumIntoBounds.d.ts +0 -10
- package/lib/esm/lib/helpers/handleError.d.ts +0 -14
- package/lib/esm/lib/helpers/handleSuccess.d.ts +0 -8
- package/lib/esm/lib/helpers/padDecimalZeros.d.ts +0 -10
- package/lib/esm/lib/helpers/padZerosLeft.d.ts +0 -9
- package/lib/esm/lib/helpers/parseRequest.d.ts +0 -21
- package/lib/esm/lib/helpers/roundToNumDecimals.d.ts +0 -9
- package/lib/esm/lib/helpers/sum.d.ts +0 -8
- package/lib/esm/lib/helpers/visitServerEndpoint.d.ts +0 -23
- package/lib/esm/lib/helpers/waitMs.d.ts +0 -7
- package/lib/esm/lib/types/ModalButtonType.d.ts +0 -17
- package/lib/esm/lib/types/ModalSize.d.ts +0 -11
- package/lib/esm/lib/types/ModalType.d.ts +0 -16
- package/lib/esm/lib/types/Variant.d.ts +0 -15
- package/lib/esm/types/components/ErrorBox.d.ts +0 -12
- package/lib/esm/types/components/LoadingSpinner.d.ts +0 -7
- package/lib/esm/types/components/Modal.d.ts +0 -40
- package/lib/esm/types/components/TabBox.d.ts +0 -11
- package/lib/esm/types/errors/ErrorWithCode.d.ts +0 -9
- package/lib/esm/types/helpers/abbreviate.d.ts +0 -10
- package/lib/esm/types/helpers/alert.d.ts +0 -2
- package/lib/esm/types/helpers/avg.d.ts +0 -8
- package/lib/esm/types/helpers/ceilToNumDecimals.d.ts +0 -9
- package/lib/esm/types/helpers/confirm.d.ts +0 -2
- package/lib/esm/types/helpers/floorToNumDecimals.d.ts +0 -9
- package/lib/esm/types/helpers/forceNumIntoBounds.d.ts +0 -10
- package/lib/esm/types/helpers/handleError.d.ts +0 -14
- package/lib/esm/types/helpers/handleSuccess.d.ts +0 -8
- package/lib/esm/types/helpers/padDecimalZeros.d.ts +0 -10
- package/lib/esm/types/helpers/padZerosLeft.d.ts +0 -9
- package/lib/esm/types/helpers/parseRequest.d.ts +0 -21
- package/lib/esm/types/helpers/roundToNumDecimals.d.ts +0 -9
- package/lib/esm/types/helpers/showFatalError.d.ts +0 -2
- package/lib/esm/types/helpers/sum.d.ts +0 -8
- package/lib/esm/types/helpers/visitServerEndpoint.d.ts +0 -23
- package/lib/esm/types/helpers/waitMs.d.ts +0 -7
- package/lib/esm/types/index.d.ts +0 -22
- package/lib/esm/types/types/ModalButtonType.d.ts +0 -17
- package/lib/esm/types/types/ModalSize.d.ts +0 -11
- package/lib/esm/types/types/ModalType.d.ts +0 -16
- package/lib/esm/types/types/ParamType.d.ts +0 -17
- package/lib/esm/types/types/ReactKitErrorCode.d.ts +0 -13
- package/lib/esm/types/types/Variant.d.ts +0 -15
- package/lib/index.d.ts +0 -274
package/lib/index.d.ts
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A wrapper for the entire React app that adds global functionality like
|
|
6
|
-
* handling for fatal error messages
|
|
7
|
-
* @author Gabe Abrams
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare type Props$3 = {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
dark?: boolean;
|
|
13
|
-
sessionExpiredMessage?: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Show an alert modal with an "Okay" button
|
|
17
|
-
* @author Gabe Abrams
|
|
18
|
-
* @param title the title text to display at the top of the alert
|
|
19
|
-
* @param text the text to display in the alert
|
|
20
|
-
*/
|
|
21
|
-
declare const alert: (title: string, text: string) => Promise<undefined>;
|
|
22
|
-
/**
|
|
23
|
-
* Show a confirmation modal with an "Okay" and a "Cancel" button
|
|
24
|
-
* @author Gabe Abrams
|
|
25
|
-
* @param title the title text to display at the top of the alert
|
|
26
|
-
* @param text the text to display in the alert
|
|
27
|
-
* @returns true if the user confirmed
|
|
28
|
-
*/
|
|
29
|
-
declare const confirm: (title: string, text: string) => Promise<boolean>;
|
|
30
|
-
/**
|
|
31
|
-
* Show a fatal error message
|
|
32
|
-
* @author Gabe Abrams
|
|
33
|
-
* @param error the error to show
|
|
34
|
-
* @param [errorTitle] title of the error box
|
|
35
|
-
*/
|
|
36
|
-
declare const showFatalError: (error: any, errorTitle?: string) => undefined;
|
|
37
|
-
declare const AppWrapper: React.FC<Props$3>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Loading spinner/indicator
|
|
41
|
-
* @author Gabe Abrams
|
|
42
|
-
*/
|
|
43
|
-
declare const LoadingSpinner: () => JSX.Element;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Displays an error
|
|
47
|
-
* @author Gabe Abrams
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
declare type Props$2 = {
|
|
51
|
-
error: any;
|
|
52
|
-
title?: string;
|
|
53
|
-
onClose?: () => void;
|
|
54
|
-
};
|
|
55
|
-
declare const ErrorBox: React.FC<Props$2>;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Bootstrap variants
|
|
59
|
-
* @author Gabe Abrams
|
|
60
|
-
*/
|
|
61
|
-
declare enum Variant {
|
|
62
|
-
Primary = "primary",
|
|
63
|
-
Secondary = "secondary",
|
|
64
|
-
Success = "success",
|
|
65
|
-
Warning = "warning",
|
|
66
|
-
Info = "info",
|
|
67
|
-
Danger = "danger",
|
|
68
|
-
Light = "light",
|
|
69
|
-
Dark = "dark"
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Types of buttons in the modal
|
|
74
|
-
* @author Gabe Abrams
|
|
75
|
-
*/
|
|
76
|
-
declare enum ModalButtonType {
|
|
77
|
-
Okay = "okay",
|
|
78
|
-
Cancel = "cancel",
|
|
79
|
-
Yes = "yes",
|
|
80
|
-
No = "no",
|
|
81
|
-
Abandon = "abandon",
|
|
82
|
-
GoBack = "goBack",
|
|
83
|
-
Continue = "continue",
|
|
84
|
-
ImSure = "imSure",
|
|
85
|
-
Delete = "delete",
|
|
86
|
-
Confirm = "confirm"
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Modal sizes
|
|
91
|
-
* @author Gabe Abrams
|
|
92
|
-
*/
|
|
93
|
-
declare enum ModalSize {
|
|
94
|
-
Small = "sm",
|
|
95
|
-
Medium = "md",
|
|
96
|
-
Large = "lg",
|
|
97
|
-
ExtraLarge = "xl"
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Types of modals
|
|
102
|
-
* @author Gabe Abrams
|
|
103
|
-
*/
|
|
104
|
-
declare enum ModalType {
|
|
105
|
-
Okay = "okay",
|
|
106
|
-
OkayCancel = "okay-cancel",
|
|
107
|
-
YesNo = "yes-no",
|
|
108
|
-
YesNoCancel = "yes-no-cancel",
|
|
109
|
-
AbandonGoBack = "abandon-goBack",
|
|
110
|
-
ImSureCancel = "imSure-cancel",
|
|
111
|
-
DeleteCancel = "delete-cancel",
|
|
112
|
-
ConfirmCancel = "confirm-cancel",
|
|
113
|
-
NoButtons = "-"
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* A generic popup modal
|
|
118
|
-
* @author Gabe Abrams
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
declare type Props$1 = {
|
|
122
|
-
type?: ModalType;
|
|
123
|
-
size?: ModalSize;
|
|
124
|
-
title?: React.ReactNode;
|
|
125
|
-
children?: React.ReactNode;
|
|
126
|
-
onClose?: (type: ModalButtonType) => void;
|
|
127
|
-
dontAllowBackdropExit?: boolean;
|
|
128
|
-
okayLabel?: string;
|
|
129
|
-
okayVariant?: Variant;
|
|
130
|
-
cancelLabel?: string;
|
|
131
|
-
cancelVariant?: Variant;
|
|
132
|
-
yesLabel?: string;
|
|
133
|
-
yesVariant?: Variant;
|
|
134
|
-
noLabel?: string;
|
|
135
|
-
noVariant?: Variant;
|
|
136
|
-
abandonLabel?: string;
|
|
137
|
-
abandonVariant?: Variant;
|
|
138
|
-
goBackLabel?: string;
|
|
139
|
-
goBackVariant?: Variant;
|
|
140
|
-
continueLabel?: string;
|
|
141
|
-
continueVariant?: Variant;
|
|
142
|
-
imSureLabel?: string;
|
|
143
|
-
imSureVariant?: Variant;
|
|
144
|
-
deleteLabel?: string;
|
|
145
|
-
deleteVariant?: Variant;
|
|
146
|
-
confirmLabel?: string;
|
|
147
|
-
confirmVariant?: Variant;
|
|
148
|
-
onTopOfOtherModals?: boolean;
|
|
149
|
-
};
|
|
150
|
-
declare const Modal: React.FC<Props$1>;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* A box with a tab on the top that holds buttons and other content
|
|
154
|
-
* @author Gabe Abrams
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
declare type Props = {
|
|
158
|
-
title: React.ReactNode;
|
|
159
|
-
children: React.ReactNode;
|
|
160
|
-
};
|
|
161
|
-
declare const TabBox: React.FC<Props>;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* An error with a code
|
|
165
|
-
* @author Gabe Abrams
|
|
166
|
-
*/
|
|
167
|
-
declare class ErrorWithCode extends Error {
|
|
168
|
-
code: string;
|
|
169
|
-
constructor(message: string, code: string);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Shorten text so it fits into a certain number of chars
|
|
174
|
-
* @author Gabe Abrams
|
|
175
|
-
* @param text the text to abbreviate
|
|
176
|
-
* @param maxChars the maximum number of chars to include
|
|
177
|
-
* @returns abbreviated text with length no greater than maxChars
|
|
178
|
-
* (including ellipses if applicable)
|
|
179
|
-
*/
|
|
180
|
-
declare const abbreviate: (text: string, maxChars: number) => string;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Get the average of a set of numbers
|
|
184
|
-
* @author Gabe Abrams
|
|
185
|
-
* @param nums the numbers to average
|
|
186
|
-
* @returns average value or 0 if no numbers
|
|
187
|
-
*/
|
|
188
|
-
declare const avg: (nums: number[]) => number;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Round a number (ceiling) to a certain number of decimals
|
|
192
|
-
* @author Gabe Abrams
|
|
193
|
-
* @param num the number to round
|
|
194
|
-
* @param numDecimals the number of decimals to round to
|
|
195
|
-
* @returns rounded number
|
|
196
|
-
*/
|
|
197
|
-
declare const ceilToNumDecimals: (num: number, numDecimals: number) => number;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Round a number (floor) to a certain number of decimals
|
|
201
|
-
* @author Gabe Abrams
|
|
202
|
-
* @param num the number to round
|
|
203
|
-
* @param numDecimals the number of decimals to round to
|
|
204
|
-
* @returns rounded number
|
|
205
|
-
*/
|
|
206
|
-
declare const floorToNumDecimals: (num: number, numDecimals: number) => number;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Force a number to stay within specific bounds
|
|
210
|
-
* @author Gabe Abrams
|
|
211
|
-
* @param num the number to move into the bounds
|
|
212
|
-
* @param min the minimum number in the bound
|
|
213
|
-
* @param max the maximum number in the bound
|
|
214
|
-
* @returns bounded number
|
|
215
|
-
*/
|
|
216
|
-
declare const forceNumIntoBounds: (num: number, min: number, max: number) => number;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Pad a number's decimal with zeros on the right
|
|
220
|
-
* (e.g. 5.2 becomes 5.20 with 2 digit padding)
|
|
221
|
-
* @author Gabe Abrams
|
|
222
|
-
* @param num the number to pad
|
|
223
|
-
* @param numDigits the minimum number of digits after the decimal
|
|
224
|
-
* @returns padded number
|
|
225
|
-
*/
|
|
226
|
-
declare const padDecimalZeros: (num: number, numDigits: number) => string;
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Pad a number with zeros on the left (e.g. 5 becomes 05 with 2 digit padding)
|
|
230
|
-
* @author Gabe Abrams
|
|
231
|
-
* @param num the number to pad
|
|
232
|
-
* @param numDigits the minimum number of digits before the decimal
|
|
233
|
-
* @returns padded number
|
|
234
|
-
*/
|
|
235
|
-
declare const padZerosLeft: (num: number, numDigits: number) => string;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Round a number to a certain number of decimals
|
|
239
|
-
* @author Gabe Abrams
|
|
240
|
-
* @param num the number to round
|
|
241
|
-
* @param numDecimals the number of decimals to round to
|
|
242
|
-
* @returns rounded number
|
|
243
|
-
*/
|
|
244
|
-
declare const roundToNumDecimals: (num: number, numDecimals: number) => number;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Sum the numbers in an array
|
|
248
|
-
* @author Gabe Abrams
|
|
249
|
-
* @param nums the numbers to sum
|
|
250
|
-
* @returns the sum of the numbers
|
|
251
|
-
*/
|
|
252
|
-
declare const sum: (nums: number[]) => number;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Wait for a certain number of ms
|
|
256
|
-
* @author Gabe Abrams
|
|
257
|
-
* @param ms number of ms to wait
|
|
258
|
-
*/
|
|
259
|
-
declare const waitMs: (ms?: number) => Promise<unknown>;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* List of error codes built into the react kit
|
|
263
|
-
* @author Gabe Abrams
|
|
264
|
-
*/
|
|
265
|
-
declare enum ReactKitErrorCode {
|
|
266
|
-
NoResponse = "DRK1",
|
|
267
|
-
NoCode = "DRK2",
|
|
268
|
-
SessionExpired = "DRK3",
|
|
269
|
-
MissingParameter = "DRK4",
|
|
270
|
-
InvalidParameter = "DRK5",
|
|
271
|
-
WrongCourse = "DRK6"
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export { AppWrapper, ErrorBox, ErrorWithCode, LoadingSpinner, Modal, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, TabBox, Variant, abbreviate, alert, avg, ceilToNumDecimals, confirm, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, showFatalError, sum, waitMs };
|