Tag
PackagesTwitterGitHub
  • Introduction
  • General concepts
  • Getting started
    • Skeleton
    • Installation
    • Public API
  • Attribute
    • Code
    • Attribute {}
    • Generic type variables
    • ★ Attribute() constructor
    • Instance
      • Accessors
        • attribute
        • name
        • value
        • [Symbol.toStringTag]
      • Properties
        • #name
        • #value
      • Methods
        • toArray()
        • toObject()
        • toString()
        • valueOf()
    • Static
      • Methods
        • isAttribute()
    • Usage
  • Attributes
    • Attributes {}
    • Generic type variables
    • Instance
      • Accessors
      • Properties
    • Attributes() constructor
    • Instance methods
    • Usage
  • Tag
    • Tag {}
    • Usage
  • Tag Extension
    • TagExtension {}
    • Usage
  • tags
    • Tags {}
    • Usage
  • BBCode
    • BBCode {}
    • Usage
  • Html
    • HTML {}
    • Usage
  • Variable
    • Variable {}
    • Usage
  • Variables
    • Variables {}
    • Usage
  • Types
    • ClosingTag
    • OpeningTag
    • TaggedText
  • License
    • MIT
  • Contact
    • ⋯ Chat
    • @ Email
  • Donate
    • ฿ Cryptocurrency
    • $ Fiat
Powered by GitBook
On this page
  • Attribute<Name, ...>
  • Attribute<...,Value>

Was this helpful?

Edit on GitHub
  1. Attribute

Generic type variables

PreviousAttribute {}Next★ Attribute() constructor

Last updated 3 years ago

Was this helpful?

Attribute<Name, ...>

​A generic type variable constrained by the , by default of the value captured from the provided name indicates the opening type of a new instance.

class Attribute<
  Name extends string = string, // <--- Declare generic type variable Name.
  Value extends string = string
> extends String {
  ...
  constructor(
    name: Name,   // <--- Capture generic type variable Name.
    value: Value  
  ) { ... }
  ...
}

Attribute<...,Value>

​A generic type variable constrained by the , by default of the value captured from the provided value indicates the value type of a new instance.

class Attribute<
  Name extends string = string,
  Value extends string = string // <--- Declare generic type variable Value.
> extends String {
  ...
  constructor(
    name: Name,
    value: Value  // <--- Capture generic type variable Value.
  ) { ... }
  ...
}
string
Attribute
string
Attribute