goji

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 4 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 Array arrayJS

Array is a wrapper for the Array global object.

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

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 ArrayValue added in v0.0.3

type ArrayValue js.Value

ArrayValue is an instance of an array.

func (ArrayValue) At added in v0.0.3

func (a ArrayValue) At(index int) js.Value

At wraps the array at instance method.

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

func (ArrayValue) Concat added in v0.0.3

func (a ArrayValue) Concat(elements ...any) ArrayValue

Concat wraps the array concat instance method.

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

func (ArrayValue) CopyWithin added in v0.0.3

func (a ArrayValue) CopyWithin(target, start, end int) ArrayValue

CopyWithin wraps the array copyWithin instance method.

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

func (ArrayValue) Entries added in v0.0.3

func (a ArrayValue) Entries() js.Value

Entries wraps the array entries instance method.

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

func (ArrayValue) Every added in v0.0.3

func (a ArrayValue) Every(callbackFn js.Value, thisArg js.Value) bool

Every wraps the array every instance method.

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

func (ArrayValue) Fill added in v0.0.3

func (a ArrayValue) Fill(value any, start, end int) ArrayValue

Fill wraps the array fill instance method.

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

func (ArrayValue) Filter added in v0.0.3

func (a ArrayValue) Filter(callbackFn js.Value, thisArg js.Value) ArrayValue

Filter wraps the array filter instance method.

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

func (ArrayValue) Find added in v0.0.3

func (a ArrayValue) Find(callbackFn js.Value, thisArg js.Value) js.Value

Find wraps the array find instance method.

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

func (ArrayValue) FindIndex added in v0.0.3

func (a ArrayValue) FindIndex(callbackFn js.Value, thisArg js.Value) int

FindIndex wraps the array findIndex instance method.

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

func (ArrayValue) FindLast added in v0.0.3

func (a ArrayValue) FindLast(callbackFn js.Value, thisArg js.Value) js.Value

FindLast wraps the array findLast instance method.

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

func (ArrayValue) FindLastIndex added in v0.0.3

func (a ArrayValue) FindLastIndex(callbackFn js.Value, thisArg js.Value) int

FindLastIndex wraps the array findLastIndex instance method.

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

func (ArrayValue) Flat added in v0.0.3

func (a ArrayValue) Flat(depth int) ArrayValue

Flat wraps the array flat instance method.

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

func (ArrayValue) FlatMap added in v0.0.3

func (a ArrayValue) FlatMap(callbackFn js.Value, thisArg js.Value) ArrayValue

FlatMap wraps the array flatMap instance method.

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

func (ArrayValue) ForEach added in v0.0.3

func (a ArrayValue) ForEach(callbackFn js.Value, thisArg js.Value)

ForEach wraps the array forEach instance method.

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

func (ArrayValue) Includes added in v0.0.3

func (a ArrayValue) Includes(searchElement any, fromIndex int) bool

Includes wraps the array includes instance method.

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

func (ArrayValue) IndexOf added in v0.0.3

func (a ArrayValue) IndexOf(searchElement any, fromIndex int) int

IndexOf wraps the array indexOf instance method.

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

func (ArrayValue) Join added in v0.0.3

func (a ArrayValue) Join(separator string) string

Join wraps the array join instance method.

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

func (ArrayValue) Keys added in v0.0.3

func (a ArrayValue) Keys() js.Value

Keys wraps the array keys instance method.

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

func (ArrayValue) LastIndexOf added in v0.0.3

func (a ArrayValue) LastIndexOf(searchElement any, fromIndex int) int

LastIndexOf wraps the array lastIndexOf instance method.

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

func (ArrayValue) Length added in v0.0.3

func (a ArrayValue) Length() int

Length wraps the array length property.

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

func (ArrayValue) Map added in v0.0.3

func (a ArrayValue) Map(callbackFn js.Value, thisArg js.Value) ArrayValue

Map wraps the array map instance method.

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

func (ArrayValue) Pop added in v0.0.3

func (a ArrayValue) Pop() js.Value

Pop wraps the array pop instance method.

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

func (ArrayValue) Push added in v0.0.3

func (a ArrayValue) Push(elements ...any) int

Push wraps the array push instance method.

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

func (ArrayValue) Reduce added in v0.0.3

func (a ArrayValue) Reduce(callbackFn js.Value, initialValue js.Value) js.Value

Reduce wraps the array reduce instance method.

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

func (ArrayValue) ReduceRight added in v0.0.3

func (a ArrayValue) ReduceRight(callbackFn js.Value, initialValue js.Value) js.Value

ReduceRight wraps the array reduceRight instance method.

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

func (ArrayValue) Reverse added in v0.0.3

func (a ArrayValue) Reverse() ArrayValue

Reverse wraps the array reverse instance method.

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

func (ArrayValue) Shift added in v0.0.3

func (a ArrayValue) Shift() js.Value

Shift wraps the array shift intance method.

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

func (ArrayValue) Slice added in v0.0.3

func (a ArrayValue) Slice(start, end int) ArrayValue

Slice wraps the array slice instance method.

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

func (ArrayValue) Some added in v0.0.3

func (a ArrayValue) Some(callbackFn js.Value, thisArg js.Value) bool

Some wraps the array some instance method.

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

func (ArrayValue) Sort added in v0.0.3

func (a ArrayValue) Sort(compareFn js.Value) ArrayValue

Sort wraps the array sort instance method.

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

func (ArrayValue) Splice added in v0.0.3

func (a ArrayValue) Splice(start, deleteCount int, items ...any) ArrayValue

Splice wraps the array splice instance method.

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

func (ArrayValue) ToLocaleString added in v0.0.3

func (a ArrayValue) ToLocaleString(locales js.Value, options js.Value) string

ToLocaleString wraps the array toLocaleString instance method.

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

func (ArrayValue) ToReversed added in v0.0.3

func (a ArrayValue) ToReversed() ArrayValue

ToReversed wraps the array toReversed instance method.

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

func (ArrayValue) ToSorted added in v0.0.3

func (a ArrayValue) ToSorted(compareFn js.Value) ArrayValue

ToSorted wraps the array toSorted instance method.

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

func (ArrayValue) ToSpliced added in v0.0.3

func (a ArrayValue) ToSpliced(start, deleteCount int, items ...any) ArrayValue

ToSpliced wraps the array toSpliced instance method.

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

func (ArrayValue) ToString added in v0.0.3

func (a ArrayValue) ToString() string

ToString wraps the array toString instance method.

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

func (ArrayValue) Unshift added in v0.0.3

func (a ArrayValue) Unshift(elements ...any) int

Unshift wraps the array unshift instance method.

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

func (ArrayValue) Values added in v0.0.3

func (a ArrayValue) Values() js.Value

Values wraps the array values instance method.

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

func (ArrayValue) With added in v0.0.3

func (a ArrayValue) With(index int, value any) ArrayValue

With wraps the array with instance method.

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

type ErrorValue

type ErrorValue js.Value

ErrorValue is an instance of

func WrapError added in v0.0.5

func WrapError(err error) ErrorValue

WrapError is a helper func that returns an ErrorValue with the message set to the given error's `Error()` value and the name set to the given error's reflected type name.

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