@kismet.ts/parsers / Exports / TextSequenceParser
Class: TextSequenceParser<T>
Type parameters
| Name | Type |
|---|---|
T | extends boolean = true |
Hierarchy
BaseTextParser<T>↳
TextSequenceParser
Table of contents
Constructors
Properties
Accessors
Methods
- applyRawArguments
- convert
- createSequence
- isSequenceInput
- parsePropertyChain
- parseRawItem
- parseRawSequence
- parseRawSequenceItems
- parseRawSingleSequence
- parseRawSubsequence
- parseSequence
- formatBase
Constructors
constructor
• new TextSequenceParser<T>(items, options)
Type parameters
| Name | Type |
|---|---|
T | extends boolean = true |
Parameters
| Name | Type |
|---|---|
items | SequenceItemType[] |
options | TextSequenceParserOptions<T> |
Overrides
BaseTextParser<T>.constructor
Defined in
Properties
manager
• Protected manager: InputTextManager
Inherited from
BaseTextParser.manager
Defined in
text/internals/baseParser.ts:8
options
• Protected options: TextSequenceParserOptions<T>
Inherited from
BaseTextParser.options
Defined in
propertyChar
• propertyChar: string = '.'
The character to use for seperating properties in InputTextSequenceParser.parsePropertyChain
Defined in
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
Accessors
splitOptions
• Protected get splitOptions(): TextSequenceParseSplitOptions
Returns
Defined in
Methods
applyRawArguments
▸ Private applyRawArguments(args): [string, string][]
Parameters
| Name | Type |
|---|---|
args | string |
Returns
[string, string][]
Defined in
convert
▸ Protected convert<R>(item): undefined | If<T, string, R>
Type parameters
| Name | Type |
|---|---|
R | extends BaseItem<R> |
Parameters
| Name | Type |
|---|---|
item | undefined | R |
Returns
undefined | If<T, string, R>
Inherited from
BaseTextParser.convert
Defined in
text/internals/baseParser.ts:16
createSequence
▸ Protected createSequence(): Sequence
Returns
Sequence
Inherited from
BaseTextParser.createSequence
Defined in
text/internals/baseParser.ts:22
isSequenceInput
▸ isSequenceInput(input): boolean
Check if the input can be a sequence string. Uses splitChar to check
Parameters
| Name | Type | Description |
|---|---|---|
input | string | Unknown input to check |
Returns
boolean
Defined in
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
| Name | Type | Description |
|---|---|---|
input | string | The input sequence in text |
spacing? | Object | - |
spacing.nodes | number | - |
spacing.variable | number | - |
Returns
undefined | If<T, string, Sequence>
Defined in
parseRawItem
▸ Protected parseRawItem(input): BaseSequenceItem
Parameters
| Name | Type |
|---|---|
input | string |
Returns
BaseSequenceItem
Inherited from
BaseTextParser.parseRawItem
Defined in
text/internals/baseParser.ts:29
parseRawSequence
▸ parseRawSequence(input, options?): undefined | If<T, string, Sequence>
Parameters
| Name | Type |
|---|---|
input | string |
options? | Object |
options.parseSubSequences? | boolean |
Returns
undefined | If<T, string, Sequence>
Defined in
parseRawSequenceItems
▸ Protected parseRawSequenceItems(sequence, items, subSequences?, depth): void
Parameters
| Name | Type | Default value |
|---|---|---|
sequence | Sequence | undefined |
items | string[] | undefined |
subSequences | boolean | true |
depth | number | undefined |
Returns
void
Defined in
parseRawSingleSequence
▸ parseRawSingleSequence(input): undefined | If<T, string, Sequence>
Parameters
| Name | Type |
|---|---|
input | string |
Returns
undefined | If<T, string, Sequence>
Defined in
parseRawSubsequence
▸ Protected parseRawSubsequence(parent, item, depth): void
Parameters
| Name | Type |
|---|---|
parent | Sequence |
item | string |
depth | number |
Returns
void
Defined in
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
| Name | Type | Description |
|---|---|---|
input | string | The input to use for parsing |
Returns
Sequence
Defined in
formatBase
▸ Static formatBase(input): string
Parameters
| Name | Type |
|---|---|
input | string |
Returns
string