how to setBlockType with a node which should have a child

my schema like

{
  name: 'customCard'
  content: 'card+'
}

{
  name: 'card',
  content: 'text*'
}

if i want replace Paragraph with customCard.create(null, card.create()),i use setBlockType,but this method only accpet one specific node,and throw a error: type given to setBlockType should be textblock,what I need to do

Sounds like replaceWith is the method you are looking for.