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
  • ClosingTag<Name, Opening, Closing>
  • OpeningTag<Name, Opening, Closing>
  • TaggedText<Text, Name, Opening, Closing>

Was this helpful?

  1. Tag
  2. Tag

Types

PreviousInstance methodsNextExamples

Last updated 3 years ago

Was this helpful?

ClosingTag<Name, Opening, Closing>

The generic type ClosingTag indicates the closing tag. It takes the tag name of a generic type variable Name constrained by the and wrap of a generic type variable Chars constrained by generic type StringOfLength of two chars.

type ClosingTag<
  Name extends string,
  Chars extends StringOfLength<2, 2, string>
> = StringOfLength<0, typeof Infinity, `${Chars[0]}/${Name}${Chars[1]}`>;

OpeningTag<Name, Opening, Closing>

The generic type OpeningTag indicates the type of closing tag. It takes the tag name of a generic type variable Name constrained by the and wrap of a generic type variable Chars constrained by generic type StringOfLength of two chars.

type OpeningTag<
  Name extends string,
  Chars extends StringOfLength<2, 2, string>
> = StringOfLength<0, typeof Infinity, `${Chars[0]}${Name}${Chars[1]}`>;

TaggedText<Text, Name, Opening, Closing>

The generic type TaggedText indicates the type of tagged text, with the opening tag and closing tag of the text.

type TaggedText<Text extends string, Name extends string, Chars extends string> =
  `${OpeningTag<Name, Chars>}${Text}${ClosingTag<Name, Chars>}`;
string
string