Documentation ¶
Index ¶
- Variables
- func Bundle(name string, url string) error
- func Imports() map[string]string
- func NewImport(path string, data string)
- func Require(path string, contents string) seed.Option
- func Return(v AnyValue) func(q Ctx)
- func Scripts(root seed.Seed) map[string]string
- type AnyArray
- type AnyBool
- type AnyFunction
- type AnyNumber
- type AnyObject
- type AnyPromise
- type AnyScript
- type AnySet
- type AnyString
- type AnyValue
- type Array
- type Bool
- type Ctx
- func (q Ctx) Await(v AnyValue)
- func (Ctx) Bool(literal bool) Bool
- func (q Ctx) Flush()
- func (q Ctx) If(condition AnyBool, do Script) ElseIfChain
- func (Ctx) Number(literal float64) Number
- func (q Ctx) Return(v AnyValue)
- func (q Ctx) Run(fname AnyFunction, args ...AnyValue)
- func (Ctx) String(literal string) String
- func (Ctx) Unique() string
- func (q Ctx) Write(b []byte) (int, error)
- type Element
- type Else
- type ElseIfChain
- type Function
- type NewArray
- type NewObject
- type Number
- type Object
- type Promise
- type Script
- type Set
- type String
- type Value
- func (v Value) Call(method string, args ...AnyValue) Value
- func (v Value) Equals(other Value) Bool
- func (v Value) Get(property string) Value
- func (v Value) GetBool() Bool
- func (v Value) GetValue() Value
- func (v Value) Index(i int) Value
- func (v Value) Run(method string, args ...AnyValue) Script
- func (v Value) Set(property string, value AnyValue) Script
- func (v Value) String() string
- func (v Value) Var(q Ctx) Value
Constants ¶
This section is empty.
Variables ¶
var False = NewBool(false)
var True = NewBool(true)
Functions ¶
Types ¶
type AnyFunction ¶
type AnyPromise ¶
AnyPromise is anything that can return a promise.
type AnyScript ¶
type AnyScript interface { AnyFunction GetScript() Script }
type Bool ¶
type Bool struct {
Value
}
Bool is a javascript boolean.
type Ctx ¶
type Ctx func(interface{})
Ctx is a script context.
func NewCtx ¶
NewCtx returns a new ctx that writes a script to the given writer. This function takes an optional number of seeds, any options passed to this context will be applied to the given seeds.
func (Ctx) Run ¶
func (q Ctx) Run(fname AnyFunction, args ...AnyValue)
Run runs the given function expression with the given arguments.
type Element ¶
type Element struct {
Value
}
Element is the most general base class from which all element objects (i.e. objects that represent elements) in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements. Most functionality is specified further down the class hierarchy.
func (Element) RequestFullscreen ¶
RequestFullscreen requests that the user agent switch from full-screen mode back to windowed mode.
type ElseIfChain ¶
type ElseIfChain struct {
// contains filtered or unexported fields
}
func (ElseIfChain) Else ¶
func (e ElseIfChain) Else(do Script)
type Function ¶
type Function struct {
Value
}
func NewFunction ¶
func NewNormalFunction ¶
func (Function) GetFunction ¶
GetFunction impliments AnyFunction.
type Number ¶
type Number struct {
Value
}
Number is a javascript number.
type Object ¶
type Object struct {
Value
}
type Script ¶
type Script func(Ctx)
Script is any js script.
func Run ¶
func Run(fname AnyFunction, args ...AnyValue) Script
Run runs the given function expression with the given arguments.
func (Script) GetFunction ¶
type String ¶
type String struct {
Value
}
String is a javascript string.
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is any js value.
func Call ¶
func Call(fname AnyFunction, args ...AnyValue) Value
Call calls the given function expressionw with the given arguments.
func Global ¶
func Global() Value
Global returns the JavaScript global object, usually "window" or "global".