We are using PM + Typescript and I was wondering if there are any recommendable approaches for adding types to the node attributes object.
For example, we have a node type ‘block’ that can hold a fixed set of attributes. Since the node type determines this set of attributes, it would be nice to have some sort of type guard function that returns a typed node.
const isBlockNode = (node: Node): node is Node<Block> => {
return node.type.name === "block";
}
I guess this would require a generic for Node. Are there any plans on implementing this? Or perhaps an existing solution?
Thanks for the work you are doing!