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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateGuest

func GenerateGuest(extensionSchema *extension.Schema, extensionHash string, packageName string) ([]byte, error)

GenerateGuest generates the guest bindings for the extension

func GenerateHost

func GenerateHost(extensionSchema *extension.Schema, extensionHash string, packageName string) ([]byte, error)

GenerateHost generates the host bindings for the extension

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 extension

func GenerateTypes

func GenerateTypes(extensionSchema *extension.Schema, packageName string) ([]byte, error)

GenerateTypes generates the types for the extension

func GetCallID

func GetCallID(schemaHash string, ifc string, fn string) uint64

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(extensionSchema *extension.Schema, extensionHash string, packageName string) ([]byte, error)

GenerateGuest generates the guest bindings for the extension

func (*Generator) GenerateGuestTranspiled

func (g *Generator) GenerateGuestTranspiled(extensionSchema *extension.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(extensionSchema *extension.Schema, extensionHash string, packageName string) ([]byte, error)

GenerateHost generates the host bindings for the extension

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(extensionSchema *extension.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 extension

func (*Generator) GenerateTypes

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

GenerateTypes generates the types for the extension

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

func (*Generator) GenerateTypesTranspiled

func (g *Generator) GenerateTypesTranspiled(extensionSchema *extension.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(extensionSchema *extension.Schema, extensionHash string, packageName string, sourceName string) (*Transpiled, error)

GenerateGuestTranspiled generates the guest bindings and transpiles it to javascript

func GenerateHostTranspiled

func GenerateHostTranspiled(extensionSchema *extension.Schema, extensionHash 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(extensionSchema *extension.Schema, packageName string, sourceName string) (*Transpiled, error)

GenerateTypesTranspiled generates the types for the extension 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