Static methods
Public
define()
define()The static method defines the BBCode tag of a specified name.
public static define<Name extends string>(name: Name): BBCodeTag<Name> {
return new this(name);
}Generic Type variables
Name extends string
A generic type variable constrained by the string indicates the type of the BBCodeTag instance via the return type.
Parameters
value: any
The name of BBCode tag to define.
Returns
BBCodeTag<Name>
A return type is a BBCodeTag object indicating that the returned value is an instance of BBCodeTag that takes a generic type variable Name as a tag name.
The return value is a new instance of BBCodeTag of a given name.
Example usage
// Example usage.
import { BBCodeTag } from '@angular-package/text';
isBBCode()
isBBCode()The static method checks if the value of any type is an instance of a BBCodeTag.
public static isBBCode<Name extends string>(
value: any,
name?: Name
): value is BBCodeTag<Name> {
return isInstance(value, BBCodeTag)
? isDefined(name) && value.name === name
: false;
}Generic Type variables
Name extends string
A generic type variable constrained by the string by default of the value from the provided name indicates the type of the BBCodeTag instance via the return type.
Parameters
value: any
The value of any type to check against the instance of BBCodeTag.
name?: Name
Optional name of a generic type variable Name as tag name of a given value.
Returns
value is BBCodeTag<Name>
The return type is a boolean indicating the value parameter is an instance of BBCodeTag that takes a generic type variable Name the name of a tag.
The return value is a boolean type indicating whether the value is the BBCodeTag instance of any or a given name.
Example usage
// Example usage.
import { BBCodeTag } from '@angular-package/text';
Last updated
Was this helpful?