JavaScriptBridge

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func CreateCallback

func CreateCallback(callable func(args []any) any) JavaScriptObject.Instance

func CreateObject

func CreateObject(obj string, args ...any) any

func DownloadBuffer

func DownloadBuffer(buffer []byte, name string)

func DownloadBufferOptions

func DownloadBufferOptions(buffer []byte, name string, mime string)

func Eval

func Eval(code string, use_global_execution_context bool) any

func ForceFsSync

func ForceFsSync()

func GetInterface

func GetInterface(intf string) JavaScriptObject.Instance

func IsJsBuffer

func IsJsBuffer(javascript_object JavaScriptObject.Instance) bool

func JsBufferToPackedByteArray

func JsBufferToPackedByteArray(javascript_buffer JavaScriptObject.Instance) []byte

func OnPwaUpdateAvailable

func OnPwaUpdateAvailable(cb func(), flags ...Signal.Flags)

func PwaNeedsUpdate

func PwaNeedsUpdate() bool

func PwaUpdate

func PwaUpdate() error

Types

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create a Go extension of this class.

T must be a type that is embedding this Extension as the first field. It is unsafe and invalid to use this type directly, or embedded in any other way.

func (*Extension[T]) AsObject

func (o *Extension[T]) AsObject() [1]gdreference.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.JavaScriptBridge

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (o Instance) AsObject() [1]gdreference.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gdreference.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Singleton

type Singleton[T gdclass.Interface] = Extension[T]

Singleton can be embedded in a new struct to create a Go singleton extension of the class.

It will become available as a global inside scripts and any any other Go Extension types will have any *T typed fields filled in to point at this singleton once they have been instantiated.

T must be a type that is embedding this Singleton as the first field. It is unsafe and invalid to use this type directly, or embedded in any other way.

Jump to

Keyboard shortcuts

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