ckeditor5-elements / parseElementSchema
Function: parseElementSchema()
ts
function parseElementSchema(input, options?): object;Validates an element schema (see validateElementSchema), and returns it as a definition when it is valid: what the editor and compileElementSchema work with, e.g. from a JSON file, whose types TypeScript does not know.
ts
const { definition, issues } = parseElementSchema(json);The definition is null when there are issues.
Parameters
| Parameter | Type |
|---|---|
input | unknown |
options? | ValidateElementSchemaOptions |
Returns
object
definition
ts
definition:
| ElementSchemaDefinition
| null;issues
ts
issues: ElementSchemaIssue[];