@rjsf/utils 5.18.5 → 5.19.0
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/dist/index.js +28 -9
- package/dist/index.js.map +3 -3
- package/dist/utils.esm.js +28 -9
- package/dist/utils.esm.js.map +3 -3
- package/dist/utils.umd.js +28 -9
- package/lib/dateRangeOptions.d.ts +11 -0
- package/lib/dateRangeOptions.js +28 -0
- package/lib/dateRangeOptions.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/schema/toIdSchema.js.map +1 -1
- package/lib/schema/toPathSchema.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +6 -4
- package/package.json +2 -2
- package/src/dateRangeOptions.ts +31 -0
- package/src/index.ts +2 -0
- package/src/schema/toIdSchema.ts +4 -4
- package/src/schema/toPathSchema.ts +8 -8
- package/src/types.ts +16 -8
package/src/types.ts
CHANGED
|
@@ -131,10 +131,12 @@ export type FieldId = {
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
/** Type describing a recursive structure of `FieldId`s for an object with a non-empty set of keys */
|
|
134
|
-
export type IdSchema<T = any> =
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
export type IdSchema<T = any> = T extends GenericObjectType
|
|
135
|
+
? FieldId & {
|
|
136
|
+
/** The set of ids for fields in the recursive object structure */
|
|
137
|
+
[key in keyof T]?: IdSchema<T[key]>;
|
|
138
|
+
}
|
|
139
|
+
: FieldId;
|
|
138
140
|
|
|
139
141
|
/** Type describing a name used for a field in the `PathSchema` */
|
|
140
142
|
export type FieldPath = {
|
|
@@ -143,10 +145,16 @@ export type FieldPath = {
|
|
|
143
145
|
};
|
|
144
146
|
|
|
145
147
|
/** Type describing a recursive structure of `FieldPath`s for an object with a non-empty set of keys */
|
|
146
|
-
export type PathSchema<T = any> =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
148
|
+
export type PathSchema<T = any> = T extends Array<infer U>
|
|
149
|
+
? FieldPath & {
|
|
150
|
+
[i: number]: PathSchema<U>;
|
|
151
|
+
}
|
|
152
|
+
: T extends GenericObjectType
|
|
153
|
+
? FieldPath & {
|
|
154
|
+
/** The set of names for fields in the recursive object structure */
|
|
155
|
+
[key in keyof T]?: PathSchema<T[key]>;
|
|
156
|
+
}
|
|
157
|
+
: FieldPath;
|
|
150
158
|
|
|
151
159
|
/** The type for error produced by RJSF schema validation */
|
|
152
160
|
export type RJSFValidationError = {
|