@kismet.ts/parsers / Exports / TextSequenceParser

Class: TextSequenceParser<T>

Type parameters

NameType
Textends boolean = true

Hierarchy

  • BaseTextParser<T>

    TextSequenceParser

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new TextSequenceParser<T>(items, options)

Type parameters

NameType
Textends boolean = true

Parameters

NameType
itemsSequenceItemType[]
optionsTextSequenceParserOptions<T>

Overrides

BaseTextParser<T&gt;.constructor

Defined in

text/sequence.ts:25open in new window

Properties

manager

Protected manager: InputTextManager

Inherited from

BaseTextParser.manager

Defined in

text/internals/baseParser.ts:8open in new window


options

Protected options: TextSequenceParserOptions<T>

Inherited from

BaseTextParser.options

Defined in

text/sequence.ts:27open in new window


propertyChar

propertyChar: string = '.'

The character to use for seperating properties in InputTextSequenceParser.parsePropertyChain

Defined in

text/sequence.ts:23open in new window


splitChar

Static splitChar: string | RegExp

The character / expression used to split items in a line. Note: if you want to have the options with a '>', change this to '->' or the options would be split

Default

/->|>/

Defined in

text/sequence.ts:18open in new window

Accessors

splitOptions

Protected get splitOptions(): TextSequenceParseSplitOptions

Returns

TextSequenceParseSplitOptions

Defined in

text/sequence.ts:35open in new window

Methods

applyRawArguments

Private applyRawArguments(args): [string, string][]

Parameters

NameType
argsstring

Returns

[string, string][]

Defined in

text/sequence.ts:56open in new window


convert

Protected convert<R>(item): undefined | If<T, string, R>

Type parameters

NameType
Rextends BaseItem<R>

Parameters

NameType
itemundefined | R

Returns

undefined | If<T, string, R>

Inherited from

BaseTextParser.convert

Defined in

text/internals/baseParser.ts:16open in new window


createSequence

Protected createSequence(): Sequence

Returns

Sequence

Inherited from

BaseTextParser.createSequence

Defined in

text/internals/baseParser.ts:22open in new window


isSequenceInput

isSequenceInput(input): boolean

Check if the input can be a sequence string. Uses splitChar to check

Parameters

NameTypeDescription
inputstringUnknown input to check

Returns

boolean

Defined in

text/sequence.ts:66open in new window


parsePropertyChain

parsePropertyChain(input, spacing?): undefined | If<T, string, Sequence>

Convert a series of get properties to an sequence

Example

Player().PRI.Team.TeamPlayer
Player().PRI.Team.<Integer>TeamIndex
Player(bAllPlayers=False).PRI.Team

Parameters

NameTypeDescription
inputstringThe input sequence in text
spacing?Object-
spacing.nodesnumber-
spacing.variablenumber-

Returns

undefined | If<T, string, Sequence>

Defined in

text/sequence.ts:84open in new window


parseRawItem

Protected parseRawItem(input): BaseSequenceItem

Parameters

NameType
inputstring

Returns

BaseSequenceItem

Inherited from

BaseTextParser.parseRawItem

Defined in

text/internals/baseParser.ts:29open in new window


parseRawSequence

parseRawSequence(input, options?): undefined | If<T, string, Sequence>

Parameters

NameType
inputstring
options?Object
options.parseSubSequences?boolean

Returns

undefined | If<T, string, Sequence>

Defined in

text/sequence.ts:268open in new window


parseRawSequenceItems

Protected parseRawSequenceItems(sequence, items, subSequences?, depth): void

Parameters

NameTypeDefault value
sequenceSequenceundefined
itemsstring[]undefined
subSequencesbooleantrue
depthnumberundefined

Returns

void

Defined in

text/sequence.ts:252open in new window


parseRawSingleSequence

parseRawSingleSequence(input): undefined | If<T, string, Sequence>

Parameters

NameType
inputstring

Returns

undefined | If<T, string, Sequence>

Defined in

text/sequence.ts:278open in new window


parseRawSubsequence

Protected parseRawSubsequence(parent, item, depth): void

Parameters

NameType
parentSequence
itemstring
depthnumber

Returns

void

Defined in

text/sequence.ts:236open in new window


parseSequence

parseSequence(input): Sequence

Parse a sequence following a custom set of parsing rules. You need to declare all options in TextSequenceParseSplitOptions for the options in this parser to be able to use this method.

Parameters

NameTypeDescription
inputstringThe input to use for parsing

Returns

Sequence

Defined in

text/sequence.ts:154open in new window


formatBase

Static formatBase(input): string

Parameters

NameType
inputstring

Returns

string

Defined in

text/sequence.ts:49open in new window