typescript

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidManifest = errors.New("invalid manifest")
)

Functions

func GenerateTypescriptIndex

func GenerateTypescriptIndex(packageSchema *scalefile.Schema, functionInfo *FunctionInfo) ([]byte, error)

func GenerateTypescriptPackageJSON

func GenerateTypescriptPackageJSON(signatureInfo *SignatureInfo) ([]byte, error)

Types

type FunctionInfo added in v0.4.6

type FunctionInfo struct {
	// PackageName is the name of the function package
	PackageName string

	// ImportPath is the import path for the function, always a path on disk
	ImportPath string
}

FunctionInfo is the import information for a Function

type Generator

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

func New

func New() *Generator

func (*Generator) GenerateTypescriptIndex

func (g *Generator) GenerateTypescriptIndex(scalefileSchema *scalefile.Schema, functionInfo *FunctionInfo) ([]byte, error)

func (*Generator) GenerateTypescriptPackageJSON

func (g *Generator) GenerateTypescriptPackageJSON(signatureInfo *SignatureInfo) ([]byte, error)

type Manifest

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

func ParseManifest

func ParseManifest(data []byte) (*Manifest, error)

func (*Manifest) AddDependency

func (m *Manifest) AddDependency(dependency string, version string) error

func (*Manifest) GetDependency

func (m *Manifest) GetDependency(dependency string) string

func (*Manifest) HasDependency

func (m *Manifest) HasDependency(dependency string) bool

func (*Manifest) RemoveDependency

func (m *Manifest) RemoveDependency(dependency string) error

func (*Manifest) Write

func (m *Manifest) Write() ([]byte, error)

type PackageJSON

type PackageJSON struct {
	Name            string            `json:"name"`
	Version         string            `json:"version"`
	Description     string            `json:"description,omitempty"`
	License         string            `json:"license,omitempty"`
	Files           []string          `json:"files,omitempty"`
	Main            string            `json:"main,omitempty"`
	Browser         string            `json:"browser,omitempty"`
	Dependencies    map[string]string `json:"dependencies,omitempty"`
	DevDependencies map[string]string `json:"devDependencies,omitempty"`
	// contains filtered or unexported fields
}

type SignatureInfo added in v0.4.6

type SignatureInfo struct {
	// Local specifies whether the signature is a locally importable signature
	Local bool

	// ImportPath is the import path for the signature, if the signature is local this will be a path on disk
	ImportPath string
}

SignatureInfo is the import information for a Signature

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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