| @ -0,0 +1,8 @@ | |||
| all: | |||
| go run generate/*.go | |||
| .PHONY: all | |||
| clean: | |||
| rm *.go | |||
| rm -rf console/ css/ document/ | |||
| .PHONY: clean | |||
| @ -1,36 +0,0 @@ | |||
| { | |||
| "Type": "Console", | |||
| "ImportJS": true, | |||
| "GlobalAPI": "console", | |||
| "Functions": [ | |||
| { | |||
| "Name": "log", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "v", | |||
| "Varidic": true, | |||
| "Type": "interface{}" | |||
| } | |||
| ] | |||
| }, | |||
| { | |||
| "Name": "error", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "v", | |||
| "Varidic": true, | |||
| "Type": "interface{}" | |||
| } | |||
| ] | |||
| }, | |||
| { | |||
| "Name": "dir", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "v", | |||
| "Type": "JSValue" | |||
| } | |||
| ] | |||
| } | |||
| ] | |||
| } | |||
| @ -1,39 +0,0 @@ | |||
| { | |||
| "Type": "CustomElementRegistry", | |||
| "ImportJS": true, | |||
| "GlobalAPI": "customElements", | |||
| "Functions": [ | |||
| { | |||
| "Name": "define", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "name", | |||
| "Type": "string" | |||
| }, | |||
| { | |||
| "Name": "constructor", | |||
| "Type": "interface{}" | |||
| } | |||
| ] | |||
| }, | |||
| { | |||
| "Name": "get", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "name", | |||
| "Type": "string" | |||
| } | |||
| ] | |||
| }, | |||
| { | |||
| "Name": "whenDefined", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "name", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": "*Promise" | |||
| } | |||
| ] | |||
| } | |||
| @ -1,59 +0,0 @@ | |||
| { | |||
| "Type": "Document", | |||
| "GlobalAPI": "document", | |||
| "ImportJS": true, | |||
| "Implements": [ | |||
| "EventTargetIFace", | |||
| "NodeIFace", | |||
| "ElementIFace" | |||
| ], | |||
| "Properties": [ | |||
| { | |||
| "Name": "body", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| } | |||
| ], | |||
| "Functions": [ | |||
| { | |||
| "Name": "createElement", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "tagName", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": "*Element" | |||
| }, | |||
| { | |||
| "Name": "getElementById", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "id", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": "*Element" | |||
| }, | |||
| { | |||
| "Name": "getElementsByName", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "name", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": "[]*Element" | |||
| }, | |||
| { | |||
| "Name": "write", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "markup", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": null | |||
| } | |||
| ] | |||
| } | |||
| @ -1,9 +0,0 @@ | |||
| { | |||
| "Type": "Element", | |||
| "ImportJS": true, | |||
| "Implements": [ | |||
| "EventTargetIFace", | |||
| "NodeIFace", | |||
| "ElementIFace" | |||
| ] | |||
| } | |||
| @ -1,50 +0,0 @@ | |||
| { | |||
| "Type": "ElementIFace", | |||
| "Interface": true, | |||
| "Implements": [ | |||
| "EventTarget", | |||
| "Node" | |||
| ], | |||
| "Properties": [ | |||
| { | |||
| "Name": "className", | |||
| "Type": "string" | |||
| }, | |||
| { | |||
| "Name": "id", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "Functions": [ | |||
| { | |||
| "Name": "querySelector", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "selector", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": "*Element" | |||
| }, | |||
| { | |||
| "Name": "querySelectorAll", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "selector", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "ReturnType": "[]*Element" | |||
| }, | |||
| { | |||
| "Name": "attachShadow", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "shadowRootInit", | |||
| "Type": "ShadowRootInit" | |||
| } | |||
| ], | |||
| "ReturnType": "*ShadowRoot" | |||
| } | |||
| ] | |||
| } | |||
| @ -1,7 +0,0 @@ | |||
| { | |||
| "Type": "Event", | |||
| "ImportJS": true, | |||
| "Implements": [ | |||
| "EventIFace" | |||
| ] | |||
| } | |||
| @ -1,37 +0,0 @@ | |||
| { | |||
| "Type": "EventIFace", | |||
| "Interface": true, | |||
| "Properties": [ | |||
| { | |||
| "Name": "currentTarget", | |||
| "Type": "Value", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "target", | |||
| "Type": "Value", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "type", | |||
| "Type": "string", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "srcElement", | |||
| "Type": "Value", | |||
| "ReadOnly": true | |||
| } | |||
| ], | |||
| "Functions": [ | |||
| { | |||
| "Name": "preventDefault" | |||
| }, | |||
| { | |||
| "Name": "stopPropagation" | |||
| }, | |||
| { | |||
| "Name": "stopImmediatePropagation" | |||
| } | |||
| ] | |||
| } | |||
| @ -1,19 +0,0 @@ | |||
| { | |||
| "Type": "EventTargetIFace", | |||
| "Interface": true, | |||
| "Functions": [ | |||
| { | |||
| "Name": "addEventListener", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "t", | |||
| "Type": "string" | |||
| }, | |||
| { | |||
| "Name": "listener", | |||
| "Type": "*Callback" | |||
| } | |||
| ] | |||
| } | |||
| ] | |||
| } | |||
| @ -1,486 +0,0 @@ | |||
| package main | |||
| import ( | |||
| "bytes" | |||
| "encoding/json" | |||
| "fmt" | |||
| "go/format" | |||
| "io/ioutil" | |||
| "log" | |||
| "os" | |||
| "path/filepath" | |||
| "strings" | |||
| ) | |||
| type TypeProperty struct { | |||
| Name string | |||
| Type string | |||
| ReadOnly bool | |||
| } | |||
| func (p TypeProperty) GetterName() string { | |||
| return "Get" + strings.Title(p.Name) | |||
| } | |||
| func (p TypeProperty) SetterName() string { | |||
| return "Set" + strings.Title(p.Name) | |||
| } | |||
| type FunctionArgument struct { | |||
| Name string | |||
| Type string | |||
| Varidic bool | |||
| } | |||
| type TypeFunction struct { | |||
| Name string | |||
| Arguments []FunctionArgument | |||
| ReturnType string | |||
| } | |||
| func (f TypeFunction) GoName() string { | |||
| return strings.Title(f.Name) | |||
| } | |||
| type TypeStructure struct { | |||
| Type string | |||
| GlobalAPI string | |||
| ImportJS bool | |||
| Interface bool | |||
| Inherits []string | |||
| Implements []string | |||
| Properties []TypeProperty | |||
| Functions []TypeFunction | |||
| String []string | |||
| } | |||
| func (t TypeStructure) Filename() string { | |||
| return fmt.Sprintf("%s.go", strings.ToLower(t.Type)) | |||
| } | |||
| func (t TypeStructure) APIFilename() string { | |||
| return fmt.Sprintf("%s/%s.go", t.PackageName(), strings.ToLower(t.Type)) | |||
| } | |||
| func (t TypeStructure) PackageName() string { | |||
| return strings.ToLower(t.GlobalAPI) | |||
| } | |||
| func (t TypeStructure) ShortName() string { | |||
| return strings.ToLower(string(t.Type[0])) | |||
| } | |||
| func (t TypeStructure) writeArguments(out *bytes.Buffer, args []FunctionArgument) { | |||
| for i, arg := range args { | |||
| if i > 0 { | |||
| out.WriteString(",") | |||
| } | |||
| out.WriteString(fmt.Sprintf("%s %s", arg.Name, arg.Type)) | |||
| } | |||
| } | |||
| func (t TypeStructure) writeReturnValue(out *bytes.Buffer, rt string) error { | |||
| switch rt { | |||
| case "string": | |||
| out.WriteString("return val.String()\r\n") | |||
| case "Value": | |||
| out.WriteString("return val") | |||
| case "NodeIFace": | |||
| out.WriteString("return NewNode(val.JSValue())\r\n") | |||
| case "*ShadowRoot": | |||
| out.WriteString("return NewShadowRoot(val.JSValue())\r\n") | |||
| case "*Promise": | |||
| out.WriteString("return NewPromise(val.JSValue())\r\n") | |||
| case "*Element": | |||
| out.WriteString("return NewElement(val.JSValue())\r\n") | |||
| case "[]*Element": | |||
| out.WriteString("elms := make([]*Element, 0)\r\n") | |||
| out.WriteString("for i := 0; i < val.Length(); i += 1 {\r\n") | |||
| out.WriteString("\telms = append(elms, NewElement(val.Index(i)))\r\n") | |||
| out.WriteString("}\r\n") | |||
| out.WriteString("return elms\r\n") | |||
| case "": | |||
| out.WriteString("return val") | |||
| default: | |||
| return fmt.Errorf("Unknown function return type %s", rt) | |||
| } | |||
| return nil | |||
| } | |||
| func (t TypeStructure) writeFunctions(out *bytes.Buffer, funcs []TypeFunction) error { | |||
| for _, f := range funcs { | |||
| out.WriteString(fmt.Sprintf("func (%s *%s) %s(", t.ShortName(), t.Type, f.GoName())) | |||
| for i, arg := range f.Arguments { | |||
| if i > 0 { | |||
| out.WriteString(",") | |||
| } | |||
| at := arg.Type | |||
| if arg.Varidic { | |||
| at = "..." + at | |||
| } | |||
| out.WriteString(fmt.Sprintf("%s %s", arg.Name, at)) | |||
| } | |||
| rt := f.ReturnType | |||
| if rt == "" { | |||
| rt = "Value" | |||
| } | |||
| out.WriteString(fmt.Sprintf(") %s {\r\n", rt)) | |||
| for _, arg := range f.Arguments { | |||
| if !arg.Varidic { | |||
| continue | |||
| } | |||
| out.WriteString(fmt.Sprintf("%sVaridic := make([]interface{}, 0)\r\n", arg.Name)) | |||
| out.WriteString(fmt.Sprintf("for _, a := range %s {\r\n", arg.Name)) | |||
| out.WriteString(fmt.Sprintf("%sVaridic = append(%sVaridic, ToJSValue(a))\r\n", arg.Name, arg.Name)) | |||
| out.WriteString("}\r\n") | |||
| } | |||
| out.WriteString(fmt.Sprintf("val := Value{ Value: %s.Call(\"%s\"", t.ShortName(), f.Name)) | |||
| for _, arg := range f.Arguments { | |||
| out.WriteString(",") | |||
| if arg.Varidic { | |||
| out.WriteString(fmt.Sprintf("%sVaridic...", arg.Name)) | |||
| } else { | |||
| out.WriteString(fmt.Sprintf("ToJSValue(%s)", arg.Name)) | |||
| } | |||
| } | |||
| out.WriteString(")}\r\n") | |||
| // Return value | |||
| t.writeReturnValue(out, rt) | |||
| out.WriteString("}\r\n") | |||
| } | |||
| return nil | |||
| } | |||
| func (t TypeStructure) writeAPIFunctions(out *bytes.Buffer, funcs []TypeFunction) error { | |||
| for _, f := range funcs { | |||
| out.WriteString(fmt.Sprintf("func %s(", f.GoName())) | |||
| for i, arg := range f.Arguments { | |||
| if i > 0 { | |||
| out.WriteString(",") | |||
| } | |||
| rt := arg.Type | |||
| if rt == "*Element" { | |||
| rt = "*dom.Element" | |||
| } else if rt == "JSValue" { | |||
| rt = "dom.JSValue" | |||
| } else if rt == "*Callback" { | |||
| rt = "*dom.Callback" | |||
| } else if rt == "*Promise" { | |||
| rt = "*dom.Promise" | |||
| } else if rt == "ShadowRootInit" { | |||
| rt = "dom.ShadowRootInit" | |||
| } | |||
| if arg.Varidic { | |||
| rt = "..." + rt | |||
| } | |||
| out.WriteString(fmt.Sprintf("%s %s", arg.Name, rt)) | |||
| } | |||
| rt := f.ReturnType | |||
| if rt == "" { | |||
| rt = "Value" | |||
| } | |||
| if rt != "string" { | |||
| if rt[0] == '*' { | |||
| rt = "*dom." + strings.TrimLeft(rt, "*") | |||
| } else if rt[0] == '[' { | |||
| rt = "[]*dom." + strings.TrimLeft(rt, "[]*") | |||
| } else { | |||
| rt = "dom." + rt | |||
| } | |||
| } | |||
| out.WriteString(fmt.Sprintf(") %s {\r\n", rt)) | |||
| out.WriteString(fmt.Sprintf("return %s.%s(", t.ShortName(), f.GoName())) | |||
| for i, arg := range f.Arguments { | |||
| if i > 0 { | |||
| out.WriteString(",") | |||
| } | |||
| if arg.Varidic { | |||
| out.WriteString(fmt.Sprintf("%s...", arg.Name)) | |||
| } else { | |||
| out.WriteString(fmt.Sprintf("%s", arg.Name)) | |||
| } | |||
| } | |||
| out.WriteString(")}\r\n") | |||
| } | |||
| return nil | |||
| } | |||
| func (t TypeStructure) writeProperties(out *bytes.Buffer, props []TypeProperty) error { | |||
| for _, p := range props { | |||
| rt := p.Type | |||
| if rt == "" { | |||
| rt = "Value" | |||
| } | |||
| out.WriteString(fmt.Sprintf("func (%s *%s) %s() %s {\r\n", t.ShortName(), t.Type, p.GetterName(), rt)) | |||
| out.WriteString(fmt.Sprintf("val := Value{ Value: %s.Get(\"%s\")}\r\n", t.ShortName(), p.Name)) | |||
| // Return value | |||
| t.writeReturnValue(out, rt) | |||
| out.WriteString(fmt.Sprintf("}\r\n")) | |||
| if !p.ReadOnly { | |||
| out.WriteString(fmt.Sprintf("func (%s *%s) %s(v %s){\r\n", t.ShortName(), t.Type, p.SetterName(), rt)) | |||
| out.WriteString(fmt.Sprintf("\t%s.Set(\"%s\", v)\r\n", t.ShortName(), p.Name)) | |||
| out.WriteString("}\r\n") | |||
| } | |||
| } | |||
| return nil | |||
| } | |||
| func (t TypeStructure) writeAPIProperties(out *bytes.Buffer, props []TypeProperty) error { | |||
| for _, p := range props { | |||
| rt := p.Type | |||
| if rt == "" { | |||
| rt = "Value" | |||
| } | |||
| if rt != "string" { | |||
| if rt[0] == '*' { | |||
| rt = "*dom." + strings.TrimLeft(rt, "*") | |||
| } else if rt[0] == '[' { | |||
| rt = "[]*dom." + strings.TrimLeft(rt, "[]*") | |||
| } else { | |||
| rt = "dom." + rt | |||
| } | |||
| } | |||
| out.WriteString(fmt.Sprintf("func %s() %s {\r\n", p.GetterName(), rt)) | |||
| out.WriteString(fmt.Sprintf("return %s.%s()", t.ShortName(), p.GetterName())) | |||
| out.WriteString(fmt.Sprintf("}\r\n")) | |||
| if !p.ReadOnly { | |||
| out.WriteString(fmt.Sprintf("func %s(v %s){\r\n", p.SetterName(), rt)) | |||
| out.WriteString(fmt.Sprintf("%s.%s(v)", t.ShortName(), p.SetterName())) | |||
| out.WriteString("}\r\n") | |||
| } | |||
| } | |||
| return nil | |||
| } | |||
| func (t TypeStructure) generateInterface(out *bytes.Buffer, types map[string]TypeStructure) error { | |||
| out.WriteString(fmt.Sprintf("type %s interface {\r\n", t.Type)) | |||
| for _, f := range t.Functions { | |||
| out.WriteString(fmt.Sprintf("\t%s(", f.GoName())) | |||
| t.writeArguments(out, f.Arguments) | |||
| out.WriteString(fmt.Sprintf(") %s\r\n", f.ReturnType)) | |||
| } | |||
| out.WriteString("}\r\n") | |||
| return nil | |||
| } | |||
| func (t TypeStructure) generateStruct(out *bytes.Buffer, types map[string]TypeStructure) (err error) { | |||
| out.WriteString(fmt.Sprintf("type %s struct {\r\n", t.Type)) | |||
| out.WriteString("\tValue\r\n") | |||
| for _, name := range t.Inherits { | |||
| out.WriteString(fmt.Sprintf("\t%s\r\n", name)) | |||
| } | |||
| out.WriteString("}\r\n") | |||
| // DEV: Start with upper case means it is public | |||
| if t.Type[0] == strings.ToUpper(string(t.Type[0]))[0] { | |||
| // Constructor | |||
| out.WriteString(fmt.Sprintf("func New%s(v js.Value) *%s {\r\n", t.Type, t.Type)) | |||
| out.WriteString("val := Value{ Value: v }\r\n") | |||
| out.WriteString("if val.IsNull() || val.IsUndefined() { return nil }\r\n") | |||
| out.WriteString(fmt.Sprintf("return val.To%s()\r\n", t.Type)) | |||
| out.WriteString("}\r\n") | |||
| // Convert to specific type helper | |||
| out.WriteString(fmt.Sprintf("func (v Value) To%s () *%s { return &%s{ Value: v }}\r\n", t.Type, t.Type, t.Type)) | |||
| } | |||
| // Properties | |||
| err = t.writeProperties(out, t.Properties) | |||
| if err != nil { | |||
| return | |||
| } | |||
| // Functions | |||
| err = t.writeFunctions(out, t.Functions) | |||
| if err != nil { | |||
| return | |||
| } | |||
| // Interfaces | |||
| for _, it := range t.Implements { | |||
| i, ok := types[it] | |||
| if !ok { | |||
| return fmt.Errorf("%q cannot implement unknown type %q", t.Type, it) | |||
| } | |||
| // Functions | |||
| err = t.writeFunctions(out, i.Functions) | |||
| if err != nil { | |||
| return | |||
| } | |||
| // Properties | |||
| err = t.writeProperties(out, i.Properties) | |||
| if err != nil { | |||
| return | |||
| } | |||
| } | |||
| return | |||
| } | |||
| func (t TypeStructure) Generate(types map[string]TypeStructure) ([]byte, error) { | |||
| out := bytes.NewBuffer(make([]byte, 0)) | |||
| out.WriteString("// DO NOT EDIT - generated file\r\n") | |||
| out.WriteString("package dom\r\n") | |||
| if t.ImportJS { | |||
| out.WriteString("import \"syscall/js\"\r\n") | |||
| } | |||
| var err error | |||
| if t.Interface { | |||
| err = t.generateInterface(out, types) | |||
| } else { | |||
| err = t.generateStruct(out, types) | |||
| } | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| return format.Source(out.Bytes()) | |||
| } | |||
| func (t TypeStructure) GenerateAPI(types map[string]TypeStructure) ([]byte, error) { | |||
| pkg := strings.ToLower(t.GlobalAPI) | |||
| out := bytes.NewBuffer(make([]byte, 0)) | |||
| out.WriteString("// DO NOT EDIT - generated file\r\n") | |||
| out.WriteString(fmt.Sprintf("package %s\r\n", pkg)) | |||
| if t.ImportJS { | |||
| out.WriteString("import \"syscall/js\"\r\n") | |||
| } | |||
| out.WriteString("import dom \"github.com/brettlangdon/go-dom/v1\"\r\n") | |||
| out.WriteString(fmt.Sprintf("var %s *dom.%s\r\n", t.ShortName(), t.Type)) | |||
| out.WriteString("func init() {\r\n") | |||
| out.WriteString(fmt.Sprintf("%s = dom.New%s(js.Global().Get(\"%s\"))\r\n", t.ShortName(), t.Type, t.GlobalAPI)) | |||
| out.WriteString("}\r\n") | |||
| err := t.writeAPIProperties(out, t.Properties) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| err = t.writeAPIFunctions(out, t.Functions) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| // Interfaces | |||
| for _, it := range t.Implements { | |||
| i, ok := types[it] | |||
| if !ok { | |||
| return nil, fmt.Errorf("%q cannot implement unknown type %q", t.Type, it) | |||
| } | |||
| // Functions | |||
| err = t.writeAPIFunctions(out, i.Functions) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| // Properties | |||
| err = t.writeAPIProperties(out, i.Properties) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| } | |||
| return format.Source(out.Bytes()) | |||
| } | |||
| func loadFile(fname string) (t TypeStructure, err error) { | |||
| fp, err := os.Open(fname) | |||
| if err != nil { | |||
| return | |||
| } | |||
| defer fp.Close() | |||
| val, err := ioutil.ReadAll(fp) | |||
| if err != nil { | |||
| return | |||
| } | |||
| err = json.Unmarshal(val, &t) | |||
| return | |||
| } | |||
| func processType(t TypeStructure, types map[string]TypeStructure) error { | |||
| contents, err := t.Generate(types) | |||
| if err != nil { | |||
| return err | |||
| } | |||
| out, err := os.OpenFile(t.Filename(), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) | |||
| if err != nil { | |||
| return err | |||
| } | |||
| defer out.Close() | |||
| _, err = out.Write(contents) | |||
| if err != nil { | |||
| return err | |||
| } | |||
| if t.GlobalAPI == "" { | |||
| return nil | |||
| } | |||
| contents, err = t.GenerateAPI(types) | |||
| if err != nil { | |||
| return err | |||
| } | |||
| err = os.MkdirAll(t.PackageName(), os.ModePerm) | |||
| if err != nil { | |||
| return err | |||
| } | |||
| api, err := os.OpenFile(t.APIFilename(), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) | |||
| if err != nil { | |||
| return err | |||
| } | |||
| defer api.Close() | |||
| _, err = api.Write(contents) | |||
| return err | |||
| } | |||
| func main() { | |||
| matches, err := filepath.Glob("generate/*.json") | |||
| if err != nil { | |||
| log.Panic(err) | |||
| } | |||
| types := make(map[string]TypeStructure) | |||
| for _, fname := range matches { | |||
| typeStructure, err := loadFile(fname) | |||
| if err != nil { | |||
| log.Panic(err) | |||
| } | |||
| types[typeStructure.Type] = typeStructure | |||
| } | |||
| for _, t := range types { | |||
| log.Printf("Generating %s\r\n", t.Type) | |||
| err = processType(t, types) | |||
| if err != nil { | |||
| log.Panic(err) | |||
| } | |||
| } | |||
| } | |||
| @ -1,8 +0,0 @@ | |||
| { | |||
| "Type": "Node", | |||
| "ImportJS": true, | |||
| "Implements": [ | |||
| "EventTargetIFace", | |||
| "NodeIFace" | |||
| ] | |||
| } | |||
| @ -1,67 +0,0 @@ | |||
| { | |||
| "Type": "NodeIFace", | |||
| "Interface": true, | |||
| "Properties": [ | |||
| { | |||
| "Name": "baseURI", | |||
| "Type": "string", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "firstChild", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "lastChild", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "nextSibling", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "previousSibling", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "parentElement", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "rootElement", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "prefix", | |||
| "Type": "string", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "nodeName", | |||
| "Type": "string", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "textContent", | |||
| "Type": "string" | |||
| } | |||
| ], | |||
| "Functions": [ | |||
| { | |||
| "Name": "appendChild", | |||
| "Arguments": [ | |||
| { | |||
| "Name": "aChild", | |||
| "Type": "*Element" | |||
| } | |||
| ], | |||
| "ReturnType": "*Element" | |||
| } | |||
| ] | |||
| } | |||
| @ -1,4 +0,0 @@ | |||
| { | |||
| "Type": "Promise", | |||
| "ImportJS": true | |||
| } | |||
| @ -1,24 +0,0 @@ | |||
| { | |||
| "Type": "ShadowRoot", | |||
| "ImportJS": true, | |||
| "Implements": [ | |||
| "EventTargetIFace", | |||
| "NodeIFace" | |||
| ], | |||
| "Properties": [ | |||
| { | |||
| "Name": "mode", | |||
| "Type": "string", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "host", | |||
| "Type": "*Element", | |||
| "ReadOnly": true | |||
| }, | |||
| { | |||
| "Name": "innerHTML", | |||
| "Type": "string" | |||
| } | |||
| ] | |||
| } | |||
| @ -1,5 +0,0 @@ | |||
| { | |||
| "Type": "Window", | |||
| "GlobalAPI": "window", | |||
| "ImportJS": true | |||
| } | |||
| @ -0,0 +1,25 @@ | |||
| // Code generated DO NOT EDIT | |||
| // abortcontroller.go | |||
| package dom | |||
| import "syscall/js" | |||
| type AbortControllerIFace interface { | |||
| Abort(args ...interface{}) | |||
| GetSignal() AbortSignal | |||
| } | |||
| type AbortController struct { | |||
| Value | |||
| } | |||
| func jsValueToAbortController(val js.Value) AbortController { | |||
| return AbortController{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsAbortController() AbortController { return AbortController{Value: v} } | |||
| func (a AbortController) Abort(args ...interface{}) { | |||
| a.Call("abort", args...) | |||
| } | |||
| func (a AbortController) GetSignal() AbortSignal { | |||
| val := a.Get("signal") | |||
| return jsValueToAbortSignal(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,32 @@ | |||
| // Code generated DO NOT EDIT | |||
| // abortsignal.go | |||
| package dom | |||
| import "syscall/js" | |||
| type AbortSignalIFace interface { | |||
| GetAborted() bool | |||
| AddEventListener(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetOnabort() EventHandler | |||
| SetOnabort(EventHandler) | |||
| RemoveEventListener(args ...interface{}) | |||
| } | |||
| type AbortSignal struct { | |||
| Value | |||
| EventTarget | |||
| } | |||
| func jsValueToAbortSignal(val js.Value) AbortSignal { return AbortSignal{Value: Value{Value: val}} } | |||
| func (v Value) AsAbortSignal() AbortSignal { return AbortSignal{Value: v} } | |||
| func (a AbortSignal) GetAborted() bool { | |||
| val := a.Get("aborted") | |||
| return val.Bool() | |||
| } | |||
| func (a AbortSignal) GetOnabort() EventHandler { | |||
| val := a.Get("onabort") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a AbortSignal) SetOnabort(val EventHandler) { | |||
| a.Set("onabort", val) | |||
| } | |||
| @ -0,0 +1,41 @@ | |||
| // Code generated DO NOT EDIT | |||
| // abstractrange.go | |||
| package dom | |||
| import "syscall/js" | |||
| type AbstractRangeIFace interface { | |||
| GetCollapsed() bool | |||
| GetEndContainer() Node | |||
| GetEndOffset() float64 | |||
| GetStartContainer() Node | |||
| GetStartOffset() float64 | |||
| } | |||
| type AbstractRange struct { | |||
| Value | |||
| } | |||
| func jsValueToAbstractRange(val js.Value) AbstractRange { | |||
| return AbstractRange{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsAbstractRange() AbstractRange { return AbstractRange{Value: v} } | |||
| func (a AbstractRange) GetCollapsed() bool { | |||
| val := a.Get("collapsed") | |||
| return val.Bool() | |||
| } | |||
| func (a AbstractRange) GetEndContainer() Node { | |||
| val := a.Get("endContainer") | |||
| return jsValueToNode(val.JSValue()) | |||
| } | |||
| func (a AbstractRange) GetEndOffset() float64 { | |||
| val := a.Get("endOffset") | |||
| return val.Float() | |||
| } | |||
| func (a AbstractRange) GetStartContainer() Node { | |||
| val := a.Get("startContainer") | |||
| return jsValueToNode(val.JSValue()) | |||
| } | |||
| func (a AbstractRange) GetStartOffset() float64 { | |||
| val := a.Get("startOffset") | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,109 @@ | |||
| // Code generated DO NOT EDIT | |||
| // applicationcache.go | |||
| package dom | |||
| import "syscall/js" | |||
| type ApplicationCacheIFace interface { | |||
| Abort(args ...interface{}) | |||
| AddEventListener(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetOncached() EventHandler | |||
| SetOncached(EventHandler) | |||
| GetOnchecking() EventHandler | |||
| SetOnchecking(EventHandler) | |||
| GetOndownloading() EventHandler | |||
| SetOndownloading(EventHandler) | |||
| GetOnerror() EventHandler | |||
| SetOnerror(EventHandler) | |||
| GetOnnoupdate() EventHandler | |||
| SetOnnoupdate(EventHandler) | |||
| GetOnobsolete() EventHandler | |||
| SetOnobsolete(EventHandler) | |||
| GetOnprogress() EventHandler | |||
| SetOnprogress(EventHandler) | |||
| GetOnupdateready() EventHandler | |||
| SetOnupdateready(EventHandler) | |||
| RemoveEventListener(args ...interface{}) | |||
| GetStatus() int | |||
| SwapCache(args ...interface{}) | |||
| Update(args ...interface{}) | |||
| } | |||
| type ApplicationCache struct { | |||
| Value | |||
| EventTarget | |||
| } | |||
| func jsValueToApplicationCache(val js.Value) ApplicationCache { | |||
| return ApplicationCache{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsApplicationCache() ApplicationCache { return ApplicationCache{Value: v} } | |||
| func (a ApplicationCache) Abort(args ...interface{}) { | |||
| a.Call("abort", args...) | |||
| } | |||
| func (a ApplicationCache) GetOncached() EventHandler { | |||
| val := a.Get("oncached") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOncached(val EventHandler) { | |||
| a.Set("oncached", val) | |||
| } | |||
| func (a ApplicationCache) GetOnchecking() EventHandler { | |||
| val := a.Get("onchecking") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOnchecking(val EventHandler) { | |||
| a.Set("onchecking", val) | |||
| } | |||
| func (a ApplicationCache) GetOndownloading() EventHandler { | |||
| val := a.Get("ondownloading") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOndownloading(val EventHandler) { | |||
| a.Set("ondownloading", val) | |||
| } | |||
| func (a ApplicationCache) GetOnerror() EventHandler { | |||
| val := a.Get("onerror") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOnerror(val EventHandler) { | |||
| a.Set("onerror", val) | |||
| } | |||
| func (a ApplicationCache) GetOnnoupdate() EventHandler { | |||
| val := a.Get("onnoupdate") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOnnoupdate(val EventHandler) { | |||
| a.Set("onnoupdate", val) | |||
| } | |||
| func (a ApplicationCache) GetOnobsolete() EventHandler { | |||
| val := a.Get("onobsolete") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOnobsolete(val EventHandler) { | |||
| a.Set("onobsolete", val) | |||
| } | |||
| func (a ApplicationCache) GetOnprogress() EventHandler { | |||
| val := a.Get("onprogress") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOnprogress(val EventHandler) { | |||
| a.Set("onprogress", val) | |||
| } | |||
| func (a ApplicationCache) GetOnupdateready() EventHandler { | |||
| val := a.Get("onupdateready") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a ApplicationCache) SetOnupdateready(val EventHandler) { | |||
| a.Set("onupdateready", val) | |||
| } | |||
| func (a ApplicationCache) GetStatus() int { | |||
| val := a.Get("status") | |||
| return val.Int() | |||
| } | |||
| func (a ApplicationCache) SwapCache(args ...interface{}) { | |||
| a.Call("swapCache", args...) | |||
| } | |||
| func (a ApplicationCache) Update(args ...interface{}) { | |||
| a.Call("update", args...) | |||
| } | |||
| @ -0,0 +1,12 @@ | |||
| package dom | |||
| import "syscall/js" | |||
| type ArrayBuffer struct { | |||
| js.TypedArray | |||
| } | |||
| func jsValueToArrayBuffer(val js.Value) ArrayBuffer { | |||
| return ArrayBuffer{TypedArray: js.TypedArray{Value: val}} | |||
| } | |||
| func (u ArrayBuffer) JSValue() js.Value { return u.TypedArray.Value } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // arraybufferview.go | |||
| package dom | |||
| import "syscall/js" | |||
| type ArrayBufferView Value | |||
| func jsValueToArrayBufferView(val js.Value) ArrayBufferView { | |||
| return ArrayBufferView(jsValueToValue(val)) | |||
| } | |||
| @ -0,0 +1,89 @@ | |||
| // Code generated DO NOT EDIT | |||
| // attr.go | |||
| package dom | |||
| import "syscall/js" | |||
| type AttrIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| GetBaseURI() string | |||
| GetChildNodes() NodeList | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| InsertBefore(args ...interface{}) Node | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLocalName() string | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetName() string | |||
| GetNamespaceURI() string | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetOwnerElement() Element | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| GetPrefix() string | |||
| GetPreviousSibling() Node | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| GetSpecified() bool | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| GetValue() string | |||
| SetValue(string) | |||
| } | |||
| type Attr struct { | |||
| Value | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToAttr(val js.Value) Attr { return Attr{Value: Value{Value: val}} } | |||
| func (v Value) AsAttr() Attr { return Attr{Value: v} } | |||
| func (a Attr) GetLocalName() string { | |||
| val := a.Get("localName") | |||
| return val.String() | |||
| } | |||
| func (a Attr) GetName() string { | |||
| val := a.Get("name") | |||
| return val.String() | |||
| } | |||
| func (a Attr) GetNamespaceURI() string { | |||
| val := a.Get("namespaceURI") | |||
| return val.String() | |||
| } | |||
| func (a Attr) GetOwnerElement() Element { | |||
| val := a.Get("ownerElement") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (a Attr) GetPrefix() string { | |||
| val := a.Get("prefix") | |||
| return val.String() | |||
| } | |||
| func (a Attr) GetSpecified() bool { | |||
| val := a.Get("specified") | |||
| return val.Bool() | |||
| } | |||
| func (a Attr) GetValue() string { | |||
| val := a.Get("value") | |||
| return val.String() | |||
| } | |||
| func (a Attr) SetValue(val string) { | |||
| a.Set("value", val) | |||
| } | |||
| @ -0,0 +1,43 @@ | |||
| // Code generated DO NOT EDIT | |||
| // audiotrack.go | |||
| package dom | |||
| import "syscall/js" | |||
| type AudioTrackIFace interface { | |||
| GetEnabled() bool | |||
| SetEnabled(bool) | |||
| GetId() string | |||
| GetKind() string | |||
| GetLabel() string | |||
| GetLanguage() string | |||
| } | |||
| type AudioTrack struct { | |||
| Value | |||
| } | |||
| func jsValueToAudioTrack(val js.Value) AudioTrack { return AudioTrack{Value: Value{Value: val}} } | |||
| func (v Value) AsAudioTrack() AudioTrack { return AudioTrack{Value: v} } | |||
| func (a AudioTrack) GetEnabled() bool { | |||
| val := a.Get("enabled") | |||
| return val.Bool() | |||
| } | |||
| func (a AudioTrack) SetEnabled(val bool) { | |||
| a.Set("enabled", val) | |||
| } | |||
| func (a AudioTrack) GetId() string { | |||
| val := a.Get("id") | |||
| return val.String() | |||
| } | |||
| func (a AudioTrack) GetKind() string { | |||
| val := a.Get("kind") | |||
| return val.String() | |||
| } | |||
| func (a AudioTrack) GetLabel() string { | |||
| val := a.Get("label") | |||
| return val.String() | |||
| } | |||
| func (a AudioTrack) GetLanguage() string { | |||
| val := a.Get("language") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,57 @@ | |||
| // Code generated DO NOT EDIT | |||
| // audiotracklist.go | |||
| package dom | |||
| import "syscall/js" | |||
| type AudioTrackListIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetTrackById(args ...interface{}) AudioTrack | |||
| GetLength() float64 | |||
| GetOnaddtrack() EventHandler | |||
| SetOnaddtrack(EventHandler) | |||
| GetOnchange() EventHandler | |||
| SetOnchange(EventHandler) | |||
| GetOnremovetrack() EventHandler | |||
| SetOnremovetrack(EventHandler) | |||
| RemoveEventListener(args ...interface{}) | |||
| } | |||
| type AudioTrackList struct { | |||
| Value | |||
| EventTarget | |||
| } | |||
| func jsValueToAudioTrackList(val js.Value) AudioTrackList { | |||
| return AudioTrackList{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsAudioTrackList() AudioTrackList { return AudioTrackList{Value: v} } | |||
| func (a AudioTrackList) GetTrackById(args ...interface{}) AudioTrack { | |||
| val := a.Call("getTrackById", args...) | |||
| return jsValueToAudioTrack(val.JSValue()) | |||
| } | |||
| func (a AudioTrackList) GetLength() float64 { | |||
| val := a.Get("length") | |||
| return val.Float() | |||
| } | |||
| func (a AudioTrackList) GetOnaddtrack() EventHandler { | |||
| val := a.Get("onaddtrack") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a AudioTrackList) SetOnaddtrack(val EventHandler) { | |||
| a.Set("onaddtrack", val) | |||
| } | |||
| func (a AudioTrackList) GetOnchange() EventHandler { | |||
| val := a.Get("onchange") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a AudioTrackList) SetOnchange(val EventHandler) { | |||
| a.Set("onchange", val) | |||
| } | |||
| func (a AudioTrackList) GetOnremovetrack() EventHandler { | |||
| val := a.Get("onremovetrack") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (a AudioTrackList) SetOnremovetrack(val EventHandler) { | |||
| a.Set("onremovetrack", val) | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| // Code generated DO NOT EDIT | |||
| // barprop.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BarPropIFace interface { | |||
| GetVisible() bool | |||
| } | |||
| type BarProp struct { | |||
| Value | |||
| } | |||
| func jsValueToBarProp(val js.Value) BarProp { return BarProp{Value: Value{Value: val}} } | |||
| func (v Value) AsBarProp() BarProp { return BarProp{Value: v} } | |||
| func (b BarProp) GetVisible() bool { | |||
| val := b.Get("visible") | |||
| return val.Bool() | |||
| } | |||
| @ -0,0 +1,44 @@ | |||
| // Code generated DO NOT EDIT | |||
| // beforeunloadevent.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BeforeUnloadEventIFace interface { | |||
| GetBubbles() bool | |||
| GetCancelBubble() bool | |||
| SetCancelBubble(bool) | |||
| GetCancelable() bool | |||
| GetComposed() bool | |||
| ComposedPath(args ...interface{}) | |||
| GetCurrentTarget() EventTarget | |||
| GetDefaultPrevented() bool | |||
| GetEventPhase() int | |||
| InitEvent(args ...interface{}) | |||
| GetIsTrusted() bool | |||
| PreventDefault(args ...interface{}) | |||
| GetReturnValue() string | |||
| SetReturnValue(string) | |||
| GetSrcElement() EventTarget | |||
| StopImmediatePropagation(args ...interface{}) | |||
| StopPropagation(args ...interface{}) | |||
| GetTarget() EventTarget | |||
| GetTimeStamp() DOMHighResTimeStamp | |||
| GetType() string | |||
| } | |||
| type BeforeUnloadEvent struct { | |||
| Value | |||
| Event | |||
| } | |||
| func jsValueToBeforeUnloadEvent(val js.Value) BeforeUnloadEvent { | |||
| return BeforeUnloadEvent{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsBeforeUnloadEvent() BeforeUnloadEvent { return BeforeUnloadEvent{Value: v} } | |||
| func (b BeforeUnloadEvent) GetReturnValue() string { | |||
| val := b.Get("returnValue") | |||
| return val.String() | |||
| } | |||
| func (b BeforeUnloadEvent) SetReturnValue(val string) { | |||
| b.Set("returnValue", val) | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| // Code generated DO NOT EDIT | |||
| // binarytype.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BinaryType string | |||
| const ( | |||
| BinaryTypeBlob BinaryType = "blob" | |||
| BinaryTypeArraybuffer BinaryType = "arraybuffer" | |||
| ) | |||
| func jsValueToBinaryType(val js.Value) BinaryType { | |||
| return BinaryType(val.String()) | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| // Code generated DO NOT EDIT | |||
| // blob.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BlobIFace interface { | |||
| GetSize() float64 | |||
| Slice(args ...interface{}) Blob | |||
| GetType() string | |||
| } | |||
| type Blob struct { | |||
| Value | |||
| } | |||
| func jsValueToBlob(val js.Value) Blob { return Blob{Value: Value{Value: val}} } | |||
| func (v Value) AsBlob() Blob { return Blob{Value: v} } | |||
| func (b Blob) GetSize() float64 { | |||
| val := b.Get("size") | |||
| return val.Float() | |||
| } | |||
| func (b Blob) Slice(args ...interface{}) Blob { | |||
| val := b.Call("slice", args...) | |||
| return jsValueToBlob(val.JSValue()) | |||
| } | |||
| func (b Blob) GetType() string { | |||
| val := b.Get("type") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,21 @@ | |||
| // Code generated DO NOT EDIT | |||
| // blobcallback.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BlobCallbackCallback func(blob Blob) | |||
| type BlobCallback struct { | |||
| Callback | |||
| } | |||
| func jsValueToBlobCallback(val js.Value) BlobCallback { | |||
| return BlobCallback{Callback: jsValueToCallback(val)} | |||
| } | |||
| func NewBlobCallback(c BlobCallbackCallback) BlobCallback { | |||
| callback := js.NewCallback(func(args []js.Value) { | |||
| blob := jsValueToBlob(args[0]) | |||
| c(blob) | |||
| }) | |||
| return BlobCallback{Callback: Callback{Callback: callback}} | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // blobpart.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BlobPart Value | |||
| func jsValueToBlobPart(val js.Value) BlobPart { | |||
| return BlobPart(jsValueToValue(val)) | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // bodyinit.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BodyInit Value | |||
| func jsValueToBodyInit(val js.Value) BodyInit { | |||
| return BodyInit(jsValueToValue(val)) | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| // Code generated DO NOT EDIT | |||
| // broadcastchannel.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BroadcastChannelIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| Close(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetName() string | |||
| GetOnmessage() EventHandler | |||
| SetOnmessage(EventHandler) | |||
| GetOnmessageerror() EventHandler | |||
| SetOnmessageerror(EventHandler) | |||
| PostMessage(args ...interface{}) | |||
| RemoveEventListener(args ...interface{}) | |||
| } | |||
| type BroadcastChannel struct { | |||
| Value | |||
| EventTarget | |||
| } | |||
| func jsValueToBroadcastChannel(val js.Value) BroadcastChannel { | |||
| return BroadcastChannel{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsBroadcastChannel() BroadcastChannel { return BroadcastChannel{Value: v} } | |||
| func (b BroadcastChannel) Close(args ...interface{}) { | |||
| b.Call("close", args...) | |||
| } | |||
| func (b BroadcastChannel) GetName() string { | |||
| val := b.Get("name") | |||
| return val.String() | |||
| } | |||
| func (b BroadcastChannel) GetOnmessage() EventHandler { | |||
| val := b.Get("onmessage") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (b BroadcastChannel) SetOnmessage(val EventHandler) { | |||
| b.Set("onmessage", val) | |||
| } | |||
| func (b BroadcastChannel) GetOnmessageerror() EventHandler { | |||
| val := b.Get("onmessageerror") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (b BroadcastChannel) SetOnmessageerror(val EventHandler) { | |||
| b.Set("onmessageerror", val) | |||
| } | |||
| func (b BroadcastChannel) PostMessage(args ...interface{}) { | |||
| b.Call("postMessage", args...) | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // buffersource.go | |||
| package dom | |||
| import "syscall/js" | |||
| type BufferSource Value | |||
| func jsValueToBufferSource(val js.Value) BufferSource { | |||
| return BufferSource(jsValueToValue(val)) | |||
| } | |||
| @ -0,0 +1,10 @@ | |||
| package dom | |||
| import "syscall/js" | |||
| type Callback struct { | |||
| js.Callback | |||
| } | |||
| func jsValueToCallback(val js.Value) Callback { return Callback{Callback: js.Callback{Value: val}} } | |||
| func (c Callback) JSValue() js.Value { return c.Callback.Value } | |||
| @ -0,0 +1,17 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canplaytyperesult.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanPlayTypeResult string | |||
| const ( | |||
| CanPlayTypeResultEmpty CanPlayTypeResult = "Empty" | |||
| CanPlayTypeResultMaybe CanPlayTypeResult = "maybe" | |||
| CanPlayTypeResultProbably CanPlayTypeResult = "probably" | |||
| ) | |||
| func jsValueToCanPlayTypeResult(val js.Value) CanPlayTypeResult { | |||
| return CanPlayTypeResult(val.String()) | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvasdirection.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasDirection string | |||
| const ( | |||
| CanvasDirectionLtr CanvasDirection = "ltr" | |||
| CanvasDirectionRtl CanvasDirection = "rtl" | |||
| CanvasDirectionInherit CanvasDirection = "inherit" | |||
| ) | |||
| func jsValueToCanvasDirection(val js.Value) CanvasDirection { | |||
| return CanvasDirection(val.String()) | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvasfillrule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasFillRule string | |||
| const ( | |||
| CanvasFillRuleNonzero CanvasFillRule = "nonzero" | |||
| CanvasFillRuleEvenodd CanvasFillRule = "evenodd" | |||
| ) | |||
| func jsValueToCanvasFillRule(val js.Value) CanvasFillRule { | |||
| return CanvasFillRule(val.String()) | |||
| } | |||
| @ -0,0 +1,20 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvasgradient.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasGradientIFace interface { | |||
| AddColorStop(args ...interface{}) | |||
| } | |||
| type CanvasGradient struct { | |||
| Value | |||
| } | |||
| func jsValueToCanvasGradient(val js.Value) CanvasGradient { | |||
| return CanvasGradient{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCanvasGradient() CanvasGradient { return CanvasGradient{Value: v} } | |||
| func (c CanvasGradient) AddColorStop(args ...interface{}) { | |||
| c.Call("addColorStop", args...) | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvasimagesource.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasImageSource Value | |||
| func jsValueToCanvasImageSource(val js.Value) CanvasImageSource { | |||
| return CanvasImageSource(jsValueToValue(val)) | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvaslinecap.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasLineCap string | |||
| const ( | |||
| CanvasLineCapButt CanvasLineCap = "butt" | |||
| CanvasLineCapRound CanvasLineCap = "round" | |||
| CanvasLineCapSquare CanvasLineCap = "square" | |||
| ) | |||
| func jsValueToCanvasLineCap(val js.Value) CanvasLineCap { | |||
| return CanvasLineCap(val.String()) | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvaslinejoin.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasLineJoin string | |||
| const ( | |||
| CanvasLineJoinRound CanvasLineJoin = "round" | |||
| CanvasLineJoinBevel CanvasLineJoin = "bevel" | |||
| CanvasLineJoinMiter CanvasLineJoin = "miter" | |||
| ) | |||
| func jsValueToCanvasLineJoin(val js.Value) CanvasLineJoin { | |||
| return CanvasLineJoin(val.String()) | |||
| } | |||
| @ -0,0 +1,20 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvaspattern.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasPatternIFace interface { | |||
| SetTransform(args ...interface{}) | |||
| } | |||
| type CanvasPattern struct { | |||
| Value | |||
| } | |||
| func jsValueToCanvasPattern(val js.Value) CanvasPattern { | |||
| return CanvasPattern{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCanvasPattern() CanvasPattern { return CanvasPattern{Value: v} } | |||
| func (c CanvasPattern) SetTransform(args ...interface{}) { | |||
| c.Call("setTransform", args...) | |||
| } | |||
| @ -0,0 +1,419 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvasrenderingcontext2d.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasRenderingContext2DIFace interface { | |||
| Arc(args ...interface{}) | |||
| ArcTo(args ...interface{}) | |||
| BeginPath(args ...interface{}) | |||
| BezierCurveTo(args ...interface{}) | |||
| GetCanvas() HTMLCanvasElement | |||
| ClearRect(args ...interface{}) | |||
| Clip(args ...interface{}) | |||
| ClipWithArgs(args ...interface{}) | |||
| ClosePath(args ...interface{}) | |||
| CreateImageData(args ...interface{}) ImageData | |||
| CreateImageDataWithArgs(args ...interface{}) ImageData | |||
| CreateLinearGradient(args ...interface{}) CanvasGradient | |||
| CreatePattern(args ...interface{}) CanvasPattern | |||
| CreateRadialGradient(args ...interface{}) CanvasGradient | |||
| GetDirection() CanvasDirection | |||
| SetDirection(CanvasDirection) | |||
| DrawFocusIfNeeded(args ...interface{}) | |||
| DrawFocusIfNeededWithArgs(args ...interface{}) | |||
| DrawImage(args ...interface{}) | |||
| Ellipse(args ...interface{}) | |||
| Fill(args ...interface{}) | |||
| FillRect(args ...interface{}) | |||
| GetFillStyle() | |||
| SetFillStyle() | |||
| FillText(args ...interface{}) | |||
| FillWithArgs(args ...interface{}) | |||
| GetFilter() string | |||
| SetFilter(string) | |||
| GetFont() string | |||
| SetFont(string) | |||
| GetImageData(args ...interface{}) ImageData | |||
| GetLineDash(args ...interface{}) | |||
| GetTransform(args ...interface{}) DOMMatrix | |||
| GetGlobalAlpha() float64 | |||
| SetGlobalAlpha(float64) | |||
| GetGlobalCompositeOperation() string | |||
| SetGlobalCompositeOperation(string) | |||
| GetImageSmoothingEnabled() bool | |||
| SetImageSmoothingEnabled(bool) | |||
| GetImageSmoothingQuality() ImageSmoothingQuality | |||
| SetImageSmoothingQuality(ImageSmoothingQuality) | |||
| IsPointInPath(args ...interface{}) bool | |||
| IsPointInPathWithArgs(args ...interface{}) bool | |||
| IsPointInStroke(args ...interface{}) bool | |||
| IsPointInStrokeWithArgs(args ...interface{}) bool | |||
| GetLineCap() CanvasLineCap | |||
| SetLineCap(CanvasLineCap) | |||
| GetLineDashOffset() float64 | |||
| SetLineDashOffset(float64) | |||
| GetLineJoin() CanvasLineJoin | |||
| SetLineJoin(CanvasLineJoin) | |||
| LineTo(args ...interface{}) | |||
| GetLineWidth() float64 | |||
| SetLineWidth(float64) | |||
| MeasureText(args ...interface{}) TextMetrics | |||
| GetMiterLimit() float64 | |||
| SetMiterLimit(float64) | |||
| MoveTo(args ...interface{}) | |||
| PutImageData(args ...interface{}) | |||
| PutImageDataWithArgs(args ...interface{}) | |||
| QuadraticCurveTo(args ...interface{}) | |||
| Rect(args ...interface{}) | |||
| ResetTransform(args ...interface{}) | |||
| Restore(args ...interface{}) | |||
| Rotate(args ...interface{}) | |||
| Save(args ...interface{}) | |||
| Scale(args ...interface{}) | |||
| ScrollPathIntoView(args ...interface{}) | |||
| ScrollPathIntoViewWithArgs(args ...interface{}) | |||
| SetLineDash(args ...interface{}) | |||
| SetTransform(args ...interface{}) | |||
| SetTransformWithArgs(args ...interface{}) | |||
| GetShadowBlur() float64 | |||
| SetShadowBlur(float64) | |||
| GetShadowColor() string | |||
| SetShadowColor(string) | |||
| GetShadowOffsetX() float64 | |||
| SetShadowOffsetX(float64) | |||
| GetShadowOffsetY() float64 | |||
| SetShadowOffsetY(float64) | |||
| Stroke(args ...interface{}) | |||
| StrokeRect(args ...interface{}) | |||
| GetStrokeStyle() | |||
| SetStrokeStyle() | |||
| StrokeText(args ...interface{}) | |||
| StrokeWithArgs(args ...interface{}) | |||
| GetTextAlign() CanvasTextAlign | |||
| SetTextAlign(CanvasTextAlign) | |||
| GetTextBaseline() CanvasTextBaseline | |||
| SetTextBaseline(CanvasTextBaseline) | |||
| Transform(args ...interface{}) | |||
| Translate(args ...interface{}) | |||
| } | |||
| type CanvasRenderingContext2D struct { | |||
| Value | |||
| } | |||
| func jsValueToCanvasRenderingContext2D(val js.Value) CanvasRenderingContext2D { | |||
| return CanvasRenderingContext2D{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCanvasRenderingContext2D() CanvasRenderingContext2D { | |||
| return CanvasRenderingContext2D{Value: v} | |||
| } | |||
| func (c CanvasRenderingContext2D) Arc(args ...interface{}) { | |||
| c.Call("arc", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) ArcTo(args ...interface{}) { | |||
| c.Call("arcTo", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) BeginPath(args ...interface{}) { | |||
| c.Call("beginPath", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) BezierCurveTo(args ...interface{}) { | |||
| c.Call("bezierCurveTo", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetCanvas() HTMLCanvasElement { | |||
| val := c.Get("canvas") | |||
| return jsValueToHTMLCanvasElement(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) ClearRect(args ...interface{}) { | |||
| c.Call("clearRect", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Clip(args ...interface{}) { | |||
| c.Call("clip", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) ClipWithArgs(args ...interface{}) { | |||
| c.Call("clipWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) ClosePath(args ...interface{}) { | |||
| c.Call("closePath", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) CreateImageData(args ...interface{}) ImageData { | |||
| val := c.Call("createImageData", args...) | |||
| return jsValueToImageData(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) CreateImageDataWithArgs(args ...interface{}) ImageData { | |||
| val := c.Call("createImageDataWithArgs", args...) | |||
| return jsValueToImageData(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) CreateLinearGradient(args ...interface{}) CanvasGradient { | |||
| val := c.Call("createLinearGradient", args...) | |||
| return jsValueToCanvasGradient(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) CreatePattern(args ...interface{}) CanvasPattern { | |||
| val := c.Call("createPattern", args...) | |||
| return jsValueToCanvasPattern(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) CreateRadialGradient(args ...interface{}) CanvasGradient { | |||
| val := c.Call("createRadialGradient", args...) | |||
| return jsValueToCanvasGradient(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetDirection() CanvasDirection { | |||
| val := c.Get("direction") | |||
| return jsValueToCanvasDirection(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetDirection(val CanvasDirection) { | |||
| c.Set("direction", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) DrawFocusIfNeeded(args ...interface{}) { | |||
| c.Call("drawFocusIfNeeded", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) DrawFocusIfNeededWithArgs(args ...interface{}) { | |||
| c.Call("drawFocusIfNeededWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) DrawImage(args ...interface{}) { | |||
| c.Call("drawImage", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Ellipse(args ...interface{}) { | |||
| c.Call("ellipse", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Fill(args ...interface{}) { | |||
| c.Call("fill", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) FillRect(args ...interface{}) { | |||
| c.Call("fillRect", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetFillStyle() Value { | |||
| val := c.Get("fillStyle") | |||
| return val | |||
| } | |||
| func (c CanvasRenderingContext2D) SetFillStyle(val Value) { | |||
| c.Set("fillStyle", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) FillText(args ...interface{}) { | |||
| c.Call("fillText", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) FillWithArgs(args ...interface{}) { | |||
| c.Call("fillWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetFilter() string { | |||
| val := c.Get("filter") | |||
| return val.String() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetFilter(val string) { | |||
| c.Set("filter", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetFont() string { | |||
| val := c.Get("font") | |||
| return val.String() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetFont(val string) { | |||
| c.Set("font", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetImageData(args ...interface{}) ImageData { | |||
| val := c.Call("getImageData", args...) | |||
| return jsValueToImageData(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetLineDash(args ...interface{}) { | |||
| c.Call("getLineDash", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetTransform(args ...interface{}) DOMMatrix { | |||
| val := c.Call("getTransform", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetGlobalAlpha() float64 { | |||
| val := c.Get("globalAlpha") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetGlobalAlpha(val float64) { | |||
| c.Set("globalAlpha", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetGlobalCompositeOperation() string { | |||
| val := c.Get("globalCompositeOperation") | |||
| return val.String() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetGlobalCompositeOperation(val string) { | |||
| c.Set("globalCompositeOperation", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetImageSmoothingEnabled() bool { | |||
| val := c.Get("imageSmoothingEnabled") | |||
| return val.Bool() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetImageSmoothingEnabled(val bool) { | |||
| c.Set("imageSmoothingEnabled", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetImageSmoothingQuality() ImageSmoothingQuality { | |||
| val := c.Get("imageSmoothingQuality") | |||
| return jsValueToImageSmoothingQuality(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetImageSmoothingQuality(val ImageSmoothingQuality) { | |||
| c.Set("imageSmoothingQuality", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) IsPointInPath(args ...interface{}) bool { | |||
| val := c.Call("isPointInPath", args...) | |||
| return val.Bool() | |||
| } | |||
| func (c CanvasRenderingContext2D) IsPointInPathWithArgs(args ...interface{}) bool { | |||
| val := c.Call("isPointInPathWithArgs", args...) | |||
| return val.Bool() | |||
| } | |||
| func (c CanvasRenderingContext2D) IsPointInStroke(args ...interface{}) bool { | |||
| val := c.Call("isPointInStroke", args...) | |||
| return val.Bool() | |||
| } | |||
| func (c CanvasRenderingContext2D) IsPointInStrokeWithArgs(args ...interface{}) bool { | |||
| val := c.Call("isPointInStrokeWithArgs", args...) | |||
| return val.Bool() | |||
| } | |||
| func (c CanvasRenderingContext2D) GetLineCap() CanvasLineCap { | |||
| val := c.Get("lineCap") | |||
| return jsValueToCanvasLineCap(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetLineCap(val CanvasLineCap) { | |||
| c.Set("lineCap", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetLineDashOffset() float64 { | |||
| val := c.Get("lineDashOffset") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetLineDashOffset(val float64) { | |||
| c.Set("lineDashOffset", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetLineJoin() CanvasLineJoin { | |||
| val := c.Get("lineJoin") | |||
| return jsValueToCanvasLineJoin(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetLineJoin(val CanvasLineJoin) { | |||
| c.Set("lineJoin", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) LineTo(args ...interface{}) { | |||
| c.Call("lineTo", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetLineWidth() float64 { | |||
| val := c.Get("lineWidth") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetLineWidth(val float64) { | |||
| c.Set("lineWidth", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) MeasureText(args ...interface{}) TextMetrics { | |||
| val := c.Call("measureText", args...) | |||
| return jsValueToTextMetrics(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetMiterLimit() float64 { | |||
| val := c.Get("miterLimit") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetMiterLimit(val float64) { | |||
| c.Set("miterLimit", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) MoveTo(args ...interface{}) { | |||
| c.Call("moveTo", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) PutImageData(args ...interface{}) { | |||
| c.Call("putImageData", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) PutImageDataWithArgs(args ...interface{}) { | |||
| c.Call("putImageDataWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) QuadraticCurveTo(args ...interface{}) { | |||
| c.Call("quadraticCurveTo", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Rect(args ...interface{}) { | |||
| c.Call("rect", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) ResetTransform(args ...interface{}) { | |||
| c.Call("resetTransform", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Restore(args ...interface{}) { | |||
| c.Call("restore", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Rotate(args ...interface{}) { | |||
| c.Call("rotate", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Save(args ...interface{}) { | |||
| c.Call("save", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Scale(args ...interface{}) { | |||
| c.Call("scale", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) ScrollPathIntoView(args ...interface{}) { | |||
| c.Call("scrollPathIntoView", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) ScrollPathIntoViewWithArgs(args ...interface{}) { | |||
| c.Call("scrollPathIntoViewWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetLineDash(args ...interface{}) { | |||
| c.Call("setLineDash", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetTransform(args ...interface{}) { | |||
| c.Call("setTransform", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetTransformWithArgs(args ...interface{}) { | |||
| c.Call("setTransformWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetShadowBlur() float64 { | |||
| val := c.Get("shadowBlur") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetShadowBlur(val float64) { | |||
| c.Set("shadowBlur", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetShadowColor() string { | |||
| val := c.Get("shadowColor") | |||
| return val.String() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetShadowColor(val string) { | |||
| c.Set("shadowColor", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetShadowOffsetX() float64 { | |||
| val := c.Get("shadowOffsetX") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetShadowOffsetX(val float64) { | |||
| c.Set("shadowOffsetX", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetShadowOffsetY() float64 { | |||
| val := c.Get("shadowOffsetY") | |||
| return val.Float() | |||
| } | |||
| func (c CanvasRenderingContext2D) SetShadowOffsetY(val float64) { | |||
| c.Set("shadowOffsetY", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) Stroke(args ...interface{}) { | |||
| c.Call("stroke", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) StrokeRect(args ...interface{}) { | |||
| c.Call("strokeRect", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetStrokeStyle() Value { | |||
| val := c.Get("strokeStyle") | |||
| return val | |||
| } | |||
| func (c CanvasRenderingContext2D) SetStrokeStyle(val Value) { | |||
| c.Set("strokeStyle", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) StrokeText(args ...interface{}) { | |||
| c.Call("strokeText", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) StrokeWithArgs(args ...interface{}) { | |||
| c.Call("strokeWithArgs", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetTextAlign() CanvasTextAlign { | |||
| val := c.Get("textAlign") | |||
| return jsValueToCanvasTextAlign(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetTextAlign(val CanvasTextAlign) { | |||
| c.Set("textAlign", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) GetTextBaseline() CanvasTextBaseline { | |||
| val := c.Get("textBaseline") | |||
| return jsValueToCanvasTextBaseline(val.JSValue()) | |||
| } | |||
| func (c CanvasRenderingContext2D) SetTextBaseline(val CanvasTextBaseline) { | |||
| c.Set("textBaseline", val) | |||
| } | |||
| func (c CanvasRenderingContext2D) Transform(args ...interface{}) { | |||
| c.Call("transform", args...) | |||
| } | |||
| func (c CanvasRenderingContext2D) Translate(args ...interface{}) { | |||
| c.Call("translate", args...) | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvastextalign.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasTextAlign string | |||
| const ( | |||
| CanvasTextAlignStart CanvasTextAlign = "start" | |||
| CanvasTextAlignEnd CanvasTextAlign = "end" | |||
| CanvasTextAlignLeft CanvasTextAlign = "left" | |||
| CanvasTextAlignRight CanvasTextAlign = "right" | |||
| CanvasTextAlignCenter CanvasTextAlign = "center" | |||
| ) | |||
| func jsValueToCanvasTextAlign(val js.Value) CanvasTextAlign { | |||
| return CanvasTextAlign(val.String()) | |||
| } | |||
| @ -0,0 +1,20 @@ | |||
| // Code generated DO NOT EDIT | |||
| // canvastextbaseline.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CanvasTextBaseline string | |||
| const ( | |||
| CanvasTextBaselineTop CanvasTextBaseline = "top" | |||
| CanvasTextBaselineHanging CanvasTextBaseline = "hanging" | |||
| CanvasTextBaselineMiddle CanvasTextBaseline = "middle" | |||
| CanvasTextBaselineAlphabetic CanvasTextBaseline = "alphabetic" | |||
| CanvasTextBaselineIdeographic CanvasTextBaseline = "ideographic" | |||
| CanvasTextBaselineBottom CanvasTextBaseline = "bottom" | |||
| ) | |||
| func jsValueToCanvasTextBaseline(val js.Value) CanvasTextBaseline { | |||
| return CanvasTextBaseline(val.String()) | |||
| } | |||
| @ -0,0 +1,62 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cdatasection.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CDATASectionIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| AppendData(args ...interface{}) | |||
| GetBaseURI() string | |||
| GetChildNodes() NodeList | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| GetData() string | |||
| SetData(string) | |||
| DeleteData(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| InsertBefore(args ...interface{}) Node | |||
| InsertData(args ...interface{}) | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLength() float64 | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| GetPreviousSibling() Node | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| ReplaceData(args ...interface{}) | |||
| SplitText(args ...interface{}) Text | |||
| SubstringData(args ...interface{}) string | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| GetWholeText() string | |||
| } | |||
| type CDATASection struct { | |||
| Value | |||
| Text | |||
| CharacterData | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToCDATASection(val js.Value) CDATASection { return CDATASection{Value: Value{Value: val}} } | |||
| func (v Value) AsCDATASection() CDATASection { return CDATASection{Value: v} } | |||
| @ -0,0 +1,113 @@ | |||
| // Code generated DO NOT EDIT | |||
| // characterdata.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CharacterDataIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| After(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| AppendData(args ...interface{}) | |||
| GetBaseURI() string | |||
| Before(args ...interface{}) | |||
| GetChildNodes() NodeList | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| GetData() string | |||
| SetData(string) | |||
| DeleteData(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| InsertBefore(args ...interface{}) Node | |||
| InsertData(args ...interface{}) | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLength() float64 | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetNextElementSibling() Element | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| GetPreviousElementSibling() Element | |||
| GetPreviousSibling() Node | |||
| Remove(args ...interface{}) | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| ReplaceData(args ...interface{}) | |||
| ReplaceWith(args ...interface{}) | |||
| SubstringData(args ...interface{}) string | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| } | |||
| type CharacterData struct { | |||
| Value | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToCharacterData(val js.Value) CharacterData { | |||
| return CharacterData{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCharacterData() CharacterData { return CharacterData{Value: v} } | |||
| func (c CharacterData) After(args ...interface{}) { | |||
| c.Call("after", args...) | |||
| } | |||
| func (c CharacterData) AppendData(args ...interface{}) { | |||
| c.Call("appendData", args...) | |||
| } | |||
| func (c CharacterData) Before(args ...interface{}) { | |||
| c.Call("before", args...) | |||
| } | |||
| func (c CharacterData) GetData() string { | |||
| val := c.Get("data") | |||
| return val.String() | |||
| } | |||
| func (c CharacterData) SetData(val string) { | |||
| c.Set("data", val) | |||
| } | |||
| func (c CharacterData) DeleteData(args ...interface{}) { | |||
| c.Call("deleteData", args...) | |||
| } | |||
| func (c CharacterData) InsertData(args ...interface{}) { | |||
| c.Call("insertData", args...) | |||
| } | |||
| func (c CharacterData) GetLength() float64 { | |||
| val := c.Get("length") | |||
| return val.Float() | |||
| } | |||
| func (c CharacterData) GetNextElementSibling() Element { | |||
| val := c.Get("nextElementSibling") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (c CharacterData) GetPreviousElementSibling() Element { | |||
| val := c.Get("previousElementSibling") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (c CharacterData) Remove(args ...interface{}) { | |||
| c.Call("remove", args...) | |||
| } | |||
| func (c CharacterData) ReplaceData(args ...interface{}) { | |||
| c.Call("replaceData", args...) | |||
| } | |||
| func (c CharacterData) ReplaceWith(args ...interface{}) { | |||
| c.Call("replaceWith", args...) | |||
| } | |||
| func (c CharacterData) SubstringData(args ...interface{}) string { | |||
| val := c.Call("substringData", args...) | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,50 @@ | |||
| // Code generated DO NOT EDIT | |||
| // closeevent.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CloseEventIFace interface { | |||
| GetBubbles() bool | |||
| GetCancelBubble() bool | |||
| SetCancelBubble(bool) | |||
| GetCancelable() bool | |||
| GetCode() int | |||
| GetComposed() bool | |||
| ComposedPath(args ...interface{}) | |||
| GetCurrentTarget() EventTarget | |||
| GetDefaultPrevented() bool | |||
| GetEventPhase() int | |||
| InitEvent(args ...interface{}) | |||
| GetIsTrusted() bool | |||
| PreventDefault(args ...interface{}) | |||
| GetReason() string | |||
| GetReturnValue() bool | |||
| SetReturnValue(bool) | |||
| GetSrcElement() EventTarget | |||
| StopImmediatePropagation(args ...interface{}) | |||
| StopPropagation(args ...interface{}) | |||
| GetTarget() EventTarget | |||
| GetTimeStamp() DOMHighResTimeStamp | |||
| GetType() string | |||
| GetWasClean() bool | |||
| } | |||
| type CloseEvent struct { | |||
| Value | |||
| Event | |||
| } | |||
| func jsValueToCloseEvent(val js.Value) CloseEvent { return CloseEvent{Value: Value{Value: val}} } | |||
| func (v Value) AsCloseEvent() CloseEvent { return CloseEvent{Value: v} } | |||
| func (c CloseEvent) GetCode() int { | |||
| val := c.Get("code") | |||
| return val.Int() | |||
| } | |||
| func (c CloseEvent) GetReason() string { | |||
| val := c.Get("reason") | |||
| return val.String() | |||
| } | |||
| func (c CloseEvent) GetWasClean() bool { | |||
| val := c.Get("wasClean") | |||
| return val.Bool() | |||
| } | |||
| @ -1,13 +1,16 @@ | |||
| package main | |||
| import ( | |||
| dom "github.com/brettlangdon/go-dom/v1" | |||
| "github.com/brettlangdon/go-dom/v1/console" | |||
| "syscall/js" | |||
| "github.com/brettlangdon/go-dom/v1/document" | |||
| ) | |||
| func main() { | |||
| app := document.GetElementById("app") | |||
| shadow := app.AttachShadow(dom.ShadowRootInit{Mode: "open"}) | |||
| console.Dir(shadow) | |||
| console := js.Global().Get("console") | |||
| nodes := document.Document.QuerySelectorAll("div") | |||
| var i float64 = 0 | |||
| for ; i < nodes.GetLength(); i++ { | |||
| console.Call("dir", nodes.Item(i).JSValue()) | |||
| } | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| // Code generated DO NOT EDIT | |||
| // colorspaceconversion.go | |||
| package dom | |||
| import "syscall/js" | |||
| type ColorSpaceConversion string | |||
| const ( | |||
| ColorSpaceConversionNone ColorSpaceConversion = "none" | |||
| ColorSpaceConversionDefault ColorSpaceConversion = "default" | |||
| ) | |||
| func jsValueToColorSpaceConversion(val js.Value) ColorSpaceConversion { | |||
| return ColorSpaceConversion(val.String()) | |||
| } | |||
| @ -0,0 +1,59 @@ | |||
| // Code generated DO NOT EDIT | |||
| // comment.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CommentIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| AppendData(args ...interface{}) | |||
| GetBaseURI() string | |||
| GetChildNodes() NodeList | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| GetData() string | |||
| SetData(string) | |||
| DeleteData(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| InsertBefore(args ...interface{}) Node | |||
| InsertData(args ...interface{}) | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLength() float64 | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| GetPreviousSibling() Node | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| ReplaceData(args ...interface{}) | |||
| SubstringData(args ...interface{}) string | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| } | |||
| type Comment struct { | |||
| Value | |||
| CharacterData | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToComment(val js.Value) Comment { return Comment{Value: Value{Value: val}} } | |||
| func (v Value) AsComment() Comment { return Comment{Value: v} } | |||
| @ -0,0 +1,28 @@ | |||
| // Code generated DO NOT EDIT | |||
| // console/console.go | |||
| package console | |||
| import "syscall/js" | |||
| var value Value | |||
| func init() { value = Value{Value: js.Global().Get("console")} } | |||
| func Clear(args ...interface{}) { return value.Call("clear", args...) } | |||
| func Table(args ...interface{}) { return value.Call("table", args...) } | |||
| func Warn(args ...interface{}) { return value.Call("warn", args...) } | |||
| func Dirxml(args ...interface{}) { return value.Call("dirxml", args...) } | |||
| func Group(args ...interface{}) { return value.Call("group", args...) } | |||
| func Time(args ...interface{}) { return value.Call("time", args...) } | |||
| func Trace(args ...interface{}) { return value.Call("trace", args...) } | |||
| func CountReset(args ...interface{}) { return value.Call("countReset", args...) } | |||
| func GroupEnd(args ...interface{}) { return value.Call("groupEnd", args...) } | |||
| func Assert(args ...interface{}) { return value.Call("assert", args...) } | |||
| func Debug(args ...interface{}) { return value.Call("debug", args...) } | |||
| func Log(args ...interface{}) { return value.Call("log", args...) } | |||
| func Dir(args ...interface{}) { return value.Call("dir", args...) } | |||
| func TimeLog(args ...interface{}) { return value.Call("timeLog", args...) } | |||
| func Error(args ...interface{}) { return value.Call("error", args...) } | |||
| func Info(args ...interface{}) { return value.Call("info", args...) } | |||
| func Count(args ...interface{}) { return value.Call("count", args...) } | |||
| func GroupCollapsed(args ...interface{}) { return value.Call("groupCollapsed", args...) } | |||
| func TimeEnd(args ...interface{}) { return value.Call("timeEnd", args...) } | |||
| @ -0,0 +1,10 @@ | |||
| // Code generated DO NOT EDIT | |||
| // css/css.go | |||
| package css | |||
| import "syscall/js" | |||
| var value Value | |||
| func init() { value = Value{Value: js.Global().Get("CSS")} } | |||
| func Escape(args ...interface{}) { return value.Call("escape", args...) } | |||
| @ -0,0 +1,36 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssgroupingrule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSGroupingRuleIFace interface { | |||
| GetCssRules() CSSRuleList | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| DeleteRule(args ...interface{}) | |||
| InsertRule(args ...interface{}) float64 | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetType() int | |||
| } | |||
| type CSSGroupingRule struct { | |||
| Value | |||
| CSSRule | |||
| } | |||
| func jsValueToCSSGroupingRule(val js.Value) CSSGroupingRule { | |||
| return CSSGroupingRule{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCSSGroupingRule() CSSGroupingRule { return CSSGroupingRule{Value: v} } | |||
| func (c CSSGroupingRule) GetCssRules() CSSRuleList { | |||
| val := c.Get("cssRules") | |||
| return jsValueToCSSRuleList(val.JSValue()) | |||
| } | |||
| func (c CSSGroupingRule) DeleteRule(args ...interface{}) { | |||
| c.Call("deleteRule", args...) | |||
| } | |||
| func (c CSSGroupingRule) InsertRule(args ...interface{}) float64 { | |||
| val := c.Call("insertRule", args...) | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,37 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssimportrule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSImportRuleIFace interface { | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| GetHref() string | |||
| GetMedia() MediaList | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetStyleSheet() CSSStyleSheet | |||
| GetType() int | |||
| } | |||
| type CSSImportRule struct { | |||
| Value | |||
| CSSRule | |||
| } | |||
| func jsValueToCSSImportRule(val js.Value) CSSImportRule { | |||
| return CSSImportRule{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCSSImportRule() CSSImportRule { return CSSImportRule{Value: v} } | |||
| func (c CSSImportRule) GetHref() string { | |||
| val := c.Get("href") | |||
| return val.String() | |||
| } | |||
| func (c CSSImportRule) GetMedia() MediaList { | |||
| val := c.Get("media") | |||
| return jsValueToMediaList(val.JSValue()) | |||
| } | |||
| func (c CSSImportRule) GetStyleSheet() CSSStyleSheet { | |||
| val := c.Get("styleSheet") | |||
| return jsValueToCSSStyleSheet(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,32 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssmarginrule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSMarginRuleIFace interface { | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| GetName() string | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetStyle() CSSStyleDeclaration | |||
| GetType() int | |||
| } | |||
| type CSSMarginRule struct { | |||
| Value | |||
| CSSRule | |||
| } | |||
| func jsValueToCSSMarginRule(val js.Value) CSSMarginRule { | |||
| return CSSMarginRule{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCSSMarginRule() CSSMarginRule { return CSSMarginRule{Value: v} } | |||
| func (c CSSMarginRule) GetName() string { | |||
| val := c.Get("name") | |||
| return val.String() | |||
| } | |||
| func (c CSSMarginRule) GetStyle() CSSStyleDeclaration { | |||
| val := c.Get("style") | |||
| return jsValueToCSSStyleDeclaration(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,32 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssnamespacerule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSNamespaceRuleIFace interface { | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| GetNamespaceURI() string | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetPrefix() string | |||
| GetType() int | |||
| } | |||
| type CSSNamespaceRule struct { | |||
| Value | |||
| CSSRule | |||
| } | |||
| func jsValueToCSSNamespaceRule(val js.Value) CSSNamespaceRule { | |||
| return CSSNamespaceRule{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCSSNamespaceRule() CSSNamespaceRule { return CSSNamespaceRule{Value: v} } | |||
| func (c CSSNamespaceRule) GetNamespaceURI() string { | |||
| val := c.Get("namespaceURI") | |||
| return val.String() | |||
| } | |||
| func (c CSSNamespaceRule) GetPrefix() string { | |||
| val := c.Get("prefix") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,38 @@ | |||
| // Code generated DO NOT EDIT | |||
| // csspagerule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSPageRuleIFace interface { | |||
| GetCssRules() CSSRuleList | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| DeleteRule(args ...interface{}) | |||
| InsertRule(args ...interface{}) float64 | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetSelectorText() string | |||
| SetSelectorText(string) | |||
| GetStyle() CSSStyleDeclaration | |||
| GetType() int | |||
| } | |||
| type CSSPageRule struct { | |||
| Value | |||
| CSSGroupingRule | |||
| CSSRule | |||
| } | |||
| func jsValueToCSSPageRule(val js.Value) CSSPageRule { return CSSPageRule{Value: Value{Value: val}} } | |||
| func (v Value) AsCSSPageRule() CSSPageRule { return CSSPageRule{Value: v} } | |||
| func (c CSSPageRule) GetSelectorText() string { | |||
| val := c.Get("selectorText") | |||
| return val.String() | |||
| } | |||
| func (c CSSPageRule) SetSelectorText(val string) { | |||
| c.Set("selectorText", val) | |||
| } | |||
| func (c CSSPageRule) GetStyle() CSSStyleDeclaration { | |||
| val := c.Get("style") | |||
| return jsValueToCSSStyleDeclaration(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,38 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssrule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSRuleIFace interface { | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetType() int | |||
| } | |||
| type CSSRule struct { | |||
| Value | |||
| } | |||
| func jsValueToCSSRule(val js.Value) CSSRule { return CSSRule{Value: Value{Value: val}} } | |||
| func (v Value) AsCSSRule() CSSRule { return CSSRule{Value: v} } | |||
| func (c CSSRule) GetCssText() string { | |||
| val := c.Get("cssText") | |||
| return val.String() | |||
| } | |||
| func (c CSSRule) SetCssText(val string) { | |||
| c.Set("cssText", val) | |||
| } | |||
| func (c CSSRule) GetParentRule() CSSRule { | |||
| val := c.Get("parentRule") | |||
| return jsValueToCSSRule(val.JSValue()) | |||
| } | |||
| func (c CSSRule) GetParentStyleSheet() CSSStyleSheet { | |||
| val := c.Get("parentStyleSheet") | |||
| return jsValueToCSSStyleSheet(val.JSValue()) | |||
| } | |||
| func (c CSSRule) GetType() int { | |||
| val := c.Get("type") | |||
| return val.Int() | |||
| } | |||
| @ -0,0 +1,24 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssrulelist.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSRuleListIFace interface { | |||
| Item(args ...interface{}) CSSRule | |||
| GetLength() float64 | |||
| } | |||
| type CSSRuleList struct { | |||
| Value | |||
| } | |||
| func jsValueToCSSRuleList(val js.Value) CSSRuleList { return CSSRuleList{Value: Value{Value: val}} } | |||
| func (v Value) AsCSSRuleList() CSSRuleList { return CSSRuleList{Value: v} } | |||
| func (c CSSRuleList) Item(args ...interface{}) CSSRule { | |||
| val := c.Call("item", args...) | |||
| return jsValueToCSSRule(val.JSValue()) | |||
| } | |||
| func (c CSSRuleList) GetLength() float64 { | |||
| val := c.Get("length") | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,68 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssstyledeclaration.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSStyleDeclarationIFace interface { | |||
| GetCssFloat() string | |||
| SetCssFloat(string) | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| GetPropertyPriority(args ...interface{}) string | |||
| GetPropertyValue(args ...interface{}) string | |||
| Item(args ...interface{}) string | |||
| GetLength() float64 | |||
| GetParentRule() CSSRule | |||
| RemoveProperty(args ...interface{}) string | |||
| SetProperty(args ...interface{}) | |||
| } | |||
| type CSSStyleDeclaration struct { | |||
| Value | |||
| } | |||
| func jsValueToCSSStyleDeclaration(val js.Value) CSSStyleDeclaration { | |||
| return CSSStyleDeclaration{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCSSStyleDeclaration() CSSStyleDeclaration { return CSSStyleDeclaration{Value: v} } | |||
| func (c CSSStyleDeclaration) GetCssFloat() string { | |||
| val := c.Get("cssFloat") | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleDeclaration) SetCssFloat(val string) { | |||
| c.Set("cssFloat", val) | |||
| } | |||
| func (c CSSStyleDeclaration) GetCssText() string { | |||
| val := c.Get("cssText") | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleDeclaration) SetCssText(val string) { | |||
| c.Set("cssText", val) | |||
| } | |||
| func (c CSSStyleDeclaration) GetPropertyPriority(args ...interface{}) string { | |||
| val := c.Call("getPropertyPriority", args...) | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleDeclaration) GetPropertyValue(args ...interface{}) string { | |||
| val := c.Call("getPropertyValue", args...) | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleDeclaration) Item(args ...interface{}) string { | |||
| val := c.Call("item", args...) | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleDeclaration) GetLength() float64 { | |||
| val := c.Get("length") | |||
| return val.Float() | |||
| } | |||
| func (c CSSStyleDeclaration) GetParentRule() CSSRule { | |||
| val := c.Get("parentRule") | |||
| return jsValueToCSSRule(val.JSValue()) | |||
| } | |||
| func (c CSSStyleDeclaration) RemoveProperty(args ...interface{}) string { | |||
| val := c.Call("removeProperty", args...) | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleDeclaration) SetProperty(args ...interface{}) { | |||
| c.Call("setProperty", args...) | |||
| } | |||
| @ -0,0 +1,34 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssstylerule.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSStyleRuleIFace interface { | |||
| GetCssText() string | |||
| SetCssText(string) | |||
| GetParentRule() CSSRule | |||
| GetParentStyleSheet() CSSStyleSheet | |||
| GetSelectorText() string | |||
| SetSelectorText(string) | |||
| GetStyle() CSSStyleDeclaration | |||
| GetType() int | |||
| } | |||
| type CSSStyleRule struct { | |||
| Value | |||
| CSSRule | |||
| } | |||
| func jsValueToCSSStyleRule(val js.Value) CSSStyleRule { return CSSStyleRule{Value: Value{Value: val}} } | |||
| func (v Value) AsCSSStyleRule() CSSStyleRule { return CSSStyleRule{Value: v} } | |||
| func (c CSSStyleRule) GetSelectorText() string { | |||
| val := c.Get("selectorText") | |||
| return val.String() | |||
| } | |||
| func (c CSSStyleRule) SetSelectorText(val string) { | |||
| c.Set("selectorText", val) | |||
| } | |||
| func (c CSSStyleRule) GetStyle() CSSStyleDeclaration { | |||
| val := c.Get("style") | |||
| return jsValueToCSSStyleDeclaration(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,44 @@ | |||
| // Code generated DO NOT EDIT | |||
| // cssstylesheet.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CSSStyleSheetIFace interface { | |||
| GetCssRules() CSSRuleList | |||
| DeleteRule(args ...interface{}) | |||
| GetDisabled() bool | |||
| SetDisabled(bool) | |||
| GetHref() string | |||
| InsertRule(args ...interface{}) float64 | |||
| GetMedia() MediaList | |||
| GetOwnerNode() | |||
| GetOwnerRule() CSSRule | |||
| GetParentStyleSheet() StyleSheet | |||
| GetTitle() string | |||
| GetType() string | |||
| } | |||
| type CSSStyleSheet struct { | |||
| Value | |||
| StyleSheet | |||
| } | |||
| func jsValueToCSSStyleSheet(val js.Value) CSSStyleSheet { | |||
| return CSSStyleSheet{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCSSStyleSheet() CSSStyleSheet { return CSSStyleSheet{Value: v} } | |||
| func (c CSSStyleSheet) GetCssRules() CSSRuleList { | |||
| val := c.Get("cssRules") | |||
| return jsValueToCSSRuleList(val.JSValue()) | |||
| } | |||
| func (c CSSStyleSheet) DeleteRule(args ...interface{}) { | |||
| c.Call("deleteRule", args...) | |||
| } | |||
| func (c CSSStyleSheet) InsertRule(args ...interface{}) float64 { | |||
| val := c.Call("insertRule", args...) | |||
| return val.Float() | |||
| } | |||
| func (c CSSStyleSheet) GetOwnerRule() CSSRule { | |||
| val := c.Get("ownerRule") | |||
| return jsValueToCSSRule(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,20 @@ | |||
| // Code generated DO NOT EDIT | |||
| // customelementconstructor.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CustomElementConstructorCallback func() Value | |||
| type CustomElementConstructor struct { | |||
| Callback | |||
| } | |||
| func jsValueToCustomElementConstructor(val js.Value) CustomElementConstructor { | |||
| return CustomElementConstructor{Callback: jsValueToCallback(val)} | |||
| } | |||
| func NewCustomElementConstructor(c CustomElementConstructorCallback) CustomElementConstructor { | |||
| callback := js.NewCallback(func(args []js.Value) { | |||
| c() | |||
| }) | |||
| return CustomElementConstructor{Callback: Callback{Callback: callback}} | |||
| } | |||
| @ -0,0 +1,33 @@ | |||
| // Code generated DO NOT EDIT | |||
| // customelementregistry.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CustomElementRegistryIFace interface { | |||
| Define(args ...interface{}) | |||
| Get(args ...interface{}) Value | |||
| Upgrade(args ...interface{}) | |||
| WhenDefined(args ...interface{}) | |||
| } | |||
| type CustomElementRegistry struct { | |||
| Value | |||
| } | |||
| func jsValueToCustomElementRegistry(val js.Value) CustomElementRegistry { | |||
| return CustomElementRegistry{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsCustomElementRegistry() CustomElementRegistry { return CustomElementRegistry{Value: v} } | |||
| func (c CustomElementRegistry) Define(args ...interface{}) { | |||
| c.Call("define", args...) | |||
| } | |||
| func (c CustomElementRegistry) Get(args ...interface{}) Value { | |||
| val := c.Call("get", args...) | |||
| return val | |||
| } | |||
| func (c CustomElementRegistry) Upgrade(args ...interface{}) { | |||
| c.Call("upgrade", args...) | |||
| } | |||
| func (c CustomElementRegistry) WhenDefined(args ...interface{}) { | |||
| c.Call("whenDefined", args...) | |||
| } | |||
| @ -0,0 +1,44 @@ | |||
| // Code generated DO NOT EDIT | |||
| // customevent.go | |||
| package dom | |||
| import "syscall/js" | |||
| type CustomEventIFace interface { | |||
| GetBubbles() bool | |||
| GetCancelBubble() bool | |||
| SetCancelBubble(bool) | |||
| GetCancelable() bool | |||
| GetComposed() bool | |||
| ComposedPath(args ...interface{}) | |||
| GetCurrentTarget() EventTarget | |||
| GetDefaultPrevented() bool | |||
| GetDetail() Value | |||
| GetEventPhase() int | |||
| InitCustomEvent(args ...interface{}) | |||
| InitEvent(args ...interface{}) | |||
| GetIsTrusted() bool | |||
| PreventDefault(args ...interface{}) | |||
| GetReturnValue() bool | |||
| SetReturnValue(bool) | |||
| GetSrcElement() EventTarget | |||
| StopImmediatePropagation(args ...interface{}) | |||
| StopPropagation(args ...interface{}) | |||
| GetTarget() EventTarget | |||
| GetTimeStamp() DOMHighResTimeStamp | |||
| GetType() string | |||
| } | |||
| type CustomEvent struct { | |||
| Value | |||
| Event | |||
| } | |||
| func jsValueToCustomEvent(val js.Value) CustomEvent { return CustomEvent{Value: Value{Value: val}} } | |||
| func (v Value) AsCustomEvent() CustomEvent { return CustomEvent{Value: v} } | |||
| func (c CustomEvent) GetDetail() Value { | |||
| val := c.Get("detail") | |||
| return val | |||
| } | |||
| func (c CustomEvent) InitCustomEvent(args ...interface{}) { | |||
| c.Call("initCustomEvent", args...) | |||
| } | |||
| @ -0,0 +1,64 @@ | |||
| // Code generated DO NOT EDIT | |||
| // datatransfer.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DataTransferIFace interface { | |||
| ClearData(args ...interface{}) | |||
| GetDropEffect() string | |||
| SetDropEffect(string) | |||
| GetEffectAllowed() string | |||
| SetEffectAllowed(string) | |||
| GetFiles() FileList | |||
| GetData(args ...interface{}) string | |||
| GetItems() DataTransferItemList | |||
| SetData(args ...interface{}) | |||
| SetDragImage(args ...interface{}) | |||
| GetTypes() | |||
| } | |||
| type DataTransfer struct { | |||
| Value | |||
| } | |||
| func jsValueToDataTransfer(val js.Value) DataTransfer { return DataTransfer{Value: Value{Value: val}} } | |||
| func (v Value) AsDataTransfer() DataTransfer { return DataTransfer{Value: v} } | |||
| func (d DataTransfer) ClearData(args ...interface{}) { | |||
| d.Call("clearData", args...) | |||
| } | |||
| func (d DataTransfer) GetDropEffect() string { | |||
| val := d.Get("dropEffect") | |||
| return val.String() | |||
| } | |||
| func (d DataTransfer) SetDropEffect(val string) { | |||
| d.Set("dropEffect", val) | |||
| } | |||
| func (d DataTransfer) GetEffectAllowed() string { | |||
| val := d.Get("effectAllowed") | |||
| return val.String() | |||
| } | |||
| func (d DataTransfer) SetEffectAllowed(val string) { | |||
| d.Set("effectAllowed", val) | |||
| } | |||
| func (d DataTransfer) GetFiles() FileList { | |||
| val := d.Get("files") | |||
| return jsValueToFileList(val.JSValue()) | |||
| } | |||
| func (d DataTransfer) GetData(args ...interface{}) string { | |||
| val := d.Call("getData", args...) | |||
| return val.String() | |||
| } | |||
| func (d DataTransfer) GetItems() DataTransferItemList { | |||
| val := d.Get("items") | |||
| return jsValueToDataTransferItemList(val.JSValue()) | |||
| } | |||
| func (d DataTransfer) SetData(args ...interface{}) { | |||
| d.Call("setData", args...) | |||
| } | |||
| func (d DataTransfer) SetDragImage(args ...interface{}) { | |||
| d.Call("setDragImage", args...) | |||
| } | |||
| func (d DataTransfer) GetTypes() Value { | |||
| val := d.Get("types") | |||
| return val | |||
| } | |||
| @ -0,0 +1,35 @@ | |||
| // Code generated DO NOT EDIT | |||
| // datatransferitem.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DataTransferItemIFace interface { | |||
| GetAsFile(args ...interface{}) File | |||
| GetAsString(args ...interface{}) | |||
| GetKind() string | |||
| GetType() string | |||
| } | |||
| type DataTransferItem struct { | |||
| Value | |||
| } | |||
| func jsValueToDataTransferItem(val js.Value) DataTransferItem { | |||
| return DataTransferItem{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDataTransferItem() DataTransferItem { return DataTransferItem{Value: v} } | |||
| func (d DataTransferItem) GetAsFile(args ...interface{}) File { | |||
| val := d.Call("getAsFile", args...) | |||
| return jsValueToFile(val.JSValue()) | |||
| } | |||
| func (d DataTransferItem) GetAsString(args ...interface{}) { | |||
| d.Call("getAsString", args...) | |||
| } | |||
| func (d DataTransferItem) GetKind() string { | |||
| val := d.Get("kind") | |||
| return val.String() | |||
| } | |||
| func (d DataTransferItem) GetType() string { | |||
| val := d.Get("type") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,39 @@ | |||
| // Code generated DO NOT EDIT | |||
| // datatransferitemlist.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DataTransferItemListIFace interface { | |||
| Add(args ...interface{}) DataTransferItem | |||
| AddWithArgs(args ...interface{}) DataTransferItem | |||
| Clear(args ...interface{}) | |||
| GetLength() float64 | |||
| Remove(args ...interface{}) | |||
| } | |||
| type DataTransferItemList struct { | |||
| Value | |||
| } | |||
| func jsValueToDataTransferItemList(val js.Value) DataTransferItemList { | |||
| return DataTransferItemList{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDataTransferItemList() DataTransferItemList { return DataTransferItemList{Value: v} } | |||
| func (d DataTransferItemList) Add(args ...interface{}) DataTransferItem { | |||
| val := d.Call("add", args...) | |||
| return jsValueToDataTransferItem(val.JSValue()) | |||
| } | |||
| func (d DataTransferItemList) AddWithArgs(args ...interface{}) DataTransferItem { | |||
| val := d.Call("addWithArgs", args...) | |||
| return jsValueToDataTransferItem(val.JSValue()) | |||
| } | |||
| func (d DataTransferItemList) Clear(args ...interface{}) { | |||
| d.Call("clear", args...) | |||
| } | |||
| func (d DataTransferItemList) GetLength() float64 { | |||
| val := d.Get("length") | |||
| return val.Float() | |||
| } | |||
| func (d DataTransferItemList) Remove(args ...interface{}) { | |||
| d.Call("remove", args...) | |||
| } | |||
| @ -0,0 +1,79 @@ | |||
| // Code generated DO NOT EDIT | |||
| // dedicatedworkerglobalscope.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DedicatedWorkerGlobalScopeIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| CancelAnimationFrame(args ...interface{}) | |||
| Close(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| ImportScripts(args ...interface{}) | |||
| GetLocation() WorkerLocation | |||
| GetName() string | |||
| GetNavigator() WorkerNavigator | |||
| GetOnerror() OnErrorEventHandler | |||
| SetOnerror(OnErrorEventHandler) | |||
| GetOnlanguagechange() EventHandler | |||
| SetOnlanguagechange(EventHandler) | |||
| GetOnmessage() EventHandler | |||
| SetOnmessage(EventHandler) | |||
| GetOnmessageerror() EventHandler | |||
| SetOnmessageerror(EventHandler) | |||
| GetOnoffline() EventHandler | |||
| SetOnoffline(EventHandler) | |||
| GetOnonline() EventHandler | |||
| SetOnonline(EventHandler) | |||
| GetOnrejectionhandled() EventHandler | |||
| SetOnrejectionhandled(EventHandler) | |||
| GetOnunhandledrejection() EventHandler | |||
| SetOnunhandledrejection(EventHandler) | |||
| PostMessage(args ...interface{}) | |||
| RemoveEventListener(args ...interface{}) | |||
| RequestAnimationFrame(args ...interface{}) float64 | |||
| GetSelf() WorkerGlobalScope | |||
| } | |||
| type DedicatedWorkerGlobalScope struct { | |||
| Value | |||
| WorkerGlobalScope | |||
| EventTarget | |||
| } | |||
| func jsValueToDedicatedWorkerGlobalScope(val js.Value) DedicatedWorkerGlobalScope { | |||
| return DedicatedWorkerGlobalScope{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDedicatedWorkerGlobalScope() DedicatedWorkerGlobalScope { | |||
| return DedicatedWorkerGlobalScope{Value: v} | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) CancelAnimationFrame(args ...interface{}) { | |||
| d.Call("cancelAnimationFrame", args...) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) Close(args ...interface{}) { | |||
| d.Call("close", args...) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) GetName() string { | |||
| val := d.Get("name") | |||
| return val.String() | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) GetOnmessage() EventHandler { | |||
| val := d.Get("onmessage") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) SetOnmessage(val EventHandler) { | |||
| d.Set("onmessage", val) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) GetOnmessageerror() EventHandler { | |||
| val := d.Get("onmessageerror") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) SetOnmessageerror(val EventHandler) { | |||
| d.Set("onmessageerror", val) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) PostMessage(args ...interface{}) { | |||
| d.Call("postMessage", args...) | |||
| } | |||
| func (d DedicatedWorkerGlobalScope) RequestAnimationFrame(args ...interface{}) float64 { | |||
| val := d.Call("requestAnimationFrame", args...) | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,823 @@ | |||
| // Code generated DO NOT EDIT | |||
| // document.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DocumentIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| AdoptNode(args ...interface{}) Node | |||
| Append(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| GetBaseURI() string | |||
| GetCharacterSet() string | |||
| GetCharset() string | |||
| GetChildElementCount() float64 | |||
| GetChildNodes() NodeList | |||
| GetChildren() HTMLCollection | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| GetCompatMode() string | |||
| Contains(args ...interface{}) bool | |||
| GetContentType() string | |||
| CreateAttribute(args ...interface{}) Attr | |||
| CreateAttributeNS(args ...interface{}) Attr | |||
| CreateCDATASection(args ...interface{}) CDATASection | |||
| CreateComment(args ...interface{}) Comment | |||
| CreateDocumentFragment(args ...interface{}) DocumentFragment | |||
| CreateElement(args ...interface{}) Element | |||
| CreateElementNS(args ...interface{}) Element | |||
| CreateEvent(args ...interface{}) Event | |||
| CreateNodeIterator(args ...interface{}) NodeIterator | |||
| CreateProcessingInstruction(args ...interface{}) ProcessingInstruction | |||
| CreateRange(args ...interface{}) Range | |||
| CreateTextNode(args ...interface{}) Text | |||
| CreateTreeWalker(args ...interface{}) TreeWalker | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetDoctype() DocumentType | |||
| GetDocumentElement() Element | |||
| GetDocumentURI() string | |||
| GetFirstChild() Node | |||
| GetFirstElementChild() Element | |||
| GetElementById(args ...interface{}) Element | |||
| GetElementsByClassName(args ...interface{}) HTMLCollection | |||
| GetElementsByTagName(args ...interface{}) HTMLCollection | |||
| GetElementsByTagNameNS(args ...interface{}) HTMLCollection | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| GetImplementation() DOMImplementation | |||
| ImportNode(args ...interface{}) Node | |||
| GetInputEncoding() string | |||
| InsertBefore(args ...interface{}) Node | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLastElementChild() Element | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOnabort() EventHandler | |||
| SetOnabort(EventHandler) | |||
| GetOnauxclick() EventHandler | |||
| SetOnauxclick(EventHandler) | |||
| GetOnblur() EventHandler | |||
| SetOnblur(EventHandler) | |||
| GetOncancel() EventHandler | |||
| SetOncancel(EventHandler) | |||
| GetOncanplay() EventHandler | |||
| SetOncanplay(EventHandler) | |||
| GetOncanplaythrough() EventHandler | |||
| SetOncanplaythrough(EventHandler) | |||
| GetOnchange() EventHandler | |||
| SetOnchange(EventHandler) | |||
| GetOnclick() EventHandler | |||
| SetOnclick(EventHandler) | |||
| GetOnclose() EventHandler | |||
| SetOnclose(EventHandler) | |||
| GetOncontextmenu() EventHandler | |||
| SetOncontextmenu(EventHandler) | |||
| GetOncopy() EventHandler | |||
| SetOncopy(EventHandler) | |||
| GetOncuechange() EventHandler | |||
| SetOncuechange(EventHandler) | |||
| GetOncut() EventHandler | |||
| SetOncut(EventHandler) | |||
| GetOndblclick() EventHandler | |||
| SetOndblclick(EventHandler) | |||
| GetOndrag() EventHandler | |||
| SetOndrag(EventHandler) | |||
| GetOndragend() EventHandler | |||
| SetOndragend(EventHandler) | |||
| GetOndragenter() EventHandler | |||
| SetOndragenter(EventHandler) | |||
| GetOndragexit() EventHandler | |||
| SetOndragexit(EventHandler) | |||
| GetOndragleave() EventHandler | |||
| SetOndragleave(EventHandler) | |||
| GetOndragover() EventHandler | |||
| SetOndragover(EventHandler) | |||
| GetOndragstart() EventHandler | |||
| SetOndragstart(EventHandler) | |||
| GetOndrop() EventHandler | |||
| SetOndrop(EventHandler) | |||
| GetOndurationchange() EventHandler | |||
| SetOndurationchange(EventHandler) | |||
| GetOnemptied() EventHandler | |||
| SetOnemptied(EventHandler) | |||
| GetOnended() EventHandler | |||
| SetOnended(EventHandler) | |||
| GetOnerror() OnErrorEventHandler | |||
| SetOnerror(OnErrorEventHandler) | |||
| GetOnfocus() EventHandler | |||
| SetOnfocus(EventHandler) | |||
| GetOninput() EventHandler | |||
| SetOninput(EventHandler) | |||
| GetOninvalid() EventHandler | |||
| SetOninvalid(EventHandler) | |||
| GetOnkeydown() EventHandler | |||
| SetOnkeydown(EventHandler) | |||
| GetOnkeypress() EventHandler | |||
| SetOnkeypress(EventHandler) | |||
| GetOnkeyup() EventHandler | |||
| SetOnkeyup(EventHandler) | |||
| GetOnload() EventHandler | |||
| SetOnload(EventHandler) | |||
| GetOnloadeddata() EventHandler | |||
| SetOnloadeddata(EventHandler) | |||
| GetOnloadedmetadata() EventHandler | |||
| SetOnloadedmetadata(EventHandler) | |||
| GetOnloadend() EventHandler | |||
| SetOnloadend(EventHandler) | |||
| GetOnloadstart() EventHandler | |||
| SetOnloadstart(EventHandler) | |||
| GetOnmousedown() EventHandler | |||
| SetOnmousedown(EventHandler) | |||
| GetOnmouseenter() EventHandler | |||
| SetOnmouseenter(EventHandler) | |||
| GetOnmouseleave() EventHandler | |||
| SetOnmouseleave(EventHandler) | |||
| GetOnmousemove() EventHandler | |||
| SetOnmousemove(EventHandler) | |||
| GetOnmouseout() EventHandler | |||
| SetOnmouseout(EventHandler) | |||
| GetOnmouseover() EventHandler | |||
| SetOnmouseover(EventHandler) | |||
| GetOnmouseup() EventHandler | |||
| SetOnmouseup(EventHandler) | |||
| GetOnpaste() EventHandler | |||
| SetOnpaste(EventHandler) | |||
| GetOnpause() EventHandler | |||
| SetOnpause(EventHandler) | |||
| GetOnplay() EventHandler | |||
| SetOnplay(EventHandler) | |||
| GetOnplaying() EventHandler | |||
| SetOnplaying(EventHandler) | |||
| GetOnprogress() EventHandler | |||
| SetOnprogress(EventHandler) | |||
| GetOnratechange() EventHandler | |||
| SetOnratechange(EventHandler) | |||
| GetOnreset() EventHandler | |||
| SetOnreset(EventHandler) | |||
| GetOnresize() EventHandler | |||
| SetOnresize(EventHandler) | |||
| GetOnscroll() EventHandler | |||
| SetOnscroll(EventHandler) | |||
| GetOnsecuritypolicyviolation() EventHandler | |||
| SetOnsecuritypolicyviolation(EventHandler) | |||
| GetOnseeked() EventHandler | |||
| SetOnseeked(EventHandler) | |||
| GetOnseeking() EventHandler | |||
| SetOnseeking(EventHandler) | |||
| GetOnselect() EventHandler | |||
| SetOnselect(EventHandler) | |||
| GetOnstalled() EventHandler | |||
| SetOnstalled(EventHandler) | |||
| GetOnsubmit() EventHandler | |||
| SetOnsubmit(EventHandler) | |||
| GetOnsuspend() EventHandler | |||
| SetOnsuspend(EventHandler) | |||
| GetOntimeupdate() EventHandler | |||
| SetOntimeupdate(EventHandler) | |||
| GetOntoggle() EventHandler | |||
| SetOntoggle(EventHandler) | |||
| GetOnvolumechange() EventHandler | |||
| SetOnvolumechange(EventHandler) | |||
| GetOnwaiting() EventHandler | |||
| SetOnwaiting(EventHandler) | |||
| GetOnwheel() EventHandler | |||
| SetOnwheel(EventHandler) | |||
| GetOrigin() string | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| Prepend(args ...interface{}) | |||
| GetPreviousSibling() Node | |||
| QuerySelector(args ...interface{}) Element | |||
| QuerySelectorAll(args ...interface{}) NodeList | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| GetURL() string | |||
| } | |||
| type Document struct { | |||
| Value | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToDocument(val js.Value) Document { return Document{Value: Value{Value: val}} } | |||
| func (v Value) AsDocument() Document { return Document{Value: v} } | |||
| func (d Document) AdoptNode(args ...interface{}) Node { | |||
| val := d.Call("adoptNode", args...) | |||
| return jsValueToNode(val.JSValue()) | |||
| } | |||
| func (d Document) Append(args ...interface{}) { | |||
| d.Call("append", args...) | |||
| } | |||
| func (d Document) GetCharacterSet() string { | |||
| val := d.Get("characterSet") | |||
| return val.String() | |||
| } | |||
| func (d Document) GetCharset() string { | |||
| val := d.Get("charset") | |||
| return val.String() | |||
| } | |||
| func (d Document) GetChildElementCount() float64 { | |||
| val := d.Get("childElementCount") | |||
| return val.Float() | |||
| } | |||
| func (d Document) GetChildren() HTMLCollection { | |||
| val := d.Get("children") | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (d Document) GetCompatMode() string { | |||
| val := d.Get("compatMode") | |||
| return val.String() | |||
| } | |||
| func (d Document) GetContentType() string { | |||
| val := d.Get("contentType") | |||
| return val.String() | |||
| } | |||
| func (d Document) CreateAttribute(args ...interface{}) Attr { | |||
| val := d.Call("createAttribute", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (d Document) CreateAttributeNS(args ...interface{}) Attr { | |||
| val := d.Call("createAttributeNS", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (d Document) CreateCDATASection(args ...interface{}) CDATASection { | |||
| val := d.Call("createCDATASection", args...) | |||
| return jsValueToCDATASection(val.JSValue()) | |||
| } | |||
| func (d Document) CreateComment(args ...interface{}) Comment { | |||
| val := d.Call("createComment", args...) | |||
| return jsValueToComment(val.JSValue()) | |||
| } | |||
| func (d Document) CreateDocumentFragment(args ...interface{}) DocumentFragment { | |||
| val := d.Call("createDocumentFragment", args...) | |||
| return jsValueToDocumentFragment(val.JSValue()) | |||
| } | |||
| func (d Document) CreateElement(args ...interface{}) Element { | |||
| val := d.Call("createElement", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) CreateElementNS(args ...interface{}) Element { | |||
| val := d.Call("createElementNS", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) CreateEvent(args ...interface{}) Event { | |||
| val := d.Call("createEvent", args...) | |||
| return jsValueToEvent(val.JSValue()) | |||
| } | |||
| func (d Document) CreateNodeIterator(args ...interface{}) NodeIterator { | |||
| val := d.Call("createNodeIterator", args...) | |||
| return jsValueToNodeIterator(val.JSValue()) | |||
| } | |||
| func (d Document) CreateProcessingInstruction(args ...interface{}) ProcessingInstruction { | |||
| val := d.Call("createProcessingInstruction", args...) | |||
| return jsValueToProcessingInstruction(val.JSValue()) | |||
| } | |||
| func (d Document) CreateRange(args ...interface{}) Range { | |||
| val := d.Call("createRange", args...) | |||
| return jsValueToRange(val.JSValue()) | |||
| } | |||
| func (d Document) CreateTextNode(args ...interface{}) Text { | |||
| val := d.Call("createTextNode", args...) | |||
| return jsValueToText(val.JSValue()) | |||
| } | |||
| func (d Document) CreateTreeWalker(args ...interface{}) TreeWalker { | |||
| val := d.Call("createTreeWalker", args...) | |||
| return jsValueToTreeWalker(val.JSValue()) | |||
| } | |||
| func (d Document) GetDoctype() DocumentType { | |||
| val := d.Get("doctype") | |||
| return jsValueToDocumentType(val.JSValue()) | |||
| } | |||
| func (d Document) GetDocumentElement() Element { | |||
| val := d.Get("documentElement") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) GetDocumentURI() string { | |||
| val := d.Get("documentURI") | |||
| return val.String() | |||
| } | |||
| func (d Document) GetFirstElementChild() Element { | |||
| val := d.Get("firstElementChild") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) GetElementById(args ...interface{}) Element { | |||
| val := d.Call("getElementById", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) GetElementsByClassName(args ...interface{}) HTMLCollection { | |||
| val := d.Call("getElementsByClassName", args...) | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (d Document) GetElementsByTagName(args ...interface{}) HTMLCollection { | |||
| val := d.Call("getElementsByTagName", args...) | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (d Document) GetElementsByTagNameNS(args ...interface{}) HTMLCollection { | |||
| val := d.Call("getElementsByTagNameNS", args...) | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (d Document) GetImplementation() DOMImplementation { | |||
| val := d.Get("implementation") | |||
| return jsValueToDOMImplementation(val.JSValue()) | |||
| } | |||
| func (d Document) ImportNode(args ...interface{}) Node { | |||
| val := d.Call("importNode", args...) | |||
| return jsValueToNode(val.JSValue()) | |||
| } | |||
| func (d Document) GetInputEncoding() string { | |||
| val := d.Get("inputEncoding") | |||
| return val.String() | |||
| } | |||
| func (d Document) GetLastElementChild() Element { | |||
| val := d.Get("lastElementChild") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) GetOnabort() EventHandler { | |||
| val := d.Get("onabort") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnabort(val EventHandler) { | |||
| d.Set("onabort", val) | |||
| } | |||
| func (d Document) GetOnauxclick() EventHandler { | |||
| val := d.Get("onauxclick") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnauxclick(val EventHandler) { | |||
| d.Set("onauxclick", val) | |||
| } | |||
| func (d Document) GetOnblur() EventHandler { | |||
| val := d.Get("onblur") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnblur(val EventHandler) { | |||
| d.Set("onblur", val) | |||
| } | |||
| func (d Document) GetOncancel() EventHandler { | |||
| val := d.Get("oncancel") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncancel(val EventHandler) { | |||
| d.Set("oncancel", val) | |||
| } | |||
| func (d Document) GetOncanplay() EventHandler { | |||
| val := d.Get("oncanplay") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncanplay(val EventHandler) { | |||
| d.Set("oncanplay", val) | |||
| } | |||
| func (d Document) GetOncanplaythrough() EventHandler { | |||
| val := d.Get("oncanplaythrough") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncanplaythrough(val EventHandler) { | |||
| d.Set("oncanplaythrough", val) | |||
| } | |||
| func (d Document) GetOnchange() EventHandler { | |||
| val := d.Get("onchange") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnchange(val EventHandler) { | |||
| d.Set("onchange", val) | |||
| } | |||
| func (d Document) GetOnclick() EventHandler { | |||
| val := d.Get("onclick") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnclick(val EventHandler) { | |||
| d.Set("onclick", val) | |||
| } | |||
| func (d Document) GetOnclose() EventHandler { | |||
| val := d.Get("onclose") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnclose(val EventHandler) { | |||
| d.Set("onclose", val) | |||
| } | |||
| func (d Document) GetOncontextmenu() EventHandler { | |||
| val := d.Get("oncontextmenu") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncontextmenu(val EventHandler) { | |||
| d.Set("oncontextmenu", val) | |||
| } | |||
| func (d Document) GetOncopy() EventHandler { | |||
| val := d.Get("oncopy") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncopy(val EventHandler) { | |||
| d.Set("oncopy", val) | |||
| } | |||
| func (d Document) GetOncuechange() EventHandler { | |||
| val := d.Get("oncuechange") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncuechange(val EventHandler) { | |||
| d.Set("oncuechange", val) | |||
| } | |||
| func (d Document) GetOncut() EventHandler { | |||
| val := d.Get("oncut") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOncut(val EventHandler) { | |||
| d.Set("oncut", val) | |||
| } | |||
| func (d Document) GetOndblclick() EventHandler { | |||
| val := d.Get("ondblclick") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndblclick(val EventHandler) { | |||
| d.Set("ondblclick", val) | |||
| } | |||
| func (d Document) GetOndrag() EventHandler { | |||
| val := d.Get("ondrag") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndrag(val EventHandler) { | |||
| d.Set("ondrag", val) | |||
| } | |||
| func (d Document) GetOndragend() EventHandler { | |||
| val := d.Get("ondragend") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndragend(val EventHandler) { | |||
| d.Set("ondragend", val) | |||
| } | |||
| func (d Document) GetOndragenter() EventHandler { | |||
| val := d.Get("ondragenter") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndragenter(val EventHandler) { | |||
| d.Set("ondragenter", val) | |||
| } | |||
| func (d Document) GetOndragexit() EventHandler { | |||
| val := d.Get("ondragexit") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndragexit(val EventHandler) { | |||
| d.Set("ondragexit", val) | |||
| } | |||
| func (d Document) GetOndragleave() EventHandler { | |||
| val := d.Get("ondragleave") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndragleave(val EventHandler) { | |||
| d.Set("ondragleave", val) | |||
| } | |||
| func (d Document) GetOndragover() EventHandler { | |||
| val := d.Get("ondragover") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndragover(val EventHandler) { | |||
| d.Set("ondragover", val) | |||
| } | |||
| func (d Document) GetOndragstart() EventHandler { | |||
| val := d.Get("ondragstart") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndragstart(val EventHandler) { | |||
| d.Set("ondragstart", val) | |||
| } | |||
| func (d Document) GetOndrop() EventHandler { | |||
| val := d.Get("ondrop") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndrop(val EventHandler) { | |||
| d.Set("ondrop", val) | |||
| } | |||
| func (d Document) GetOndurationchange() EventHandler { | |||
| val := d.Get("ondurationchange") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOndurationchange(val EventHandler) { | |||
| d.Set("ondurationchange", val) | |||
| } | |||
| func (d Document) GetOnemptied() EventHandler { | |||
| val := d.Get("onemptied") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnemptied(val EventHandler) { | |||
| d.Set("onemptied", val) | |||
| } | |||
| func (d Document) GetOnended() EventHandler { | |||
| val := d.Get("onended") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnended(val EventHandler) { | |||
| d.Set("onended", val) | |||
| } | |||
| func (d Document) GetOnerror() OnErrorEventHandler { | |||
| val := d.Get("onerror") | |||
| return jsValueToOnErrorEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnerror(val OnErrorEventHandler) { | |||
| d.Set("onerror", val) | |||
| } | |||
| func (d Document) GetOnfocus() EventHandler { | |||
| val := d.Get("onfocus") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnfocus(val EventHandler) { | |||
| d.Set("onfocus", val) | |||
| } | |||
| func (d Document) GetOninput() EventHandler { | |||
| val := d.Get("oninput") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOninput(val EventHandler) { | |||
| d.Set("oninput", val) | |||
| } | |||
| func (d Document) GetOninvalid() EventHandler { | |||
| val := d.Get("oninvalid") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOninvalid(val EventHandler) { | |||
| d.Set("oninvalid", val) | |||
| } | |||
| func (d Document) GetOnkeydown() EventHandler { | |||
| val := d.Get("onkeydown") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnkeydown(val EventHandler) { | |||
| d.Set("onkeydown", val) | |||
| } | |||
| func (d Document) GetOnkeypress() EventHandler { | |||
| val := d.Get("onkeypress") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnkeypress(val EventHandler) { | |||
| d.Set("onkeypress", val) | |||
| } | |||
| func (d Document) GetOnkeyup() EventHandler { | |||
| val := d.Get("onkeyup") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnkeyup(val EventHandler) { | |||
| d.Set("onkeyup", val) | |||
| } | |||
| func (d Document) GetOnload() EventHandler { | |||
| val := d.Get("onload") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnload(val EventHandler) { | |||
| d.Set("onload", val) | |||
| } | |||
| func (d Document) GetOnloadeddata() EventHandler { | |||
| val := d.Get("onloadeddata") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnloadeddata(val EventHandler) { | |||
| d.Set("onloadeddata", val) | |||
| } | |||
| func (d Document) GetOnloadedmetadata() EventHandler { | |||
| val := d.Get("onloadedmetadata") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnloadedmetadata(val EventHandler) { | |||
| d.Set("onloadedmetadata", val) | |||
| } | |||
| func (d Document) GetOnloadend() EventHandler { | |||
| val := d.Get("onloadend") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnloadend(val EventHandler) { | |||
| d.Set("onloadend", val) | |||
| } | |||
| func (d Document) GetOnloadstart() EventHandler { | |||
| val := d.Get("onloadstart") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnloadstart(val EventHandler) { | |||
| d.Set("onloadstart", val) | |||
| } | |||
| func (d Document) GetOnmousedown() EventHandler { | |||
| val := d.Get("onmousedown") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmousedown(val EventHandler) { | |||
| d.Set("onmousedown", val) | |||
| } | |||
| func (d Document) GetOnmouseenter() EventHandler { | |||
| val := d.Get("onmouseenter") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmouseenter(val EventHandler) { | |||
| d.Set("onmouseenter", val) | |||
| } | |||
| func (d Document) GetOnmouseleave() EventHandler { | |||
| val := d.Get("onmouseleave") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmouseleave(val EventHandler) { | |||
| d.Set("onmouseleave", val) | |||
| } | |||
| func (d Document) GetOnmousemove() EventHandler { | |||
| val := d.Get("onmousemove") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmousemove(val EventHandler) { | |||
| d.Set("onmousemove", val) | |||
| } | |||
| func (d Document) GetOnmouseout() EventHandler { | |||
| val := d.Get("onmouseout") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmouseout(val EventHandler) { | |||
| d.Set("onmouseout", val) | |||
| } | |||
| func (d Document) GetOnmouseover() EventHandler { | |||
| val := d.Get("onmouseover") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmouseover(val EventHandler) { | |||
| d.Set("onmouseover", val) | |||
| } | |||
| func (d Document) GetOnmouseup() EventHandler { | |||
| val := d.Get("onmouseup") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnmouseup(val EventHandler) { | |||
| d.Set("onmouseup", val) | |||
| } | |||
| func (d Document) GetOnpaste() EventHandler { | |||
| val := d.Get("onpaste") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnpaste(val EventHandler) { | |||
| d.Set("onpaste", val) | |||
| } | |||
| func (d Document) GetOnpause() EventHandler { | |||
| val := d.Get("onpause") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnpause(val EventHandler) { | |||
| d.Set("onpause", val) | |||
| } | |||
| func (d Document) GetOnplay() EventHandler { | |||
| val := d.Get("onplay") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnplay(val EventHandler) { | |||
| d.Set("onplay", val) | |||
| } | |||
| func (d Document) GetOnplaying() EventHandler { | |||
| val := d.Get("onplaying") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnplaying(val EventHandler) { | |||
| d.Set("onplaying", val) | |||
| } | |||
| func (d Document) GetOnprogress() EventHandler { | |||
| val := d.Get("onprogress") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnprogress(val EventHandler) { | |||
| d.Set("onprogress", val) | |||
| } | |||
| func (d Document) GetOnratechange() EventHandler { | |||
| val := d.Get("onratechange") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnratechange(val EventHandler) { | |||
| d.Set("onratechange", val) | |||
| } | |||
| func (d Document) GetOnreset() EventHandler { | |||
| val := d.Get("onreset") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnreset(val EventHandler) { | |||
| d.Set("onreset", val) | |||
| } | |||
| func (d Document) GetOnresize() EventHandler { | |||
| val := d.Get("onresize") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnresize(val EventHandler) { | |||
| d.Set("onresize", val) | |||
| } | |||
| func (d Document) GetOnscroll() EventHandler { | |||
| val := d.Get("onscroll") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnscroll(val EventHandler) { | |||
| d.Set("onscroll", val) | |||
| } | |||
| func (d Document) GetOnsecuritypolicyviolation() EventHandler { | |||
| val := d.Get("onsecuritypolicyviolation") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnsecuritypolicyviolation(val EventHandler) { | |||
| d.Set("onsecuritypolicyviolation", val) | |||
| } | |||
| func (d Document) GetOnseeked() EventHandler { | |||
| val := d.Get("onseeked") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnseeked(val EventHandler) { | |||
| d.Set("onseeked", val) | |||
| } | |||
| func (d Document) GetOnseeking() EventHandler { | |||
| val := d.Get("onseeking") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnseeking(val EventHandler) { | |||
| d.Set("onseeking", val) | |||
| } | |||
| func (d Document) GetOnselect() EventHandler { | |||
| val := d.Get("onselect") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnselect(val EventHandler) { | |||
| d.Set("onselect", val) | |||
| } | |||
| func (d Document) GetOnstalled() EventHandler { | |||
| val := d.Get("onstalled") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnstalled(val EventHandler) { | |||
| d.Set("onstalled", val) | |||
| } | |||
| func (d Document) GetOnsubmit() EventHandler { | |||
| val := d.Get("onsubmit") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnsubmit(val EventHandler) { | |||
| d.Set("onsubmit", val) | |||
| } | |||
| func (d Document) GetOnsuspend() EventHandler { | |||
| val := d.Get("onsuspend") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnsuspend(val EventHandler) { | |||
| d.Set("onsuspend", val) | |||
| } | |||
| func (d Document) GetOntimeupdate() EventHandler { | |||
| val := d.Get("ontimeupdate") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOntimeupdate(val EventHandler) { | |||
| d.Set("ontimeupdate", val) | |||
| } | |||
| func (d Document) GetOntoggle() EventHandler { | |||
| val := d.Get("ontoggle") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOntoggle(val EventHandler) { | |||
| d.Set("ontoggle", val) | |||
| } | |||
| func (d Document) GetOnvolumechange() EventHandler { | |||
| val := d.Get("onvolumechange") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnvolumechange(val EventHandler) { | |||
| d.Set("onvolumechange", val) | |||
| } | |||
| func (d Document) GetOnwaiting() EventHandler { | |||
| val := d.Get("onwaiting") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnwaiting(val EventHandler) { | |||
| d.Set("onwaiting", val) | |||
| } | |||
| func (d Document) GetOnwheel() EventHandler { | |||
| val := d.Get("onwheel") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (d Document) SetOnwheel(val EventHandler) { | |||
| d.Set("onwheel", val) | |||
| } | |||
| func (d Document) GetOrigin() string { | |||
| val := d.Get("origin") | |||
| return val.String() | |||
| } | |||
| func (d Document) Prepend(args ...interface{}) { | |||
| d.Call("prepend", args...) | |||
| } | |||
| func (d Document) QuerySelector(args ...interface{}) Element { | |||
| val := d.Call("querySelector", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d Document) QuerySelectorAll(args ...interface{}) NodeList { | |||
| val := d.Call("querySelectorAll", args...) | |||
| return jsValueToNodeList(val.JSValue()) | |||
| } | |||
| func (d Document) GetURL() string { | |||
| val := d.Get("URL") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,13 @@ | |||
| package document | |||
| import ( | |||
| "syscall/js" | |||
| dom "github.com/brettlangdon/go-dom/v1" | |||
| ) | |||
| var value dom.Document | |||
| func init() { | |||
| value = dom.Value{Value: js.Global().Get("document")}.AsDocument() | |||
| } | |||
| @ -0,0 +1,95 @@ | |||
| // Code generated DO NOT EDIT | |||
| // documentfragment.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DocumentFragmentIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| Append(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| GetBaseURI() string | |||
| GetChildElementCount() float64 | |||
| GetChildNodes() NodeList | |||
| GetChildren() HTMLCollection | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetFirstElementChild() Element | |||
| GetElementById(args ...interface{}) Element | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| InsertBefore(args ...interface{}) Node | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLastElementChild() Element | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| Prepend(args ...interface{}) | |||
| GetPreviousSibling() Node | |||
| QuerySelector(args ...interface{}) Element | |||
| QuerySelectorAll(args ...interface{}) NodeList | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| } | |||
| type DocumentFragment struct { | |||
| Value | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToDocumentFragment(val js.Value) DocumentFragment { | |||
| return DocumentFragment{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDocumentFragment() DocumentFragment { return DocumentFragment{Value: v} } | |||
| func (d DocumentFragment) Append(args ...interface{}) { | |||
| d.Call("append", args...) | |||
| } | |||
| func (d DocumentFragment) GetChildElementCount() float64 { | |||
| val := d.Get("childElementCount") | |||
| return val.Float() | |||
| } | |||
| func (d DocumentFragment) GetChildren() HTMLCollection { | |||
| val := d.Get("children") | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (d DocumentFragment) GetFirstElementChild() Element { | |||
| val := d.Get("firstElementChild") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d DocumentFragment) GetElementById(args ...interface{}) Element { | |||
| val := d.Call("getElementById", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d DocumentFragment) GetLastElementChild() Element { | |||
| val := d.Get("lastElementChild") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d DocumentFragment) Prepend(args ...interface{}) { | |||
| d.Call("prepend", args...) | |||
| } | |||
| func (d DocumentFragment) QuerySelector(args ...interface{}) Element { | |||
| val := d.Call("querySelector", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (d DocumentFragment) QuerySelectorAll(args ...interface{}) NodeList { | |||
| val := d.Call("querySelectorAll", args...) | |||
| return jsValueToNodeList(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,17 @@ | |||
| // Code generated DO NOT EDIT | |||
| // documentreadystate.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DocumentReadyState string | |||
| const ( | |||
| DocumentReadyStateLoading DocumentReadyState = "loading" | |||
| DocumentReadyStateInteractive DocumentReadyState = "interactive" | |||
| DocumentReadyStateComplete DocumentReadyState = "complete" | |||
| ) | |||
| func jsValueToDocumentReadyState(val js.Value) DocumentReadyState { | |||
| return DocumentReadyState(val.String()) | |||
| } | |||
| @ -0,0 +1,81 @@ | |||
| // Code generated DO NOT EDIT | |||
| // documenttype.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DocumentTypeIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| After(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| GetBaseURI() string | |||
| Before(args ...interface{}) | |||
| GetChildNodes() NodeList | |||
| CloneNode(args ...interface{}) Node | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetRootNode(args ...interface{}) Node | |||
| HasChildNodes(args ...interface{}) bool | |||
| InsertBefore(args ...interface{}) Node | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| GetName() string | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| GetPreviousSibling() Node | |||
| GetPublicId() string | |||
| Remove(args ...interface{}) | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| ReplaceWith(args ...interface{}) | |||
| GetSystemId() string | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| } | |||
| type DocumentType struct { | |||
| Value | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToDocumentType(val js.Value) DocumentType { return DocumentType{Value: Value{Value: val}} } | |||
| func (v Value) AsDocumentType() DocumentType { return DocumentType{Value: v} } | |||
| func (d DocumentType) After(args ...interface{}) { | |||
| d.Call("after", args...) | |||
| } | |||
| func (d DocumentType) Before(args ...interface{}) { | |||
| d.Call("before", args...) | |||
| } | |||
| func (d DocumentType) GetName() string { | |||
| val := d.Get("name") | |||
| return val.String() | |||
| } | |||
| func (d DocumentType) GetPublicId() string { | |||
| val := d.Get("publicId") | |||
| return val.String() | |||
| } | |||
| func (d DocumentType) Remove(args ...interface{}) { | |||
| d.Call("remove", args...) | |||
| } | |||
| func (d DocumentType) ReplaceWith(args ...interface{}) { | |||
| d.Call("replaceWith", args...) | |||
| } | |||
| func (d DocumentType) GetSystemId() string { | |||
| val := d.Get("systemId") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domexception.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMExceptionIFace interface { | |||
| GetCode() int | |||
| GetMessage() string | |||
| GetName() string | |||
| } | |||
| type DOMException struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMException(val js.Value) DOMException { return DOMException{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMException() DOMException { return DOMException{Value: v} } | |||
| func (d DOMException) GetCode() int { | |||
| val := d.Get("code") | |||
| return val.Int() | |||
| } | |||
| func (d DOMException) GetMessage() string { | |||
| val := d.Get("message") | |||
| return val.String() | |||
| } | |||
| func (d DOMException) GetName() string { | |||
| val := d.Get("name") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domhighrestimestamp.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMHighResTimeStamp float64 | |||
| func jsValueToDOMHighResTimeStamp(val js.Value) DOMHighResTimeStamp { | |||
| return DOMHighResTimeStamp(val.Float()) | |||
| } | |||
| @ -0,0 +1,36 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domimplementation.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMImplementationIFace interface { | |||
| CreateDocument(args ...interface{}) XMLDocument | |||
| CreateDocumentType(args ...interface{}) DocumentType | |||
| CreateHTMLDocument(args ...interface{}) Document | |||
| HasFeature(args ...interface{}) bool | |||
| } | |||
| type DOMImplementation struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMImplementation(val js.Value) DOMImplementation { | |||
| return DOMImplementation{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDOMImplementation() DOMImplementation { return DOMImplementation{Value: v} } | |||
| func (d DOMImplementation) CreateDocument(args ...interface{}) XMLDocument { | |||
| val := d.Call("createDocument", args...) | |||
| return jsValueToXMLDocument(val.JSValue()) | |||
| } | |||
| func (d DOMImplementation) CreateDocumentType(args ...interface{}) DocumentType { | |||
| val := d.Call("createDocumentType", args...) | |||
| return jsValueToDocumentType(val.JSValue()) | |||
| } | |||
| func (d DOMImplementation) CreateHTMLDocument(args ...interface{}) Document { | |||
| val := d.Call("createHTMLDocument", args...) | |||
| return jsValueToDocument(val.JSValue()) | |||
| } | |||
| func (d DOMImplementation) HasFeature(args ...interface{}) bool { | |||
| val := d.Call("hasFeature", args...) | |||
| return val.Bool() | |||
| } | |||
| @ -0,0 +1,306 @@ | |||
| // Code generated DO NOT EDIT | |||
| // dommatrix.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMMatrixIFace interface { | |||
| GetA() float64 | |||
| SetA(float64) | |||
| GetB() float64 | |||
| SetB(float64) | |||
| GetC() float64 | |||
| SetC(float64) | |||
| GetD() float64 | |||
| SetD(float64) | |||
| GetE() float64 | |||
| SetE(float64) | |||
| GetF() float64 | |||
| SetF(float64) | |||
| FlipX(args ...interface{}) DOMMatrix | |||
| FlipY(args ...interface{}) DOMMatrix | |||
| FromFloat32Array(args ...interface{}) DOMMatrix | |||
| FromFloat64Array(args ...interface{}) DOMMatrix | |||
| FromMatrix(args ...interface{}) DOMMatrix | |||
| Inverse(args ...interface{}) DOMMatrix | |||
| InvertSelf(args ...interface{}) DOMMatrix | |||
| GetIs2D() bool | |||
| GetIsIdentity() bool | |||
| GetM11() float64 | |||
| SetM11(float64) | |||
| GetM12() float64 | |||
| SetM12(float64) | |||
| GetM13() float64 | |||
| SetM13(float64) | |||
| GetM14() float64 | |||
| SetM14(float64) | |||
| GetM21() float64 | |||
| SetM21(float64) | |||
| GetM22() float64 | |||
| SetM22(float64) | |||
| GetM23() float64 | |||
| SetM23(float64) | |||
| GetM24() float64 | |||
| SetM24(float64) | |||
| GetM31() float64 | |||
| SetM31(float64) | |||
| GetM32() float64 | |||
| SetM32(float64) | |||
| GetM33() float64 | |||
| SetM33(float64) | |||
| GetM34() float64 | |||
| SetM34(float64) | |||
| GetM41() float64 | |||
| SetM41(float64) | |||
| GetM42() float64 | |||
| SetM42(float64) | |||
| GetM43() float64 | |||
| SetM43(float64) | |||
| GetM44() float64 | |||
| SetM44(float64) | |||
| Multiply(args ...interface{}) DOMMatrix | |||
| MultiplySelf(args ...interface{}) DOMMatrix | |||
| PreMultiplySelf(args ...interface{}) DOMMatrix | |||
| Rotate(args ...interface{}) DOMMatrix | |||
| RotateAxisAngle(args ...interface{}) DOMMatrix | |||
| RotateAxisAngleSelf(args ...interface{}) DOMMatrix | |||
| RotateFromVector(args ...interface{}) DOMMatrix | |||
| RotateFromVectorSelf(args ...interface{}) DOMMatrix | |||
| RotateSelf(args ...interface{}) DOMMatrix | |||
| Scale(args ...interface{}) DOMMatrix | |||
| Scale3d(args ...interface{}) DOMMatrix | |||
| Scale3dSelf(args ...interface{}) DOMMatrix | |||
| ScaleSelf(args ...interface{}) DOMMatrix | |||
| SetMatrixValue(args ...interface{}) DOMMatrix | |||
| SkewX(args ...interface{}) DOMMatrix | |||
| SkewXSelf(args ...interface{}) DOMMatrix | |||
| SkewY(args ...interface{}) DOMMatrix | |||
| SkewYSelf(args ...interface{}) DOMMatrix | |||
| ToFloat32Array(args ...interface{}) Float32Array | |||
| ToFloat64Array(args ...interface{}) Float64Array | |||
| ToJSON(args ...interface{}) Value | |||
| TransformPoint(args ...interface{}) DOMPoint | |||
| Translate(args ...interface{}) DOMMatrix | |||
| TranslateSelf(args ...interface{}) DOMMatrix | |||
| } | |||
| type DOMMatrix struct { | |||
| Value | |||
| DOMMatrixReadOnly | |||
| } | |||
| func jsValueToDOMMatrix(val js.Value) DOMMatrix { return DOMMatrix{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMMatrix() DOMMatrix { return DOMMatrix{Value: v} } | |||
| func (d DOMMatrix) GetA() float64 { | |||
| val := d.Get("a") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetA(val float64) { | |||
| d.Set("a", val) | |||
| } | |||
| func (d DOMMatrix) GetB() float64 { | |||
| val := d.Get("b") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetB(val float64) { | |||
| d.Set("b", val) | |||
| } | |||
| func (d DOMMatrix) GetC() float64 { | |||
| val := d.Get("c") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetC(val float64) { | |||
| d.Set("c", val) | |||
| } | |||
| func (d DOMMatrix) GetD() float64 { | |||
| val := d.Get("d") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetD(val float64) { | |||
| d.Set("d", val) | |||
| } | |||
| func (d DOMMatrix) GetE() float64 { | |||
| val := d.Get("e") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetE(val float64) { | |||
| d.Set("e", val) | |||
| } | |||
| func (d DOMMatrix) GetF() float64 { | |||
| val := d.Get("f") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetF(val float64) { | |||
| d.Set("f", val) | |||
| } | |||
| func (d DOMMatrix) FromFloat32Array(args ...interface{}) DOMMatrix { | |||
| val := d.Call("fromFloat32Array", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) FromFloat64Array(args ...interface{}) DOMMatrix { | |||
| val := d.Call("fromFloat64Array", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) FromMatrix(args ...interface{}) DOMMatrix { | |||
| val := d.Call("fromMatrix", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) InvertSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("invertSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) GetM11() float64 { | |||
| val := d.Get("m11") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM11(val float64) { | |||
| d.Set("m11", val) | |||
| } | |||
| func (d DOMMatrix) GetM12() float64 { | |||
| val := d.Get("m12") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM12(val float64) { | |||
| d.Set("m12", val) | |||
| } | |||
| func (d DOMMatrix) GetM13() float64 { | |||
| val := d.Get("m13") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM13(val float64) { | |||
| d.Set("m13", val) | |||
| } | |||
| func (d DOMMatrix) GetM14() float64 { | |||
| val := d.Get("m14") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM14(val float64) { | |||
| d.Set("m14", val) | |||
| } | |||
| func (d DOMMatrix) GetM21() float64 { | |||
| val := d.Get("m21") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM21(val float64) { | |||
| d.Set("m21", val) | |||
| } | |||
| func (d DOMMatrix) GetM22() float64 { | |||
| val := d.Get("m22") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM22(val float64) { | |||
| d.Set("m22", val) | |||
| } | |||
| func (d DOMMatrix) GetM23() float64 { | |||
| val := d.Get("m23") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM23(val float64) { | |||
| d.Set("m23", val) | |||
| } | |||
| func (d DOMMatrix) GetM24() float64 { | |||
| val := d.Get("m24") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM24(val float64) { | |||
| d.Set("m24", val) | |||
| } | |||
| func (d DOMMatrix) GetM31() float64 { | |||
| val := d.Get("m31") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM31(val float64) { | |||
| d.Set("m31", val) | |||
| } | |||
| func (d DOMMatrix) GetM32() float64 { | |||
| val := d.Get("m32") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM32(val float64) { | |||
| d.Set("m32", val) | |||
| } | |||
| func (d DOMMatrix) GetM33() float64 { | |||
| val := d.Get("m33") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM33(val float64) { | |||
| d.Set("m33", val) | |||
| } | |||
| func (d DOMMatrix) GetM34() float64 { | |||
| val := d.Get("m34") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM34(val float64) { | |||
| d.Set("m34", val) | |||
| } | |||
| func (d DOMMatrix) GetM41() float64 { | |||
| val := d.Get("m41") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM41(val float64) { | |||
| d.Set("m41", val) | |||
| } | |||
| func (d DOMMatrix) GetM42() float64 { | |||
| val := d.Get("m42") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM42(val float64) { | |||
| d.Set("m42", val) | |||
| } | |||
| func (d DOMMatrix) GetM43() float64 { | |||
| val := d.Get("m43") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM43(val float64) { | |||
| d.Set("m43", val) | |||
| } | |||
| func (d DOMMatrix) GetM44() float64 { | |||
| val := d.Get("m44") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrix) SetM44(val float64) { | |||
| d.Set("m44", val) | |||
| } | |||
| func (d DOMMatrix) MultiplySelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("multiplySelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) PreMultiplySelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("preMultiplySelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) RotateAxisAngleSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("rotateAxisAngleSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) RotateFromVectorSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("rotateFromVectorSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) RotateSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("rotateSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) Scale3dSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("scale3dSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) ScaleSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("scaleSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) SetMatrixValue(args ...interface{}) DOMMatrix { | |||
| val := d.Call("setMatrixValue", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) SkewXSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("skewXSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) SkewYSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("skewYSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrix) TranslateSelf(args ...interface{}) DOMMatrix { | |||
| val := d.Call("translateSelf", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,231 @@ | |||
| // Code generated DO NOT EDIT | |||
| // dommatrixreadonly.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMMatrixReadOnlyIFace interface { | |||
| GetA() float64 | |||
| GetB() float64 | |||
| GetC() float64 | |||
| GetD() float64 | |||
| GetE() float64 | |||
| GetF() float64 | |||
| FlipX(args ...interface{}) DOMMatrix | |||
| FlipY(args ...interface{}) DOMMatrix | |||
| FromFloat32Array(args ...interface{}) DOMMatrixReadOnly | |||
| FromFloat64Array(args ...interface{}) DOMMatrixReadOnly | |||
| FromMatrix(args ...interface{}) DOMMatrixReadOnly | |||
| Inverse(args ...interface{}) DOMMatrix | |||
| GetIs2D() bool | |||
| GetIsIdentity() bool | |||
| GetM11() float64 | |||
| GetM12() float64 | |||
| GetM13() float64 | |||
| GetM14() float64 | |||
| GetM21() float64 | |||
| GetM22() float64 | |||
| GetM23() float64 | |||
| GetM24() float64 | |||
| GetM31() float64 | |||
| GetM32() float64 | |||
| GetM33() float64 | |||
| GetM34() float64 | |||
| GetM41() float64 | |||
| GetM42() float64 | |||
| GetM43() float64 | |||
| GetM44() float64 | |||
| Multiply(args ...interface{}) DOMMatrix | |||
| Rotate(args ...interface{}) DOMMatrix | |||
| RotateAxisAngle(args ...interface{}) DOMMatrix | |||
| RotateFromVector(args ...interface{}) DOMMatrix | |||
| Scale(args ...interface{}) DOMMatrix | |||
| Scale3d(args ...interface{}) DOMMatrix | |||
| SkewX(args ...interface{}) DOMMatrix | |||
| SkewY(args ...interface{}) DOMMatrix | |||
| ToFloat32Array(args ...interface{}) Float32Array | |||
| ToFloat64Array(args ...interface{}) Float64Array | |||
| ToJSON(args ...interface{}) Value | |||
| TransformPoint(args ...interface{}) DOMPoint | |||
| Translate(args ...interface{}) DOMMatrix | |||
| } | |||
| type DOMMatrixReadOnly struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMMatrixReadOnly(val js.Value) DOMMatrixReadOnly { | |||
| return DOMMatrixReadOnly{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDOMMatrixReadOnly() DOMMatrixReadOnly { return DOMMatrixReadOnly{Value: v} } | |||
| func (d DOMMatrixReadOnly) GetA() float64 { | |||
| val := d.Get("a") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetB() float64 { | |||
| val := d.Get("b") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetC() float64 { | |||
| val := d.Get("c") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetD() float64 { | |||
| val := d.Get("d") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetE() float64 { | |||
| val := d.Get("e") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetF() float64 { | |||
| val := d.Get("f") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) FlipX(args ...interface{}) DOMMatrix { | |||
| val := d.Call("flipX", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) FlipY(args ...interface{}) DOMMatrix { | |||
| val := d.Call("flipY", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) FromFloat32Array(args ...interface{}) DOMMatrixReadOnly { | |||
| val := d.Call("fromFloat32Array", args...) | |||
| return jsValueToDOMMatrixReadOnly(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) FromFloat64Array(args ...interface{}) DOMMatrixReadOnly { | |||
| val := d.Call("fromFloat64Array", args...) | |||
| return jsValueToDOMMatrixReadOnly(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) FromMatrix(args ...interface{}) DOMMatrixReadOnly { | |||
| val := d.Call("fromMatrix", args...) | |||
| return jsValueToDOMMatrixReadOnly(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) Inverse(args ...interface{}) DOMMatrix { | |||
| val := d.Call("inverse", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) GetIs2D() bool { | |||
| val := d.Get("is2D") | |||
| return val.Bool() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetIsIdentity() bool { | |||
| val := d.Get("isIdentity") | |||
| return val.Bool() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM11() float64 { | |||
| val := d.Get("m11") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM12() float64 { | |||
| val := d.Get("m12") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM13() float64 { | |||
| val := d.Get("m13") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM14() float64 { | |||
| val := d.Get("m14") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM21() float64 { | |||
| val := d.Get("m21") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM22() float64 { | |||
| val := d.Get("m22") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM23() float64 { | |||
| val := d.Get("m23") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM24() float64 { | |||
| val := d.Get("m24") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM31() float64 { | |||
| val := d.Get("m31") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM32() float64 { | |||
| val := d.Get("m32") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM33() float64 { | |||
| val := d.Get("m33") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM34() float64 { | |||
| val := d.Get("m34") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM41() float64 { | |||
| val := d.Get("m41") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM42() float64 { | |||
| val := d.Get("m42") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM43() float64 { | |||
| val := d.Get("m43") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) GetM44() float64 { | |||
| val := d.Get("m44") | |||
| return val.Float() | |||
| } | |||
| func (d DOMMatrixReadOnly) Multiply(args ...interface{}) DOMMatrix { | |||
| val := d.Call("multiply", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) Rotate(args ...interface{}) DOMMatrix { | |||
| val := d.Call("rotate", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) RotateAxisAngle(args ...interface{}) DOMMatrix { | |||
| val := d.Call("rotateAxisAngle", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) RotateFromVector(args ...interface{}) DOMMatrix { | |||
| val := d.Call("rotateFromVector", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) Scale(args ...interface{}) DOMMatrix { | |||
| val := d.Call("scale", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) Scale3d(args ...interface{}) DOMMatrix { | |||
| val := d.Call("scale3d", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) SkewX(args ...interface{}) DOMMatrix { | |||
| val := d.Call("skewX", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) SkewY(args ...interface{}) DOMMatrix { | |||
| val := d.Call("skewY", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) ToFloat32Array(args ...interface{}) Float32Array { | |||
| val := d.Call("toFloat32Array", args...) | |||
| return jsValueToFloat32Array(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) ToFloat64Array(args ...interface{}) Float64Array { | |||
| val := d.Call("toFloat64Array", args...) | |||
| return jsValueToFloat64Array(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) ToJSON(args ...interface{}) Value { | |||
| val := d.Call("toJSON", args...) | |||
| return val | |||
| } | |||
| func (d DOMMatrixReadOnly) TransformPoint(args ...interface{}) DOMPoint { | |||
| val := d.Call("transformPoint", args...) | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMMatrixReadOnly) Translate(args ...interface{}) DOMMatrix { | |||
| val := d.Call("translate", args...) | |||
| return jsValueToDOMMatrix(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,58 @@ | |||
| // Code generated DO NOT EDIT | |||
| // dompoint.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMPointIFace interface { | |||
| FromPoint(args ...interface{}) DOMPoint | |||
| MatrixTransform(args ...interface{}) DOMPoint | |||
| ToJSON(args ...interface{}) Value | |||
| GetW() float64 | |||
| SetW(float64) | |||
| GetX() float64 | |||
| SetX(float64) | |||
| GetY() float64 | |||
| SetY(float64) | |||
| GetZ() float64 | |||
| SetZ(float64) | |||
| } | |||
| type DOMPoint struct { | |||
| Value | |||
| DOMPointReadOnly | |||
| } | |||
| func jsValueToDOMPoint(val js.Value) DOMPoint { return DOMPoint{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMPoint() DOMPoint { return DOMPoint{Value: v} } | |||
| func (d DOMPoint) FromPoint(args ...interface{}) DOMPoint { | |||
| val := d.Call("fromPoint", args...) | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMPoint) GetW() float64 { | |||
| val := d.Get("w") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPoint) SetW(val float64) { | |||
| d.Set("w", val) | |||
| } | |||
| func (d DOMPoint) GetX() float64 { | |||
| val := d.Get("x") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPoint) SetX(val float64) { | |||
| d.Set("x", val) | |||
| } | |||
| func (d DOMPoint) GetY() float64 { | |||
| val := d.Get("y") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPoint) SetY(val float64) { | |||
| d.Set("y", val) | |||
| } | |||
| func (d DOMPoint) GetZ() float64 { | |||
| val := d.Get("z") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPoint) SetZ(val float64) { | |||
| d.Set("z", val) | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| // Code generated DO NOT EDIT | |||
| // dompointreadonly.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMPointReadOnlyIFace interface { | |||
| FromPoint(args ...interface{}) DOMPointReadOnly | |||
| MatrixTransform(args ...interface{}) DOMPoint | |||
| ToJSON(args ...interface{}) Value | |||
| GetW() float64 | |||
| GetX() float64 | |||
| GetY() float64 | |||
| GetZ() float64 | |||
| } | |||
| type DOMPointReadOnly struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMPointReadOnly(val js.Value) DOMPointReadOnly { | |||
| return DOMPointReadOnly{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDOMPointReadOnly() DOMPointReadOnly { return DOMPointReadOnly{Value: v} } | |||
| func (d DOMPointReadOnly) FromPoint(args ...interface{}) DOMPointReadOnly { | |||
| val := d.Call("fromPoint", args...) | |||
| return jsValueToDOMPointReadOnly(val.JSValue()) | |||
| } | |||
| func (d DOMPointReadOnly) MatrixTransform(args ...interface{}) DOMPoint { | |||
| val := d.Call("matrixTransform", args...) | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMPointReadOnly) ToJSON(args ...interface{}) Value { | |||
| val := d.Call("toJSON", args...) | |||
| return val | |||
| } | |||
| func (d DOMPointReadOnly) GetW() float64 { | |||
| val := d.Get("w") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPointReadOnly) GetX() float64 { | |||
| val := d.Get("x") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPointReadOnly) GetY() float64 { | |||
| val := d.Get("y") | |||
| return val.Float() | |||
| } | |||
| func (d DOMPointReadOnly) GetZ() float64 { | |||
| val := d.Get("z") | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,54 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domquad.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMQuadIFace interface { | |||
| FromQuad(args ...interface{}) DOMQuad | |||
| FromRect(args ...interface{}) DOMQuad | |||
| GetBounds(args ...interface{}) DOMRect | |||
| GetP1() DOMPoint | |||
| GetP2() DOMPoint | |||
| GetP3() DOMPoint | |||
| GetP4() DOMPoint | |||
| ToJSON(args ...interface{}) Value | |||
| } | |||
| type DOMQuad struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMQuad(val js.Value) DOMQuad { return DOMQuad{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMQuad() DOMQuad { return DOMQuad{Value: v} } | |||
| func (d DOMQuad) FromQuad(args ...interface{}) DOMQuad { | |||
| val := d.Call("fromQuad", args...) | |||
| return jsValueToDOMQuad(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) FromRect(args ...interface{}) DOMQuad { | |||
| val := d.Call("fromRect", args...) | |||
| return jsValueToDOMQuad(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) GetBounds(args ...interface{}) DOMRect { | |||
| val := d.Call("getBounds", args...) | |||
| return jsValueToDOMRect(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) GetP1() DOMPoint { | |||
| val := d.Get("p1") | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) GetP2() DOMPoint { | |||
| val := d.Get("p2") | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) GetP3() DOMPoint { | |||
| val := d.Get("p3") | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) GetP4() DOMPoint { | |||
| val := d.Get("p4") | |||
| return jsValueToDOMPoint(val.JSValue()) | |||
| } | |||
| func (d DOMQuad) ToJSON(args ...interface{}) Value { | |||
| val := d.Call("toJSON", args...) | |||
| return val | |||
| } | |||
| @ -0,0 +1,61 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domrect.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMRectIFace interface { | |||
| GetBottom() float64 | |||
| FromRect(args ...interface{}) DOMRect | |||
| GetHeight() float64 | |||
| SetHeight(float64) | |||
| GetLeft() float64 | |||
| GetRight() float64 | |||
| ToJSON(args ...interface{}) Value | |||
| GetTop() float64 | |||
| GetWidth() float64 | |||
| SetWidth(float64) | |||
| GetX() float64 | |||
| SetX(float64) | |||
| GetY() float64 | |||
| SetY(float64) | |||
| } | |||
| type DOMRect struct { | |||
| Value | |||
| DOMRectReadOnly | |||
| } | |||
| func jsValueToDOMRect(val js.Value) DOMRect { return DOMRect{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMRect() DOMRect { return DOMRect{Value: v} } | |||
| func (d DOMRect) FromRect(args ...interface{}) DOMRect { | |||
| val := d.Call("fromRect", args...) | |||
| return jsValueToDOMRect(val.JSValue()) | |||
| } | |||
| func (d DOMRect) GetHeight() float64 { | |||
| val := d.Get("height") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRect) SetHeight(val float64) { | |||
| d.Set("height", val) | |||
| } | |||
| func (d DOMRect) GetWidth() float64 { | |||
| val := d.Get("width") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRect) SetWidth(val float64) { | |||
| d.Set("width", val) | |||
| } | |||
| func (d DOMRect) GetX() float64 { | |||
| val := d.Get("x") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRect) SetX(val float64) { | |||
| d.Set("x", val) | |||
| } | |||
| func (d DOMRect) GetY() float64 { | |||
| val := d.Get("y") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRect) SetY(val float64) { | |||
| d.Set("y", val) | |||
| } | |||
| @ -0,0 +1,24 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domrectlist.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMRectListIFace interface { | |||
| Item(args ...interface{}) DOMRect | |||
| GetLength() float64 | |||
| } | |||
| type DOMRectList struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMRectList(val js.Value) DOMRectList { return DOMRectList{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMRectList() DOMRectList { return DOMRectList{Value: v} } | |||
| func (d DOMRectList) Item(args ...interface{}) DOMRect { | |||
| val := d.Call("item", args...) | |||
| return jsValueToDOMRect(val.JSValue()) | |||
| } | |||
| func (d DOMRectList) GetLength() float64 { | |||
| val := d.Get("length") | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,66 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domrectreadonly.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMRectReadOnlyIFace interface { | |||
| GetBottom() float64 | |||
| FromRect(args ...interface{}) DOMRectReadOnly | |||
| GetHeight() float64 | |||
| GetLeft() float64 | |||
| GetRight() float64 | |||
| ToJSON(args ...interface{}) Value | |||
| GetTop() float64 | |||
| GetWidth() float64 | |||
| GetX() float64 | |||
| GetY() float64 | |||
| } | |||
| type DOMRectReadOnly struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMRectReadOnly(val js.Value) DOMRectReadOnly { | |||
| return DOMRectReadOnly{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDOMRectReadOnly() DOMRectReadOnly { return DOMRectReadOnly{Value: v} } | |||
| func (d DOMRectReadOnly) GetBottom() float64 { | |||
| val := d.Get("bottom") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) FromRect(args ...interface{}) DOMRectReadOnly { | |||
| val := d.Call("fromRect", args...) | |||
| return jsValueToDOMRectReadOnly(val.JSValue()) | |||
| } | |||
| func (d DOMRectReadOnly) GetHeight() float64 { | |||
| val := d.Get("height") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) GetLeft() float64 { | |||
| val := d.Get("left") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) GetRight() float64 { | |||
| val := d.Get("right") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) ToJSON(args ...interface{}) Value { | |||
| val := d.Call("toJSON", args...) | |||
| return val | |||
| } | |||
| func (d DOMRectReadOnly) GetTop() float64 { | |||
| val := d.Get("top") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) GetWidth() float64 { | |||
| val := d.Get("width") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) GetX() float64 { | |||
| val := d.Get("x") | |||
| return val.Float() | |||
| } | |||
| func (d DOMRectReadOnly) GetY() float64 { | |||
| val := d.Get("y") | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,31 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domstringlist.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMStringListIFace interface { | |||
| Contains(args ...interface{}) bool | |||
| Item(args ...interface{}) string | |||
| GetLength() float64 | |||
| } | |||
| type DOMStringList struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMStringList(val js.Value) DOMStringList { | |||
| return DOMStringList{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsDOMStringList() DOMStringList { return DOMStringList{Value: v} } | |||
| func (d DOMStringList) Contains(args ...interface{}) bool { | |||
| val := d.Call("contains", args...) | |||
| return val.Bool() | |||
| } | |||
| func (d DOMStringList) Item(args ...interface{}) string { | |||
| val := d.Call("item", args...) | |||
| return val.String() | |||
| } | |||
| func (d DOMStringList) GetLength() float64 { | |||
| val := d.Get("length") | |||
| return val.Float() | |||
| } | |||
| @ -0,0 +1,14 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domstringmap.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMStringMapIFace interface { | |||
| } | |||
| type DOMStringMap struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMStringMap(val js.Value) DOMStringMap { return DOMStringMap{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMStringMap() DOMStringMap { return DOMStringMap{Value: v} } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domtimestamp.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMTimeStamp float64 | |||
| func jsValueToDOMTimeStamp(val js.Value) DOMTimeStamp { | |||
| return DOMTimeStamp(val.Float()) | |||
| } | |||
| @ -0,0 +1,61 @@ | |||
| // Code generated DO NOT EDIT | |||
| // domtokenlist.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DOMTokenListIFace interface { | |||
| Add(args ...interface{}) | |||
| Contains(args ...interface{}) bool | |||
| Item(args ...interface{}) string | |||
| GetLength() float64 | |||
| Remove(args ...interface{}) | |||
| Replace(args ...interface{}) bool | |||
| Supports(args ...interface{}) bool | |||
| Toggle(args ...interface{}) bool | |||
| GetValue() string | |||
| SetValue(string) | |||
| } | |||
| type DOMTokenList struct { | |||
| Value | |||
| } | |||
| func jsValueToDOMTokenList(val js.Value) DOMTokenList { return DOMTokenList{Value: Value{Value: val}} } | |||
| func (v Value) AsDOMTokenList() DOMTokenList { return DOMTokenList{Value: v} } | |||
| func (d DOMTokenList) Add(args ...interface{}) { | |||
| d.Call("add", args...) | |||
| } | |||
| func (d DOMTokenList) Contains(args ...interface{}) bool { | |||
| val := d.Call("contains", args...) | |||
| return val.Bool() | |||
| } | |||
| func (d DOMTokenList) Item(args ...interface{}) string { | |||
| val := d.Call("item", args...) | |||
| return val.String() | |||
| } | |||
| func (d DOMTokenList) GetLength() float64 { | |||
| val := d.Get("length") | |||
| return val.Float() | |||
| } | |||
| func (d DOMTokenList) Remove(args ...interface{}) { | |||
| d.Call("remove", args...) | |||
| } | |||
| func (d DOMTokenList) Replace(args ...interface{}) bool { | |||
| val := d.Call("replace", args...) | |||
| return val.Bool() | |||
| } | |||
| func (d DOMTokenList) Supports(args ...interface{}) bool { | |||
| val := d.Call("supports", args...) | |||
| return val.Bool() | |||
| } | |||
| func (d DOMTokenList) Toggle(args ...interface{}) bool { | |||
| val := d.Call("toggle", args...) | |||
| return val.Bool() | |||
| } | |||
| func (d DOMTokenList) GetValue() string { | |||
| val := d.Get("value") | |||
| return val.String() | |||
| } | |||
| func (d DOMTokenList) SetValue(val string) { | |||
| d.Set("value", val) | |||
| } | |||
| @ -0,0 +1,19 @@ | |||
| // Code generated DO NOT EDIT | |||
| // dragevent.go | |||
| package dom | |||
| import "syscall/js" | |||
| type DragEventIFace interface { | |||
| GetDataTransfer() DataTransfer | |||
| } | |||
| type DragEvent struct { | |||
| Value | |||
| } | |||
| func jsValueToDragEvent(val js.Value) DragEvent { return DragEvent{Value: Value{Value: val}} } | |||
| func (v Value) AsDragEvent() DragEvent { return DragEvent{Value: v} } | |||
| func (d DragEvent) GetDataTransfer() DataTransfer { | |||
| val := d.Get("dataTransfer") | |||
| return jsValueToDataTransfer(val.JSValue()) | |||
| } | |||
| @ -0,0 +1,300 @@ | |||
| // Code generated DO NOT EDIT | |||
| // element.go | |||
| package dom | |||
| import "syscall/js" | |||
| type ElementIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| After(args ...interface{}) | |||
| Append(args ...interface{}) | |||
| AppendChild(args ...interface{}) Node | |||
| GetAssignedSlot() HTMLSlotElement | |||
| AttachShadow(args ...interface{}) ShadowRoot | |||
| GetAttributes() NamedNodeMap | |||
| GetBaseURI() string | |||
| Before(args ...interface{}) | |||
| GetChildElementCount() float64 | |||
| GetChildNodes() NodeList | |||
| GetChildren() HTMLCollection | |||
| GetClassList() DOMTokenList | |||
| GetClassName() string | |||
| SetClassName(string) | |||
| CloneNode(args ...interface{}) Node | |||
| Closest(args ...interface{}) Element | |||
| CompareDocumentPosition(args ...interface{}) int | |||
| Contains(args ...interface{}) bool | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetFirstChild() Node | |||
| GetFirstElementChild() Element | |||
| GetAttribute(args ...interface{}) string | |||
| GetAttributeNS(args ...interface{}) string | |||
| GetAttributeNames(args ...interface{}) | |||
| GetAttributeNode(args ...interface{}) Attr | |||
| GetAttributeNodeNS(args ...interface{}) Attr | |||
| GetElementsByClassName(args ...interface{}) HTMLCollection | |||
| GetElementsByTagName(args ...interface{}) HTMLCollection | |||
| GetElementsByTagNameNS(args ...interface{}) HTMLCollection | |||
| GetRootNode(args ...interface{}) Node | |||
| HasAttribute(args ...interface{}) bool | |||
| HasAttributeNS(args ...interface{}) bool | |||
| HasAttributes(args ...interface{}) bool | |||
| HasChildNodes(args ...interface{}) bool | |||
| GetId() string | |||
| SetId(string) | |||
| InsertAdjacentElement(args ...interface{}) Element | |||
| InsertAdjacentText(args ...interface{}) | |||
| InsertBefore(args ...interface{}) Node | |||
| GetIsConnected() bool | |||
| IsDefaultNamespace(args ...interface{}) bool | |||
| IsEqualNode(args ...interface{}) bool | |||
| IsSameNode(args ...interface{}) bool | |||
| GetLastChild() Node | |||
| GetLastElementChild() Element | |||
| GetLocalName() string | |||
| LookupNamespaceURI(args ...interface{}) string | |||
| LookupPrefix(args ...interface{}) string | |||
| Matches(args ...interface{}) bool | |||
| GetNamespaceURI() string | |||
| GetNextElementSibling() Element | |||
| GetNextSibling() Node | |||
| GetNodeName() string | |||
| GetNodeType() int | |||
| GetNodeValue() string | |||
| SetNodeValue(string) | |||
| Normalize(args ...interface{}) | |||
| GetOwnerDocument() Document | |||
| GetParentElement() Element | |||
| GetParentNode() Node | |||
| GetPrefix() string | |||
| Prepend(args ...interface{}) | |||
| GetPreviousElementSibling() Element | |||
| GetPreviousSibling() Node | |||
| QuerySelector(args ...interface{}) Element | |||
| QuerySelectorAll(args ...interface{}) NodeList | |||
| Remove(args ...interface{}) | |||
| RemoveAttribute(args ...interface{}) | |||
| RemoveAttributeNS(args ...interface{}) | |||
| RemoveAttributeNode(args ...interface{}) Attr | |||
| RemoveChild(args ...interface{}) Node | |||
| RemoveEventListener(args ...interface{}) | |||
| ReplaceChild(args ...interface{}) Node | |||
| ReplaceWith(args ...interface{}) | |||
| SetAttribute(args ...interface{}) | |||
| SetAttributeNS(args ...interface{}) | |||
| SetAttributeNode(args ...interface{}) Attr | |||
| SetAttributeNodeNS(args ...interface{}) Attr | |||
| GetShadowRoot() ShadowRoot | |||
| GetSlot() string | |||
| SetSlot(string) | |||
| GetTagName() string | |||
| GetTextContent() string | |||
| SetTextContent(string) | |||
| ToggleAttribute(args ...interface{}) bool | |||
| WebkitMatchesSelector(args ...interface{}) bool | |||
| } | |||
| type Element struct { | |||
| Value | |||
| Node | |||
| EventTarget | |||
| } | |||
| func jsValueToElement(val js.Value) Element { return Element{Value: Value{Value: val}} } | |||
| func (v Value) AsElement() Element { return Element{Value: v} } | |||
| func (e Element) After(args ...interface{}) { | |||
| e.Call("after", args...) | |||
| } | |||
| func (e Element) Append(args ...interface{}) { | |||
| e.Call("append", args...) | |||
| } | |||
| func (e Element) GetAssignedSlot() HTMLSlotElement { | |||
| val := e.Get("assignedSlot") | |||
| return jsValueToHTMLSlotElement(val.JSValue()) | |||
| } | |||
| func (e Element) AttachShadow(args ...interface{}) ShadowRoot { | |||
| val := e.Call("attachShadow", args...) | |||
| return jsValueToShadowRoot(val.JSValue()) | |||
| } | |||
| func (e Element) GetAttributes() NamedNodeMap { | |||
| val := e.Get("attributes") | |||
| return jsValueToNamedNodeMap(val.JSValue()) | |||
| } | |||
| func (e Element) Before(args ...interface{}) { | |||
| e.Call("before", args...) | |||
| } | |||
| func (e Element) GetChildElementCount() float64 { | |||
| val := e.Get("childElementCount") | |||
| return val.Float() | |||
| } | |||
| func (e Element) GetChildren() HTMLCollection { | |||
| val := e.Get("children") | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (e Element) GetClassList() DOMTokenList { | |||
| val := e.Get("classList") | |||
| return jsValueToDOMTokenList(val.JSValue()) | |||
| } | |||
| func (e Element) GetClassName() string { | |||
| val := e.Get("className") | |||
| return val.String() | |||
| } | |||
| func (e Element) SetClassName(val string) { | |||
| e.Set("className", val) | |||
| } | |||
| func (e Element) Closest(args ...interface{}) Element { | |||
| val := e.Call("closest", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) GetFirstElementChild() Element { | |||
| val := e.Get("firstElementChild") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) GetAttribute(args ...interface{}) string { | |||
| val := e.Call("getAttribute", args...) | |||
| return val.String() | |||
| } | |||
| func (e Element) GetAttributeNS(args ...interface{}) string { | |||
| val := e.Call("getAttributeNS", args...) | |||
| return val.String() | |||
| } | |||
| func (e Element) GetAttributeNames(args ...interface{}) { | |||
| e.Call("getAttributeNames", args...) | |||
| } | |||
| func (e Element) GetAttributeNode(args ...interface{}) Attr { | |||
| val := e.Call("getAttributeNode", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (e Element) GetAttributeNodeNS(args ...interface{}) Attr { | |||
| val := e.Call("getAttributeNodeNS", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (e Element) GetElementsByClassName(args ...interface{}) HTMLCollection { | |||
| val := e.Call("getElementsByClassName", args...) | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (e Element) GetElementsByTagName(args ...interface{}) HTMLCollection { | |||
| val := e.Call("getElementsByTagName", args...) | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (e Element) GetElementsByTagNameNS(args ...interface{}) HTMLCollection { | |||
| val := e.Call("getElementsByTagNameNS", args...) | |||
| return jsValueToHTMLCollection(val.JSValue()) | |||
| } | |||
| func (e Element) HasAttribute(args ...interface{}) bool { | |||
| val := e.Call("hasAttribute", args...) | |||
| return val.Bool() | |||
| } | |||
| func (e Element) HasAttributeNS(args ...interface{}) bool { | |||
| val := e.Call("hasAttributeNS", args...) | |||
| return val.Bool() | |||
| } | |||
| func (e Element) HasAttributes(args ...interface{}) bool { | |||
| val := e.Call("hasAttributes", args...) | |||
| return val.Bool() | |||
| } | |||
| func (e Element) GetId() string { | |||
| val := e.Get("id") | |||
| return val.String() | |||
| } | |||
| func (e Element) SetId(val string) { | |||
| e.Set("id", val) | |||
| } | |||
| func (e Element) InsertAdjacentElement(args ...interface{}) Element { | |||
| val := e.Call("insertAdjacentElement", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) InsertAdjacentText(args ...interface{}) { | |||
| e.Call("insertAdjacentText", args...) | |||
| } | |||
| func (e Element) GetLastElementChild() Element { | |||
| val := e.Get("lastElementChild") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) GetLocalName() string { | |||
| val := e.Get("localName") | |||
| return val.String() | |||
| } | |||
| func (e Element) Matches(args ...interface{}) bool { | |||
| val := e.Call("matches", args...) | |||
| return val.Bool() | |||
| } | |||
| func (e Element) GetNamespaceURI() string { | |||
| val := e.Get("namespaceURI") | |||
| return val.String() | |||
| } | |||
| func (e Element) GetNextElementSibling() Element { | |||
| val := e.Get("nextElementSibling") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) GetPrefix() string { | |||
| val := e.Get("prefix") | |||
| return val.String() | |||
| } | |||
| func (e Element) Prepend(args ...interface{}) { | |||
| e.Call("prepend", args...) | |||
| } | |||
| func (e Element) GetPreviousElementSibling() Element { | |||
| val := e.Get("previousElementSibling") | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) QuerySelector(args ...interface{}) Element { | |||
| val := e.Call("querySelector", args...) | |||
| return jsValueToElement(val.JSValue()) | |||
| } | |||
| func (e Element) QuerySelectorAll(args ...interface{}) NodeList { | |||
| val := e.Call("querySelectorAll", args...) | |||
| return jsValueToNodeList(val.JSValue()) | |||
| } | |||
| func (e Element) Remove(args ...interface{}) { | |||
| e.Call("remove", args...) | |||
| } | |||
| func (e Element) RemoveAttribute(args ...interface{}) { | |||
| e.Call("removeAttribute", args...) | |||
| } | |||
| func (e Element) RemoveAttributeNS(args ...interface{}) { | |||
| e.Call("removeAttributeNS", args...) | |||
| } | |||
| func (e Element) RemoveAttributeNode(args ...interface{}) Attr { | |||
| val := e.Call("removeAttributeNode", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (e Element) ReplaceWith(args ...interface{}) { | |||
| e.Call("replaceWith", args...) | |||
| } | |||
| func (e Element) SetAttribute(args ...interface{}) { | |||
| e.Call("setAttribute", args...) | |||
| } | |||
| func (e Element) SetAttributeNS(args ...interface{}) { | |||
| e.Call("setAttributeNS", args...) | |||
| } | |||
| func (e Element) SetAttributeNode(args ...interface{}) Attr { | |||
| val := e.Call("setAttributeNode", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (e Element) SetAttributeNodeNS(args ...interface{}) Attr { | |||
| val := e.Call("setAttributeNodeNS", args...) | |||
| return jsValueToAttr(val.JSValue()) | |||
| } | |||
| func (e Element) GetShadowRoot() ShadowRoot { | |||
| val := e.Get("shadowRoot") | |||
| return jsValueToShadowRoot(val.JSValue()) | |||
| } | |||
| func (e Element) GetSlot() string { | |||
| val := e.Get("slot") | |||
| return val.String() | |||
| } | |||
| func (e Element) SetSlot(val string) { | |||
| e.Set("slot", val) | |||
| } | |||
| func (e Element) GetTagName() string { | |||
| val := e.Get("tagName") | |||
| return val.String() | |||
| } | |||
| func (e Element) ToggleAttribute(args ...interface{}) bool { | |||
| val := e.Call("toggleAttribute", args...) | |||
| return val.Bool() | |||
| } | |||
| func (e Element) WebkitMatchesSelector(args ...interface{}) bool { | |||
| val := e.Call("webkitMatchesSelector", args...) | |||
| return val.Bool() | |||
| } | |||
| @ -0,0 +1,16 @@ | |||
| // Code generated DO NOT EDIT | |||
| // endingtype.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EndingType string | |||
| const ( | |||
| EndingTypeTransparent EndingType = "transparent" | |||
| EndingTypeNative EndingType = "native" | |||
| ) | |||
| func jsValueToEndingType(val js.Value) EndingType { | |||
| return EndingType(val.String()) | |||
| } | |||
| @ -0,0 +1,60 @@ | |||
| // Code generated DO NOT EDIT | |||
| // errorevent.go | |||
| package dom | |||
| import "syscall/js" | |||
| type ErrorEventIFace interface { | |||
| GetBubbles() bool | |||
| GetCancelBubble() bool | |||
| SetCancelBubble(bool) | |||
| GetCancelable() bool | |||
| GetColno() float64 | |||
| GetComposed() bool | |||
| ComposedPath(args ...interface{}) | |||
| GetCurrentTarget() EventTarget | |||
| GetDefaultPrevented() bool | |||
| GetError() Value | |||
| GetEventPhase() int | |||
| GetFilename() string | |||
| InitEvent(args ...interface{}) | |||
| GetIsTrusted() bool | |||
| GetLineno() float64 | |||
| GetMessage() string | |||
| PreventDefault(args ...interface{}) | |||
| GetReturnValue() bool | |||
| SetReturnValue(bool) | |||
| GetSrcElement() EventTarget | |||
| StopImmediatePropagation(args ...interface{}) | |||
| StopPropagation(args ...interface{}) | |||
| GetTarget() EventTarget | |||
| GetTimeStamp() DOMHighResTimeStamp | |||
| GetType() string | |||
| } | |||
| type ErrorEvent struct { | |||
| Value | |||
| Event | |||
| } | |||
| func jsValueToErrorEvent(val js.Value) ErrorEvent { return ErrorEvent{Value: Value{Value: val}} } | |||
| func (v Value) AsErrorEvent() ErrorEvent { return ErrorEvent{Value: v} } | |||
| func (e ErrorEvent) GetColno() float64 { | |||
| val := e.Get("colno") | |||
| return val.Float() | |||
| } | |||
| func (e ErrorEvent) GetError() Value { | |||
| val := e.Get("error") | |||
| return val | |||
| } | |||
| func (e ErrorEvent) GetFilename() string { | |||
| val := e.Get("filename") | |||
| return val.String() | |||
| } | |||
| func (e ErrorEvent) GetLineno() float64 { | |||
| val := e.Get("lineno") | |||
| return val.Float() | |||
| } | |||
| func (e ErrorEvent) GetMessage() string { | |||
| val := e.Get("message") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,107 @@ | |||
| // Code generated DO NOT EDIT | |||
| // event.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EventIFace interface { | |||
| GetBubbles() bool | |||
| GetCancelBubble() bool | |||
| SetCancelBubble(bool) | |||
| GetCancelable() bool | |||
| GetComposed() bool | |||
| ComposedPath(args ...interface{}) | |||
| GetCurrentTarget() EventTarget | |||
| GetDefaultPrevented() bool | |||
| GetEventPhase() int | |||
| InitEvent(args ...interface{}) | |||
| GetIsTrusted() bool | |||
| PreventDefault(args ...interface{}) | |||
| GetReturnValue() bool | |||
| SetReturnValue(bool) | |||
| GetSrcElement() EventTarget | |||
| StopImmediatePropagation(args ...interface{}) | |||
| StopPropagation(args ...interface{}) | |||
| GetTarget() EventTarget | |||
| GetTimeStamp() DOMHighResTimeStamp | |||
| GetType() string | |||
| } | |||
| type Event struct { | |||
| Value | |||
| } | |||
| func jsValueToEvent(val js.Value) Event { return Event{Value: Value{Value: val}} } | |||
| func (v Value) AsEvent() Event { return Event{Value: v} } | |||
| func (e Event) GetBubbles() bool { | |||
| val := e.Get("bubbles") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) GetCancelBubble() bool { | |||
| val := e.Get("cancelBubble") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) SetCancelBubble(val bool) { | |||
| e.Set("cancelBubble", val) | |||
| } | |||
| func (e Event) GetCancelable() bool { | |||
| val := e.Get("cancelable") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) GetComposed() bool { | |||
| val := e.Get("composed") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) ComposedPath(args ...interface{}) { | |||
| e.Call("composedPath", args...) | |||
| } | |||
| func (e Event) GetCurrentTarget() EventTarget { | |||
| val := e.Get("currentTarget") | |||
| return jsValueToEventTarget(val.JSValue()) | |||
| } | |||
| func (e Event) GetDefaultPrevented() bool { | |||
| val := e.Get("defaultPrevented") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) GetEventPhase() int { | |||
| val := e.Get("eventPhase") | |||
| return val.Int() | |||
| } | |||
| func (e Event) InitEvent(args ...interface{}) { | |||
| e.Call("initEvent", args...) | |||
| } | |||
| func (e Event) GetIsTrusted() bool { | |||
| val := e.Get("isTrusted") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) PreventDefault(args ...interface{}) { | |||
| e.Call("preventDefault", args...) | |||
| } | |||
| func (e Event) GetReturnValue() bool { | |||
| val := e.Get("returnValue") | |||
| return val.Bool() | |||
| } | |||
| func (e Event) SetReturnValue(val bool) { | |||
| e.Set("returnValue", val) | |||
| } | |||
| func (e Event) GetSrcElement() EventTarget { | |||
| val := e.Get("srcElement") | |||
| return jsValueToEventTarget(val.JSValue()) | |||
| } | |||
| func (e Event) StopImmediatePropagation(args ...interface{}) { | |||
| e.Call("stopImmediatePropagation", args...) | |||
| } | |||
| func (e Event) StopPropagation(args ...interface{}) { | |||
| e.Call("stopPropagation", args...) | |||
| } | |||
| func (e Event) GetTarget() EventTarget { | |||
| val := e.Get("target") | |||
| return jsValueToEventTarget(val.JSValue()) | |||
| } | |||
| func (e Event) GetTimeStamp() DOMHighResTimeStamp { | |||
| val := e.Get("timeStamp") | |||
| return jsValueToDOMHighResTimeStamp(val.JSValue()) | |||
| } | |||
| func (e Event) GetType() string { | |||
| val := e.Get("type") | |||
| return val.String() | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| // Code generated DO NOT EDIT | |||
| // eventhandler.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EventHandler EventHandlerNonNull | |||
| func jsValueToEventHandler(val js.Value) EventHandler { | |||
| return EventHandler(jsValueToEventHandlerNonNull(val)) | |||
| } | |||
| @ -0,0 +1,21 @@ | |||
| // Code generated DO NOT EDIT | |||
| // eventhandlernonnull.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EventHandlerNonNullCallback func(event Event) Value | |||
| type EventHandlerNonNull struct { | |||
| Callback | |||
| } | |||
| func jsValueToEventHandlerNonNull(val js.Value) EventHandlerNonNull { | |||
| return EventHandlerNonNull{Callback: jsValueToCallback(val)} | |||
| } | |||
| func NewEventHandlerNonNull(c EventHandlerNonNullCallback) EventHandlerNonNull { | |||
| callback := js.NewCallback(func(args []js.Value) { | |||
| event := jsValueToEvent(args[0]) | |||
| c(event) | |||
| }) | |||
| return EventHandlerNonNull{Callback: Callback{Callback: callback}} | |||
| } | |||
| @ -0,0 +1,31 @@ | |||
| // Code generated DO NOT EDIT | |||
| // eventlistener.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EventListenerHandleEventCallback func(event Event) | |||
| type EventListenerHandleEvent struct { | |||
| Callback | |||
| } | |||
| func jsValueToEventListenerHandleEvent(val js.Value) EventListenerHandleEvent { | |||
| return EventListenerHandleEvent{Callback: jsValueToCallback(val)} | |||
| } | |||
| func NewEventListenerHandleEvent(c EventListenerHandleEventCallback) EventListenerHandleEvent { | |||
| callback := js.NewCallback(func(args []js.Value) { | |||
| event := jsValueToEvent(args[0]) | |||
| c(event) | |||
| }) | |||
| return EventListenerHandleEvent{Callback: Callback{Callback: callback}} | |||
| } | |||
| type EventListener struct { | |||
| Value | |||
| HandleEvent EventListenerHandleEventCallback | |||
| } | |||
| func jsValueToEventListener(val js.Value) EventListener { | |||
| return EventListener{Value: Value{Value: val}} | |||
| } | |||
| func (v Value) AsEventListener() EventListener { return EventListener{Value: v} } | |||
| @ -0,0 +1,64 @@ | |||
| // Code generated DO NOT EDIT | |||
| // eventsource.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EventSourceIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| Close(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| GetOnerror() EventHandler | |||
| SetOnerror(EventHandler) | |||
| GetOnmessage() EventHandler | |||
| SetOnmessage(EventHandler) | |||
| GetOnopen() EventHandler | |||
| SetOnopen(EventHandler) | |||
| GetReadyState() int | |||
| RemoveEventListener(args ...interface{}) | |||
| GetUrl() string | |||
| GetWithCredentials() bool | |||
| } | |||
| type EventSource struct { | |||
| Value | |||
| EventTarget | |||
| } | |||
| func jsValueToEventSource(val js.Value) EventSource { return EventSource{Value: Value{Value: val}} } | |||
| func (v Value) AsEventSource() EventSource { return EventSource{Value: v} } | |||
| func (e EventSource) Close(args ...interface{}) { | |||
| e.Call("close", args...) | |||
| } | |||
| func (e EventSource) GetOnerror() EventHandler { | |||
| val := e.Get("onerror") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (e EventSource) SetOnerror(val EventHandler) { | |||
| e.Set("onerror", val) | |||
| } | |||
| func (e EventSource) GetOnmessage() EventHandler { | |||
| val := e.Get("onmessage") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (e EventSource) SetOnmessage(val EventHandler) { | |||
| e.Set("onmessage", val) | |||
| } | |||
| func (e EventSource) GetOnopen() EventHandler { | |||
| val := e.Get("onopen") | |||
| return jsValueToEventHandler(val.JSValue()) | |||
| } | |||
| func (e EventSource) SetOnopen(val EventHandler) { | |||
| e.Set("onopen", val) | |||
| } | |||
| func (e EventSource) GetReadyState() int { | |||
| val := e.Get("readyState") | |||
| return val.Int() | |||
| } | |||
| func (e EventSource) GetUrl() string { | |||
| val := e.Get("url") | |||
| return val.String() | |||
| } | |||
| func (e EventSource) GetWithCredentials() bool { | |||
| val := e.Get("withCredentials") | |||
| return val.Bool() | |||
| } | |||
| @ -0,0 +1,27 @@ | |||
| // Code generated DO NOT EDIT | |||
| // eventtarget.go | |||
| package dom | |||
| import "syscall/js" | |||
| type EventTargetIFace interface { | |||
| AddEventListener(args ...interface{}) | |||
| DispatchEvent(args ...interface{}) bool | |||
| RemoveEventListener(args ...interface{}) | |||
| } | |||
| type EventTarget struct { | |||
| Value | |||
| } | |||
| func jsValueToEventTarget(val js.Value) EventTarget { return EventTarget{Value: Value{Value: val}} } | |||
| func (v Value) AsEventTarget() EventTarget { return EventTarget{Value: v} } | |||
| func (e EventTarget) AddEventListener(args ...interface{}) { | |||
| e.Call("addEventListener", args...) | |||
| } | |||
| func (e EventTarget) DispatchEvent(args ...interface{}) bool { | |||
| val := e.Call("dispatchEvent", args...) | |||
| return val.Bool() | |||
| } | |||
| func (e EventTarget) RemoveEventListener(args ...interface{}) { | |||
| e.Call("removeEventListener", args...) | |||
| } | |||