# Static methods

## Public

### `define()`

The static method defines the BBCode tag of a specified name.

```typescript
public static define<Name extends string>(name: Name): BBCodeTag<Name> {
  return new this(name);
}
```

#### Generic Type variables

| Name / Description                                                                                                                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong><code>Name extends string</code></strong></p><p>A generic type variable constrained by the <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html#string"><code>string</code></a> indicates the type of the <code>BBCodeTag</code> instance via the return type.</p> |

#### Parameters

| Name: type   | Description                       |
| ------------ | --------------------------------- |
| `value: any` | The name of BBCode tag to define. |

#### Returns

| Return type                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong><code>BBCodeTag\<Name></code></strong></p><p>A return type is a <code>BBCodeTag</code> object indicating that the returned value is an instance of <code>BBCodeTag</code> that takes a generic type variable <code>Name</code> as a tag name.</p> |

The **return value** is a new instance of `BBCodeTag` of a given `name`.

#### Example usage

```typescript
// Example usage.
import { BBCodeTag } from '@angular-package/text';


```

### `isBBCode()`

The static method checks if the value of any type is an instance of a `BBCodeTag`.

```typescript
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 / Description                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong><code>Name extends string</code></strong></p><p>A generic type variable constrained by the <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html#string"><code>string</code></a> by default of the value from the provided <code>name</code> indicates the type of the <code>BBCodeTag</code> instance via the return type.</p> |

#### Parameters

| Name: type    | Description                                                                   |
| ------------- | ----------------------------------------------------------------------------- |
| `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

| Return type                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong><code>value is BBCodeTag\<Name></code></strong></p><p>The return type is a <code>boolean</code> indicating the <code>value</code> parameter is an instance of <code>BBCodeTag</code> that takes a generic type variable <code>Name</code> the name of a tag.</p> |

The **return value** is a `boolean` type indicating whether the value is the `BBCodeTag` instance of any or a given name.

#### Example usage

```typescript
// Example usage.
import { BBCodeTag } from '@angular-package/text';


```
