typescript

package
v1.509.12 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigPaths = TsConfigPaths{
	Rel: ".",
	Map: &map[string][]string{},
}
View Source
var InvalidTsconfig = TsConfig{
	Paths: &DefaultConfigPaths,
}

Functions

This section is empty.

Types

type TsConfig

type TsConfig struct {
	// Directory of the tsconfig file
	ConfigDir string

	// Name of the tsconfig file relative to ConfigDir
	ConfigName string

	RootDir string
	BaseUrl string

	VirtualRootDirs []string

	Paths *TsConfigPaths

	// References to other tsconfig or packages that must be resolved.
	Types   []string
	Extends string

	// TODO: drop references? Not supported by rules_ts?
	References []string
}

func (TsConfig) ExpandPaths

func (c TsConfig) ExpandPaths(from, p string) []string

Expand the given path to all possible mapped paths for this config, in priority order.

Path matching algorithm based on ESBuild implementation Inspired by: https://github.com/evanw/esbuild/blob/deb93e92267a96575a6e434ff18421f4ef0605e4/internal/resolver/resolver.go#L1831-L1945

type TsConfigMap

type TsConfigMap struct {
	// contains filtered or unexported fields
}

type TsConfigPaths

type TsConfigPaths struct {
	Rel string
	Map *map[string][]string
}

type TsWorkspace

type TsWorkspace struct {
	// contains filtered or unexported fields
}

func NewTsWorkspace

func NewTsWorkspace() *TsWorkspace

func (*TsWorkspace) AddTsConfigFile

func (tc *TsWorkspace) AddTsConfigFile(root, rel, fileName string)

func (*TsWorkspace) ExpandPaths

func (tc *TsWorkspace) ExpandPaths(from, f string) []string

func (*TsWorkspace) GetTsConfigFile added in v1.508.0

func (tc *TsWorkspace) GetTsConfigFile(rel string) *TsConfig

func (*TsWorkspace) IsWithinTsRoot

func (tc *TsWorkspace) IsWithinTsRoot(f string) bool

func (*TsWorkspace) ResolveConfig added in v1.509.12

func (tc *TsWorkspace) ResolveConfig(dir string) (string, *TsConfig)

Jump to

Keyboard shortcuts

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