UNPKG

@angular-package/wrapper

Version:

Wrap the text with the opening and closing chars.

28 lines (27 loc) 2.23 kB
import { Wrap } from './wrap.class'; import { Wrapped } from '../type/wrapped.type'; export declare class Wrapper<Opening extends string = string, Text extends string = '', Closing extends string = string> extends Wrap<Opening, Text, Closing> { get [Symbol.toStringTag](): string; static define<Opening extends string, Closing extends string, Text extends string = ''>(opening: Opening, closing: Closing, text?: Text): Wrapper<Opening, Text, Closing>; static isWrapper<Opening extends string, Closing extends string, Text extends string = string>(value: any, opening?: Opening, closing?: Closing, text?: Text): value is Wrapper<Opening, Text, Closing>; static replaceClosing(text: string, closing: string, replaceValue: string): string; static replaceOpening(text: string, opening: string, replaceValue: string): string; static unwrap(text: string, opening: string, closing: string): string; constructor(opening: Opening, closing: Closing, text?: Text); isClosingIn(text: string): boolean; isOpeningIn(text: string): boolean; replaceClosingIn(text: string, replaceValue: string): string; replaceOpeningIn(text: string, replaceValue: string): string; removeWrapIn(text: string): string; textReplaceClosing(closing: string): string; textReplaceOpening(opening: string): string; textUnwrap(opening?: string, closing?: string): string; textWrap<TextOpening extends string, TextClosing extends string>(opening: TextOpening, closing: TextClosing): Wrapped<TextOpening, Text, TextClosing>; toArray(): readonly [Opening, Text, Closing]; toWrap(): Wrap<Opening, Text, Closing>; unwrap(): Text; unwrapText(opening?: string, closing?: string): string; wrap<CustomOpening extends string = Opening, CustomClosing extends string = Closing>(opening?: CustomOpening, closing?: CustomClosing): Wrapped<CustomOpening, Wrapped<Opening, Text, Closing>, CustomClosing>; wrapOn<CustomText extends string = ''>(text: CustomText): Wrapped<Opening, CustomText, Closing>; wrapText<TextOpening extends string = '', TextClosing extends string = ''>(opening: TextOpening, closing: TextClosing): Wrapped<Opening, Wrapped<TextOpening, Text, TextClosing>, Closing>; }