jsmodule

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: AGPL-3.0 Imports: 1 Imported by: 7

Documentation

Overview

Package jsmodule the JS module

Index

Constants

View Source
const (
	// ExtPrefix common module prefix
	ExtPrefix = "cloudcat/"
)

Variables

This section is empty.

Functions

func AllModules

func AllModules() map[string]*ext.Extension

func Register

func Register(name string, mod Module)

Register the given mod as an external JavaScript module that can be imported by name.

Types

type Global

type Global interface {
	Module
	Global() // is it a global module
}

Global is it a global module When the module implements the interface it will be loaded into the global when the js.VM is initialized.

type Module

type Module interface {
	Exports() any // module instance
}

Module is what a module needs to return

func GetModule

func GetModule(name string) (Module, bool)

Jump to

Keyboard shortcuts

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