index
Index
Classes
Interfaces
BOM
A Byte-Order Mark at the start of a document
Properties
text
text:
string
The BOM text, i.e. '\ufeff'
.
Defined in
type
type:
"bom"
A property to differentiate the different types of whitespace
Defined in
EscLine
An escaped newline
Properties
text
text:
string
The escaped newline
Defined in
type
type:
"line-escape"
A property to differentiate the different types of whitespace
Defined in
InlineWhitespace
Regular plain old whitespace characters
Properties
text
text:
string
The whitespace's text
Defined in
type
type:
"space"
A property to differentiate the different types of whitespace
Defined in
LineSpaceSlashDash
A slashdash comment in a document, i.e. a slashdash commented node
Properties
preface
preface:
PlainNodeSpace
[]
Any whitespace between the slashdash token and the value
Defined in
type
type:
"slashdash"
A property to differentiate the different types of whitespace
Defined in
value
value:
Node
The escaped value
Defined in
Location
Location inside source text
Properties
endColumn
endColumn:
number
Column of the last character of the Token. 1-indexed.
Defined in
endLine
endLine:
number
Line of the last character. 1-indexed.
Defined in
endOffset
endOffset:
number
Offset behind the last character. 0-indexed.
Defined in
startColumn
startColumn:
number
Column of the first character of the Token. 1-indexed.
Defined in
startLine
startLine:
number
Line of the first character. 1-indexed.
Defined in
startOffset
startOffset:
number
Offset of the first character. 0-indexed.
Defined in
MultilineComment
A multiline comment
Properties
text
text:
string
The comment text, including the comment tokens themselves
Defined in
type
type:
"multiline"
A property to differentiate the different types of whitespace
Defined in
Newline
A single newline
Note a newline can consist of multiple characters: \r\n
is a single newline.
Properties
text
text:
string
The newline
Defined in
type
type:
"newline"
A property to differentiate the different types of whitespace
Defined in
NodeSpaceSlashDash
A slashdash comment inside a node, i.e. a slashdash commented argument, property, or child block
Properties
preface
preface:
PlainNodeSpace
[]
Any whitespace between the slashdash token and the value
Defined in
type
type:
"slashdash"
A property to differentiate the different types of whitespace
Defined in
value
The escaped value
Defined in
SingleLineComment
A single-line comment
Properties
text
text:
string
The comment's text, starting at the //
and ending with a newline unless the comment ended at the end of the file
Defined in
type
type:
"singleline"
A property to differentiate the different types of whitespace
Defined in
Type Aliases
LineSpace
LineSpace: (
PlainLineSpace
|LineSpaceSlashDash
)[]
Whitespace in a document, i.e. before/after/between nodes
Defined in
NodeSpace
NodeSpace: (
PlainNodeSpace
|NodeSpaceSlashDash
)[]
Whitespace inside of a node, e.g. between two arguments in a node.
Defined in
PlainLineSpace
PlainLineSpace:
BOM
|InlineWhitespace
|Newline
|SingleLineComment
|MultilineComment
A single plain whitespace item in a document, i.e. before/after/between nodes
Defined in
PlainNodeSpace
PlainNodeSpace:
InlineWhitespace
|EscLine
|MultilineComment
A single plain whitespace item inside of a node, e.g. between two arguments in a node.
Defined in
Functions
clearFormat()
clearFormat<
T
>(v
):T
Type Parameters
• T extends Identifier
| Tag
| Value
| Entry
| Node
| Document
Parameters
• v: T
Returns
T
Defined in
format()
format(
v
):string
Parameters
• v: Identifier
| Tag
| Value
| Entry
| Node
| Document
Returns
string
Defined in
getLocation()
getLocation(
element
):undefined
|Location
Get location information of the given parsed element
If the element was not created by the parser, or if the parser option storeLocations
was not set to true
, the result will be undefined.
Parameters
• element: Identifier
| Tag
| Value
| Entry
| Node
| Document
Returns
undefined
| Location
Defined in
parse()
parse(text, options)
parse(
text
,options
):Value
Parse the given text as a value.
The text should not contain anything other than the value, i.e. no leading or trailing whitespace, no comments, no tags.
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options
• options.as: "value"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean
Returns
Defined in
parse(text, options)
parse(
text
,options
):Identifier
Parse the given text as a identifier.
The text should not contain anything other than the identifier, i.e. no leading or trailing whitespace, no comments, no tags.
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options
• options.as: "identifier"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean
Returns
Defined in
parse(text, options)
parse(
text
,options
):Entry
Parse the given text as an entry.
The text can contain extra whitespace, tags, and comments (though no slashdash comments of entire nodes)
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options
• options.as: "entry"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean
Returns
Defined in
parse(text, options)
parse(
text
,options
):Node
Parse the given text as a node.
The text can contain extra whitespace, tags, and comments.
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options
• options.as: "node"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean
Returns
Defined in
parse(text, options)
parse(
text
,options
):LineSpace
Parse the given text as a whitespace in a document.
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options
• options.as: "whitespace in document"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean
Returns
Defined in
parse(text, options)
parse(
text
,options
):NodeSpace
Parse the given text as a whitespace in a node.
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options
• options.as: "whitespace in node"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean
Returns
Defined in
parse(text, options)
parse(
text
,options
?):Document
Parse the given text as a document.
The text can contain extra whitespace, tags, and comments.
Parameters
• text: string
| ArrayBuffer
| DataView
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
• options?
• options.as?: "document"
• options.graphemeLocations?: boolean
• options.storeLocations?: boolean