What's the type of 'next' in ProsemirorModel content.js

Hey!

I am reading the code of content.js now . And I have a problem with the type of ’ next ’ .

It seems as ContentMatch[], but in matchType method ,it looks like NodeType[].

So which type is it.

我明白了,这里类型是

  /** 这里类型是 [ NodeType, ContentMatch, NodeType, ContentMatch.... ]   */
  next: Array<NodeType<S> | ContentMatch<S>>;
  /** 这类型是 [ NodeType, NodeType[], NodeType, NodeType[]... ] */
  wrapCache: Array<NodeType<S> | Array<NodeType<S>>>;

It’s an alternating array of [NodeType, ContentMatch, NodeType, ContentMatch, ...] elements. Hence the i += 2 index increments.

I got it. Thank you!