@rjsf/utils 5.0.0-beta.1 → 5.0.0-beta.5

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.
Files changed (50) hide show
  1. package/README.md +2 -0
  2. package/dist/index.d.ts +1221 -38
  3. package/package.json +3 -3
  4. package/dist/allowAdditionalItems.d.ts +0 -8
  5. package/dist/asNumber.d.ts +0 -10
  6. package/dist/canExpand.d.ts +0 -11
  7. package/dist/constants.d.ts +0 -27
  8. package/dist/createSchemaUtils.d.ts +0 -9
  9. package/dist/dataURItoBlob.d.ts +0 -10
  10. package/dist/deepEquals.d.ts +0 -8
  11. package/dist/findSchemaDefinition.d.ts +0 -20
  12. package/dist/getInputProps.d.ts +0 -10
  13. package/dist/getSchemaType.d.ts +0 -13
  14. package/dist/getSubmitButtonOptions.d.ts +0 -10
  15. package/dist/getTemplate.d.ts +0 -10
  16. package/dist/getUiOptions.d.ts +0 -8
  17. package/dist/getWidget.d.ts +0 -13
  18. package/dist/guessType.d.ts +0 -7
  19. package/dist/hasWidget.d.ts +0 -10
  20. package/dist/isConstant.d.ts +0 -8
  21. package/dist/isCustomWidget.d.ts +0 -7
  22. package/dist/isFixedItems.d.ts +0 -8
  23. package/dist/isObject.d.ts +0 -7
  24. package/dist/localToUTC.d.ts +0 -6
  25. package/dist/mergeDefaultsWithFormData.d.ts +0 -15
  26. package/dist/mergeObjects.d.ts +0 -9
  27. package/dist/mergeSchemas.d.ts +0 -10
  28. package/dist/optionsList.d.ts +0 -10
  29. package/dist/orderProperties.d.ts +0 -11
  30. package/dist/pad.d.ts +0 -7
  31. package/dist/parseDateString.d.ts +0 -9
  32. package/dist/processSelectValue.d.ts +0 -11
  33. package/dist/rangeSpec.d.ts +0 -9
  34. package/dist/schema/getDefaultFormState.d.ts +0 -47
  35. package/dist/schema/getDisplayLabel.d.ts +0 -11
  36. package/dist/schema/getMatchingOption.d.ts +0 -10
  37. package/dist/schema/index.d.ts +0 -11
  38. package/dist/schema/isFilesArray.d.ts +0 -10
  39. package/dist/schema/isMultiSelect.d.ts +0 -9
  40. package/dist/schema/isSelect.d.ts +0 -9
  41. package/dist/schema/mergeValidationData.d.ts +0 -12
  42. package/dist/schema/retrieveSchema.d.ts +0 -98
  43. package/dist/schema/toIdSchema.d.ts +0 -13
  44. package/dist/schema/toPathSchema.d.ts +0 -11
  45. package/dist/schemaRequiresTrueValue.d.ts +0 -11
  46. package/dist/shouldRender.d.ts +0 -10
  47. package/dist/toConstant.d.ts +0 -9
  48. package/dist/toDateString.d.ts +0 -9
  49. package/dist/types.d.ts +0 -755
  50. package/dist/utcToLocal.d.ts +0 -6
@@ -1,98 +0,0 @@
1
- import { GenericObjectType, RJSFSchema, RJSFSchemaDefinition, ValidatorType } from "../types";
2
- /** Resolves a conditional block (if/else/then) by removing the condition and merging the appropriate conditional branch
3
- * with the rest of the schema
4
- *
5
- * @param validator - An implementation of the `ValidatorType` interface that is used to detect valid schema conditions
6
- * @param schema - The schema for which resolving a condition is desired
7
- * @param rootSchema - The root schema that will be forwarded to all the APIs
8
- * @param formData - The current formData to assist retrieving a schema
9
- * @returns - A schema with the appropriate condition resolved
10
- */
11
- export declare function resolveCondition<T = any>(validator: ValidatorType, schema: RJSFSchema, rootSchema: RJSFSchema, formData: T): import("json-schema").JSONSchema7;
12
- /** Resolves references and dependencies within a schema and its 'allOf' children.
13
- * Called internally by retrieveSchema.
14
- *
15
- * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
16
- * @param schema - The schema for which resolving a schema is desired
17
- * @param [rootSchema={}] - The root schema that will be forwarded to all the APIs
18
- * @param [formData] - The current formData, if any, to assist retrieving a schema
19
- * @returns - The schema having its references and dependencies resolved
20
- */
21
- export declare function resolveSchema<T = any>(validator: ValidatorType, schema: RJSFSchema, rootSchema?: RJSFSchema, formData?: T): RJSFSchema;
22
- /** Resolves references within a schema and its 'allOf' children.
23
- *
24
- * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
25
- * @param schema - The schema for which resolving a reference is desired
26
- * @param rootSchema - The root schema that will be forwarded to all the APIs
27
- * @param [formData] - The current formData, if any, to assist retrieving a schema
28
- * @returns - The schema having its references resolved
29
- */
30
- export declare function resolveReference<T = any>(validator: ValidatorType, schema: RJSFSchema, rootSchema: RJSFSchema, formData?: T): RJSFSchema;
31
- /** Creates new 'properties' items for each key in the `formData`
32
- *
33
- * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
34
- * @param theSchema - The schema for which the existing additional properties is desired
35
- * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s * @param validator
36
- * @param [aFormData] - The current formData, if any, to assist retrieving a schema
37
- * @returns - The updated schema with additional properties stubbed
38
- */
39
- export declare function stubExistingAdditionalProperties<T = any>(validator: ValidatorType, theSchema: RJSFSchema, rootSchema?: RJSFSchema, aFormData?: T): RJSFSchema;
40
- /** Retrieves an expanded schema that has had all of its conditions, additional properties, references and dependencies
41
- * resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData` that is used to do the
42
- * potentially recursive resolution.
43
- *
44
- * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
45
- * @param schema - The schema for which retrieving a schema is desired
46
- * @param [rootSchema={}] - The root schema that will be forwarded to all the APIs
47
- * @param [rawFormData] - The current formData, if any, to assist retrieving a schema
48
- * @returns - The schema having its conditions, additional properties, references and dependencies resolved
49
- */
50
- export default function retrieveSchema<T = any>(validator: ValidatorType, schema: RJSFSchema, rootSchema?: RJSFSchema, rawFormData?: T): RJSFSchema;
51
- /** Resolves dependencies within a schema and its 'allOf' children.
52
- *
53
- * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
54
- * @param schema - The schema for which resolving a dependency is desired
55
- * @param rootSchema - The root schema that will be forwarded to all the APIs
56
- * @param [formData] - The current formData, if any, to assist retrieving a schema
57
- * @returns - The schema with its dependencies resolved
58
- */
59
- export declare function resolveDependencies<T = any>(validator: ValidatorType, schema: RJSFSchema, rootSchema: RJSFSchema, formData?: T): RJSFSchema;
60
- /** Processes all the `dependencies` recursively into the `resolvedSchema` as needed
61
- *
62
- * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
63
- * @param dependencies - The set of dependencies that needs to be processed
64
- * @param resolvedSchema - The schema for which processing dependencies is desired
65
- * @param rootSchema - The root schema that will be forwarded to all the APIs
66
- * @param [formData] - The current formData, if any, to assist retrieving a schema
67
- * @returns - The schema with the `dependencies` resolved into it
68
- */
69
- export declare function processDependencies<T = any>(validator: ValidatorType, dependencies: RJSFSchema["dependencies"], resolvedSchema: RJSFSchema, rootSchema: RJSFSchema, formData?: T): RJSFSchema;
70
- /** Updates a schema with additionally required properties added
71
- *
72
- * @param schema - The schema for which resolving a dependent properties is desired
73
- * @param [additionallyRequired] - An optional array of additionally required names
74
- * @returns - The schema with the additional required values merged in
75
- */
76
- export declare function withDependentProperties(schema: RJSFSchema, additionallyRequired?: string[]): import("json-schema").JSONSchema7;
77
- /** Merges a dependent schema into the `schema` dealing with oneOfs and references
78
- *
79
- * @param validator - An implementation of the `ValidatorType` interface that will be forwarded to all the APIs
80
- * @param schema - The schema for which resolving a dependent schema is desired
81
- * @param rootSchema - The root schema that will be forwarded to all the APIs
82
- * @param dependencyKey - The key name of the dependency
83
- * @param dependencyValue - The potentially dependent schema
84
- * @param formData- The current formData to assist retrieving a schema
85
- * @returns - The schema with the dependent schema resolved into it
86
- */
87
- export declare function withDependentSchema<T>(validator: ValidatorType, schema: RJSFSchema, rootSchema: RJSFSchema, dependencyKey: string, dependencyValue: RJSFSchema, formData?: T): GenericObjectType;
88
- /** Returns a `schema` with the best choice from the `oneOf` options merged into it
89
- *
90
- * @param validator - An implementation of the `ValidatorType` interface that will be used to validate oneOf options
91
- * @param schema - The schema for which resolving a oneOf subschema is desired
92
- * @param rootSchema - The root schema that will be forwarded to all the APIs
93
- * @param dependencyKey - The key name of the oneOf dependency
94
- * @param oneOf - The list of schemas representing the oneOf options
95
- * @param [formData] - The current formData to assist retrieving a schema
96
- * @returns The schema with best choice of oneOf schemas merged into
97
- */
98
- export declare function withExactlyOneSubschema<T = any>(validator: ValidatorType, schema: RJSFSchema, rootSchema: RJSFSchema, dependencyKey: string, oneOf: RJSFSchemaDefinition[], formData?: T): GenericObjectType;
@@ -1,13 +0,0 @@
1
- import { IdSchema, RJSFSchema, ValidatorType } from "../types";
2
- /** Generates an `IdSchema` object for the `schema`, recursively
3
- *
4
- * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
5
- * @param schema - The schema for which the `IdSchema` is desired
6
- * @param [id] - The base id for the schema
7
- * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s
8
- * @param [formData] - The current formData, if any, to assist retrieving a schema
9
- * @param [idPrefix='root'] - The prefix to use for the id
10
- * @param [idSeparator='_'] - The separator to use for the path segments in the id
11
- * @returns - The `IdSchema` object for the `schema`
12
- */
13
- export default function toIdSchema<T = any>(validator: ValidatorType, schema: RJSFSchema, id?: string | null, rootSchema?: RJSFSchema, formData?: T, idPrefix?: string, idSeparator?: string): IdSchema<T>;
@@ -1,11 +0,0 @@
1
- import { PathSchema, RJSFSchema, ValidatorType } from "../types";
2
- /** Generates an `PathSchema` object for the `schema`, recursively
3
- *
4
- * @param validator - An implementation of the `ValidatorType` interface that will be used when necessary
5
- * @param schema - The schema for which the `PathSchema` is desired
6
- * @param [name=''] - The base name for the schema
7
- * @param [rootSchema] - The root schema, used to primarily to look up `$ref`s
8
- * @param [formData] - The current formData, if any, to assist retrieving a schema
9
- * @returns - The `PathSchema` object for the `schema`
10
- */
11
- export default function toPathSchema<T = any>(validator: ValidatorType, schema: RJSFSchema, name?: string, rootSchema?: RJSFSchema, formData?: T): PathSchema<T>;
@@ -1,11 +0,0 @@
1
- import { RJSFSchema } from "./types";
2
- /** Check to see if a `schema` specifies that a value must be true. This happens when:
3
- * - `schema.const` is truthy
4
- * - `schema.enum` == `[true]`
5
- * - `schema.anyOf` or `schema.oneOf` has a single value which recursively returns true
6
- * - `schema.allOf` has at least one value which recursively returns true
7
- *
8
- * @param schema - The schema to check
9
- * @returns - True if the schema specifies a value that must be true, false otherwise
10
- */
11
- export default function schemaRequiresTrueValue(schema: RJSFSchema): boolean;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- /** Determines whether the given `component` should be rerendered by comparing its current set of props and state
3
- * against the next set. If either of those two sets are not the same, then the component should be rerendered.
4
- *
5
- * @param component - A React component being checked
6
- * @param nextProps - The next set of props against which to check
7
- * @param nextState - The next set of state against which to check
8
- * @returns - True if the component should be re-rendered, false otherwise
9
- */
10
- export default function shouldRender(component: React.Component, nextProps: any, nextState: any): boolean;
@@ -1,9 +0,0 @@
1
- import { RJSFSchema } from "./types";
2
- /** Returns the constant value from the schema when it is either a single value enum or has a const key. Otherwise
3
- * throws an error.
4
- *
5
- * @param schema - The schema from which to obtain the constant value
6
- * @returns - The constant value for the schema
7
- * @throws - Error when the schema does not have a constant value
8
- */
9
- export default function toConstant(schema: RJSFSchema): import("json-schema").JSONSchema7Type | undefined;
@@ -1,9 +0,0 @@
1
- import { DateObject } from "./types";
2
- /** Returns a UTC date string for the given `dateObject`. If `time` is false, then the time portion of the string is
3
- * removed.
4
- *
5
- * @param dateObject - The `DateObject` to convert to a date string
6
- * @param [time=true] - Optional flag used to remove the time portion of the date string if false
7
- * @returns - The UTC date string
8
- */
9
- export default function toDateString(dateObject: DateObject, time?: boolean): string;