I do not understand this recursive type definition (CodeMirror 6 Reference Manual):
export type Extension = {extension: Extension} | readonly Extension[]
Where is the terminator clause (other than the empty array)? Could someone please explain this type?
There are library types that just declare their extension
property without actually defining it, such as the values returned by Facet.of
. Those provide the terminator. You can’t define new terminator values in user code.