angular-package
TwitterGitHub
Text
Text
  • Introduction
  • Benefits
  • Getting started
    • General concepts
    • Skeleton
    • Installation
    • Public API
  • Wrapper
    • Basic concepts
    • Wrap
      • Generic type variables
      • Instance accessors
      • Instance properties
      • Static methods
      • Wrap() constructor
      • Instance methods
      • Examples
    • Wrapper
      • Generic type variables
      • Static properties
      • Instance accessors
      • Static methods
      • Wrapper() constructor
      • Instance methods
      • Examples
    • Wrapped
      • Generic type variables
      • Instance accessors
      • Instance properties
      • Static methods
      • Wrapped() constructor
      • Instance methods
      • Types
      • Examples
  • Tag
    • Basic concepts
    • Tag
      • Generic type variables
      • Static accessors
      • Static properties
      • Instance accessors
      • Instance properties
      • Static methods
      • Tag() constructor
      • Instance methods
      • Types
      • Examples
    • BBCodeTag
      • Static methods
      • BBCodeTag() constructor
    • HtmlTag
      • Generic type variables
      • HtmlTag() constructor
    • Tags
    • Tagged
  • Main
    • AllowedChars
    • Attribute
      • Generic type variables
      • Instance accessors
      • Instance properties
      • Static methods
      • Attribute() constructor
      • Instance methods
    • Attributes
    • Template
    • Text
  • Legend
    • Property tags
  • Other
    • Contact
    • Sponsor
  • More versions
Powered by GitBook
On this page
  • Public
  • define()
  • isBBCode()

Was this helpful?

  1. Tag
  2. BBCodeTag

Static methods

Public

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 / Description

Name extends string

Parameters

Name: type
Description

value: any

The name of BBCode tag to define.

Returns

Return type

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()

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 / Description

Name extends string

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

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';

PreviousBBCodeTagNextBBCodeTag() constructor

Last updated 3 years ago

Was this helpful?

A generic type variable constrained by the indicates the type of the BBCodeTag instance via the return type.

A generic type variable constrained by the by default of the value from the provided name indicates the type of the BBCodeTag instance via the return type.

string
string