parser

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 12 Imported by: 4

Documentation

Overview

Package parser provides a Go module parser for TypeScript AST

Package parser provides a Go module parser for TypeScript AST

Package parser provides a Go module parser for TypeScript AST

Package parser provides a Go module parser for TypeScript AST

Package parser provides a Go module parser for TypeScript AST

Package parser provides a Go module parser for TypeScript AST

Index

Constants

This section is empty.

Variables

View Source
var All = func(opt *FilterOpt) bool {
	return true
}

All exports all interfaces

View Source
var Default = func(opt *FilterOpt) bool {
	if !opt.BasePackage {
		return false
	}

	if !opt.Exported {
		return false
	}

	return true
}

Default exports all other than neither in base-package nor exported

Functions

This section is empty.

Types

type FilterOpt added in v1.0.0

type FilterOpt struct {
	BasePackage bool
	Package     string
	Name        string
	Exported    bool
	// Dependency - 他のstructから依存されている場合にtrueとなる
	// 同じstructに対して複数回呼ばれ、依存されていない状況ではfalseとして呼ばれる可能性がある
	// 一度でもtrueとして返せば出力される
	// dependencyがfalseの時にtrueを返す場合、trueでも常にtrueを返すべきである
	Dependency bool
}

FilterOpt is options to filter exported interfaces

type Parser

type Parser struct {
	Filter func(opt *FilterOpt) bool
	// contains filtered or unexported fields
}

Parser is a Go module parser for TypeScript AST

func NewParser

func NewParser(dir string, filter func(*FilterOpt) bool) (*Parser, error)

NewParser initializes a new Parser

func (*Parser) GetBasePackage added in v1.0.0

func (p *Parser) GetBasePackage() string

GetBasePackage returns a base module for the root package

func (*Parser) Parse

func (p *Parser) Parse() (res map[string]tstypes.Type, err error)

Parse parses the Go module and returns ASTs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL