Class SourceFile
Package: grammarkdown
Constructors
constructor(filename, text, elements)
Constructs a new instance of the SourceFile
class
Declaration
constructor(filename: string, text: string, elements: ReadonlyArray<SourceElement>);
Parameters
Properties
elements
Declaration
readonly elements: ReadonlyArray<SourceElement>;
Property Value
ReadonlyArray<SourceElement>
filename
Declaration
readonly filename: string;
Property Value
string
firstChild
Declaration
get firstChild(): Node | undefined;
Property Value
Node | undefined
imports
Declaration
imports: ReadonlyArray<string> | undefined;
Property Value
ReadonlyArray<string> | undefined
lastChild
Declaration
get lastChild(): Node | undefined;
Property Value
Node | undefined
lineMap
Declaration
readonly lineMap: LineMap;
Property Value
text
Declaration
readonly text: string;
Property Value
string
Methods
children()
Declaration
children(): IterableIterator<Node>;
Returns
IterableIterator<Node>
forEachChild(cbNode)
Declaration
forEachChild<T>(cbNode: (node: Node) => T | undefined): T | undefined;
Type Parameters
- T
Parameters
- cbNode
- (node: Node) => T | undefined
Returns
T | undefined
update(elements)
Declaration
update(elements: ReadonlyArray<SourceElement>): SourceFile;
Parameters
- elements
- ReadonlyArray<SourceElement>