Generic type variables
Wrapper<Opening,Text,Closing>
Wrapper<Opening,Text,Closing>Openingextendsstring=string
Openingextendsstring=stringA generic type variable constrained by the string, by default of the value captured from the provided opening indicates the opening type of a new Wrapper instance.
class Wrapper<
Opening extends string = string, // <--- Declare generic type variable Opening.
Text extends string = '',
Closing extends string = string
> extends Wrap<Opening, Text, Closing> {
...
constructor(
opening: Opening, // <--- Capture generic type variable Opening.
closing: Closing,
text: Text = '' as Text
) {
super(opening, closing, text);
}
...
}Wrapper<Opening,Text,Closing>
Wrapper<Opening,Text,Closing>Textextendsstring=''
Textextendsstring=''A generic type variable constrained by the string, by default of the value captured from the provided text indicates the text type of a new Wrapper instance.
Wrapper<Opening,Text,Closing>
Wrapper<Opening,Text,Closing>Closingextendsstring=string
Closingextendsstring=stringA generic type variable constrained by the string, by default of the value captured from the provided closing indicates the closing type of a new Wrapper instance.
Last updated
Was this helpful?