goji

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

Go JavaScript Interface

A library for doing JavaScript things in Go.

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

View Source
var Error errorJS

Error is a wrapper for the Error global object.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error

View Source
var Event eventJS

Event is a wrapper for the Event global interface.

https://developer.mozilla.org/en-US/docs/Web/API/Event

View Source
var EventListenerOptions = &eventListenerOptions{}

EventListenerOptions is used to set event listener options.

View Source
var EventOptions = &eventOptions{}

EventOptions is used to set event listener options.

View Source
var EventTarget eventTargetJS

EventTarget wraps the EventTarget global interface.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget

View Source
var JSON jsonJS

JSON is a wrapper for the JSON global object.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON

View Source
var Promise promiseJS

Promise is a wrapper for the Promise global object.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

View Source
var Uint8Array uint8ArrayJS

Uint8Array is a wrapper for the Uint8Array global object.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array

Functions

func Async added in v0.0.2

func Async(fn func(this js.Value, args []js.Value) (js.Value, error)) js.Func

Async is a helper function that wraps the given func in a promise that resolves when no error is returned or rejects when an error is returned.

func Await

func Await(prom PromiseValue) (res []js.Value, err error)

Await is a helper function that waits for a promise to resolve or reject and returns the results and an error value.

func BytesFromUint8Array

func BytesFromUint8Array(src Uint8ArrayValue) []byte

BytesFromUint8Array is a helper function that copies the given Uint8Array into a new byte slice.

func EventListener

func EventListener(fn func(event EventValue)) js.Func

EventListener returns a new event listener callback that calls the given func when an event is received.

func MarshalJS

func MarshalJS(v any) (js.Value, error)

MarshalJS marshals the given value into a js.Value.

func UnmarshalJS

func UnmarshalJS(value js.Value, v any) error

UnmarshalJS unmarshals the given js.Value into the given pointer.

Types

type ErrorValue

type ErrorValue js.Value

ErrorValue is an instance of

func (ErrorValue) Error

func (v ErrorValue) Error() string

Error wraps the Error toString prototype method.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/toString

type EventTargetValue

type EventTargetValue js.Value

EventTargetValue is an instance of EventTarget.

func (EventTargetValue) AddEventListener

func (e EventTargetValue) AddEventListener(eventType string, listener js.Value, opts ...eventListenerOption)

AddEventListener wraps the EventTarget addEventListener instance method.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

func (EventTargetValue) DispatchEvent

func (e EventTargetValue) DispatchEvent(event js.Value) bool

DispatchEvent wraps the EventTarget dispatchEvent instance method.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent

func (EventTargetValue) RemoveEventListener

func (e EventTargetValue) RemoveEventListener(eventType string, listener js.Value, options js.Value)

RemoveEventListener wraps the EventTarget removeEventListener instance method.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener

type EventValue

type EventValue js.Value

EventValue is an instance of Event.

func (EventValue) Bubbles

func (e EventValue) Bubbles() bool

Bubbles returns the Event bubbles property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/bubbles

func (EventValue) Cancelable

func (e EventValue) Cancelable() bool

Cancelable returns the Event cancelable property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable

func (EventValue) Composed

func (e EventValue) Composed() bool

Composed returns the Event composed property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/composed

func (EventValue) ComposedPath

func (e EventValue) ComposedPath() js.Value

ComposedPath wraps the Event composedPath instance method.

https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath

func (EventValue) CurrentTarget

func (e EventValue) CurrentTarget() EventTargetValue

CurrentTarget returns the Event currentTarget property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget

func (EventValue) DefaultPrevented

func (e EventValue) DefaultPrevented() bool

DefaultPrevented returns the Event defaultPrevented property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/defaultPrevented

func (EventValue) EventPhase

func (e EventValue) EventPhase() int

EventPhase returns the Event eventPhase property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase

func (EventValue) IsTrusted

func (e EventValue) IsTrusted() bool

IsTrusted returns the Event isTrusted property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted

func (EventValue) PreventDefault

func (e EventValue) PreventDefault()

PreventDefault wraps the Event preventDefault instance method.

https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault

func (EventValue) StopImmediatePropagation

func (e EventValue) StopImmediatePropagation()

StopImmediatePropagation wraps the Event stopImmediatePropagation instance method.

https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation

func (EventValue) StopPropagation

func (e EventValue) StopPropagation()

StopPropagation wraps the Event stopPropagation instance method.

https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation

func (EventValue) Target

func (e EventValue) Target() EventTargetValue

Target returns the Event target property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/target

func (EventValue) TimeStamp

func (e EventValue) TimeStamp() float64

TimeStamp returns the Event timeStamp property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp

func (EventValue) Type

func (e EventValue) Type() string

Type returns the Event type property.

https://developer.mozilla.org/en-US/docs/Web/API/Event/type

type PromiseValue

type PromiseValue js.Value

PromiseValue is an instance of Promise.

func PromiseOf

func PromiseOf(fn func(resolve, reject func(value js.Value))) PromiseValue

PromiseOf is a helper function that wraps the given func in a promise.

func (PromiseValue) Catch

func (v PromiseValue) Catch(onRejected js.Func) PromiseValue

Catch wraps the Promise catch prototype method.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch

func (PromiseValue) Finally

func (v PromiseValue) Finally(onFinally js.Value) PromiseValue

Finally wraps the Promise finally prototype method.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally

func (PromiseValue) Then

func (v PromiseValue) Then(onFulfilled js.Func) PromiseValue

Then wraps the Promise then prototype method.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then

type Uint8ArrayValue

type Uint8ArrayValue js.Value

Uint8ArrayValue is an instance of Uint8Array.

func Uint8ArrayFromBytes

func Uint8ArrayFromBytes(src []byte) Uint8ArrayValue

Uint8ArrayFromBytes is a helper function that copies the given byte slice into a new Uint8Array.

func (Uint8ArrayValue) Length

func (a Uint8ArrayValue) Length() int

Length is a wrapper for Uint8Array length property.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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