Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Interpolator

Hierarchy

  • Interpolator

Index

Constructors

constructor

  • Parameters

    Returns Interpolator

Properties

Optional matchedEnds

matchedEnds: Ends

random

random: Random<{ get: any }> = generalRandom

Accessors

formatDates

  • get formatDates(): undefined | false | true
  • Returns undefined | false | true

formatNumbers

  • get formatNumbers(): undefined | false | true
  • Returns undefined | false | true

segments

  • Returns ISegment[]

Methods

formatValue

  • Parameters

    • value: unknown

    Returns string | Iterable<IStringSection>

interpolate

  • Parameters

    • str: string
    • Rest ...args: any[]

    Returns IStringSection[]

interpolateString

  • interpolateString(str: string, ...args: any[]): string
  • Parameters

    • str: string
    • Rest ...args: any[]

    Returns string

setRandom

  • setRandom(random: Random): this
  • Parameters

    Returns this

with

  • Parameters

    Returns this

Static combineLikeSections

  • combineLikeSections(sections: IStringSection[], ignoreKeys?: string[]): void
  • Parameters

    Returns void

Static getArgument

  • getArgument(keyMap: string, ...args: any[]): { hasValue: false; value?: undefined } | { hasValue: true; value: T }
  • Parameters

    • keyMap: string
    • Rest ...args: any[]

    Returns { hasValue: false; value?: undefined } | { hasValue: true; value: T }

Static getIndexOfTopLevel

  • getIndexOfTopLevel(character: string, segment: string, start?: number): number
  • Returns the index of the first occurrence of character in the provided string which is not inside a segment {}. Returns -1 if there is no occurrence.

    Parameters

    • character: string
    • segment: string
    • Default value start: number = 0

    Returns number

Generated using TypeDoc