tiptap/packages/core/src/Node.ts

22 lines
311 B
TypeScript
Raw Normal View History

2019-12-17 06:20:05 +08:00
import Extension from './Extension'
2020-03-06 03:30:58 +08:00
export default abstract class Node extends Extension {
2019-12-17 06:20:05 +08:00
constructor(options = {}) {
super(options)
}
2020-03-06 04:05:01 +08:00
public type = 'node'
2019-12-17 06:20:05 +08:00
2020-03-06 07:15:36 +08:00
public topNode = false
2020-03-29 06:54:49 +08:00
schema(): any {
return null
}
2019-12-17 06:20:05 +08:00
2020-03-30 18:40:25 +08:00
get schemaType() {
return this.editor.schema.nodes[this.name]
}
2019-12-17 06:20:05 +08:00
}