tiptap/packages/core/src/utils/getSchema.ts

14 lines
514 B
TypeScript
Raw Normal View History

import { Schema } from 'prosemirror-model'
2020-09-04 17:59:09 +08:00
import { Extensions } from '../types'
import getTopNodeFromExtensions from './getTopNodeFromExtensions'
import getNodesFromExtensions from './getNodesFromExtensions'
import getMarksFromExtensions from './getMarksFromExtensions'
2020-09-04 17:59:09 +08:00
export default function getSchema(extensions: Extensions): Schema {
return new Schema({
topNode: getTopNodeFromExtensions(extensions),
nodes: getNodesFromExtensions(extensions),
marks: getMarksFromExtensions(extensions),
})
}