Documentation
¶
Overview ¶
Package parser provides a Parse function for parsing TypeScript source files into an abstract syntax tree (AST).
Example ¶
package main import ( "fmt" "github.com/armsnyder/typescript-ast-go/parser" ) func main() { src := []byte(` export interface ProgressParams<T> { /** * The progress token provided by the client or server. */ token: ProgressToken; /** * The progress data. */ value: T; }`) sourceFile := parser.Parse(src) fmt.Printf("Parsed %T", sourceFile.Statements[0]) }
Output: Parsed *ast.InterfaceDeclaration
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(source []byte) *ast.SourceFile
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.