Versions in this module Expand all Collapse all v0 v0.22.0 Dec 27, 2025 Changes in this version + var ErrLoopAlreadyRunning = errors.New("event loop already running") + var ErrLoopNotRunning = errors.New("event loop not running") + var ErrPromiseRejected = errors.New("promise rejected") + var ErrPromiseTimeout = errors.New("promise did not resolve within timeout") + func ExtractPromiseValue(value goja.Value) (interface{}, error) + func GetPromise(value goja.Value) *goja.Promise + func IsPromise(value goja.Value) bool + type EventLoop struct + func New(vm *goja.Runtime) *EventLoop + func (e *EventLoop) AwaitPromise(ctx context.Context, value goja.Value) PromiseResult + func (e *EventLoop) ClearTimeout(t *Timer) + func (e *EventLoop) EnqueueJob(fn func()) + func (e *EventLoop) NewPromise() (*goja.Promise, func(interface{}), func(interface{})) + func (e *EventLoop) RegisterCallback() func(func()) + func (e *EventLoop) RegisterFetch(config *fetch.FetchConfig) + func (e *EventLoop) Run(ctx context.Context, fn func(*goja.Runtime) (goja.Value, error)) (goja.Value, error) + func (e *EventLoop) RunOnLoop(fn func()) bool + func (e *EventLoop) Runtime() *goja.Runtime + func (e *EventLoop) SetTimeout(fn func(), delay time.Duration) *Timer + func (e *EventLoop) WrapGoFunctionAsync(name string, fn func(call goja.FunctionCall, enqueue func(func())) goja.Value) + type PromiseResult struct + Error error + State PromiseState + Value goja.Value + type PromiseState int + const PromiseStateFulfilled + const PromiseStatePending + const PromiseStateRejected + type Timer struct