typescript

package
v0.0.0-...-3de72e3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Preprocessor

type Preprocessor struct {
	*inputprocessor.BasePreprocessor
}

Preprocessor is the preprocessor of typescript compile actions.

func (*Preprocessor) ComputeSpec

func (p *Preprocessor) ComputeSpec() error

ComputeSpec computes any further action specification that is not immediately inferrable from flags or toolchain configuration.

type Reference

type Reference struct {
	// Path is the path to the project reference.
	Path string `json:path`
}

Reference defines the path to a project reference.

type Tsconfig

type Tsconfig struct {
	// Extends is the parent tsconfig to be extended.
	Extends string `json:extends`
	// Exclude is the list of files to be excluded.
	Exclude []string `json:exclude`
	// Files is the list of files to be included.
	Files []string `json:files`
	// Include is the list of directories to be included.
	Include []string `json:include`
	// References is list of project references.
	References []Reference `json:references`
	// PaTsPathth is the path to this tsconfig.json file.
	TsPath string
}

Tsconfig encapusulates configuration in tsconfig.json for a Typescript project.

func (*Tsconfig) Inputs

func (t *Tsconfig) Inputs() ([]Tsinput, error)

Inputs returns a list of Tsinput specified in the Files, Include, and References section of this tsconfig.json.

func (*Tsconfig) Path

func (t *Tsconfig) Path() string

Path returns the path to this tsconfig.

type Tsfile

type Tsfile struct {
	// Imports is a list of imports in the typescript file.
	Imports []string
	// TsPath is the path to this typescript file.
	TsPath string
}

Tsfile is a struct for a single typescript file.

func (*Tsfile) Inputs

func (t *Tsfile) Inputs() ([]Tsinput, error)

Inputs returns a list of files imported by this tsfile.

func (*Tsfile) Path

func (t *Tsfile) Path() string

Path returns the path to this tsfile.

type Tsinput

type Tsinput interface {
	Path() string
	Inputs() ([]Tsinput, error)
}

Tsinput is the interface for inputs of typescript.

type TsinputProcessor

type TsinputProcessor struct {
	// Paths is a list of paths for inputs.
	Paths map[string]bool
	// Tsinputs is a list of Tsinput, whose deps are to be processed.
	Tsinputs []Tsinput
}

TsinputProcessor is used to find deps recursively from Tsinputs.

func ProcessInputs

func ProcessInputs(path string) (*TsinputProcessor, error)

ProcessInputs returns a TsInputProcessor, if the path points to a tsfile or a tsconfig, returns error otherwise.

func (*TsinputProcessor) Inputs

func (t *TsinputProcessor) Inputs() ([]string, error)

Inputs returns a list of path of dependencies for t.Tsinputs.

func (*TsinputProcessor) Outputs

func (t *TsinputProcessor) Outputs() (*Tsoutput, error)

Outputs returns Tsoutput struct, containing the output files from the inputs.

type Tsoutput

type Tsoutput struct {
	Outdir   string
	Outfiles []string
}

Tsoutput is the struct for output files and directories. Only Outfiles are supported for now.

Jump to

Keyboard shortcuts

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