gojs

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 4 Imported by: 52

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFuncOpts = errorutil.NewWithFmt("invalid function options: %v")
)

Functions

func RegisterFuncWithSignature

func RegisterFuncWithSignature(runtime *goja.Runtime, opts FuncOpts) error

RegisterFunc registers a function with given name, signatures and description

Types

type FuncOpts

type FuncOpts struct {
	Name        string
	Signatures  []string
	Description string
	FuncDecl    interface{}
}

type GojaModule

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

func (*GojaModule) Enable

func (p *GojaModule) Enable(runtime Runtime)

func (*GojaModule) Name

func (p *GojaModule) Name() string

func (*GojaModule) Register

func (p *GojaModule) Register() Module

func (*GojaModule) Require

func (p *GojaModule) Require(runtime *goja.Runtime, module *goja.Object)

func (*GojaModule) Set

func (p *GojaModule) Set(objects Objects) Module

func (*GojaModule) String

func (p *GojaModule) String() string

type Module

type Module interface {
	Name() string
	Set(objects Objects) Module
	Enable(Runtime)
	Register() Module
}

func NewGojaModule

func NewGojaModule(name string) Module

type Object

type Object interface {
	Set(string, interface{})
	Get(string) interface{}
}

type Objects

type Objects map[string]interface{}

type Runtime

type Runtime interface {
	Set(string, interface{}) error
}

Jump to

Keyboard shortcuts

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