NodeType.contains() should return list of NodeKind (schema definition)

We need NodeType.contains() to be able to return an array of NodeKinds.

I want my list items to contain either another list item OR a paragraph. Currently in order to achieve this I have to make my paragraph type be a descendant of a list_item type. While this does work, it seems like a backwards way to define a node hierarchy. Instead of allowing types to have many ancestors, why not allow nodes to contain many types? This would parallel how containsMarks works.

Another way to think about it is who has the knowledge? Right now my paragraph node needs to know that it can be a child of a list (by NodeKind definition). Instead I’d prefer that my list knows it can have paragraph children.

Since I need a full subtyping relation between all kinds, you can’t do this. But with the current (post-0.4.0) code, you can create new NodeKind objects with an array of super kinds, which allows you to do much the same thing (but without the possibility of creating cycles).

I’m fine keeping the NodeKind tree as is, what I’d like though is to be able to specify multiple types in the contains() method.

If I have the following NodeKind tree (parent -> [children]): A -> [B, C -> [D]]

There is currently no way for me to setup a Node that can contain only B & D, I’d have to instead restructure my tree to get them under the same ancestor.

Yes, that’s a consequence of the requirement that the types make up a single hierarchy.