typescript

package
v0.4.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateGuest

func GenerateGuest(signatureSchema *signature.Schema, signatureHash string, packageName string) ([]byte, error)

GenerateGuest generates the guest bindings for the signature

func GenerateHost

func GenerateHost(signatureSchema *signature.Schema, signatureHash string, packageName string) ([]byte, error)

GenerateHost generates the host bindings for the signature

Note: the given schema should already be normalized, validated, and modified to have its accessors and validators disabled

func GeneratePackageJSON

func GeneratePackageJSON(packageName string, packageVersion string) ([]byte, error)

GeneratePackageJSON generates the package.json file for the signature

func GenerateTypes

func GenerateTypes(signatureSchema *signature.Schema, packageName string) ([]byte, error)

GenerateTypes generates the types for the signature

Types

type Generator

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

Generator is the typescript generator

func New

func New() (*Generator, error)

New creates a new typescript generator

func (*Generator) GenerateGuest

func (g *Generator) GenerateGuest(signatureSchema *signature.Schema, signatureHash string, packageName string) ([]byte, error)

GenerateGuest generates the guest bindings for the signature

func (*Generator) GenerateGuestTranspiled

func (g *Generator) GenerateGuestTranspiled(signatureSchema *signature.Schema, packageName string, sourceName string, typescriptSource string) (*Transpiled, error)

GenerateGuestTranspiled takes the typescript source for the generated guest bindings and transpiles it to javascript

func (*Generator) GenerateHost

func (g *Generator) GenerateHost(signatureSchema *signature.Schema, signatureHash string, packageName string) ([]byte, error)

GenerateHost generates the host bindings for the signature

Note: the given schema should already be normalized, validated, and modified to have its accessors and validators disabled

func (*Generator) GenerateHostTranspiled

func (g *Generator) GenerateHostTranspiled(signatureSchema *signature.Schema, packageName string, sourceName string, typescriptSource string) (*Transpiled, error)

GenerateHostTranspiled takes the typescript source for the generated host bindings and transpiles it to javascript

Note: the given schema should already be normalized, validated, and modified to have its accessors and validators disabled

func (*Generator) GeneratePackageJSON

func (g *Generator) GeneratePackageJSON(packageName string, packageVersion string) ([]byte, error)

GeneratePackageJSON generates the package.json file for the signature

func (*Generator) GenerateTypes

func (g *Generator) GenerateTypes(signatureSchema *signature.Schema, packageName string) ([]byte, error)

GenerateTypes generates the types for the signature

This is not transpiled to javascript and does not include source maps or type definitions

func (*Generator) GenerateTypesTranspiled

func (g *Generator) GenerateTypesTranspiled(signatureSchema *signature.Schema, packageName string, sourceName string, typescriptSource string) (*Transpiled, error)

GenerateTypesTranspiled takes the typescript source for the generated types and transpiles it to javascript

type Transpiled

type Transpiled struct {
	Typescript  []byte
	Javascript  []byte
	SourceMap   []byte
	Declaration []byte
}

func GenerateGuestTranspiled

func GenerateGuestTranspiled(signatureSchema *signature.Schema, signatureHash string, packageName string, sourceName string) (*Transpiled, error)

GenerateGuestTranspiled generates the guest bindings and transpiles it to javascript

func GenerateHostTranspiled

func GenerateHostTranspiled(signatureSchema *signature.Schema, signatureHash string, packageName string, sourceName string) (*Transpiled, error)

GenerateHostTranspiled generates the host bindings and transpiles it to javascript

Note: the given schema should already be normalized, validated, and modified to have its accessors and validators disabled

func GenerateTypesTranspiled

func GenerateTypesTranspiled(signatureSchema *signature.Schema, packageName string, sourceName string) (*Transpiled, error)

GenerateTypesTranspiled generates the types for the signature and transpiles it to javascript

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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