all files / model/ DocumentSchema.js

100% Statements 8/8
100% Branches 2/2
100% Functions 4/4
100% Lines 8/8
1 statement, 1 branch Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42                  363×     363×     363× 363×       119×             816×             363×            
import Schema from './Schema'
import DocumentNode from './DocumentNode'
import Container from './Container'
import PropertyAnnotation from './PropertyAnnotation'
import ContainerAnnotation from './ContainerAnnotation'
 
class DocumentSchema extends Schema {
 
  constructor({ name, DocumentClass, defaultTextType='text', version='0.0.0' }) {
    super(name, version)
 
    /* istanbul ignore next */
    Iif (!DocumentClass) {
      throw new Error('DocumentClass is mandatory')
    }
 
    this.DocumentClass = DocumentClass
    this.defaultTextType = defaultTextType
  }
 
  getDocumentClass() {
    return this.DocumentClass
  }
 
  /*
    @override
  */
  getDefaultTextType() {
    return this.defaultTextType
  }
 
  /*
    @override
  */
  getBuiltIns() {
    return [DocumentNode, PropertyAnnotation, Container, ContainerAnnotation]
  }
 
}
 
export default DocumentSchema