In js:? How do you write it?

when I read vue VNode"s API today, I saw that some grammars are very advanced, and some don"t find relevant answers. Do you know what the following writing methods are all about? github address
the previous one? I don"t know what it means, and why do I use the | bit operation?
clipboard.png

clipboard.png
....JS

clipboard.png

Mar.29,2022

the current Vue syntax is based on the static type checking syntax of flow . : is also the use of the colon in js, separate from ? . ? means optional values in static type checking language. | is not a bit operator, but is or. It is used to indicate a value that accepts a string or numeric type. The last method (): Component | void {} . The colon indicates that the type required to return a value must be Component or no return value. Component this type is a class extended by Vue based on flow


you will understand flow or TypeScript


is the static type syntax check of flow

.
Menu