@elliemae/ds-props-helpers 2.2.0 → 2.2.2
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/cjs/globalProps/constants.js +15 -0
- package/cjs/globalProps/globalAttributesPropTypes.js +382 -0
- package/cjs/globalProps/index.js +11 -0
- package/cjs/globalProps/useGetGlobalAttributes.js +36 -0
- package/cjs/index.js +8 -0
- package/cjs/propTypes/PropTypes.js +130 -0
- package/cjs/propTypes/customPropTypes.js +21 -0
- package/cjs/propTypes/describe.js +64 -0
- package/cjs/propTypes/describeConversions.js +104 -0
- package/cjs/propTypes/describeGuards.js +21 -0
- package/cjs/propTypes/index.js +11 -0
- package/cjs/propTypes/toTypescript.js +160 -0
- package/cjs/propTypes/types.js +2 -0
- package/cjs/validation/typescriptValidator.js +3 -2
- package/esm/globalProps/constants.js +11 -0
- package/esm/globalProps/globalAttributesPropTypes.js +378 -0
- package/esm/globalProps/index.js +2 -0
- package/esm/globalProps/useGetGlobalAttributes.js +32 -0
- package/esm/index.js +4 -0
- package/esm/propTypes/PropTypes.js +124 -0
- package/esm/propTypes/customPropTypes.js +17 -0
- package/esm/propTypes/describe.js +62 -0
- package/esm/propTypes/describeConversions.js +96 -0
- package/esm/propTypes/describeGuards.js +10 -0
- package/esm/propTypes/index.js +2 -0
- package/esm/propTypes/toTypescript.js +154 -0
- package/esm/propTypes/types.js +1 -0
- package/esm/validation/typescriptValidator.js +2 -1
- package/package.json +56 -4
- package/types/globalProps/constants.d.ts +3 -0
- package/types/globalProps/globalAttributesPropTypes.d.ts +363 -0
- package/types/globalProps/index.d.ts +2 -0
- package/types/globalProps/useGetGlobalAttributes.d.ts +5 -0
- package/types/index.d.ts +2 -0
- package/types/propTypes/PropTypes.d.ts +3 -0
- package/types/propTypes/customPropTypes.d.ts +2 -0
- package/types/propTypes/describe.d.ts +3 -0
- package/types/propTypes/describeConversions.d.ts +3 -0
- package/types/propTypes/describeGuards.d.ts +9 -0
- package/types/propTypes/index.d.ts +3 -0
- package/types/propTypes/toTypescript.d.ts +3 -0
- package/types/propTypes/types.d.ts +96 -0
- package/types/tests/globalProps/TestComponent.d.ts +1 -0
- package/types/tests/{any.validation.test.d.ts → globalProps/globalAttributes.test.d.ts} +0 -0
- package/types/tests/{array.validation.test.d.ts → validation/any.validation.test.d.ts} +0 -0
- package/types/tests/{boolean.validation.test.d.ts → validation/array.validation.test.d.ts} +0 -0
- package/types/tests/{function.validation.test.d.ts → validation/boolean.validation.test.d.ts} +0 -0
- package/types/tests/{number.validation.test.d.ts → validation/function.validation.test.d.ts} +0 -0
- package/types/tests/{object.validation.test.d.ts → validation/number.validation.test.d.ts} +0 -0
- package/types/tests/{schema.validation.test.d.ts → validation/object.validation.test.d.ts} +0 -0
- package/types/tests/{string.validation.test.d.ts → validation/schema.validation.test.d.ts} +0 -0
- package/types/tests/{union.validation.test.d.ts → validation/string.validation.test.d.ts} +0 -0
- package/types/tests/{test.schema.d.ts → validation/test.schema.d.ts} +0 -0
- package/types/tests/validation/union.validation.test.d.ts +1 -0
- package/types/validation/typescriptValidator.d.ts +2 -2
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
export declare const globalAttributesPropTypes: {
|
|
2
|
+
'aria-*': any;
|
|
3
|
+
'on-*': any;
|
|
4
|
+
'data-*': any;
|
|
5
|
+
'all HTML attributes': any;
|
|
6
|
+
about: any;
|
|
7
|
+
accept: any;
|
|
8
|
+
acceptCharset: any;
|
|
9
|
+
accessKey: any;
|
|
10
|
+
action: any;
|
|
11
|
+
allowFullScreen: any;
|
|
12
|
+
allowTransparency: any;
|
|
13
|
+
alt: any;
|
|
14
|
+
'aria-activedescendant': any;
|
|
15
|
+
'aria-atomic': any;
|
|
16
|
+
'aria-autocomplete': any;
|
|
17
|
+
'aria-busy': any;
|
|
18
|
+
'aria-checked': any;
|
|
19
|
+
'aria-colcount': any;
|
|
20
|
+
'aria-colindex': any;
|
|
21
|
+
'aria-colspan': any;
|
|
22
|
+
'aria-controls': any;
|
|
23
|
+
'aria-current': any;
|
|
24
|
+
'aria-describedby': any;
|
|
25
|
+
'aria-details': any;
|
|
26
|
+
'aria-disabled': any;
|
|
27
|
+
'aria-dropeffect': any;
|
|
28
|
+
'aria-errormessage': any;
|
|
29
|
+
'aria-expanded': any;
|
|
30
|
+
'aria-flowto': any;
|
|
31
|
+
'aria-grabbed': any;
|
|
32
|
+
'aria-haspopup': any;
|
|
33
|
+
'aria-hidden': any;
|
|
34
|
+
'aria-invalid': any;
|
|
35
|
+
'aria-keyshortcuts': any;
|
|
36
|
+
'aria-label': any;
|
|
37
|
+
'aria-labelledby': any;
|
|
38
|
+
'aria-level': any;
|
|
39
|
+
'aria-live': any;
|
|
40
|
+
'aria-modal': any;
|
|
41
|
+
'aria-multiline': any;
|
|
42
|
+
'aria-multiselectable': any;
|
|
43
|
+
'aria-orientation': any;
|
|
44
|
+
'aria-owns': any;
|
|
45
|
+
'aria-placeholder': any;
|
|
46
|
+
'aria-posinset': any;
|
|
47
|
+
'aria-pressed': any;
|
|
48
|
+
'aria-readonly': any;
|
|
49
|
+
'aria-relevant': any;
|
|
50
|
+
'aria-required': any;
|
|
51
|
+
'aria-roledescription': any;
|
|
52
|
+
'aria-rowcount': any;
|
|
53
|
+
'aria-rowindex': any;
|
|
54
|
+
'aria-rowspan': any;
|
|
55
|
+
'aria-selected': any;
|
|
56
|
+
'aria-setsize': any;
|
|
57
|
+
'aria-sort': any;
|
|
58
|
+
'aria-valuemax': any;
|
|
59
|
+
'aria-valuemin': any;
|
|
60
|
+
'aria-valuenow': any;
|
|
61
|
+
'aria-valuetext': any;
|
|
62
|
+
as: any;
|
|
63
|
+
async: any;
|
|
64
|
+
autoCapitalize: any;
|
|
65
|
+
autoComplete: any;
|
|
66
|
+
autoCorrect: any;
|
|
67
|
+
autoFocus: any;
|
|
68
|
+
autoPlay: any;
|
|
69
|
+
autoSave: any;
|
|
70
|
+
capture: any;
|
|
71
|
+
cellPadding: any;
|
|
72
|
+
cellSpacing: any;
|
|
73
|
+
challenge: any;
|
|
74
|
+
charSet: any;
|
|
75
|
+
checked: any;
|
|
76
|
+
cite: any;
|
|
77
|
+
classID: any;
|
|
78
|
+
className: any;
|
|
79
|
+
color: any;
|
|
80
|
+
cols: any;
|
|
81
|
+
colSpan: any;
|
|
82
|
+
content: any;
|
|
83
|
+
contentEditable: any;
|
|
84
|
+
contextMenu: any;
|
|
85
|
+
controls: any;
|
|
86
|
+
coords: any;
|
|
87
|
+
crossOrigin: any;
|
|
88
|
+
data: any;
|
|
89
|
+
datatype: any;
|
|
90
|
+
dateTime: any;
|
|
91
|
+
default: any;
|
|
92
|
+
defaultChecked: any;
|
|
93
|
+
defaultValue: any;
|
|
94
|
+
defer: any;
|
|
95
|
+
dir: any;
|
|
96
|
+
disabled: any;
|
|
97
|
+
download: any;
|
|
98
|
+
draggable: any;
|
|
99
|
+
encType: any;
|
|
100
|
+
form: any;
|
|
101
|
+
formAction: any;
|
|
102
|
+
formEncType: any;
|
|
103
|
+
formMethod: any;
|
|
104
|
+
formNoValidate: any;
|
|
105
|
+
formTarget: any;
|
|
106
|
+
frameBorder: any;
|
|
107
|
+
headers: any;
|
|
108
|
+
height: any;
|
|
109
|
+
hidden: any;
|
|
110
|
+
high: any;
|
|
111
|
+
href: any;
|
|
112
|
+
hrefLang: any;
|
|
113
|
+
htmlFor: any;
|
|
114
|
+
httpEquiv: any;
|
|
115
|
+
id: any;
|
|
116
|
+
inlist: any;
|
|
117
|
+
inputMode: any;
|
|
118
|
+
integrity: any;
|
|
119
|
+
is: any;
|
|
120
|
+
itemID: any;
|
|
121
|
+
itemProp: any;
|
|
122
|
+
itemRef: any;
|
|
123
|
+
itemScope: any;
|
|
124
|
+
itemType: any;
|
|
125
|
+
keyParams: any;
|
|
126
|
+
keyType: any;
|
|
127
|
+
kind: any;
|
|
128
|
+
label: any;
|
|
129
|
+
lang: any;
|
|
130
|
+
list: any;
|
|
131
|
+
loop: any;
|
|
132
|
+
low: any;
|
|
133
|
+
manifest: any;
|
|
134
|
+
marginHeight: any;
|
|
135
|
+
marginWidth: any;
|
|
136
|
+
max: any;
|
|
137
|
+
maxLength: any;
|
|
138
|
+
media: any;
|
|
139
|
+
mediaGroup: any;
|
|
140
|
+
method: any;
|
|
141
|
+
min: any;
|
|
142
|
+
minLength: any;
|
|
143
|
+
multiple: any;
|
|
144
|
+
muted: any;
|
|
145
|
+
name: any;
|
|
146
|
+
nonce: any;
|
|
147
|
+
noValidate: any;
|
|
148
|
+
onAbort: any;
|
|
149
|
+
onAbortCapture: any;
|
|
150
|
+
onAnimationEnd: any;
|
|
151
|
+
onAnimationEndCapture: any;
|
|
152
|
+
onAnimationIteration: any;
|
|
153
|
+
onAnimationIterationCapture: any;
|
|
154
|
+
onAnimationStart: any;
|
|
155
|
+
onAnimationStartCapture: any;
|
|
156
|
+
onAuxClick: any;
|
|
157
|
+
onAuxClickCapture: any;
|
|
158
|
+
onBeforeInput: any;
|
|
159
|
+
onBeforeInputCapture: any;
|
|
160
|
+
onBlur: any;
|
|
161
|
+
onBlurCapture: any;
|
|
162
|
+
onCanPlay: any;
|
|
163
|
+
onCanPlayCapture: any;
|
|
164
|
+
onCanPlayThrough: any;
|
|
165
|
+
onCanPlayThroughCapture: any;
|
|
166
|
+
onChange: any;
|
|
167
|
+
onChangeCapture: any;
|
|
168
|
+
onClick: any;
|
|
169
|
+
onClickCapture: any;
|
|
170
|
+
onCompositionEnd: any;
|
|
171
|
+
onCompositionEndCapture: any;
|
|
172
|
+
onCompositionStart: any;
|
|
173
|
+
onCompositionStartCapture: any;
|
|
174
|
+
onCompositionUpdate: any;
|
|
175
|
+
onCompositionUpdateCapture: any;
|
|
176
|
+
onContextMenu: any;
|
|
177
|
+
onContextMenuCapture: any;
|
|
178
|
+
onCopy: any;
|
|
179
|
+
onCopyCapture: any;
|
|
180
|
+
onCut: any;
|
|
181
|
+
onCutCapture: any;
|
|
182
|
+
onDoubleClick: any;
|
|
183
|
+
onDoubleClickCapture: any;
|
|
184
|
+
onDrag: any;
|
|
185
|
+
onDragCapture: any;
|
|
186
|
+
onDragEnd: any;
|
|
187
|
+
onDragEndCapture: any;
|
|
188
|
+
onDragEnter: any;
|
|
189
|
+
onDragEnterCapture: any;
|
|
190
|
+
onDragExit: any;
|
|
191
|
+
onDragExitCapture: any;
|
|
192
|
+
onDragLeave: any;
|
|
193
|
+
onDragLeaveCapture: any;
|
|
194
|
+
onDragOver: any;
|
|
195
|
+
onDragOverCapture: any;
|
|
196
|
+
onDragStart: any;
|
|
197
|
+
onDragStartCapture: any;
|
|
198
|
+
onDrop: any;
|
|
199
|
+
onDropCapture: any;
|
|
200
|
+
onDurationChange: any;
|
|
201
|
+
onDurationChangeCapture: any;
|
|
202
|
+
onEmptied: any;
|
|
203
|
+
onEmptiedCapture: any;
|
|
204
|
+
onEncrypted: any;
|
|
205
|
+
onEncryptedCapture: any;
|
|
206
|
+
onEnded: any;
|
|
207
|
+
onEndedCapture: any;
|
|
208
|
+
onError: any;
|
|
209
|
+
onErrorCapture: any;
|
|
210
|
+
onFocus: any;
|
|
211
|
+
onFocusCapture: any;
|
|
212
|
+
onGotPointerCapture: any;
|
|
213
|
+
onGotPointerCaptureCapture: any;
|
|
214
|
+
onInput: any;
|
|
215
|
+
onInputCapture: any;
|
|
216
|
+
onInvalid: any;
|
|
217
|
+
onInvalidCapture: any;
|
|
218
|
+
onKeyDown: any;
|
|
219
|
+
onKeyDownCapture: any;
|
|
220
|
+
onKeyPress: any;
|
|
221
|
+
onKeyPressCapture: any;
|
|
222
|
+
onKeyUp: any;
|
|
223
|
+
onKeyUpCapture: any;
|
|
224
|
+
onLoad: any;
|
|
225
|
+
onLoadCapture: any;
|
|
226
|
+
onLoadedData: any;
|
|
227
|
+
onLoadedDataCapture: any;
|
|
228
|
+
onLoadedMetadata: any;
|
|
229
|
+
onLoadedMetadataCapture: any;
|
|
230
|
+
onLoadStart: any;
|
|
231
|
+
onLoadStartCapture: any;
|
|
232
|
+
onLostPointerCapture: any;
|
|
233
|
+
onLostPointerCaptureCapture: any;
|
|
234
|
+
onMouseDown: any;
|
|
235
|
+
onMouseDownCapture: any;
|
|
236
|
+
onMouseEnter: any;
|
|
237
|
+
onMouseLeave: any;
|
|
238
|
+
onMouseMove: any;
|
|
239
|
+
onMouseMoveCapture: any;
|
|
240
|
+
onMouseOut: any;
|
|
241
|
+
onMouseOutCapture: any;
|
|
242
|
+
onMouseOver: any;
|
|
243
|
+
onMouseOverCapture: any;
|
|
244
|
+
onMouseUp: any;
|
|
245
|
+
onMouseUpCapture: any;
|
|
246
|
+
onPaste: any;
|
|
247
|
+
onPasteCapture: any;
|
|
248
|
+
onPause: any;
|
|
249
|
+
onPauseCapture: any;
|
|
250
|
+
onPlay: any;
|
|
251
|
+
onPlayCapture: any;
|
|
252
|
+
onPlaying: any;
|
|
253
|
+
onPlayingCapture: any;
|
|
254
|
+
onPointerCancel: any;
|
|
255
|
+
onPointerCancelCapture: any;
|
|
256
|
+
onPointerDown: any;
|
|
257
|
+
onPointerDownCapture: any;
|
|
258
|
+
onPointerEnter: any;
|
|
259
|
+
onPointerEnterCapture: any;
|
|
260
|
+
onPointerLeave: any;
|
|
261
|
+
onPointerLeaveCapture: any;
|
|
262
|
+
onPointerMove: any;
|
|
263
|
+
onPointerMoveCapture: any;
|
|
264
|
+
onPointerOut: any;
|
|
265
|
+
onPointerOutCapture: any;
|
|
266
|
+
onPointerOver: any;
|
|
267
|
+
onPointerOverCapture: any;
|
|
268
|
+
onPointerUp: any;
|
|
269
|
+
onPointerUpCapture: any;
|
|
270
|
+
onProgress: any;
|
|
271
|
+
onProgressCapture: any;
|
|
272
|
+
onRateChange: any;
|
|
273
|
+
onRateChangeCapture: any;
|
|
274
|
+
onReset: any;
|
|
275
|
+
onResetCapture: any;
|
|
276
|
+
onScroll: any;
|
|
277
|
+
onScrollCapture: any;
|
|
278
|
+
onSeeked: any;
|
|
279
|
+
onSeekedCapture: any;
|
|
280
|
+
onSeeking: any;
|
|
281
|
+
onSeekingCapture: any;
|
|
282
|
+
onSelect: any;
|
|
283
|
+
onSelectCapture: any;
|
|
284
|
+
onStalled: any;
|
|
285
|
+
onStalledCapture: any;
|
|
286
|
+
onSubmit: any;
|
|
287
|
+
onSubmitCapture: any;
|
|
288
|
+
onSuspend: any;
|
|
289
|
+
onSuspendCapture: any;
|
|
290
|
+
onTimeUpdate: any;
|
|
291
|
+
onTimeUpdateCapture: any;
|
|
292
|
+
onTouchCancel: any;
|
|
293
|
+
onTouchCancelCapture: any;
|
|
294
|
+
onTouchEnd: any;
|
|
295
|
+
onTouchEndCapture: any;
|
|
296
|
+
onTouchMove: any;
|
|
297
|
+
onTouchMoveCapture: any;
|
|
298
|
+
onTouchStart: any;
|
|
299
|
+
onTouchStartCapture: any;
|
|
300
|
+
onTransitionEnd: any;
|
|
301
|
+
onTransitionEndCapture: any;
|
|
302
|
+
onVolumeChange: any;
|
|
303
|
+
onVolumeChangeCapture: any;
|
|
304
|
+
onWaiting: any;
|
|
305
|
+
onWaitingCapture: any;
|
|
306
|
+
onWheel: any;
|
|
307
|
+
onWheelCapture: any;
|
|
308
|
+
open: any;
|
|
309
|
+
optimum: any;
|
|
310
|
+
pattern: any;
|
|
311
|
+
placeholder: any;
|
|
312
|
+
playsInline: any;
|
|
313
|
+
poster: any;
|
|
314
|
+
prefix: any;
|
|
315
|
+
preload: any;
|
|
316
|
+
property: any;
|
|
317
|
+
radioGroup: any;
|
|
318
|
+
readOnly: any;
|
|
319
|
+
rel: any;
|
|
320
|
+
required: any;
|
|
321
|
+
resource: any;
|
|
322
|
+
results: any;
|
|
323
|
+
reversed: any;
|
|
324
|
+
role: any;
|
|
325
|
+
rows: any;
|
|
326
|
+
rowSpan: any;
|
|
327
|
+
sandbox: any;
|
|
328
|
+
scope: any;
|
|
329
|
+
scoped: any;
|
|
330
|
+
scrolling: any;
|
|
331
|
+
seamless: any;
|
|
332
|
+
security: any;
|
|
333
|
+
selected: any;
|
|
334
|
+
shape: any;
|
|
335
|
+
size: any;
|
|
336
|
+
sizes: any;
|
|
337
|
+
slot: any;
|
|
338
|
+
span: any;
|
|
339
|
+
spellCheck: any;
|
|
340
|
+
src: any;
|
|
341
|
+
srcDoc: any;
|
|
342
|
+
srcLang: any;
|
|
343
|
+
srcSet: any;
|
|
344
|
+
start: any;
|
|
345
|
+
step: any;
|
|
346
|
+
style: any;
|
|
347
|
+
summary: any;
|
|
348
|
+
suppressContentEditableWarning: any;
|
|
349
|
+
suppressHydrationWarning: any;
|
|
350
|
+
tabIndex: any;
|
|
351
|
+
target: any;
|
|
352
|
+
title: any;
|
|
353
|
+
translate: any;
|
|
354
|
+
type: any;
|
|
355
|
+
typeof: any;
|
|
356
|
+
unselectable: any;
|
|
357
|
+
useMap: any;
|
|
358
|
+
value: any;
|
|
359
|
+
vocab: any;
|
|
360
|
+
width: any;
|
|
361
|
+
wmode: any;
|
|
362
|
+
wrap: any;
|
|
363
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AriaAttributes, DOMAttributes, HTMLAttributes } from 'react';
|
|
2
|
+
import { GlobalAttributes } from './constants';
|
|
3
|
+
declare type PropsWithAttributes<T extends Record<string, unknown>> = T & AriaAttributes & DOMAttributes<Element> & HTMLAttributes<Element>;
|
|
4
|
+
export declare const useGetGlobalAttributes: <T extends Record<string, unknown>>(props: PropsWithAttributes<T>, overrides: GlobalAttributes<(...args: unknown[]) => unknown>) => AriaAttributes & DOMAttributes<Element> & HTMLAttributes<Element>;
|
|
5
|
+
export {};
|
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AllPropTypes, ParametizedPropTypes, ReactDescT } from './types';
|
|
2
|
+
export declare const hasArguments: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is ParametizedPropTypes;
|
|
3
|
+
export declare const isOneOfType: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").oneOfType;
|
|
4
|
+
export declare const isArrayOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").arrayOf;
|
|
5
|
+
export declare const isShape: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").shape;
|
|
6
|
+
export declare const isInstanceOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").instanceOf;
|
|
7
|
+
export declare const isOneOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").oneOf;
|
|
8
|
+
export declare const isObjectOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").objectOf;
|
|
9
|
+
export declare const isExact: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is typeof import("prop-types").exact;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { any, array, bool, func, number, object, string, node, element, symbol, elementType, instanceOf, oneOf, oneOfType, arrayOf, objectOf, shape, exact, ValidationMap } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ReactDescObjT {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
deprecated?: Record<string, string>;
|
|
7
|
+
description?: string;
|
|
8
|
+
defaultValue?: unknown;
|
|
9
|
+
format?: string;
|
|
10
|
+
warned?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare type InstanceOfT = typeof instanceOf;
|
|
13
|
+
export declare type OneOfT = typeof oneOf;
|
|
14
|
+
export declare type ObjectOfT = typeof objectOf;
|
|
15
|
+
export declare type ExactT = typeof exact;
|
|
16
|
+
export declare type OneOfTypeT = typeof oneOfType;
|
|
17
|
+
export declare type ArrayOfT = typeof arrayOf;
|
|
18
|
+
export declare type ShapeT = typeof shape;
|
|
19
|
+
export declare type AnyT = typeof any;
|
|
20
|
+
export declare type ArrayT = typeof array;
|
|
21
|
+
export declare type BoolT = typeof bool;
|
|
22
|
+
export declare type FuncT = typeof func;
|
|
23
|
+
export declare type NumberT = typeof number;
|
|
24
|
+
export declare type ObjectT = typeof object;
|
|
25
|
+
export declare type StringT = typeof string;
|
|
26
|
+
export declare type NodeT = typeof node;
|
|
27
|
+
export declare type ElementT = typeof element;
|
|
28
|
+
export declare type SymbolT = typeof symbol;
|
|
29
|
+
export declare type ElementTypeT = typeof elementType;
|
|
30
|
+
export declare type ParametizedPropTypes = InstanceOfT | OneOfT | ObjectOfT | ExactT | OneOfTypeT | ArrayOfT | ShapeT;
|
|
31
|
+
export declare type AllPropTypes = AnyT | ArrayT | BoolT | FuncT | NumberT | ObjectT | StringT | NodeT | ElementT | SymbolT | ElementTypeT | ParametizedPropTypes;
|
|
32
|
+
export declare type PropTypesTypes = 'any' | 'array' | 'bool' | 'func' | 'number' | 'object' | 'string' | 'node' | 'element' | 'symbol' | 'elementType' | 'instanceOf' | 'oneOf' | 'oneOfType' | 'arrayOf' | 'objectOf' | 'shape' | 'exact' | 'tuple';
|
|
33
|
+
export interface ReactDescT {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
type: PropTypesTypes;
|
|
36
|
+
defaultValue: (this: ReactDescT, dfault: unknown) => ReactDescT;
|
|
37
|
+
deprecated: (this: ReactDescT, info: Record<string, string>) => ReactDescT;
|
|
38
|
+
description: (this: ReactDescT, descr: string) => ReactDescT;
|
|
39
|
+
format: (this: ReactDescT, format: string) => ReactDescT;
|
|
40
|
+
isRequired: ReactDescT;
|
|
41
|
+
reactDesc: ReactDescObjT;
|
|
42
|
+
args?: ReactDescT | ReactDescT[] | Record<string, ReactDescT> | unknown[] | Parameters<InstanceOfT>[0] | Parameters<OneOfT>[0] | Parameters<ObjectOfT>[0] | Parameters<ExactT>[0];
|
|
43
|
+
}
|
|
44
|
+
export interface ComponentDocumentation {
|
|
45
|
+
propTypes: Record<string, ReactDescT>;
|
|
46
|
+
availableAt?: unknown;
|
|
47
|
+
description?: unknown;
|
|
48
|
+
details?: unknown;
|
|
49
|
+
deprecated?: unknown;
|
|
50
|
+
usage?: unknown;
|
|
51
|
+
intrinsicElement?: unknown;
|
|
52
|
+
toTypescript?: unknown;
|
|
53
|
+
}
|
|
54
|
+
export interface TypescriptDocumentation extends Partial<ComponentDocumentation> {
|
|
55
|
+
name: string;
|
|
56
|
+
properties?: {
|
|
57
|
+
name: string;
|
|
58
|
+
required?: boolean | undefined;
|
|
59
|
+
deprecated?: Record<string, string> | undefined;
|
|
60
|
+
description?: string | undefined;
|
|
61
|
+
format?: string | undefined;
|
|
62
|
+
warned?: boolean | undefined;
|
|
63
|
+
}[];
|
|
64
|
+
}
|
|
65
|
+
export declare type DocumentedReactComponent<T> = React.ComponentType<T> & {
|
|
66
|
+
availableAt: unknown;
|
|
67
|
+
description: unknown;
|
|
68
|
+
details: unknown;
|
|
69
|
+
deprecated: unknown;
|
|
70
|
+
usage: unknown;
|
|
71
|
+
intrinsicElement: unknown;
|
|
72
|
+
toTypescript: unknown;
|
|
73
|
+
propTypesValue: ValidationMap<Record<string, unknown>>;
|
|
74
|
+
};
|
|
75
|
+
export declare type DocumentedPropType = ReactDescT;
|
|
76
|
+
export declare type PropTypesObj = {
|
|
77
|
+
any: DocumentedPropType;
|
|
78
|
+
array: DocumentedPropType;
|
|
79
|
+
bool: DocumentedPropType;
|
|
80
|
+
func: DocumentedPropType;
|
|
81
|
+
number: DocumentedPropType;
|
|
82
|
+
object: DocumentedPropType;
|
|
83
|
+
string: DocumentedPropType;
|
|
84
|
+
node: DocumentedPropType;
|
|
85
|
+
element: DocumentedPropType;
|
|
86
|
+
symbol: DocumentedPropType;
|
|
87
|
+
elementType: DocumentedPropType;
|
|
88
|
+
instanceOf: (cls: unknown) => DocumentedPropType;
|
|
89
|
+
oneOf: (arr: unknown[]) => DocumentedPropType;
|
|
90
|
+
oneOfType: (arr: DocumentedPropType[]) => DocumentedPropType;
|
|
91
|
+
arrayOf: (smth: DocumentedPropType) => DocumentedPropType;
|
|
92
|
+
objectOf: (smth: DocumentedPropType) => DocumentedPropType;
|
|
93
|
+
shape: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;
|
|
94
|
+
exact: (obj: Record<string, DocumentedPropType>) => DocumentedPropType;
|
|
95
|
+
tuple: (arr: DocumentedPropType[]) => DocumentedPropType;
|
|
96
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function TestComponent(props: any): JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/tests/{function.validation.test.d.ts → validation/boolean.validation.test.d.ts}
RENAMED
|
File without changes
|
package/types/tests/{number.validation.test.d.ts → validation/function.validation.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
interface TypescriptSchema {
|
|
3
3
|
description: string;
|
|
4
4
|
name: string;
|
|
@@ -11,5 +11,5 @@ interface TypescriptSchema {
|
|
|
11
11
|
}[];
|
|
12
12
|
}
|
|
13
13
|
export declare const validateTypescriptPropTypesImplementation: (props: PropsWithChildren<Record<string, unknown>>, schema: TypescriptSchema, validationsMemo?: Record<string, string>, nextValidationsMemo?: Record<string, string>) => void;
|
|
14
|
-
export declare const useValidateTypescriptPropTypes: <T = Record<string, any>>(props: PropsWithChildren<T>, propTypes: any) => void;
|
|
14
|
+
export declare const useValidateTypescriptPropTypes: <T = Record<string, any>>(props: React.PropsWithChildren<T>, propTypes: any) => void;
|
|
15
15
|
export {};
|