angular-package
TwitterGitHub
Wrapper
Wrapper
  • Introduction
  • ❤ Benefits
    • Explanation
    • Designing
  • General concepts
  • Getting started
    • Skeleton
    • Installation
      • npm
    • Public API
    • Basic concepts
  • Wrap {}
    • Overview
    • Generic type variables
    • ★ Constructor
    • Accessors
      • closing
      • opening
      • text
      • [Symbol.toStringTag]
    • Properties
      • #closing
      • #opening
      • #text
    • Methods
      • Static
        • hasClosing()
        • hasOpening()
        • isWrap()
      • Instance
        • getClosing()
        • getOpening()
        • getText()
        • hasClosing()
        • hasOpening()
        • hasText()
        • isWrapped()
        • ★ replaceClosing()
        • ★ replaceOpening()
        • ★ replaceText()
        • toString()
        • valueOf()
    • Example usage
  • Wrapper {}
    • Overview
    • Generic type variables
    • Constructor
    • Accessors
      • [Symbol.toStringTag]
    • Methods
      • Static
        • define()
        • isWrapper()
        • replaceClosing()
        • replaceOpening()
        • 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
  • Contact
    • ⋯ Chat
    • @ Email
  • Donate
    • ฿ Cryptocurrency
    • $ Fiat
  • More versions
Powered by GitBook
On this page
  • Wrapped<Opening, Text, Closing>
  • Generic type variables
  • Returns

Was this helpful?

  1. Type

Wrapped

PreviousExample usageNextKeep a changelog

Last updated 3 years ago

Was this helpful?

Wrapped<Opening, Text, Closing>

The Wrapped type indicates the text wrapped by the opening characters at the beginning and the closing characters at the end of the text. It's built from generic type variables in order , and on the template ${Opening}${Text}${Closing}.

wrapped.type.ts
export type Wrapped<
  Opening extends string = '',
  Text extends string = '',
  Closing extends string = ''
> = `${Opening}${Text}${Closing}`;

Generic type variables

Openingextendsstring=''

A generic type variable determines the opening characters placed before the text on the template ${Opening}${Text}${Closing}.

Textextendsstring=''

A generic type variable determines the text between the opening and closing characters on the template ${Opening}${Text}${Closing}.

Closingextendsstring=''

A generic type variable determines the closing characters placed after the text on the template ${Opening}${Text}${Closing}.

Returns

The type returns of generic type variables in order , and indicating wrapped text.

Opening
Text
Closing
template literal
Opening
Text
Closing