js

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplatePlaceholder = "//__TEMPLATE_INSERT_IMPORTS__"
)

Variables

This section is empty.

Functions

func BindgenCmd

func BindgenCmd() *cli.Cmd

func CreateJSBindings

func CreateJSBindings(spec BindgenSpec) (code string, err error)

Types

type BindgenFlags

type BindgenFlags struct {
	BuildOpts toolchain.Options

	WASM string `cli:"wasm,#path to the wasm blob, required to select module import for bindings"`

	Output string `cli:"o|output,#set file path to write the generated output, if not set, write generated bindings to stdout"`

	ES             string `cli:"es,def=5,comp=5,comp=6,#set ES language when transpiling typescript"`
	ModuleName     string `cli:"module-name,def=bindings,#set module name for generated bindings"`
	ModuleSystem   string `` /* 154-byte string literal not displayed */
	Minify         bool   `cli:"minify,#write minified code and source map along with the bindgen output file"`
	CustomTemplate string `cli:"T|template,#set path to a custom bindgen template file"`

	Platform toolchain.Platform `cli:"p|platform,def=js/wasm,#set os/arch pair used when building the wasm"`
	Tags     []string           `cli:"t|tag,#set go build tags used when building the wasm"`
}

func GetBindgenFlags added in v0.2.0

func GetBindgenFlags() *BindgenFlags

type BindgenSpec added in v0.2.1

type BindgenSpec struct {
	ModuleSystem  string
	ES            string
	ModuleName    string
	CustomWrapper string
	Deps          []*toolchain.Package
	Filter        WasmImportFilter
}

type SimpleWasmImportFilter

type SimpleWasmImportFilter map[WasmImportKey]bool

func CreateSimpleFilterFromWasm

func CreateSimpleFilterFromWasm(blob []byte) (filter SimpleWasmImportFilter, err error)

func (SimpleWasmImportFilter) Keep

func (m SimpleWasmImportFilter) Keep(module, field string) bool

type WasmImportFilter

type WasmImportFilter interface {
	Keep(module, field string) bool
}

type WasmImportKey

type WasmImportKey struct {
	Module string
	Field  string
}

Jump to

Keyboard shortcuts

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