UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).

35 lines (30 loc) 763 B
import Schema from './Schema' import DocumentNode from './DocumentNode' import Container from './Container' import PropertyAnnotation from './PropertyAnnotation' import ContainerAnnotation from './ContainerAnnotation' export default class DocumentSchema extends Schema { constructor (schemaSpec) { super(schemaSpec) /* istanbul ignore next */ if (!schemaSpec.DocumentClass) { throw new Error('DocumentClass is mandatory') } Object.assign(this, schemaSpec) } getDocumentClass () { return this.DocumentClass } /* @override */ getDefaultTextType () { return this.defaultTextType } /* @override */ getBuiltIns () { return [DocumentNode, PropertyAnnotation, Container, ContainerAnnotation] } }