Wrapper
PackagesTwitterGitHub
Draft
Draft
  • Introduction
  • ❤ Benefits
    • Explanation
    • Designing
  • General concepts
  • Getting started
    • Skeleton
    • Installation
      • npm
    • Public API
    • Basic concepts
  • Wrap {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • get closing()
      • get opening()
      • get text()
      • get [Symbol.toStringTag]()
    • Properties
      • #closing
      • #opening
      • #text
    • Methods
      • ↓ Static
      • static hasClosing()
      • static hasOpening()
      • static isWrap()
      • ↓ Instance
      • getClosing()
      • getOpening()
      • getText()
      • hasClosing()
      • hasOpening()
      • hasText()
      • isWrapped()
      • ★ replaceClosing()
      • ★ replaceOpening()
      • ★ replaceText()
      • toString()
      • valueOf()
    • Example usage
  • Wrapper {}
    • Overview
    • Generic type variables
    • Constructor
    • Accessors
      • get [Symbol.toStringTag]()
    • Methods
      • ↓ Static
      • static define()
      • static isWrapper()
      • static replaceClosing()
      • static replaceOpening()
      • static unwrap()
      • ↓ Instance
      • isClosingIn()
      • isOpeningIn()
      • replaceClosingIn()
      • replaceOpeningIn()
      • removeWrapIn()
      • textReplaceClosing()
      • textReplaceOpening()
      • ⚠ textHasClosing()
      • ⚠ textHasOpening()
      • textUnwrap()
      • textWrap()
      • toArray()
      • toWrap()
      • unwrap()
      • unwrapText()
      • ★ wrap()
      • ★ wrapOn()
      • ★ wrapText()
    • Example usage
  • Type
    • Wrapped
  • Change log
    • Keep a changelog
    • CHANGELOG.md
    • v1.0.0
  • GIT
    • Commit
    • Semantic Versioning
  • License
    • MIT
  • Social
    • Gettr
    • Twitter
    • YouTube
  • Contact
    • ⋯ Chat
    • @ Email
    • ✆ Phone
  • Donate
    • ฿ Cryptocurrency
    • $ Fiat
Powered by GitBook
On this page
  • Wrapper<Opening,Text,Closing>
  • Wrapper<Opening,Text,Closing>
  • Wrapper<Opening,Text,Closing>

Was this helpful?

Edit on GitHub
  1. Wrapper {}

Generic type variables

PreviousOverviewNextConstructor

Last updated 3 years ago

Was this helpful?

Wrapper<Opening,Text,Closing>

Openingextendsstring=string

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

wrapper.class.ts
class Wrapper<
  Opening extends string = string, // <--- Declare generic type variable Opening.
  Text extends string = '',
  Closing extends string = string
> extends Wrap<Opening, Text, Closing> {
  ...
  constructor(
    opening: Opening, // <--- Capture generic type variable Opening.
    closing: Closing,
    text: Text = '' as Text
  ) {
    super(opening, closing, text);
  }
  ...
}

Wrapper<Opening,Text,Closing>

Textextendsstring=''

wrapper.class.ts
class Wrapper<
  Opening extends string = string,
  Text extends string = '', // <--- Declare generic type variable Text.
  Closing extends string = string
> extends Wrap<Opening, Text, Closing> {
  ...
  constructor(
    opening: Opening,
    closing: Closing,
    text: Text = '' as Text // <--- Capture generic type variable Text.
  ) {
    super(opening, closing, text);
  }
  ...
}

Wrapper<Opening,Text,Closing>

Closingextendsstring=string

wrapper.class.ts
class Wrapper<
  Opening extends string = string,
  Text extends string = '',
  Closing extends string = string // <--- Declare generic type variable Closing.
> extends Wrap<Opening, Text, Closing> {
  ...
  constructor(
    opening: Opening,
    closing: Closing, // <--- Capture generic type variable Closing.
    text: Text = '' as Text
  ) {
    super(opening, closing, text);
  }
  ...
}

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

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

string
Wrapper
string
Wrapper
string
Wrapper
opening
text
closing