@ht-rnd/json-schema-editor 2.0.2 → 2.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 +9 -7
- package/dist/lib/main.es.js +3751 -3512
- package/dist/lib/main.umd.js +18 -18
- package/dist/types/index.d.ts +7 -3
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ErrorObject } from 'ajv/dist/2020';
|
|
2
1
|
import { useForm } from 'react-hook-form';
|
|
3
2
|
import { z } from 'zod';
|
|
4
3
|
|
|
@@ -129,6 +128,11 @@ export declare const SCHEMA_TYPES: readonly ["string", "integer", "number", "boo
|
|
|
129
128
|
|
|
130
129
|
export declare const SCHEMA_TYPES_WITH_REF: readonly ["string", "integer", "number", "boolean", "object", "array", "ref"];
|
|
131
130
|
|
|
131
|
+
export declare interface SchemaError {
|
|
132
|
+
instancePath: string;
|
|
133
|
+
message?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
132
136
|
export declare const schemaToForm: (schema: JSONSchema) => FormSchema;
|
|
133
137
|
|
|
134
138
|
export declare type SchemaType = "string" | "number" | "integer" | "boolean" | "object" | "array" | "ref";
|
|
@@ -166,7 +170,7 @@ export declare function useJsonSchemaEditor(options?: JsonSchemaEditorOptions):
|
|
|
166
170
|
|
|
167
171
|
export declare interface UseJsonSchemaEditorReturn {
|
|
168
172
|
schema: JSONSchema;
|
|
169
|
-
errors:
|
|
173
|
+
errors: SchemaError[] | null;
|
|
170
174
|
fields: FieldItem[];
|
|
171
175
|
definitions: DefinitionItem[];
|
|
172
176
|
form: ReturnType<typeof useForm<FormSchema>>;
|
|
@@ -183,6 +187,6 @@ export declare interface UseJsonSchemaEditorReturn {
|
|
|
183
187
|
reset: () => void;
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
export declare function validateSchema(schema: JSONSchema):
|
|
190
|
+
export declare function validateSchema(schema: JSONSchema): SchemaError[] | null;
|
|
187
191
|
|
|
188
192
|
export { }
|
package/package.json
CHANGED