Browse Source

Update primitive type mapping

master
Brett Langdon 7 years ago
parent
commit
fd9f6ac5bd
No known key found for this signature in database GPG Key ID: B664881177781B04
84 changed files with 474 additions and 440 deletions
  1. +6
    -6
      abstractrange.go
  2. +3
    -3
      audiotracklist.go
  3. +3
    -3
      blob.go
  4. +1
    -1
      cdatasection.go
  5. +3
    -3
      characterdata.go
  6. +6
    -7
      cmd/dom/main.go
  7. +1
    -1
      comment.go
  8. +1
    -1
      console/console.go
  9. +1
    -1
      css/css.go
  10. +3
    -3
      cssgroupingrule.go
  11. +1
    -1
      csspagerule.go
  12. +3
    -3
      cssrulelist.go
  13. +3
    -3
      cssstyledeclaration.go
  14. +3
    -3
      cssstylesheet.go
  15. +3
    -3
      datatransferitemlist.go
  16. +3
    -3
      dedicatedworkerglobalscope.go
  17. +3
    -3
      document.go
  18. +2
    -2
      document/document.go
  19. +3
    -3
      documentfragment.go
  20. +3
    -3
      domrectlist.go
  21. +3
    -3
      domstringlist.go
  22. +2
    -2
      domtimestamp.go
  23. +3
    -3
      domtokenlist.go
  24. +3
    -3
      element.go
  25. +6
    -6
      errorevent.go
  26. +4
    -4
      file.go
  27. +3
    -3
      filelist.go
  28. +1
    -1
      generate/generator.go
  29. +5
    -4
      generate/idl_type.go
  30. +17
    -0
      generate/static/value.go
  31. +1
    -1
      go.mod
  32. +3
    -3
      history.go
  33. +3
    -3
      htmlallcollection.go
  34. +10
    -10
      htmlcanvaselement.go
  35. +3
    -3
      htmlcollection.go
  36. +5
    -5
      htmlelement.go
  37. +1
    -1
      htmlformcontrolscollection.go
  38. +3
    -3
      htmlformelement.go
  39. +16
    -16
      htmlimageelement.go
  40. +35
    -35
      htmlinputelement.go
  41. +5
    -5
      htmllielement.go
  42. +25
    -25
      htmlmarqueeelement.go
  43. +5
    -5
      htmlolistelement.go
  44. +3
    -3
      htmloptionelement.go
  45. +10
    -10
      htmloptionscollection.go
  46. +15
    -15
      htmlselectelement.go
  47. +13
    -13
      htmltablecellelement.go
  48. +5
    -5
      htmltablecolelement.go
  49. +6
    -6
      htmltablerowelement.go
  50. +33
    -33
      htmltextareaelement.go
  51. +16
    -16
      htmlvideoelement.go
  52. +6
    -6
      imagebitmap.go
  53. +6
    -6
      imagedata.go
  54. +3
    -3
      medialist.go
  55. +3
    -3
      mimetypearray.go
  56. +3
    -3
      namednodemap.go
  57. +3
    -3
      navigator.go
  58. +16
    -16
      nodefilter.go
  59. +3
    -3
      nodeiterator.go
  60. +3
    -3
      nodelist.go
  61. +10
    -10
      offscreencanvas.go
  62. +3
    -3
      onerroreventhandlernonnull.go
  63. +3
    -3
      plugin.go
  64. +3
    -3
      pluginarray.go
  65. +1
    -1
      processinginstruction.go
  66. +6
    -6
      progressevent.go
  67. +1
    -1
      radionodelist.go
  68. +2
    -2
      range.go
  69. +2
    -2
      staticrange.go
  70. +3
    -3
      storage.go
  71. +3
    -3
      stylesheetlist.go
  72. +1
    -1
      text.go
  73. +3
    -3
      texttrackcuelist.go
  74. +3
    -3
      texttracklist.go
  75. +3
    -3
      timeranges.go
  76. +3
    -3
      treewalker.go
  77. +17
    -0
      value.go
  78. +6
    -6
      videotracklist.go
  79. +3
    -3
      websocket.go
  80. +12
    -12
      window.go
  81. +8
    -8
      window/window.go
  82. +6
    -6
      workerglobalscope.go
  83. +3
    -3
      workernavigator.go
  84. +5
    -5
      xmlhttprequest.go

+ 6
- 6
abstractrange.go View File

@ -7,9 +7,9 @@ import "syscall/js"
type AbstractRangeIFace interface { type AbstractRangeIFace interface {
GetCollapsed() bool GetCollapsed() bool
GetEndContainer() Node GetEndContainer() Node
GetEndOffset() float64
GetEndOffset() int
GetStartContainer() Node GetStartContainer() Node
GetStartOffset() float64
GetStartOffset() int
} }
type AbstractRange struct { type AbstractRange struct {
Value Value
@ -27,15 +27,15 @@ func (a AbstractRange) GetEndContainer() Node {
val := a.Get("endContainer") val := a.Get("endContainer")
return JSValueToNode(val.JSValue()) return JSValueToNode(val.JSValue())
} }
func (a AbstractRange) GetEndOffset() float64 {
func (a AbstractRange) GetEndOffset() int {
val := a.Get("endOffset") val := a.Get("endOffset")
return val.Float()
return val.Int()
} }
func (a AbstractRange) GetStartContainer() Node { func (a AbstractRange) GetStartContainer() Node {
val := a.Get("startContainer") val := a.Get("startContainer")
return JSValueToNode(val.JSValue()) return JSValueToNode(val.JSValue())
} }
func (a AbstractRange) GetStartOffset() float64 {
func (a AbstractRange) GetStartOffset() int {
val := a.Get("startOffset") val := a.Get("startOffset")
return val.Float()
return val.Int()
} }

+ 3
- 3
audiotracklist.go View File

@ -8,7 +8,7 @@ type AudioTrackListIFace interface {
AddEventListener(args ...interface{}) AddEventListener(args ...interface{})
DispatchEvent(args ...interface{}) bool DispatchEvent(args ...interface{}) bool
GetTrackById(args ...interface{}) AudioTrack GetTrackById(args ...interface{}) AudioTrack
GetLength() float64
GetLength() int
GetOnaddtrack() EventHandler GetOnaddtrack() EventHandler
SetOnaddtrack(EventHandler) SetOnaddtrack(EventHandler)
GetOnchange() EventHandler GetOnchange() EventHandler
@ -30,9 +30,9 @@ func (a AudioTrackList) GetTrackById(args ...interface{}) AudioTrack {
val := a.Call("getTrackById", args...) val := a.Call("getTrackById", args...)
return JSValueToAudioTrack(val.JSValue()) return JSValueToAudioTrack(val.JSValue())
} }
func (a AudioTrackList) GetLength() float64 {
func (a AudioTrackList) GetLength() int {
val := a.Get("length") val := a.Get("length")
return val.Float()
return val.Int()
} }
func (a AudioTrackList) GetOnaddtrack() EventHandler { func (a AudioTrackList) GetOnaddtrack() EventHandler {
val := a.Get("onaddtrack") val := a.Get("onaddtrack")


+ 3
- 3
blob.go View File

@ -5,7 +5,7 @@ package dom
import "syscall/js" import "syscall/js"
type BlobIFace interface { type BlobIFace interface {
GetSize() float64
GetSize() int
Slice(args ...interface{}) Blob Slice(args ...interface{}) Blob
GetType() string GetType() string
} }
@ -15,9 +15,9 @@ type Blob struct {
func JSValueToBlob(val js.Value) Blob { return Blob{Value: Value{Value: val}} } func JSValueToBlob(val js.Value) Blob { return Blob{Value: Value{Value: val}} }
func (v Value) AsBlob() Blob { return Blob{Value: v} } func (v Value) AsBlob() Blob { return Blob{Value: v} }
func (b Blob) GetSize() float64 {
func (b Blob) GetSize() int {
val := b.Get("size") val := b.Get("size")
return val.Float()
return val.Int()
} }
func (b Blob) Slice(args ...interface{}) Blob { func (b Blob) Slice(args ...interface{}) Blob {
val := b.Call("slice", args...) val := b.Call("slice", args...)


+ 1
- 1
cdatasection.go View File

@ -27,7 +27,7 @@ type CDATASectionIFace interface {
IsEqualNode(args ...interface{}) bool IsEqualNode(args ...interface{}) bool
IsSameNode(args ...interface{}) bool IsSameNode(args ...interface{}) bool
GetLastChild() Node GetLastChild() Node
GetLength() float64
GetLength() int
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
GetNextSibling() Node GetNextSibling() Node


+ 3
- 3
characterdata.go View File

@ -29,7 +29,7 @@ type CharacterDataIFace interface {
IsEqualNode(args ...interface{}) bool IsEqualNode(args ...interface{}) bool
IsSameNode(args ...interface{}) bool IsSameNode(args ...interface{}) bool
GetLastChild() Node GetLastChild() Node
GetLength() float64
GetLength() int
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
GetNextElementSibling() Element GetNextElementSibling() Element
@ -86,9 +86,9 @@ func (c CharacterData) DeleteData(args ...interface{}) {
func (c CharacterData) InsertData(args ...interface{}) { func (c CharacterData) InsertData(args ...interface{}) {
c.Call("insertData", args...) c.Call("insertData", args...)
} }
func (c CharacterData) GetLength() float64 {
func (c CharacterData) GetLength() int {
val := c.Get("length") val := c.Get("length")
return val.Float()
return val.Int()
} }
func (c CharacterData) GetNextElementSibling() Element { func (c CharacterData) GetNextElementSibling() Element {
val := c.Get("nextElementSibling") val := c.Get("nextElementSibling")


+ 6
- 7
cmd/dom/main.go View File

@ -1,18 +1,17 @@
package main package main
import ( import (
"github.com/brettlangdon/go-dom/v1/console"
"github.com/brettlangdon/go-dom/v1/document"
"github.com/brettlangdon/go-dom/v1/window"
"github.com/brettlangdon/go-dom/console"
"github.com/brettlangdon/go-dom/document"
"github.com/brettlangdon/go-dom/window"
) )
func main() { func main() {
loc := window.GetLocation() loc := window.GetLocation()
console.Dir(loc.JSValue())
console.Dir(loc)
nodes := document.QuerySelectorAll("div") nodes := document.QuerySelectorAll("div")
var i float64 = 0
for ; i < nodes.GetLength(); i++ {
console.Dir(nodes.Item(i).JSValue())
for i := 0; i < nodes.GetLength(); i++ {
console.Dir(nodes.Item(i))
} }
} }

+ 1
- 1
comment.go View File

@ -27,7 +27,7 @@ type CommentIFace interface {
IsEqualNode(args ...interface{}) bool IsEqualNode(args ...interface{}) bool
IsSameNode(args ...interface{}) bool IsSameNode(args ...interface{}) bool
GetLastChild() Node GetLastChild() Node
GetLength() float64
GetLength() int
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
GetNextSibling() Node GetNextSibling() Node


+ 1
- 1
console/console.go View File

@ -2,7 +2,7 @@
// console/console.go // console/console.go
package console package console
import dom "github.com/brettlangdon/go-dom/v1"
import dom "github.com/brettlangdon/go-dom"
import "syscall/js" import "syscall/js"
var value dom.Value var value dom.Value


+ 1
- 1
css/css.go View File

@ -2,7 +2,7 @@
// css/css.go // css/css.go
package css package css
import dom "github.com/brettlangdon/go-dom/v1"
import dom "github.com/brettlangdon/go-dom"
import "syscall/js" import "syscall/js"
var value dom.Value var value dom.Value


+ 3
- 3
cssgroupingrule.go View File

@ -9,7 +9,7 @@ type CSSGroupingRuleIFace interface {
GetCssText() string GetCssText() string
SetCssText(string) SetCssText(string)
DeleteRule(args ...interface{}) DeleteRule(args ...interface{})
InsertRule(args ...interface{}) float64
InsertRule(args ...interface{}) int
GetParentRule() CSSRule GetParentRule() CSSRule
GetParentStyleSheet() CSSStyleSheet GetParentStyleSheet() CSSStyleSheet
GetType() int GetType() int
@ -30,7 +30,7 @@ func (c CSSGroupingRule) GetCssRules() CSSRuleList {
func (c CSSGroupingRule) DeleteRule(args ...interface{}) { func (c CSSGroupingRule) DeleteRule(args ...interface{}) {
c.Call("deleteRule", args...) c.Call("deleteRule", args...)
} }
func (c CSSGroupingRule) InsertRule(args ...interface{}) float64 {
func (c CSSGroupingRule) InsertRule(args ...interface{}) int {
val := c.Call("insertRule", args...) val := c.Call("insertRule", args...)
return val.Float()
return val.Int()
} }

+ 1
- 1
csspagerule.go View File

@ -9,7 +9,7 @@ type CSSPageRuleIFace interface {
GetCssText() string GetCssText() string
SetCssText(string) SetCssText(string)
DeleteRule(args ...interface{}) DeleteRule(args ...interface{})
InsertRule(args ...interface{}) float64
InsertRule(args ...interface{}) int
GetParentRule() CSSRule GetParentRule() CSSRule
GetParentStyleSheet() CSSStyleSheet GetParentStyleSheet() CSSStyleSheet
GetSelectorText() string GetSelectorText() string


+ 3
- 3
cssrulelist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type CSSRuleListIFace interface { type CSSRuleListIFace interface {
Item(args ...interface{}) CSSRule Item(args ...interface{}) CSSRule
GetLength() float64
GetLength() int
} }
type CSSRuleList struct { type CSSRuleList struct {
Value Value
@ -18,7 +18,7 @@ func (c CSSRuleList) Item(args ...interface{}) CSSRule {
val := c.Call("item", args...) val := c.Call("item", args...)
return JSValueToCSSRule(val.JSValue()) return JSValueToCSSRule(val.JSValue())
} }
func (c CSSRuleList) GetLength() float64 {
func (c CSSRuleList) GetLength() int {
val := c.Get("length") val := c.Get("length")
return val.Float()
return val.Int()
} }

+ 3
- 3
cssstyledeclaration.go View File

@ -12,7 +12,7 @@ type CSSStyleDeclarationIFace interface {
GetPropertyPriority(args ...interface{}) string GetPropertyPriority(args ...interface{}) string
GetPropertyValue(args ...interface{}) string GetPropertyValue(args ...interface{}) string
Item(args ...interface{}) string Item(args ...interface{}) string
GetLength() float64
GetLength() int
GetParentRule() CSSRule GetParentRule() CSSRule
RemoveProperty(args ...interface{}) string RemoveProperty(args ...interface{}) string
SetProperty(args ...interface{}) SetProperty(args ...interface{})
@ -51,9 +51,9 @@ func (c CSSStyleDeclaration) Item(args ...interface{}) string {
val := c.Call("item", args...) val := c.Call("item", args...)
return val.String() return val.String()
} }
func (c CSSStyleDeclaration) GetLength() float64 {
func (c CSSStyleDeclaration) GetLength() int {
val := c.Get("length") val := c.Get("length")
return val.Float()
return val.Int()
} }
func (c CSSStyleDeclaration) GetParentRule() CSSRule { func (c CSSStyleDeclaration) GetParentRule() CSSRule {
val := c.Get("parentRule") val := c.Get("parentRule")


+ 3
- 3
cssstylesheet.go View File

@ -10,7 +10,7 @@ type CSSStyleSheetIFace interface {
GetDisabled() bool GetDisabled() bool
SetDisabled(bool) SetDisabled(bool)
GetHref() string GetHref() string
InsertRule(args ...interface{}) float64
InsertRule(args ...interface{}) int
GetMedia() MediaList GetMedia() MediaList
GetOwnerNode() GetOwnerNode()
GetOwnerRule() CSSRule GetOwnerRule() CSSRule
@ -34,9 +34,9 @@ func (c CSSStyleSheet) GetCssRules() CSSRuleList {
func (c CSSStyleSheet) DeleteRule(args ...interface{}) { func (c CSSStyleSheet) DeleteRule(args ...interface{}) {
c.Call("deleteRule", args...) c.Call("deleteRule", args...)
} }
func (c CSSStyleSheet) InsertRule(args ...interface{}) float64 {
func (c CSSStyleSheet) InsertRule(args ...interface{}) int {
val := c.Call("insertRule", args...) val := c.Call("insertRule", args...)
return val.Float()
return val.Int()
} }
func (c CSSStyleSheet) GetOwnerRule() CSSRule { func (c CSSStyleSheet) GetOwnerRule() CSSRule {
val := c.Get("ownerRule") val := c.Get("ownerRule")


+ 3
- 3
datatransferitemlist.go View File

@ -8,7 +8,7 @@ type DataTransferItemListIFace interface {
Add(args ...interface{}) DataTransferItem Add(args ...interface{}) DataTransferItem
AddWithArgs(args ...interface{}) DataTransferItem AddWithArgs(args ...interface{}) DataTransferItem
Clear(args ...interface{}) Clear(args ...interface{})
GetLength() float64
GetLength() int
Remove(args ...interface{}) Remove(args ...interface{})
} }
type DataTransferItemList struct { type DataTransferItemList struct {
@ -30,9 +30,9 @@ func (d DataTransferItemList) AddWithArgs(args ...interface{}) DataTransferItem
func (d DataTransferItemList) Clear(args ...interface{}) { func (d DataTransferItemList) Clear(args ...interface{}) {
d.Call("clear", args...) d.Call("clear", args...)
} }
func (d DataTransferItemList) GetLength() float64 {
func (d DataTransferItemList) GetLength() int {
val := d.Get("length") val := d.Get("length")
return val.Float()
return val.Int()
} }
func (d DataTransferItemList) Remove(args ...interface{}) { func (d DataTransferItemList) Remove(args ...interface{}) {
d.Call("remove", args...) d.Call("remove", args...)


+ 3
- 3
dedicatedworkerglobalscope.go View File

@ -31,7 +31,7 @@ type DedicatedWorkerGlobalScopeIFace interface {
SetOnunhandledrejection(EventHandler) SetOnunhandledrejection(EventHandler)
PostMessage(args ...interface{}) PostMessage(args ...interface{})
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
RequestAnimationFrame(args ...interface{}) float64
RequestAnimationFrame(args ...interface{}) int
GetSelf() WorkerGlobalScope GetSelf() WorkerGlobalScope
} }
type DedicatedWorkerGlobalScope struct { type DedicatedWorkerGlobalScope struct {
@ -73,7 +73,7 @@ func (d DedicatedWorkerGlobalScope) SetOnmessageerror(val EventHandler) {
func (d DedicatedWorkerGlobalScope) PostMessage(args ...interface{}) { func (d DedicatedWorkerGlobalScope) PostMessage(args ...interface{}) {
d.Call("postMessage", args...) d.Call("postMessage", args...)
} }
func (d DedicatedWorkerGlobalScope) RequestAnimationFrame(args ...interface{}) float64 {
func (d DedicatedWorkerGlobalScope) RequestAnimationFrame(args ...interface{}) int {
val := d.Call("requestAnimationFrame", args...) val := d.Call("requestAnimationFrame", args...)
return val.Float()
return val.Int()
} }

+ 3
- 3
document.go View File

@ -12,7 +12,7 @@ type DocumentIFace interface {
GetBaseURI() string GetBaseURI() string
GetCharacterSet() string GetCharacterSet() string
GetCharset() string GetCharset() string
GetChildElementCount() float64
GetChildElementCount() int
GetChildNodes() NodeList GetChildNodes() NodeList
GetChildren() HTMLCollection GetChildren() HTMLCollection
CloneNode(args ...interface{}) Node CloneNode(args ...interface{}) Node
@ -231,9 +231,9 @@ func (d Document) GetCharset() string {
val := d.Get("charset") val := d.Get("charset")
return val.String() return val.String()
} }
func (d Document) GetChildElementCount() float64 {
func (d Document) GetChildElementCount() int {
val := d.Get("childElementCount") val := d.Get("childElementCount")
return val.Float()
return val.Int()
} }
func (d Document) GetChildren() HTMLCollection { func (d Document) GetChildren() HTMLCollection {
val := d.Get("children") val := d.Get("children")


+ 2
- 2
document/document.go View File

@ -2,7 +2,7 @@
// document/document.go // document/document.go
package document package document
import dom "github.com/brettlangdon/go-dom/v1"
import dom "github.com/brettlangdon/go-dom"
import "syscall/js" import "syscall/js"
var value dom.Document var value dom.Document
@ -31,7 +31,7 @@ func GetCharacterSet() string {
func GetCharset() string { func GetCharset() string {
return value.GetCharset() return value.GetCharset()
} }
func GetChildElementCount() float64 {
func GetChildElementCount() int {
return value.GetChildElementCount() return value.GetChildElementCount()
} }
func GetChildNodes() dom.NodeList { func GetChildNodes() dom.NodeList {


+ 3
- 3
documentfragment.go View File

@ -9,7 +9,7 @@ type DocumentFragmentIFace interface {
Append(args ...interface{}) Append(args ...interface{})
AppendChild(args ...interface{}) Node AppendChild(args ...interface{}) Node
GetBaseURI() string GetBaseURI() string
GetChildElementCount() float64
GetChildElementCount() int
GetChildNodes() NodeList GetChildNodes() NodeList
GetChildren() HTMLCollection GetChildren() HTMLCollection
CloneNode(args ...interface{}) Node CloneNode(args ...interface{}) Node
@ -62,9 +62,9 @@ func (v Value) AsDocumentFragment() DocumentFragment { return DocumentFragment{V
func (d DocumentFragment) Append(args ...interface{}) { func (d DocumentFragment) Append(args ...interface{}) {
d.Call("append", args...) d.Call("append", args...)
} }
func (d DocumentFragment) GetChildElementCount() float64 {
func (d DocumentFragment) GetChildElementCount() int {
val := d.Get("childElementCount") val := d.Get("childElementCount")
return val.Float()
return val.Int()
} }
func (d DocumentFragment) GetChildren() HTMLCollection { func (d DocumentFragment) GetChildren() HTMLCollection {
val := d.Get("children") val := d.Get("children")


+ 3
- 3
domrectlist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type DOMRectListIFace interface { type DOMRectListIFace interface {
Item(args ...interface{}) DOMRect Item(args ...interface{}) DOMRect
GetLength() float64
GetLength() int
} }
type DOMRectList struct { type DOMRectList struct {
Value Value
@ -18,7 +18,7 @@ func (d DOMRectList) Item(args ...interface{}) DOMRect {
val := d.Call("item", args...) val := d.Call("item", args...)
return JSValueToDOMRect(val.JSValue()) return JSValueToDOMRect(val.JSValue())
} }
func (d DOMRectList) GetLength() float64 {
func (d DOMRectList) GetLength() int {
val := d.Get("length") val := d.Get("length")
return val.Float()
return val.Int()
} }

+ 3
- 3
domstringlist.go View File

@ -7,7 +7,7 @@ import "syscall/js"
type DOMStringListIFace interface { type DOMStringListIFace interface {
Contains(args ...interface{}) bool Contains(args ...interface{}) bool
Item(args ...interface{}) string Item(args ...interface{}) string
GetLength() float64
GetLength() int
} }
type DOMStringList struct { type DOMStringList struct {
Value Value
@ -25,7 +25,7 @@ func (d DOMStringList) Item(args ...interface{}) string {
val := d.Call("item", args...) val := d.Call("item", args...)
return val.String() return val.String()
} }
func (d DOMStringList) GetLength() float64 {
func (d DOMStringList) GetLength() int {
val := d.Get("length") val := d.Get("length")
return val.Float()
return val.Int()
} }

+ 2
- 2
domtimestamp.go View File

@ -4,8 +4,8 @@ package dom
import "syscall/js" import "syscall/js"
type DOMTimeStamp float64
type DOMTimeStamp int
func JSValueToDOMTimeStamp(val js.Value) DOMTimeStamp { func JSValueToDOMTimeStamp(val js.Value) DOMTimeStamp {
return DOMTimeStamp(val.Float())
return DOMTimeStamp(val.Int())
} }

+ 3
- 3
domtokenlist.go View File

@ -8,7 +8,7 @@ type DOMTokenListIFace interface {
Add(args ...interface{}) Add(args ...interface{})
Contains(args ...interface{}) bool Contains(args ...interface{}) bool
Item(args ...interface{}) string Item(args ...interface{}) string
GetLength() float64
GetLength() int
Remove(args ...interface{}) Remove(args ...interface{})
Replace(args ...interface{}) bool Replace(args ...interface{}) bool
Supports(args ...interface{}) bool Supports(args ...interface{}) bool
@ -33,9 +33,9 @@ func (d DOMTokenList) Item(args ...interface{}) string {
val := d.Call("item", args...) val := d.Call("item", args...)
return val.String() return val.String()
} }
func (d DOMTokenList) GetLength() float64 {
func (d DOMTokenList) GetLength() int {
val := d.Get("length") val := d.Get("length")
return val.Float()
return val.Int()
} }
func (d DOMTokenList) Remove(args ...interface{}) { func (d DOMTokenList) Remove(args ...interface{}) {
d.Call("remove", args...) d.Call("remove", args...)


+ 3
- 3
element.go View File

@ -14,7 +14,7 @@ type ElementIFace interface {
GetAttributes() NamedNodeMap GetAttributes() NamedNodeMap
GetBaseURI() string GetBaseURI() string
Before(args ...interface{}) Before(args ...interface{})
GetChildElementCount() float64
GetChildElementCount() int
GetChildNodes() NodeList GetChildNodes() NodeList
GetChildren() HTMLCollection GetChildren() HTMLCollection
GetClassList() DOMTokenList GetClassList() DOMTokenList
@ -122,9 +122,9 @@ func (e Element) GetAttributes() NamedNodeMap {
func (e Element) Before(args ...interface{}) { func (e Element) Before(args ...interface{}) {
e.Call("before", args...) e.Call("before", args...)
} }
func (e Element) GetChildElementCount() float64 {
func (e Element) GetChildElementCount() int {
val := e.Get("childElementCount") val := e.Get("childElementCount")
return val.Float()
return val.Int()
} }
func (e Element) GetChildren() HTMLCollection { func (e Element) GetChildren() HTMLCollection {
val := e.Get("children") val := e.Get("children")


+ 6
- 6
errorevent.go View File

@ -9,7 +9,7 @@ type ErrorEventIFace interface {
GetCancelBubble() bool GetCancelBubble() bool
SetCancelBubble(bool) SetCancelBubble(bool)
GetCancelable() bool GetCancelable() bool
GetColno() float64
GetColno() int
GetComposed() bool GetComposed() bool
ComposedPath(args ...interface{}) ComposedPath(args ...interface{})
GetCurrentTarget() EventTarget GetCurrentTarget() EventTarget
@ -19,7 +19,7 @@ type ErrorEventIFace interface {
GetFilename() string GetFilename() string
InitEvent(args ...interface{}) InitEvent(args ...interface{})
GetIsTrusted() bool GetIsTrusted() bool
GetLineno() float64
GetLineno() int
GetMessage() string GetMessage() string
PreventDefault(args ...interface{}) PreventDefault(args ...interface{})
GetReturnValue() bool GetReturnValue() bool
@ -38,9 +38,9 @@ type ErrorEvent struct {
func JSValueToErrorEvent(val js.Value) ErrorEvent { return ErrorEvent{Value: Value{Value: val}} } func JSValueToErrorEvent(val js.Value) ErrorEvent { return ErrorEvent{Value: Value{Value: val}} }
func (v Value) AsErrorEvent() ErrorEvent { return ErrorEvent{Value: v} } func (v Value) AsErrorEvent() ErrorEvent { return ErrorEvent{Value: v} }
func (e ErrorEvent) GetColno() float64 {
func (e ErrorEvent) GetColno() int {
val := e.Get("colno") val := e.Get("colno")
return val.Float()
return val.Int()
} }
func (e ErrorEvent) GetError() Value { func (e ErrorEvent) GetError() Value {
val := e.Get("error") val := e.Get("error")
@ -50,9 +50,9 @@ func (e ErrorEvent) GetFilename() string {
val := e.Get("filename") val := e.Get("filename")
return val.String() return val.String()
} }
func (e ErrorEvent) GetLineno() float64 {
func (e ErrorEvent) GetLineno() int {
val := e.Get("lineno") val := e.Get("lineno")
return val.Float()
return val.Int()
} }
func (e ErrorEvent) GetMessage() string { func (e ErrorEvent) GetMessage() string {
val := e.Get("message") val := e.Get("message")


+ 4
- 4
file.go View File

@ -5,9 +5,9 @@ package dom
import "syscall/js" import "syscall/js"
type FileIFace interface { type FileIFace interface {
GetLastModified() float64
GetLastModified() int
GetName() string GetName() string
GetSize() float64
GetSize() int
Slice(args ...interface{}) Blob Slice(args ...interface{}) Blob
GetType() string GetType() string
} }
@ -18,9 +18,9 @@ type File struct {
func JSValueToFile(val js.Value) File { return File{Value: Value{Value: val}} } func JSValueToFile(val js.Value) File { return File{Value: Value{Value: val}} }
func (v Value) AsFile() File { return File{Value: v} } func (v Value) AsFile() File { return File{Value: v} }
func (f File) GetLastModified() float64 {
func (f File) GetLastModified() int {
val := f.Get("lastModified") val := f.Get("lastModified")
return val.Float()
return val.Int()
} }
func (f File) GetName() string { func (f File) GetName() string {
val := f.Get("name") val := f.Get("name")


+ 3
- 3
filelist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type FileListIFace interface { type FileListIFace interface {
Item(args ...interface{}) File Item(args ...interface{}) File
GetLength() float64
GetLength() int
} }
type FileList struct { type FileList struct {
Value Value
@ -18,7 +18,7 @@ func (f FileList) Item(args ...interface{}) File {
val := f.Call("item", args...) val := f.Call("item", args...)
return JSValueToFile(val.JSValue()) return JSValueToFile(val.JSValue())
} }
func (f FileList) GetLength() float64 {
func (f FileList) GetLength() int {
val := f.Get("length") val := f.Get("length")
return val.Float()
return val.Int()
} }

+ 1
- 1
generate/generator.go View File

@ -435,7 +435,7 @@ func (g *Generator) generateNamespace(spec Spec) (err error) {
b.WriteString("// Code generated DO NOT EDIT") b.WriteString("// Code generated DO NOT EDIT")
b.WriteF("// %s", fname) b.WriteF("// %s", fname)
b.WriteF("package %s", d) b.WriteF("package %s", d)
b.WriteString("import dom \"github.com/brettlangdon/go-dom/v1\"")
b.WriteString("import dom \"github.com/brettlangdon/go-dom\"")
b.WriteString("import \"syscall/js\"") b.WriteString("import \"syscall/js\"")
vt := "Value" vt := "Value"


+ 5
- 4
generate/idl_type.go View File

@ -24,11 +24,12 @@ func convertIDLType(idlType interface{}) string {
switch t { switch t {
case "USVString", "DOMString", "CSSOMString": case "USVString", "DOMString", "CSSOMString":
t = "string" t = "string"
case "unsigned long", "long", "unsigned long long",
"double", "unrestricted double", "long long":
t = "float64"
case "unsigned short", "short":
case "unsigned long", "unsigned long long",
"long", "long long",
"unsigned short", "short":
t = "int" t = "int"
case "double", "unrestricted double":
t = "float64"
case "boolean": case "boolean":
t = "bool" t = "bool"
case "any", "object": case "any", "object":


+ 17
- 0
generate/static/value.go View File

@ -16,11 +16,28 @@ func (v Value) JSValue() js.Value { return v.Value }
func (v Value) Get(p string) Value { return JSValueToValue(v.Value.Get(p)) } func (v Value) Get(p string) Value { return JSValueToValue(v.Value.Get(p)) }
func (v Value) Index(i int) Value { return JSValueToValue(v.Value.Index(i)) } func (v Value) Index(i int) Value { return JSValueToValue(v.Value.Index(i)) }
func (v Value) Call(m string, args ...interface{}) Value { func (v Value) Call(m string, args ...interface{}) Value {
for i, a := range args {
args[i] = GetJSValue(a)
}
return JSValueToValue(v.Value.Call(m, args...)) return JSValueToValue(v.Value.Call(m, args...))
} }
func (v Value) Invoke(args ...interface{}) Value { func (v Value) Invoke(args ...interface{}) Value {
for i, a := range args {
args[i] = GetJSValue(a)
}
return JSValueToValue(v.Value.Invoke(args...)) return JSValueToValue(v.Value.Invoke(args...))
} }
func (v Value) New(args ...interface{}) Value { func (v Value) New(args ...interface{}) Value {
for i, a := range args {
args[i] = GetJSValue(a)
}
return JSValueToValue(v.Value.New(args...)) return JSValueToValue(v.Value.New(args...))
} }
func GetJSValue(v interface{}) interface{} {
t, ok := v.(JSValue)
if ok {
return t.JSValue()
}
return v
}

+ 1
- 1
go.mod View File

@ -1 +1 @@
module github.com/brettlangdon/go-dom/v1
module github.com/brettlangdon/go-dom

+ 3
- 3
history.go View File

@ -8,7 +8,7 @@ type HistoryIFace interface {
Back(args ...interface{}) Back(args ...interface{})
Forward(args ...interface{}) Forward(args ...interface{})
Go(args ...interface{}) Go(args ...interface{})
GetLength() float64
GetLength() int
PushState(args ...interface{}) PushState(args ...interface{})
ReplaceState(args ...interface{}) ReplaceState(args ...interface{})
GetScrollRestoration() ScrollRestoration GetScrollRestoration() ScrollRestoration
@ -30,9 +30,9 @@ func (h History) Forward(args ...interface{}) {
func (h History) Go(args ...interface{}) { func (h History) Go(args ...interface{}) {
h.Call("go", args...) h.Call("go", args...)
} }
func (h History) GetLength() float64 {
func (h History) GetLength() int {
val := h.Get("length") val := h.Get("length")
return val.Float()
return val.Int()
} }
func (h History) PushState(args ...interface{}) { func (h History) PushState(args ...interface{}) {
h.Call("pushState", args...) h.Call("pushState", args...)


+ 3
- 3
htmlallcollection.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type HTMLAllCollectionIFace interface { type HTMLAllCollectionIFace interface {
Item(args ...interface{}) Item(args ...interface{})
GetLength() float64
GetLength() int
NamedItem(args ...interface{}) NamedItem(args ...interface{})
} }
type HTMLAllCollection struct { type HTMLAllCollection struct {
@ -20,9 +20,9 @@ func (v Value) AsHTMLAllCollection() HTMLAllCollection { return HTMLAllCollectio
func (h HTMLAllCollection) Item(args ...interface{}) { func (h HTMLAllCollection) Item(args ...interface{}) {
h.Call("item", args...) h.Call("item", args...)
} }
func (h HTMLAllCollection) GetLength() float64 {
func (h HTMLAllCollection) GetLength() int {
val := h.Get("length") val := h.Get("length")
return val.Float()
return val.Int()
} }
func (h HTMLAllCollection) NamedItem(args ...interface{}) { func (h HTMLAllCollection) NamedItem(args ...interface{}) {
h.Call("namedItem", args...) h.Call("namedItem", args...)


+ 10
- 10
htmlcanvaselement.go View File

@ -44,8 +44,8 @@ type HTMLCanvasElementIFace interface {
HasAttributeNS(args ...interface{}) bool HasAttributeNS(args ...interface{}) bool
HasAttributes(args ...interface{}) bool HasAttributes(args ...interface{}) bool
HasChildNodes(args ...interface{}) bool HasChildNodes(args ...interface{}) bool
GetHeight() float64
SetHeight(float64)
GetHeight() int
SetHeight(int)
GetHidden() bool GetHidden() bool
SetHidden(bool) SetHidden(bool)
GetId() string GetId() string
@ -105,8 +105,8 @@ type HTMLCanvasElementIFace interface {
GetTranslate() bool GetTranslate() bool
SetTranslate(bool) SetTranslate(bool)
WebkitMatchesSelector(args ...interface{}) bool WebkitMatchesSelector(args ...interface{}) bool
GetWidth() float64
SetWidth(float64)
GetWidth() int
SetWidth(int)
} }
type HTMLCanvasElement struct { type HTMLCanvasElement struct {
Value Value
@ -124,11 +124,11 @@ func (h HTMLCanvasElement) GetContext(args ...interface{}) RenderingContext {
val := h.Call("getContext", args...) val := h.Call("getContext", args...)
return JSValueToRenderingContext(val.JSValue()) return JSValueToRenderingContext(val.JSValue())
} }
func (h HTMLCanvasElement) GetHeight() float64 {
func (h HTMLCanvasElement) GetHeight() int {
val := h.Get("height") val := h.Get("height")
return val.Float()
return val.Int()
} }
func (h HTMLCanvasElement) SetHeight(val float64) {
func (h HTMLCanvasElement) SetHeight(val int) {
h.Set("height", val) h.Set("height", val)
} }
func (h HTMLCanvasElement) ToBlob(args ...interface{}) { func (h HTMLCanvasElement) ToBlob(args ...interface{}) {
@ -142,10 +142,10 @@ func (h HTMLCanvasElement) TransferControlToOffscreen(args ...interface{}) Offsc
val := h.Call("transferControlToOffscreen", args...) val := h.Call("transferControlToOffscreen", args...)
return JSValueToOffscreenCanvas(val.JSValue()) return JSValueToOffscreenCanvas(val.JSValue())
} }
func (h HTMLCanvasElement) GetWidth() float64 {
func (h HTMLCanvasElement) GetWidth() int {
val := h.Get("width") val := h.Get("width")
return val.Float()
return val.Int()
} }
func (h HTMLCanvasElement) SetWidth(val float64) {
func (h HTMLCanvasElement) SetWidth(val int) {
h.Set("width", val) h.Set("width", val)
} }

+ 3
- 3
htmlcollection.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type HTMLCollectionIFace interface { type HTMLCollectionIFace interface {
Item(args ...interface{}) Element Item(args ...interface{}) Element
GetLength() float64
GetLength() int
NamedItem(args ...interface{}) Element NamedItem(args ...interface{}) Element
} }
type HTMLCollection struct { type HTMLCollection struct {
@ -21,9 +21,9 @@ func (h HTMLCollection) Item(args ...interface{}) Element {
val := h.Call("item", args...) val := h.Call("item", args...)
return JSValueToElement(val.JSValue()) return JSValueToElement(val.JSValue())
} }
func (h HTMLCollection) GetLength() float64 {
func (h HTMLCollection) GetLength() int {
val := h.Get("length") val := h.Get("length")
return val.Float()
return val.Int()
} }
func (h HTMLCollection) NamedItem(args ...interface{}) Element { func (h HTMLCollection) NamedItem(args ...interface{}) Element {
val := h.Call("namedItem", args...) val := h.Call("namedItem", args...)


+ 5
- 5
htmlelement.go View File

@ -233,8 +233,8 @@ type HTMLElementIFace interface {
GetSpellcheck() bool GetSpellcheck() bool
SetSpellcheck(bool) SetSpellcheck(bool)
GetStyle() CSSStyleDeclaration GetStyle() CSSStyleDeclaration
GetTabIndex() float64
SetTabIndex(float64)
GetTabIndex() int
SetTabIndex(int)
GetTagName() string GetTagName() string
GetTextContent() string GetTextContent() string
SetTextContent(string) SetTextContent(string)
@ -818,11 +818,11 @@ func (h HTMLElement) GetStyle() CSSStyleDeclaration {
val := h.Get("style") val := h.Get("style")
return JSValueToCSSStyleDeclaration(val.JSValue()) return JSValueToCSSStyleDeclaration(val.JSValue())
} }
func (h HTMLElement) GetTabIndex() float64 {
func (h HTMLElement) GetTabIndex() int {
val := h.Get("tabIndex") val := h.Get("tabIndex")
return val.Float()
return val.Int()
} }
func (h HTMLElement) SetTabIndex(val float64) {
func (h HTMLElement) SetTabIndex(val int) {
h.Set("tabIndex", val) h.Set("tabIndex", val)
} }
func (h HTMLElement) GetTitle() string { func (h HTMLElement) GetTitle() string {


+ 1
- 1
htmlformcontrolscollection.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type HTMLFormControlsCollectionIFace interface { type HTMLFormControlsCollectionIFace interface {
Item(args ...interface{}) Element Item(args ...interface{}) Element
GetLength() float64
GetLength() int
NamedItem(args ...interface{}) NamedItem(args ...interface{})
} }
type HTMLFormControlsCollection struct { type HTMLFormControlsCollection struct {


+ 3
- 3
htmlformelement.go View File

@ -71,7 +71,7 @@ type HTMLFormElementIFace interface {
GetLang() string GetLang() string
SetLang(string) SetLang(string)
GetLastChild() Node GetLastChild() Node
GetLength() float64
GetLength() int
GetLocalName() string GetLocalName() string
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
@ -179,9 +179,9 @@ func (h HTMLFormElement) GetEnctype() string {
func (h HTMLFormElement) SetEnctype(val string) { func (h HTMLFormElement) SetEnctype(val string) {
h.Set("enctype", val) h.Set("enctype", val)
} }
func (h HTMLFormElement) GetLength() float64 {
func (h HTMLFormElement) GetLength() int {
val := h.Get("length") val := h.Get("length")
return val.Float()
return val.Int()
} }
func (h HTMLFormElement) GetMethod() string { func (h HTMLFormElement) GetMethod() string {
val := h.Get("method") val := h.Get("method")


+ 16
- 16
htmlimageelement.go View File

@ -52,8 +52,8 @@ type HTMLImageElementIFace interface {
HasAttributeNS(args ...interface{}) bool HasAttributeNS(args ...interface{}) bool
HasAttributes(args ...interface{}) bool HasAttributes(args ...interface{}) bool
HasChildNodes(args ...interface{}) bool HasChildNodes(args ...interface{}) bool
GetHeight() float64
SetHeight(float64)
GetHeight() int
SetHeight(int)
GetHidden() bool GetHidden() bool
SetHidden(bool) SetHidden(bool)
GetId() string GetId() string
@ -77,8 +77,8 @@ type HTMLImageElementIFace interface {
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
Matches(args ...interface{}) bool Matches(args ...interface{}) bool
GetNamespaceURI() string GetNamespaceURI() string
GetNaturalHeight() float64
GetNaturalWidth() float64
GetNaturalHeight() int
GetNaturalWidth() int
GetNextSibling() Node GetNextSibling() Node
GetNodeName() string GetNodeName() string
GetNodeType() int GetNodeType() int
@ -124,8 +124,8 @@ type HTMLImageElementIFace interface {
GetUseMap() string GetUseMap() string
SetUseMap(string) SetUseMap(string)
WebkitMatchesSelector(args ...interface{}) bool WebkitMatchesSelector(args ...interface{}) bool
GetWidth() float64
SetWidth(float64)
GetWidth() int
SetWidth(int)
} }
type HTMLImageElement struct { type HTMLImageElement struct {
Value Value
@ -171,11 +171,11 @@ func (h HTMLImageElement) GetDecoding() string {
func (h HTMLImageElement) SetDecoding(val string) { func (h HTMLImageElement) SetDecoding(val string) {
h.Set("decoding", val) h.Set("decoding", val)
} }
func (h HTMLImageElement) GetHeight() float64 {
func (h HTMLImageElement) GetHeight() int {
val := h.Get("height") val := h.Get("height")
return val.Float()
return val.Int()
} }
func (h HTMLImageElement) SetHeight(val float64) {
func (h HTMLImageElement) SetHeight(val int) {
h.Set("height", val) h.Set("height", val)
} }
func (h HTMLImageElement) GetIsMap() bool { func (h HTMLImageElement) GetIsMap() bool {
@ -185,13 +185,13 @@ func (h HTMLImageElement) GetIsMap() bool {
func (h HTMLImageElement) SetIsMap(val bool) { func (h HTMLImageElement) SetIsMap(val bool) {
h.Set("isMap", val) h.Set("isMap", val)
} }
func (h HTMLImageElement) GetNaturalHeight() float64 {
func (h HTMLImageElement) GetNaturalHeight() int {
val := h.Get("naturalHeight") val := h.Get("naturalHeight")
return val.Float()
return val.Int()
} }
func (h HTMLImageElement) GetNaturalWidth() float64 {
func (h HTMLImageElement) GetNaturalWidth() int {
val := h.Get("naturalWidth") val := h.Get("naturalWidth")
return val.Float()
return val.Int()
} }
func (h HTMLImageElement) GetReferrerPolicy() string { func (h HTMLImageElement) GetReferrerPolicy() string {
val := h.Get("referrerPolicy") val := h.Get("referrerPolicy")
@ -228,10 +228,10 @@ func (h HTMLImageElement) GetUseMap() string {
func (h HTMLImageElement) SetUseMap(val string) { func (h HTMLImageElement) SetUseMap(val string) {
h.Set("useMap", val) h.Set("useMap", val)
} }
func (h HTMLImageElement) GetWidth() float64 {
func (h HTMLImageElement) GetWidth() int {
val := h.Get("width") val := h.Get("width")
return val.Float()
return val.Int()
} }
func (h HTMLImageElement) SetWidth(val float64) {
func (h HTMLImageElement) SetWidth(val int) {
h.Set("width", val) h.Set("width", val)
} }

+ 35
- 35
htmlinputelement.go View File

@ -75,8 +75,8 @@ type HTMLInputElementIFace interface {
HasAttributeNS(args ...interface{}) bool HasAttributeNS(args ...interface{}) bool
HasAttributes(args ...interface{}) bool HasAttributes(args ...interface{}) bool
HasChildNodes(args ...interface{}) bool HasChildNodes(args ...interface{}) bool
GetHeight() float64
SetHeight(float64)
GetHeight() int
SetHeight(int)
GetHidden() bool GetHidden() bool
SetHidden(bool) SetHidden(bool)
GetId() string GetId() string
@ -103,12 +103,12 @@ type HTMLInputElementIFace interface {
Matches(args ...interface{}) bool Matches(args ...interface{}) bool
GetMax() string GetMax() string
SetMax(string) SetMax(string)
GetMaxLength() float64
SetMaxLength(float64)
GetMaxLength() int
SetMaxLength(int)
GetMin() string GetMin() string
SetMin(string) SetMin(string)
GetMinLength() float64
SetMinLength(float64)
GetMinLength() int
SetMinLength(int)
GetMultiple() bool GetMultiple() bool
SetMultiple(bool) SetMultiple(bool)
GetName() string GetName() string
@ -143,10 +143,10 @@ type HTMLInputElementIFace interface {
Select(args ...interface{}) Select(args ...interface{})
GetSelectionDirection() string GetSelectionDirection() string
SetSelectionDirection(string) SetSelectionDirection(string)
GetSelectionEnd() float64
SetSelectionEnd(float64)
GetSelectionStart() float64
SetSelectionStart(float64)
GetSelectionEnd() int
SetSelectionEnd(int)
GetSelectionStart() int
SetSelectionStart(int)
SetAttribute(args ...interface{}) SetAttribute(args ...interface{})
SetAttributeNS(args ...interface{}) SetAttributeNS(args ...interface{})
SetAttributeNode(args ...interface{}) Attr SetAttributeNode(args ...interface{}) Attr
@ -156,8 +156,8 @@ type HTMLInputElementIFace interface {
SetRangeTextWithArgs(args ...interface{}) SetRangeTextWithArgs(args ...interface{})
SetSelectionRange(args ...interface{}) SetSelectionRange(args ...interface{})
GetShadowRoot() ShadowRoot GetShadowRoot() ShadowRoot
GetSize() float64
SetSize(float64)
GetSize() int
SetSize(int)
GetSlot() string GetSlot() string
SetSlot(string) SetSlot(string)
GetSpellcheck() bool GetSpellcheck() bool
@ -187,8 +187,8 @@ type HTMLInputElementIFace interface {
GetValueAsNumber() float64 GetValueAsNumber() float64
SetValueAsNumber(float64) SetValueAsNumber(float64)
WebkitMatchesSelector(args ...interface{}) bool WebkitMatchesSelector(args ...interface{}) bool
GetWidth() float64
SetWidth(float64)
GetWidth() int
SetWidth(int)
GetWillValidate() bool GetWillValidate() bool
} }
type HTMLInputElement struct { type HTMLInputElement struct {
@ -316,11 +316,11 @@ func (h HTMLInputElement) GetFormTarget() string {
func (h HTMLInputElement) SetFormTarget(val string) { func (h HTMLInputElement) SetFormTarget(val string) {
h.Set("formTarget", val) h.Set("formTarget", val)
} }
func (h HTMLInputElement) GetHeight() float64 {
func (h HTMLInputElement) GetHeight() int {
val := h.Get("height") val := h.Get("height")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetHeight(val float64) {
func (h HTMLInputElement) SetHeight(val int) {
h.Set("height", val) h.Set("height", val)
} }
func (h HTMLInputElement) GetIndeterminate() bool { func (h HTMLInputElement) GetIndeterminate() bool {
@ -345,11 +345,11 @@ func (h HTMLInputElement) GetMax() string {
func (h HTMLInputElement) SetMax(val string) { func (h HTMLInputElement) SetMax(val string) {
h.Set("max", val) h.Set("max", val)
} }
func (h HTMLInputElement) GetMaxLength() float64 {
func (h HTMLInputElement) GetMaxLength() int {
val := h.Get("maxLength") val := h.Get("maxLength")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetMaxLength(val float64) {
func (h HTMLInputElement) SetMaxLength(val int) {
h.Set("maxLength", val) h.Set("maxLength", val)
} }
func (h HTMLInputElement) GetMin() string { func (h HTMLInputElement) GetMin() string {
@ -359,11 +359,11 @@ func (h HTMLInputElement) GetMin() string {
func (h HTMLInputElement) SetMin(val string) { func (h HTMLInputElement) SetMin(val string) {
h.Set("min", val) h.Set("min", val)
} }
func (h HTMLInputElement) GetMinLength() float64 {
func (h HTMLInputElement) GetMinLength() int {
val := h.Get("minLength") val := h.Get("minLength")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetMinLength(val float64) {
func (h HTMLInputElement) SetMinLength(val int) {
h.Set("minLength", val) h.Set("minLength", val)
} }
func (h HTMLInputElement) GetMultiple() bool { func (h HTMLInputElement) GetMultiple() bool {
@ -422,18 +422,18 @@ func (h HTMLInputElement) GetSelectionDirection() string {
func (h HTMLInputElement) SetSelectionDirection(val string) { func (h HTMLInputElement) SetSelectionDirection(val string) {
h.Set("selectionDirection", val) h.Set("selectionDirection", val)
} }
func (h HTMLInputElement) GetSelectionEnd() float64 {
func (h HTMLInputElement) GetSelectionEnd() int {
val := h.Get("selectionEnd") val := h.Get("selectionEnd")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetSelectionEnd(val float64) {
func (h HTMLInputElement) SetSelectionEnd(val int) {
h.Set("selectionEnd", val) h.Set("selectionEnd", val)
} }
func (h HTMLInputElement) GetSelectionStart() float64 {
func (h HTMLInputElement) GetSelectionStart() int {
val := h.Get("selectionStart") val := h.Get("selectionStart")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetSelectionStart(val float64) {
func (h HTMLInputElement) SetSelectionStart(val int) {
h.Set("selectionStart", val) h.Set("selectionStart", val)
} }
func (h HTMLInputElement) SetCustomValidity(args ...interface{}) { func (h HTMLInputElement) SetCustomValidity(args ...interface{}) {
@ -448,11 +448,11 @@ func (h HTMLInputElement) SetRangeTextWithArgs(args ...interface{}) {
func (h HTMLInputElement) SetSelectionRange(args ...interface{}) { func (h HTMLInputElement) SetSelectionRange(args ...interface{}) {
h.Call("setSelectionRange", args...) h.Call("setSelectionRange", args...)
} }
func (h HTMLInputElement) GetSize() float64 {
func (h HTMLInputElement) GetSize() int {
val := h.Get("size") val := h.Get("size")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetSize(val float64) {
func (h HTMLInputElement) SetSize(val int) {
h.Set("size", val) h.Set("size", val)
} }
func (h HTMLInputElement) GetSrc() string { func (h HTMLInputElement) GetSrc() string {
@ -511,11 +511,11 @@ func (h HTMLInputElement) GetValueAsNumber() float64 {
func (h HTMLInputElement) SetValueAsNumber(val float64) { func (h HTMLInputElement) SetValueAsNumber(val float64) {
h.Set("valueAsNumber", val) h.Set("valueAsNumber", val)
} }
func (h HTMLInputElement) GetWidth() float64 {
func (h HTMLInputElement) GetWidth() int {
val := h.Get("width") val := h.Get("width")
return val.Float()
return val.Int()
} }
func (h HTMLInputElement) SetWidth(val float64) {
func (h HTMLInputElement) SetWidth(val int) {
h.Set("width", val) h.Set("width", val)
} }
func (h HTMLInputElement) GetWillValidate() bool { func (h HTMLInputElement) GetWillValidate() bool {


+ 5
- 5
htmllielement.go View File

@ -98,8 +98,8 @@ type HTMLLIElementIFace interface {
ToggleAttribute(args ...interface{}) bool ToggleAttribute(args ...interface{}) bool
GetTranslate() bool GetTranslate() bool
SetTranslate(bool) SetTranslate(bool)
GetValue() float64
SetValue(float64)
GetValue() int
SetValue(int)
WebkitMatchesSelector(args ...interface{}) bool WebkitMatchesSelector(args ...interface{}) bool
} }
type HTMLLIElement struct { type HTMLLIElement struct {
@ -114,10 +114,10 @@ func JSValueToHTMLLIElement(val js.Value) HTMLLIElement {
return HTMLLIElement{Value: Value{Value: val}} return HTMLLIElement{Value: Value{Value: val}}
} }
func (v Value) AsHTMLLIElement() HTMLLIElement { return HTMLLIElement{Value: v} } func (v Value) AsHTMLLIElement() HTMLLIElement { return HTMLLIElement{Value: v} }
func (h HTMLLIElement) GetValue() float64 {
func (h HTMLLIElement) GetValue() int {
val := h.Get("value") val := h.Get("value")
return val.Float()
return val.Int()
} }
func (h HTMLLIElement) SetValue(val float64) {
func (h HTMLLIElement) SetValue(val int) {
h.Set("value", val) h.Set("value", val)
} }

+ 25
- 25
htmlmarqueeelement.go View File

@ -53,8 +53,8 @@ type HTMLMarqueeElementIFace interface {
SetHeight(string) SetHeight(string)
GetHidden() bool GetHidden() bool
SetHidden(bool) SetHidden(bool)
GetHspace() float64
SetHspace(float64)
GetHspace() int
SetHspace(int)
GetId() string GetId() string
SetId(string) SetId(string)
GetInnerText() string GetInnerText() string
@ -72,8 +72,8 @@ type HTMLMarqueeElementIFace interface {
GetLocalName() string GetLocalName() string
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
GetLoop() float64
SetLoop(float64)
GetLoop() int
SetLoop(int)
Matches(args ...interface{}) bool Matches(args ...interface{}) bool
GetNamespaceURI() string GetNamespaceURI() string
GetNextSibling() Node GetNextSibling() Node
@ -99,10 +99,10 @@ type HTMLMarqueeElementIFace interface {
RemoveChild(args ...interface{}) Node RemoveChild(args ...interface{}) Node
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
ReplaceChild(args ...interface{}) Node ReplaceChild(args ...interface{}) Node
GetScrollAmount() float64
SetScrollAmount(float64)
GetScrollDelay() float64
SetScrollDelay(float64)
GetScrollAmount() int
SetScrollAmount(int)
GetScrollDelay() int
SetScrollDelay(int)
SetAttribute(args ...interface{}) SetAttribute(args ...interface{})
SetAttributeNS(args ...interface{}) SetAttributeNS(args ...interface{})
SetAttributeNode(args ...interface{}) Attr SetAttributeNode(args ...interface{}) Attr
@ -124,8 +124,8 @@ type HTMLMarqueeElementIFace interface {
SetTranslate(bool) SetTranslate(bool)
GetTrueSpeed() bool GetTrueSpeed() bool
SetTrueSpeed(bool) SetTrueSpeed(bool)
GetVspace() float64
SetVspace(float64)
GetVspace() int
SetVspace(int)
WebkitMatchesSelector(args ...interface{}) bool WebkitMatchesSelector(args ...interface{}) bool
GetWidth() string GetWidth() string
SetWidth(string) SetWidth(string)
@ -170,18 +170,18 @@ func (h HTMLMarqueeElement) GetHeight() string {
func (h HTMLMarqueeElement) SetHeight(val string) { func (h HTMLMarqueeElement) SetHeight(val string) {
h.Set("height", val) h.Set("height", val)
} }
func (h HTMLMarqueeElement) GetHspace() float64 {
func (h HTMLMarqueeElement) GetHspace() int {
val := h.Get("hspace") val := h.Get("hspace")
return val.Float()
return val.Int()
} }
func (h HTMLMarqueeElement) SetHspace(val float64) {
func (h HTMLMarqueeElement) SetHspace(val int) {
h.Set("hspace", val) h.Set("hspace", val)
} }
func (h HTMLMarqueeElement) GetLoop() float64 {
func (h HTMLMarqueeElement) GetLoop() int {
val := h.Get("loop") val := h.Get("loop")
return val.Float()
return val.Int()
} }
func (h HTMLMarqueeElement) SetLoop(val float64) {
func (h HTMLMarqueeElement) SetLoop(val int) {
h.Set("loop", val) h.Set("loop", val)
} }
func (h HTMLMarqueeElement) GetOnbounce() EventHandler { func (h HTMLMarqueeElement) GetOnbounce() EventHandler {
@ -205,18 +205,18 @@ func (h HTMLMarqueeElement) GetOnstart() EventHandler {
func (h HTMLMarqueeElement) SetOnstart(val EventHandler) { func (h HTMLMarqueeElement) SetOnstart(val EventHandler) {
h.Set("onstart", val) h.Set("onstart", val)
} }
func (h HTMLMarqueeElement) GetScrollAmount() float64 {
func (h HTMLMarqueeElement) GetScrollAmount() int {
val := h.Get("scrollAmount") val := h.Get("scrollAmount")
return val.Float()
return val.Int()
} }
func (h HTMLMarqueeElement) SetScrollAmount(val float64) {
func (h HTMLMarqueeElement) SetScrollAmount(val int) {
h.Set("scrollAmount", val) h.Set("scrollAmount", val)
} }
func (h HTMLMarqueeElement) GetScrollDelay() float64 {
func (h HTMLMarqueeElement) GetScrollDelay() int {
val := h.Get("scrollDelay") val := h.Get("scrollDelay")
return val.Float()
return val.Int()
} }
func (h HTMLMarqueeElement) SetScrollDelay(val float64) {
func (h HTMLMarqueeElement) SetScrollDelay(val int) {
h.Set("scrollDelay", val) h.Set("scrollDelay", val)
} }
func (h HTMLMarqueeElement) Start(args ...interface{}) { func (h HTMLMarqueeElement) Start(args ...interface{}) {
@ -232,11 +232,11 @@ func (h HTMLMarqueeElement) GetTrueSpeed() bool {
func (h HTMLMarqueeElement) SetTrueSpeed(val bool) { func (h HTMLMarqueeElement) SetTrueSpeed(val bool) {
h.Set("trueSpeed", val) h.Set("trueSpeed", val)
} }
func (h HTMLMarqueeElement) GetVspace() float64 {
func (h HTMLMarqueeElement) GetVspace() int {
val := h.Get("vspace") val := h.Get("vspace")
return val.Float()
return val.Int()
} }
func (h HTMLMarqueeElement) SetVspace(val float64) {
func (h HTMLMarqueeElement) SetVspace(val int) {
h.Set("vspace", val) h.Set("vspace", val)
} }
func (h HTMLMarqueeElement) GetWidth() string { func (h HTMLMarqueeElement) GetWidth() string {


+ 5
- 5
htmlolistelement.go View File

@ -92,8 +92,8 @@ type HTMLOListElementIFace interface {
SetSlot(string) SetSlot(string)
GetSpellcheck() bool GetSpellcheck() bool
SetSpellcheck(bool) SetSpellcheck(bool)
GetStart() float64
SetStart(float64)
GetStart() int
SetStart(int)
GetTagName() string GetTagName() string
GetTextContent() string GetTextContent() string
SetTextContent(string) SetTextContent(string)
@ -125,11 +125,11 @@ func (h HTMLOListElement) GetReversed() bool {
func (h HTMLOListElement) SetReversed(val bool) { func (h HTMLOListElement) SetReversed(val bool) {
h.Set("reversed", val) h.Set("reversed", val)
} }
func (h HTMLOListElement) GetStart() float64 {
func (h HTMLOListElement) GetStart() int {
val := h.Get("start") val := h.Get("start")
return val.Float()
return val.Int()
} }
func (h HTMLOListElement) SetStart(val float64) {
func (h HTMLOListElement) SetStart(val int) {
h.Set("start", val) h.Set("start", val)
} }
func (h HTMLOListElement) GetType() string { func (h HTMLOListElement) GetType() string {


+ 3
- 3
htmloptionelement.go View File

@ -52,7 +52,7 @@ type HTMLOptionElementIFace interface {
SetHidden(bool) SetHidden(bool)
GetId() string GetId() string
SetId(string) SetId(string)
GetIndex() float64
GetIndex() int
GetInnerText() string GetInnerText() string
SetInnerText(string) SetInnerText(string)
InsertAdjacentElement(args ...interface{}) Element InsertAdjacentElement(args ...interface{}) Element
@ -144,9 +144,9 @@ func (h HTMLOptionElement) GetForm() HTMLFormElement {
val := h.Get("form") val := h.Get("form")
return JSValueToHTMLFormElement(val.JSValue()) return JSValueToHTMLFormElement(val.JSValue())
} }
func (h HTMLOptionElement) GetIndex() float64 {
func (h HTMLOptionElement) GetIndex() int {
val := h.Get("index") val := h.Get("index")
return val.Float()
return val.Int()
} }
func (h HTMLOptionElement) GetLabel() string { func (h HTMLOptionElement) GetLabel() string {
val := h.Get("label") val := h.Get("label")


+ 10
- 10
htmloptionscollection.go View File

@ -7,12 +7,12 @@ import "syscall/js"
type HTMLOptionsCollectionIFace interface { type HTMLOptionsCollectionIFace interface {
Add(args ...interface{}) Add(args ...interface{})
Item(args ...interface{}) Element Item(args ...interface{}) Element
GetLength() float64
SetLength(float64)
GetLength() int
SetLength(int)
NamedItem(args ...interface{}) Element NamedItem(args ...interface{}) Element
Remove(args ...interface{}) Remove(args ...interface{})
GetSelectedIndex() float64
SetSelectedIndex(float64)
GetSelectedIndex() int
SetSelectedIndex(int)
} }
type HTMLOptionsCollection struct { type HTMLOptionsCollection struct {
Value Value
@ -26,20 +26,20 @@ func (v Value) AsHTMLOptionsCollection() HTMLOptionsCollection { return HTMLOpti
func (h HTMLOptionsCollection) Add(args ...interface{}) { func (h HTMLOptionsCollection) Add(args ...interface{}) {
h.Call("add", args...) h.Call("add", args...)
} }
func (h HTMLOptionsCollection) GetLength() float64 {
func (h HTMLOptionsCollection) GetLength() int {
val := h.Get("length") val := h.Get("length")
return val.Float()
return val.Int()
} }
func (h HTMLOptionsCollection) SetLength(val float64) {
func (h HTMLOptionsCollection) SetLength(val int) {
h.Set("length", val) h.Set("length", val)
} }
func (h HTMLOptionsCollection) Remove(args ...interface{}) { func (h HTMLOptionsCollection) Remove(args ...interface{}) {
h.Call("remove", args...) h.Call("remove", args...)
} }
func (h HTMLOptionsCollection) GetSelectedIndex() float64 {
func (h HTMLOptionsCollection) GetSelectedIndex() int {
val := h.Get("selectedIndex") val := h.Get("selectedIndex")
return val.Float()
return val.Int()
} }
func (h HTMLOptionsCollection) SetSelectedIndex(val float64) {
func (h HTMLOptionsCollection) SetSelectedIndex(val int) {
h.Set("selectedIndex", val) h.Set("selectedIndex", val)
} }

+ 15
- 15
htmlselectelement.go View File

@ -70,8 +70,8 @@ type HTMLSelectElementIFace interface {
GetLang() string GetLang() string
SetLang(string) SetLang(string)
GetLastChild() Node GetLastChild() Node
GetLength() float64
SetLength(float64)
GetLength() int
SetLength(int)
GetLocalName() string GetLocalName() string
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
@ -105,8 +105,8 @@ type HTMLSelectElementIFace interface {
ReportValidity(args ...interface{}) bool ReportValidity(args ...interface{}) bool
GetRequired() bool GetRequired() bool
SetRequired(bool) SetRequired(bool)
GetSelectedIndex() float64
SetSelectedIndex(float64)
GetSelectedIndex() int
SetSelectedIndex(int)
GetSelectedOptions() HTMLCollection GetSelectedOptions() HTMLCollection
SetAttribute(args ...interface{}) SetAttribute(args ...interface{})
SetAttributeNS(args ...interface{}) SetAttributeNS(args ...interface{})
@ -114,8 +114,8 @@ type HTMLSelectElementIFace interface {
SetAttributeNodeNS(args ...interface{}) Attr SetAttributeNodeNS(args ...interface{}) Attr
SetCustomValidity(args ...interface{}) SetCustomValidity(args ...interface{})
GetShadowRoot() ShadowRoot GetShadowRoot() ShadowRoot
GetSize() float64
SetSize(float64)
GetSize() int
SetSize(int)
GetSlot() string GetSlot() string
SetSlot(string) SetSlot(string)
GetSpellcheck() bool GetSpellcheck() bool
@ -188,11 +188,11 @@ func (h HTMLSelectElement) GetLabels() NodeList {
val := h.Get("labels") val := h.Get("labels")
return JSValueToNodeList(val.JSValue()) return JSValueToNodeList(val.JSValue())
} }
func (h HTMLSelectElement) GetLength() float64 {
func (h HTMLSelectElement) GetLength() int {
val := h.Get("length") val := h.Get("length")
return val.Float()
return val.Int()
} }
func (h HTMLSelectElement) SetLength(val float64) {
func (h HTMLSelectElement) SetLength(val int) {
h.Set("length", val) h.Set("length", val)
} }
func (h HTMLSelectElement) GetMultiple() bool { func (h HTMLSelectElement) GetMultiple() bool {
@ -234,11 +234,11 @@ func (h HTMLSelectElement) GetRequired() bool {
func (h HTMLSelectElement) SetRequired(val bool) { func (h HTMLSelectElement) SetRequired(val bool) {
h.Set("required", val) h.Set("required", val)
} }
func (h HTMLSelectElement) GetSelectedIndex() float64 {
func (h HTMLSelectElement) GetSelectedIndex() int {
val := h.Get("selectedIndex") val := h.Get("selectedIndex")
return val.Float()
return val.Int()
} }
func (h HTMLSelectElement) SetSelectedIndex(val float64) {
func (h HTMLSelectElement) SetSelectedIndex(val int) {
h.Set("selectedIndex", val) h.Set("selectedIndex", val)
} }
func (h HTMLSelectElement) GetSelectedOptions() HTMLCollection { func (h HTMLSelectElement) GetSelectedOptions() HTMLCollection {
@ -248,11 +248,11 @@ func (h HTMLSelectElement) GetSelectedOptions() HTMLCollection {
func (h HTMLSelectElement) SetCustomValidity(args ...interface{}) { func (h HTMLSelectElement) SetCustomValidity(args ...interface{}) {
h.Call("setCustomValidity", args...) h.Call("setCustomValidity", args...)
} }
func (h HTMLSelectElement) GetSize() float64 {
func (h HTMLSelectElement) GetSize() int {
val := h.Get("size") val := h.Get("size")
return val.Float()
return val.Int()
} }
func (h HTMLSelectElement) SetSize(val float64) {
func (h HTMLSelectElement) SetSize(val int) {
h.Set("size", val) h.Set("size", val)
} }
func (h HTMLSelectElement) GetType() string { func (h HTMLSelectElement) GetType() string {


+ 13
- 13
htmltablecellelement.go View File

@ -17,7 +17,7 @@ type HTMLTableCellElementIFace interface {
GetAutocapitalize() string GetAutocapitalize() string
SetAutocapitalize(string) SetAutocapitalize(string)
GetBaseURI() string GetBaseURI() string
GetCellIndex() float64
GetCellIndex() int
GetChildNodes() NodeList GetChildNodes() NodeList
GetClassList() DOMTokenList GetClassList() DOMTokenList
GetClassName() string GetClassName() string
@ -25,8 +25,8 @@ type HTMLTableCellElementIFace interface {
Click(args ...interface{}) Click(args ...interface{})
CloneNode(args ...interface{}) Node CloneNode(args ...interface{}) Node
Closest(args ...interface{}) Element Closest(args ...interface{}) Element
GetColSpan() float64
SetColSpan(float64)
GetColSpan() int
SetColSpan(int)
CompareDocumentPosition(args ...interface{}) int CompareDocumentPosition(args ...interface{}) int
Contains(args ...interface{}) bool Contains(args ...interface{}) bool
GetDir() string GetDir() string
@ -88,8 +88,8 @@ type HTMLTableCellElementIFace interface {
RemoveChild(args ...interface{}) Node RemoveChild(args ...interface{}) Node
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
ReplaceChild(args ...interface{}) Node ReplaceChild(args ...interface{}) Node
GetRowSpan() float64
SetRowSpan(float64)
GetRowSpan() int
SetRowSpan(int)
GetScope() string GetScope() string
SetScope(string) SetScope(string)
SetAttribute(args ...interface{}) SetAttribute(args ...interface{})
@ -130,15 +130,15 @@ func (h HTMLTableCellElement) GetAbbr() string {
func (h HTMLTableCellElement) SetAbbr(val string) { func (h HTMLTableCellElement) SetAbbr(val string) {
h.Set("abbr", val) h.Set("abbr", val)
} }
func (h HTMLTableCellElement) GetCellIndex() float64 {
func (h HTMLTableCellElement) GetCellIndex() int {
val := h.Get("cellIndex") val := h.Get("cellIndex")
return val.Float()
return val.Int()
} }
func (h HTMLTableCellElement) GetColSpan() float64 {
func (h HTMLTableCellElement) GetColSpan() int {
val := h.Get("colSpan") val := h.Get("colSpan")
return val.Float()
return val.Int()
} }
func (h HTMLTableCellElement) SetColSpan(val float64) {
func (h HTMLTableCellElement) SetColSpan(val int) {
h.Set("colSpan", val) h.Set("colSpan", val)
} }
func (h HTMLTableCellElement) GetHeaders() string { func (h HTMLTableCellElement) GetHeaders() string {
@ -148,11 +148,11 @@ func (h HTMLTableCellElement) GetHeaders() string {
func (h HTMLTableCellElement) SetHeaders(val string) { func (h HTMLTableCellElement) SetHeaders(val string) {
h.Set("headers", val) h.Set("headers", val)
} }
func (h HTMLTableCellElement) GetRowSpan() float64 {
func (h HTMLTableCellElement) GetRowSpan() int {
val := h.Get("rowSpan") val := h.Get("rowSpan")
return val.Float()
return val.Int()
} }
func (h HTMLTableCellElement) SetRowSpan(val float64) {
func (h HTMLTableCellElement) SetRowSpan(val int) {
h.Set("rowSpan", val) h.Set("rowSpan", val)
} }
func (h HTMLTableCellElement) GetScope() string { func (h HTMLTableCellElement) GetScope() string {


+ 5
- 5
htmltablecolelement.go View File

@ -88,8 +88,8 @@ type HTMLTableColElementIFace interface {
GetShadowRoot() ShadowRoot GetShadowRoot() ShadowRoot
GetSlot() string GetSlot() string
SetSlot(string) SetSlot(string)
GetSpan() float64
SetSpan(float64)
GetSpan() int
SetSpan(int)
GetSpellcheck() bool GetSpellcheck() bool
SetSpellcheck(bool) SetSpellcheck(bool)
GetTagName() string GetTagName() string
@ -114,10 +114,10 @@ func JSValueToHTMLTableColElement(val js.Value) HTMLTableColElement {
return HTMLTableColElement{Value: Value{Value: val}} return HTMLTableColElement{Value: Value{Value: val}}
} }
func (v Value) AsHTMLTableColElement() HTMLTableColElement { return HTMLTableColElement{Value: v} } func (v Value) AsHTMLTableColElement() HTMLTableColElement { return HTMLTableColElement{Value: v} }
func (h HTMLTableColElement) GetSpan() float64 {
func (h HTMLTableColElement) GetSpan() int {
val := h.Get("span") val := h.Get("span")
return val.Float()
return val.Int()
} }
func (h HTMLTableColElement) SetSpan(val float64) {
func (h HTMLTableColElement) SetSpan(val int) {
h.Set("span", val) h.Set("span", val)
} }

+ 6
- 6
htmltablerowelement.go View File

@ -84,8 +84,8 @@ type HTMLTableRowElementIFace interface {
RemoveChild(args ...interface{}) Node RemoveChild(args ...interface{}) Node
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
ReplaceChild(args ...interface{}) Node ReplaceChild(args ...interface{}) Node
GetRowIndex() float64
GetSectionRowIndex() float64
GetRowIndex() int
GetSectionRowIndex() int
SetAttribute(args ...interface{}) SetAttribute(args ...interface{})
SetAttributeNS(args ...interface{}) SetAttributeNS(args ...interface{})
SetAttributeNode(args ...interface{}) Attr SetAttributeNode(args ...interface{}) Attr
@ -128,11 +128,11 @@ func (h HTMLTableRowElement) InsertCell(args ...interface{}) HTMLTableCellElemen
val := h.Call("insertCell", args...) val := h.Call("insertCell", args...)
return JSValueToHTMLTableCellElement(val.JSValue()) return JSValueToHTMLTableCellElement(val.JSValue())
} }
func (h HTMLTableRowElement) GetRowIndex() float64 {
func (h HTMLTableRowElement) GetRowIndex() int {
val := h.Get("rowIndex") val := h.Get("rowIndex")
return val.Float()
return val.Int()
} }
func (h HTMLTableRowElement) GetSectionRowIndex() float64 {
func (h HTMLTableRowElement) GetSectionRowIndex() int {
val := h.Get("sectionRowIndex") val := h.Get("sectionRowIndex")
return val.Float()
return val.Int()
} }

+ 33
- 33
htmltextareaelement.go View File

@ -27,8 +27,8 @@ type HTMLTextAreaElementIFace interface {
Click(args ...interface{}) Click(args ...interface{})
CloneNode(args ...interface{}) Node CloneNode(args ...interface{}) Node
Closest(args ...interface{}) Element Closest(args ...interface{}) Element
GetCols() float64
SetCols(float64)
GetCols() int
SetCols(int)
CompareDocumentPosition(args ...interface{}) int CompareDocumentPosition(args ...interface{}) int
Contains(args ...interface{}) bool Contains(args ...interface{}) bool
GetDefaultValue() string GetDefaultValue() string
@ -78,10 +78,10 @@ type HTMLTextAreaElementIFace interface {
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
Matches(args ...interface{}) bool Matches(args ...interface{}) bool
GetMaxLength() float64
SetMaxLength(float64)
GetMinLength() float64
SetMinLength(float64)
GetMaxLength() int
SetMaxLength(int)
GetMinLength() int
SetMinLength(int)
GetName() string GetName() string
SetName(string) SetName(string)
GetNamespaceURI() string GetNamespaceURI() string
@ -109,15 +109,15 @@ type HTMLTextAreaElementIFace interface {
ReportValidity(args ...interface{}) bool ReportValidity(args ...interface{}) bool
GetRequired() bool GetRequired() bool
SetRequired(bool) SetRequired(bool)
GetRows() float64
SetRows(float64)
GetRows() int
SetRows(int)
Select(args ...interface{}) Select(args ...interface{})
GetSelectionDirection() string GetSelectionDirection() string
SetSelectionDirection(string) SetSelectionDirection(string)
GetSelectionEnd() float64
SetSelectionEnd(float64)
GetSelectionStart() float64
SetSelectionStart(float64)
GetSelectionEnd() int
SetSelectionEnd(int)
GetSelectionStart() int
SetSelectionStart(int)
SetAttribute(args ...interface{}) SetAttribute(args ...interface{})
SetAttributeNS(args ...interface{}) SetAttributeNS(args ...interface{})
SetAttributeNode(args ...interface{}) Attr SetAttributeNode(args ...interface{}) Attr
@ -134,7 +134,7 @@ type HTMLTextAreaElementIFace interface {
GetTagName() string GetTagName() string
GetTextContent() string GetTextContent() string
SetTextContent(string) SetTextContent(string)
GetTextLength() float64
GetTextLength() int
GetTitle() string GetTitle() string
SetTitle(string) SetTitle(string)
ToggleAttribute(args ...interface{}) bool ToggleAttribute(args ...interface{}) bool
@ -180,11 +180,11 @@ func (h HTMLTextAreaElement) CheckValidity(args ...interface{}) bool {
val := h.Call("checkValidity", args...) val := h.Call("checkValidity", args...)
return val.Bool() return val.Bool()
} }
func (h HTMLTextAreaElement) GetCols() float64 {
func (h HTMLTextAreaElement) GetCols() int {
val := h.Get("cols") val := h.Get("cols")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) SetCols(val float64) {
func (h HTMLTextAreaElement) SetCols(val int) {
h.Set("cols", val) h.Set("cols", val)
} }
func (h HTMLTextAreaElement) GetDefaultValue() string { func (h HTMLTextAreaElement) GetDefaultValue() string {
@ -216,18 +216,18 @@ func (h HTMLTextAreaElement) GetLabels() NodeList {
val := h.Get("labels") val := h.Get("labels")
return JSValueToNodeList(val.JSValue()) return JSValueToNodeList(val.JSValue())
} }
func (h HTMLTextAreaElement) GetMaxLength() float64 {
func (h HTMLTextAreaElement) GetMaxLength() int {
val := h.Get("maxLength") val := h.Get("maxLength")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) SetMaxLength(val float64) {
func (h HTMLTextAreaElement) SetMaxLength(val int) {
h.Set("maxLength", val) h.Set("maxLength", val)
} }
func (h HTMLTextAreaElement) GetMinLength() float64 {
func (h HTMLTextAreaElement) GetMinLength() int {
val := h.Get("minLength") val := h.Get("minLength")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) SetMinLength(val float64) {
func (h HTMLTextAreaElement) SetMinLength(val int) {
h.Set("minLength", val) h.Set("minLength", val)
} }
func (h HTMLTextAreaElement) GetName() string { func (h HTMLTextAreaElement) GetName() string {
@ -262,11 +262,11 @@ func (h HTMLTextAreaElement) GetRequired() bool {
func (h HTMLTextAreaElement) SetRequired(val bool) { func (h HTMLTextAreaElement) SetRequired(val bool) {
h.Set("required", val) h.Set("required", val)
} }
func (h HTMLTextAreaElement) GetRows() float64 {
func (h HTMLTextAreaElement) GetRows() int {
val := h.Get("rows") val := h.Get("rows")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) SetRows(val float64) {
func (h HTMLTextAreaElement) SetRows(val int) {
h.Set("rows", val) h.Set("rows", val)
} }
func (h HTMLTextAreaElement) Select(args ...interface{}) { func (h HTMLTextAreaElement) Select(args ...interface{}) {
@ -279,18 +279,18 @@ func (h HTMLTextAreaElement) GetSelectionDirection() string {
func (h HTMLTextAreaElement) SetSelectionDirection(val string) { func (h HTMLTextAreaElement) SetSelectionDirection(val string) {
h.Set("selectionDirection", val) h.Set("selectionDirection", val)
} }
func (h HTMLTextAreaElement) GetSelectionEnd() float64 {
func (h HTMLTextAreaElement) GetSelectionEnd() int {
val := h.Get("selectionEnd") val := h.Get("selectionEnd")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) SetSelectionEnd(val float64) {
func (h HTMLTextAreaElement) SetSelectionEnd(val int) {
h.Set("selectionEnd", val) h.Set("selectionEnd", val)
} }
func (h HTMLTextAreaElement) GetSelectionStart() float64 {
func (h HTMLTextAreaElement) GetSelectionStart() int {
val := h.Get("selectionStart") val := h.Get("selectionStart")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) SetSelectionStart(val float64) {
func (h HTMLTextAreaElement) SetSelectionStart(val int) {
h.Set("selectionStart", val) h.Set("selectionStart", val)
} }
func (h HTMLTextAreaElement) SetCustomValidity(args ...interface{}) { func (h HTMLTextAreaElement) SetCustomValidity(args ...interface{}) {
@ -305,9 +305,9 @@ func (h HTMLTextAreaElement) SetRangeTextWithArgs(args ...interface{}) {
func (h HTMLTextAreaElement) SetSelectionRange(args ...interface{}) { func (h HTMLTextAreaElement) SetSelectionRange(args ...interface{}) {
h.Call("setSelectionRange", args...) h.Call("setSelectionRange", args...)
} }
func (h HTMLTextAreaElement) GetTextLength() float64 {
func (h HTMLTextAreaElement) GetTextLength() int {
val := h.Get("textLength") val := h.Get("textLength")
return val.Float()
return val.Int()
} }
func (h HTMLTextAreaElement) GetType() string { func (h HTMLTextAreaElement) GetType() string {
val := h.Get("type") val := h.Get("type")


+ 16
- 16
htmlvideoelement.go View File

@ -65,8 +65,8 @@ type HTMLVideoElementIFace interface {
HasAttributeNS(args ...interface{}) bool HasAttributeNS(args ...interface{}) bool
HasAttributes(args ...interface{}) bool HasAttributes(args ...interface{}) bool
HasChildNodes(args ...interface{}) bool HasChildNodes(args ...interface{}) bool
GetHeight() float64
SetHeight(float64)
GetHeight() int
SetHeight(int)
GetHidden() bool GetHidden() bool
SetHidden(bool) SetHidden(bool)
GetId() string GetId() string
@ -148,14 +148,14 @@ type HTMLVideoElementIFace interface {
ToggleAttribute(args ...interface{}) bool ToggleAttribute(args ...interface{}) bool
GetTranslate() bool GetTranslate() bool
SetTranslate(bool) SetTranslate(bool)
GetVideoHeight() float64
GetVideoHeight() int
GetVideoTracks() VideoTrackList GetVideoTracks() VideoTrackList
GetVideoWidth() float64
GetVideoWidth() int
GetVolume() float64 GetVolume() float64
SetVolume(float64) SetVolume(float64)
WebkitMatchesSelector(args ...interface{}) bool WebkitMatchesSelector(args ...interface{}) bool
GetWidth() float64
SetWidth(float64)
GetWidth() int
SetWidth(int)
} }
type HTMLVideoElement struct { type HTMLVideoElement struct {
Value Value
@ -170,11 +170,11 @@ func JSValueToHTMLVideoElement(val js.Value) HTMLVideoElement {
return HTMLVideoElement{Value: Value{Value: val}} return HTMLVideoElement{Value: Value{Value: val}}
} }
func (v Value) AsHTMLVideoElement() HTMLVideoElement { return HTMLVideoElement{Value: v} } func (v Value) AsHTMLVideoElement() HTMLVideoElement { return HTMLVideoElement{Value: v} }
func (h HTMLVideoElement) GetHeight() float64 {
func (h HTMLVideoElement) GetHeight() int {
val := h.Get("height") val := h.Get("height")
return val.Float()
return val.Int()
} }
func (h HTMLVideoElement) SetHeight(val float64) {
func (h HTMLVideoElement) SetHeight(val int) {
h.Set("height", val) h.Set("height", val)
} }
func (h HTMLVideoElement) GetPlaysInline() bool { func (h HTMLVideoElement) GetPlaysInline() bool {
@ -191,18 +191,18 @@ func (h HTMLVideoElement) GetPoster() string {
func (h HTMLVideoElement) SetPoster(val string) { func (h HTMLVideoElement) SetPoster(val string) {
h.Set("poster", val) h.Set("poster", val)
} }
func (h HTMLVideoElement) GetVideoHeight() float64 {
func (h HTMLVideoElement) GetVideoHeight() int {
val := h.Get("videoHeight") val := h.Get("videoHeight")
return val.Float()
return val.Int()
} }
func (h HTMLVideoElement) GetVideoWidth() float64 {
func (h HTMLVideoElement) GetVideoWidth() int {
val := h.Get("videoWidth") val := h.Get("videoWidth")
return val.Float()
return val.Int()
} }
func (h HTMLVideoElement) GetWidth() float64 {
func (h HTMLVideoElement) GetWidth() int {
val := h.Get("width") val := h.Get("width")
return val.Float()
return val.Int()
} }
func (h HTMLVideoElement) SetWidth(val float64) {
func (h HTMLVideoElement) SetWidth(val int) {
h.Set("width", val) h.Set("width", val)
} }

+ 6
- 6
imagebitmap.go View File

@ -6,8 +6,8 @@ import "syscall/js"
type ImageBitmapIFace interface { type ImageBitmapIFace interface {
Close(args ...interface{}) Close(args ...interface{})
GetHeight() float64
GetWidth() float64
GetHeight() int
GetWidth() int
} }
type ImageBitmap struct { type ImageBitmap struct {
Value Value
@ -18,11 +18,11 @@ func (v Value) AsImageBitmap() ImageBitmap { return ImageBitmap{Value:
func (i ImageBitmap) Close(args ...interface{}) { func (i ImageBitmap) Close(args ...interface{}) {
i.Call("close", args...) i.Call("close", args...)
} }
func (i ImageBitmap) GetHeight() float64 {
func (i ImageBitmap) GetHeight() int {
val := i.Get("height") val := i.Get("height")
return val.Float()
return val.Int()
} }
func (i ImageBitmap) GetWidth() float64 {
func (i ImageBitmap) GetWidth() int {
val := i.Get("width") val := i.Get("width")
return val.Float()
return val.Int()
} }

+ 6
- 6
imagedata.go View File

@ -6,8 +6,8 @@ import "syscall/js"
type ImageDataIFace interface { type ImageDataIFace interface {
GetData() Uint8ClampedArray GetData() Uint8ClampedArray
GetHeight() float64
GetWidth() float64
GetHeight() int
GetWidth() int
} }
type ImageData struct { type ImageData struct {
Value Value
@ -19,11 +19,11 @@ func (i ImageData) GetData() Uint8ClampedArray {
val := i.Get("data") val := i.Get("data")
return JSValueToUint8ClampedArray(val.JSValue()) return JSValueToUint8ClampedArray(val.JSValue())
} }
func (i ImageData) GetHeight() float64 {
func (i ImageData) GetHeight() int {
val := i.Get("height") val := i.Get("height")
return val.Float()
return val.Int()
} }
func (i ImageData) GetWidth() float64 {
func (i ImageData) GetWidth() int {
val := i.Get("width") val := i.Get("width")
return val.Float()
return val.Int()
} }

+ 3
- 3
medialist.go View File

@ -8,7 +8,7 @@ type MediaListIFace interface {
AppendMedium(args ...interface{}) AppendMedium(args ...interface{})
DeleteMedium(args ...interface{}) DeleteMedium(args ...interface{})
Item(args ...interface{}) string Item(args ...interface{}) string
GetLength() float64
GetLength() int
GetMediaText() string GetMediaText() string
SetMediaText(string) SetMediaText(string)
} }
@ -28,9 +28,9 @@ func (m MediaList) Item(args ...interface{}) string {
val := m.Call("item", args...) val := m.Call("item", args...)
return val.String() return val.String()
} }
func (m MediaList) GetLength() float64 {
func (m MediaList) GetLength() int {
val := m.Get("length") val := m.Get("length")
return val.Float()
return val.Int()
} }
func (m MediaList) GetMediaText() string { func (m MediaList) GetMediaText() string {
val := m.Get("mediaText") val := m.Get("mediaText")


+ 3
- 3
mimetypearray.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type MimeTypeArrayIFace interface { type MimeTypeArrayIFace interface {
Item(args ...interface{}) MimeType Item(args ...interface{}) MimeType
GetLength() float64
GetLength() int
NamedItem(args ...interface{}) MimeType NamedItem(args ...interface{}) MimeType
} }
type MimeTypeArray struct { type MimeTypeArray struct {
@ -21,9 +21,9 @@ func (m MimeTypeArray) Item(args ...interface{}) MimeType {
val := m.Call("item", args...) val := m.Call("item", args...)
return JSValueToMimeType(val.JSValue()) return JSValueToMimeType(val.JSValue())
} }
func (m MimeTypeArray) GetLength() float64 {
func (m MimeTypeArray) GetLength() int {
val := m.Get("length") val := m.Get("length")
return val.Float()
return val.Int()
} }
func (m MimeTypeArray) NamedItem(args ...interface{}) MimeType { func (m MimeTypeArray) NamedItem(args ...interface{}) MimeType {
val := m.Call("namedItem", args...) val := m.Call("namedItem", args...)


+ 3
- 3
namednodemap.go View File

@ -8,7 +8,7 @@ type NamedNodeMapIFace interface {
GetNamedItem(args ...interface{}) Attr GetNamedItem(args ...interface{}) Attr
GetNamedItemNS(args ...interface{}) Attr GetNamedItemNS(args ...interface{}) Attr
Item(args ...interface{}) Attr Item(args ...interface{}) Attr
GetLength() float64
GetLength() int
RemoveNamedItem(args ...interface{}) Attr RemoveNamedItem(args ...interface{}) Attr
RemoveNamedItemNS(args ...interface{}) Attr RemoveNamedItemNS(args ...interface{}) Attr
SetNamedItem(args ...interface{}) Attr SetNamedItem(args ...interface{}) Attr
@ -32,9 +32,9 @@ func (n NamedNodeMap) Item(args ...interface{}) Attr {
val := n.Call("item", args...) val := n.Call("item", args...)
return JSValueToAttr(val.JSValue()) return JSValueToAttr(val.JSValue())
} }
func (n NamedNodeMap) GetLength() float64 {
func (n NamedNodeMap) GetLength() int {
val := n.Get("length") val := n.Get("length")
return val.Float()
return val.Int()
} }
func (n NamedNodeMap) RemoveNamedItem(args ...interface{}) Attr { func (n NamedNodeMap) RemoveNamedItem(args ...interface{}) Attr {
val := n.Call("removeNamedItem", args...) val := n.Call("removeNamedItem", args...)


+ 3
- 3
navigator.go View File

@ -9,7 +9,7 @@ type NavigatorIFace interface {
GetAppName() string GetAppName() string
GetAppVersion() string GetAppVersion() string
GetCookieEnabled() bool GetCookieEnabled() bool
GetHardwareConcurrency() float64
GetHardwareConcurrency() int
JavaEnabled(args ...interface{}) bool JavaEnabled(args ...interface{}) bool
GetLanguage() string GetLanguage() string
GetLanguages() GetLanguages()
@ -48,9 +48,9 @@ func (n Navigator) GetCookieEnabled() bool {
val := n.Get("cookieEnabled") val := n.Get("cookieEnabled")
return val.Bool() return val.Bool()
} }
func (n Navigator) GetHardwareConcurrency() float64 {
func (n Navigator) GetHardwareConcurrency() int {
val := n.Get("hardwareConcurrency") val := n.Get("hardwareConcurrency")
return val.Float()
return val.Int()
} }
func (n Navigator) JavaEnabled(args ...interface{}) bool { func (n Navigator) JavaEnabled(args ...interface{}) bool {
val := n.Call("javaEnabled", args...) val := n.Call("javaEnabled", args...)


+ 16
- 16
nodefilter.go View File

@ -5,22 +5,22 @@ package dom
import "syscall/js" import "syscall/js"
const ( const (
NodeFilterFILTER_ACCEPT int = 1
NodeFilterFILTER_REJECT int = 2
NodeFilterFILTER_SKIP int = 3
NodeFilterSHOW_ALL float64 = 0xFFFFFFFF
NodeFilterSHOW_ATTRIBUTE float64 = 0x2
NodeFilterSHOW_CDATA_SECTION float64 = 0x8
NodeFilterSHOW_COMMENT float64 = 0x80
NodeFilterSHOW_DOCUMENT float64 = 0x100
NodeFilterSHOW_DOCUMENT_FRAGMENT float64 = 0x400
NodeFilterSHOW_DOCUMENT_TYPE float64 = 0x200
NodeFilterSHOW_ELEMENT float64 = 0x1
NodeFilterSHOW_ENTITY float64 = 0x20
NodeFilterSHOW_ENTITY_REFERENCE float64 = 0x10
NodeFilterSHOW_NOTATION float64 = 0x800
NodeFilterSHOW_PROCESSING_INSTRUCTION float64 = 0x40
NodeFilterSHOW_TEXT float64 = 0x4
NodeFilterFILTER_ACCEPT int = 1
NodeFilterFILTER_REJECT int = 2
NodeFilterFILTER_SKIP int = 3
NodeFilterSHOW_ALL int = 0xFFFFFFFF
NodeFilterSHOW_ATTRIBUTE int = 0x2
NodeFilterSHOW_CDATA_SECTION int = 0x8
NodeFilterSHOW_COMMENT int = 0x80
NodeFilterSHOW_DOCUMENT int = 0x100
NodeFilterSHOW_DOCUMENT_FRAGMENT int = 0x400
NodeFilterSHOW_DOCUMENT_TYPE int = 0x200
NodeFilterSHOW_ELEMENT int = 0x1
NodeFilterSHOW_ENTITY int = 0x20
NodeFilterSHOW_ENTITY_REFERENCE int = 0x10
NodeFilterSHOW_NOTATION int = 0x800
NodeFilterSHOW_PROCESSING_INSTRUCTION int = 0x40
NodeFilterSHOW_TEXT int = 0x4
) )
type NodeFilterAcceptNodeCallback func(node Node) type NodeFilterAcceptNodeCallback func(node Node)


+ 3
- 3
nodeiterator.go View File

@ -12,7 +12,7 @@ type NodeIteratorIFace interface {
PreviousNode(args ...interface{}) Node PreviousNode(args ...interface{}) Node
GetReferenceNode() Node GetReferenceNode() Node
GetRoot() Node GetRoot() Node
GetWhatToShow() float64
GetWhatToShow() int
} }
type NodeIterator struct { type NodeIterator struct {
Value Value
@ -47,7 +47,7 @@ func (n NodeIterator) GetRoot() Node {
val := n.Get("root") val := n.Get("root")
return JSValueToNode(val.JSValue()) return JSValueToNode(val.JSValue())
} }
func (n NodeIterator) GetWhatToShow() float64 {
func (n NodeIterator) GetWhatToShow() int {
val := n.Get("whatToShow") val := n.Get("whatToShow")
return val.Float()
return val.Int()
} }

+ 3
- 3
nodelist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type NodeListIFace interface { type NodeListIFace interface {
Item(args ...interface{}) Node Item(args ...interface{}) Node
GetLength() float64
GetLength() int
} }
type NodeList struct { type NodeList struct {
Value Value
@ -18,7 +18,7 @@ func (n NodeList) Item(args ...interface{}) Node {
val := n.Call("item", args...) val := n.Call("item", args...)
return JSValueToNode(val.JSValue()) return JSValueToNode(val.JSValue())
} }
func (n NodeList) GetLength() float64 {
func (n NodeList) GetLength() int {
val := n.Get("length") val := n.Get("length")
return val.Float()
return val.Int()
} }

+ 10
- 10
offscreencanvas.go View File

@ -9,12 +9,12 @@ type OffscreenCanvasIFace interface {
ConvertToBlob(args ...interface{}) ConvertToBlob(args ...interface{})
DispatchEvent(args ...interface{}) bool DispatchEvent(args ...interface{}) bool
GetContext(args ...interface{}) OffscreenRenderingContext GetContext(args ...interface{}) OffscreenRenderingContext
GetHeight() float64
SetHeight(float64)
GetHeight() int
SetHeight(int)
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
TransferToImageBitmap(args ...interface{}) ImageBitmap TransferToImageBitmap(args ...interface{}) ImageBitmap
GetWidth() float64
SetWidth(float64)
GetWidth() int
SetWidth(int)
} }
type OffscreenCanvas struct { type OffscreenCanvas struct {
Value Value
@ -32,21 +32,21 @@ func (o OffscreenCanvas) GetContext(args ...interface{}) OffscreenRenderingConte
val := o.Call("getContext", args...) val := o.Call("getContext", args...)
return JSValueToOffscreenRenderingContext(val.JSValue()) return JSValueToOffscreenRenderingContext(val.JSValue())
} }
func (o OffscreenCanvas) GetHeight() float64 {
func (o OffscreenCanvas) GetHeight() int {
val := o.Get("height") val := o.Get("height")
return val.Float()
return val.Int()
} }
func (o OffscreenCanvas) SetHeight(val float64) {
func (o OffscreenCanvas) SetHeight(val int) {
o.Set("height", val) o.Set("height", val)
} }
func (o OffscreenCanvas) TransferToImageBitmap(args ...interface{}) ImageBitmap { func (o OffscreenCanvas) TransferToImageBitmap(args ...interface{}) ImageBitmap {
val := o.Call("transferToImageBitmap", args...) val := o.Call("transferToImageBitmap", args...)
return JSValueToImageBitmap(val.JSValue()) return JSValueToImageBitmap(val.JSValue())
} }
func (o OffscreenCanvas) GetWidth() float64 {
func (o OffscreenCanvas) GetWidth() int {
val := o.Get("width") val := o.Get("width")
return val.Float()
return val.Int()
} }
func (o OffscreenCanvas) SetWidth(val float64) {
func (o OffscreenCanvas) SetWidth(val int) {
o.Set("width", val) o.Set("width", val)
} }

+ 3
- 3
onerroreventhandlernonnull.go View File

@ -4,7 +4,7 @@ package dom
import "syscall/js" import "syscall/js"
type OnErrorEventHandlerNonNullCallback func(event Value, source string, lineno float64, colno float64, error Value) Value
type OnErrorEventHandlerNonNullCallback func(event Value, source string, lineno int, colno int, error Value) Value
type OnErrorEventHandlerNonNull struct { type OnErrorEventHandlerNonNull struct {
Callback Callback
} }
@ -16,8 +16,8 @@ func NewOnErrorEventHandlerNonNull(c OnErrorEventHandlerNonNullCallback) OnError
callback := js.NewCallback(func(args []js.Value) { callback := js.NewCallback(func(args []js.Value) {
event := JSValueToValue(args[0]) event := JSValueToValue(args[0])
source := args[1].String() source := args[1].String()
lineno := args[2].Float()
colno := args[3].Float()
lineno := args[2].Int()
colno := args[3].Int()
error := JSValueToValue(args[4]) error := JSValueToValue(args[4])
c(event, source, lineno, colno, error) c(event, source, lineno, colno, error)
}) })


+ 3
- 3
plugin.go View File

@ -8,7 +8,7 @@ type PluginIFace interface {
GetDescription() string GetDescription() string
GetFilename() string GetFilename() string
Item(args ...interface{}) MimeType Item(args ...interface{}) MimeType
GetLength() float64
GetLength() int
GetName() string GetName() string
NamedItem(args ...interface{}) MimeType NamedItem(args ...interface{}) MimeType
} }
@ -30,9 +30,9 @@ func (p Plugin) Item(args ...interface{}) MimeType {
val := p.Call("item", args...) val := p.Call("item", args...)
return JSValueToMimeType(val.JSValue()) return JSValueToMimeType(val.JSValue())
} }
func (p Plugin) GetLength() float64 {
func (p Plugin) GetLength() int {
val := p.Get("length") val := p.Get("length")
return val.Float()
return val.Int()
} }
func (p Plugin) GetName() string { func (p Plugin) GetName() string {
val := p.Get("name") val := p.Get("name")


+ 3
- 3
pluginarray.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type PluginArrayIFace interface { type PluginArrayIFace interface {
Item(args ...interface{}) Plugin Item(args ...interface{}) Plugin
GetLength() float64
GetLength() int
NamedItem(args ...interface{}) Plugin NamedItem(args ...interface{}) Plugin
Refresh(args ...interface{}) Refresh(args ...interface{})
} }
@ -20,9 +20,9 @@ func (p PluginArray) Item(args ...interface{}) Plugin {
val := p.Call("item", args...) val := p.Call("item", args...)
return JSValueToPlugin(val.JSValue()) return JSValueToPlugin(val.JSValue())
} }
func (p PluginArray) GetLength() float64 {
func (p PluginArray) GetLength() int {
val := p.Get("length") val := p.Get("length")
return val.Float()
return val.Int()
} }
func (p PluginArray) NamedItem(args ...interface{}) Plugin { func (p PluginArray) NamedItem(args ...interface{}) Plugin {
val := p.Call("namedItem", args...) val := p.Call("namedItem", args...)


+ 1
- 1
processinginstruction.go View File

@ -27,7 +27,7 @@ type ProcessingInstructionIFace interface {
IsEqualNode(args ...interface{}) bool IsEqualNode(args ...interface{}) bool
IsSameNode(args ...interface{}) bool IsSameNode(args ...interface{}) bool
GetLastChild() Node GetLastChild() Node
GetLength() float64
GetLength() int
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
GetNextSibling() Node GetNextSibling() Node


+ 6
- 6
progressevent.go View File

@ -17,7 +17,7 @@ type ProgressEventIFace interface {
InitEvent(args ...interface{}) InitEvent(args ...interface{})
GetIsTrusted() bool GetIsTrusted() bool
GetLengthComputable() bool GetLengthComputable() bool
GetLoaded() float64
GetLoaded() int
PreventDefault(args ...interface{}) PreventDefault(args ...interface{})
GetReturnValue() bool GetReturnValue() bool
SetReturnValue(bool) SetReturnValue(bool)
@ -26,7 +26,7 @@ type ProgressEventIFace interface {
StopPropagation(args ...interface{}) StopPropagation(args ...interface{})
GetTarget() EventTarget GetTarget() EventTarget
GetTimeStamp() DOMHighResTimeStamp GetTimeStamp() DOMHighResTimeStamp
GetTotal() float64
GetTotal() int
GetType() string GetType() string
} }
type ProgressEvent struct { type ProgressEvent struct {
@ -42,11 +42,11 @@ func (p ProgressEvent) GetLengthComputable() bool {
val := p.Get("lengthComputable") val := p.Get("lengthComputable")
return val.Bool() return val.Bool()
} }
func (p ProgressEvent) GetLoaded() float64 {
func (p ProgressEvent) GetLoaded() int {
val := p.Get("loaded") val := p.Get("loaded")
return val.Float()
return val.Int()
} }
func (p ProgressEvent) GetTotal() float64 {
func (p ProgressEvent) GetTotal() int {
val := p.Get("total") val := p.Get("total")
return val.Float()
return val.Int()
} }

+ 1
- 1
radionodelist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type RadioNodeListIFace interface { type RadioNodeListIFace interface {
Item(args ...interface{}) Node Item(args ...interface{}) Node
GetLength() float64
GetLength() int
GetValue() string GetValue() string
SetValue(string) SetValue(string)
} }


+ 2
- 2
range.go View File

@ -15,7 +15,7 @@ type RangeIFace interface {
DeleteContents(args ...interface{}) DeleteContents(args ...interface{})
Detach(args ...interface{}) Detach(args ...interface{})
GetEndContainer() Node GetEndContainer() Node
GetEndOffset() float64
GetEndOffset() int
ExtractContents(args ...interface{}) DocumentFragment ExtractContents(args ...interface{}) DocumentFragment
InsertNode(args ...interface{}) InsertNode(args ...interface{})
IntersectsNode(args ...interface{}) bool IntersectsNode(args ...interface{}) bool
@ -29,7 +29,7 @@ type RangeIFace interface {
SetStartAfter(args ...interface{}) SetStartAfter(args ...interface{})
SetStartBefore(args ...interface{}) SetStartBefore(args ...interface{})
GetStartContainer() Node GetStartContainer() Node
GetStartOffset() float64
GetStartOffset() int
SurroundContents(args ...interface{}) SurroundContents(args ...interface{})
} }
type Range struct { type Range struct {


+ 2
- 2
staticrange.go View File

@ -7,9 +7,9 @@ import "syscall/js"
type StaticRangeIFace interface { type StaticRangeIFace interface {
GetCollapsed() bool GetCollapsed() bool
GetEndContainer() Node GetEndContainer() Node
GetEndOffset() float64
GetEndOffset() int
GetStartContainer() Node GetStartContainer() Node
GetStartOffset() float64
GetStartOffset() int
} }
type StaticRange struct { type StaticRange struct {
Value Value


+ 3
- 3
storage.go View File

@ -8,7 +8,7 @@ type StorageIFace interface {
Clear(args ...interface{}) Clear(args ...interface{})
GetItem(args ...interface{}) string GetItem(args ...interface{}) string
Key(args ...interface{}) string Key(args ...interface{}) string
GetLength() float64
GetLength() int
RemoveItem(args ...interface{}) RemoveItem(args ...interface{})
SetItem(args ...interface{}) SetItem(args ...interface{})
} }
@ -29,9 +29,9 @@ func (s Storage) Key(args ...interface{}) string {
val := s.Call("key", args...) val := s.Call("key", args...)
return val.String() return val.String()
} }
func (s Storage) GetLength() float64 {
func (s Storage) GetLength() int {
val := s.Get("length") val := s.Get("length")
return val.Float()
return val.Int()
} }
func (s Storage) RemoveItem(args ...interface{}) { func (s Storage) RemoveItem(args ...interface{}) {
s.Call("removeItem", args...) s.Call("removeItem", args...)


+ 3
- 3
stylesheetlist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type StyleSheetListIFace interface { type StyleSheetListIFace interface {
Item(args ...interface{}) StyleSheet Item(args ...interface{}) StyleSheet
GetLength() float64
GetLength() int
} }
type StyleSheetList struct { type StyleSheetList struct {
Value Value
@ -20,7 +20,7 @@ func (s StyleSheetList) Item(args ...interface{}) StyleSheet {
val := s.Call("item", args...) val := s.Call("item", args...)
return JSValueToStyleSheet(val.JSValue()) return JSValueToStyleSheet(val.JSValue())
} }
func (s StyleSheetList) GetLength() float64 {
func (s StyleSheetList) GetLength() int {
val := s.Get("length") val := s.Get("length")
return val.Float()
return val.Int()
} }

+ 1
- 1
text.go View File

@ -28,7 +28,7 @@ type TextIFace interface {
IsEqualNode(args ...interface{}) bool IsEqualNode(args ...interface{}) bool
IsSameNode(args ...interface{}) bool IsSameNode(args ...interface{}) bool
GetLastChild() Node GetLastChild() Node
GetLength() float64
GetLength() int
LookupNamespaceURI(args ...interface{}) string LookupNamespaceURI(args ...interface{}) string
LookupPrefix(args ...interface{}) string LookupPrefix(args ...interface{}) string
GetNextSibling() Node GetNextSibling() Node


+ 3
- 3
texttrackcuelist.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type TextTrackCueListIFace interface { type TextTrackCueListIFace interface {
GetCueById(args ...interface{}) TextTrackCue GetCueById(args ...interface{}) TextTrackCue
GetLength() float64
GetLength() int
} }
type TextTrackCueList struct { type TextTrackCueList struct {
Value Value
@ -20,7 +20,7 @@ func (t TextTrackCueList) GetCueById(args ...interface{}) TextTrackCue {
val := t.Call("getCueById", args...) val := t.Call("getCueById", args...)
return JSValueToTextTrackCue(val.JSValue()) return JSValueToTextTrackCue(val.JSValue())
} }
func (t TextTrackCueList) GetLength() float64 {
func (t TextTrackCueList) GetLength() int {
val := t.Get("length") val := t.Get("length")
return val.Float()
return val.Int()
} }

+ 3
- 3
texttracklist.go View File

@ -8,7 +8,7 @@ type TextTrackListIFace interface {
AddEventListener(args ...interface{}) AddEventListener(args ...interface{})
DispatchEvent(args ...interface{}) bool DispatchEvent(args ...interface{}) bool
GetTrackById(args ...interface{}) TextTrack GetTrackById(args ...interface{}) TextTrack
GetLength() float64
GetLength() int
GetOnaddtrack() EventHandler GetOnaddtrack() EventHandler
SetOnaddtrack(EventHandler) SetOnaddtrack(EventHandler)
GetOnchange() EventHandler GetOnchange() EventHandler
@ -30,9 +30,9 @@ func (t TextTrackList) GetTrackById(args ...interface{}) TextTrack {
val := t.Call("getTrackById", args...) val := t.Call("getTrackById", args...)
return JSValueToTextTrack(val.JSValue()) return JSValueToTextTrack(val.JSValue())
} }
func (t TextTrackList) GetLength() float64 {
func (t TextTrackList) GetLength() int {
val := t.Get("length") val := t.Get("length")
return val.Float()
return val.Int()
} }
func (t TextTrackList) GetOnaddtrack() EventHandler { func (t TextTrackList) GetOnaddtrack() EventHandler {
val := t.Get("onaddtrack") val := t.Get("onaddtrack")


+ 3
- 3
timeranges.go View File

@ -6,7 +6,7 @@ import "syscall/js"
type TimeRangesIFace interface { type TimeRangesIFace interface {
End(args ...interface{}) float64 End(args ...interface{}) float64
GetLength() float64
GetLength() int
Start(args ...interface{}) float64 Start(args ...interface{}) float64
} }
type TimeRanges struct { type TimeRanges struct {
@ -19,9 +19,9 @@ func (t TimeRanges) End(args ...interface{}) float64 {
val := t.Call("end", args...) val := t.Call("end", args...)
return val.Float() return val.Float()
} }
func (t TimeRanges) GetLength() float64 {
func (t TimeRanges) GetLength() int {
val := t.Get("length") val := t.Get("length")
return val.Float()
return val.Int()
} }
func (t TimeRanges) Start(args ...interface{}) float64 { func (t TimeRanges) Start(args ...interface{}) float64 {
val := t.Call("start", args...) val := t.Call("start", args...)


+ 3
- 3
treewalker.go View File

@ -16,7 +16,7 @@ type TreeWalkerIFace interface {
PreviousNode(args ...interface{}) Node PreviousNode(args ...interface{}) Node
PreviousSibling(args ...interface{}) Node PreviousSibling(args ...interface{}) Node
GetRoot() Node GetRoot() Node
GetWhatToShow() float64
GetWhatToShow() int
} }
type TreeWalker struct { type TreeWalker struct {
Value Value
@ -67,7 +67,7 @@ func (t TreeWalker) GetRoot() Node {
val := t.Get("root") val := t.Get("root")
return JSValueToNode(val.JSValue()) return JSValueToNode(val.JSValue())
} }
func (t TreeWalker) GetWhatToShow() float64 {
func (t TreeWalker) GetWhatToShow() int {
val := t.Get("whatToShow") val := t.Get("whatToShow")
return val.Float()
return val.Int()
} }

+ 17
- 0
value.go View File

@ -16,11 +16,28 @@ func (v Value) JSValue() js.Value { return v.Value }
func (v Value) Get(p string) Value { return JSValueToValue(v.Value.Get(p)) } func (v Value) Get(p string) Value { return JSValueToValue(v.Value.Get(p)) }
func (v Value) Index(i int) Value { return JSValueToValue(v.Value.Index(i)) } func (v Value) Index(i int) Value { return JSValueToValue(v.Value.Index(i)) }
func (v Value) Call(m string, args ...interface{}) Value { func (v Value) Call(m string, args ...interface{}) Value {
for i, a := range args {
args[i] = GetJSValue(a)
}
return JSValueToValue(v.Value.Call(m, args...)) return JSValueToValue(v.Value.Call(m, args...))
} }
func (v Value) Invoke(args ...interface{}) Value { func (v Value) Invoke(args ...interface{}) Value {
for i, a := range args {
args[i] = GetJSValue(a)
}
return JSValueToValue(v.Value.Invoke(args...)) return JSValueToValue(v.Value.Invoke(args...))
} }
func (v Value) New(args ...interface{}) Value { func (v Value) New(args ...interface{}) Value {
for i, a := range args {
args[i] = GetJSValue(a)
}
return JSValueToValue(v.Value.New(args...)) return JSValueToValue(v.Value.New(args...))
} }
func GetJSValue(v interface{}) interface{} {
t, ok := v.(JSValue)
if ok {
return t.JSValue()
}
return v
}

+ 6
- 6
videotracklist.go View File

@ -8,7 +8,7 @@ type VideoTrackListIFace interface {
AddEventListener(args ...interface{}) AddEventListener(args ...interface{})
DispatchEvent(args ...interface{}) bool DispatchEvent(args ...interface{}) bool
GetTrackById(args ...interface{}) VideoTrack GetTrackById(args ...interface{}) VideoTrack
GetLength() float64
GetLength() int
GetOnaddtrack() EventHandler GetOnaddtrack() EventHandler
SetOnaddtrack(EventHandler) SetOnaddtrack(EventHandler)
GetOnchange() EventHandler GetOnchange() EventHandler
@ -16,7 +16,7 @@ type VideoTrackListIFace interface {
GetOnremovetrack() EventHandler GetOnremovetrack() EventHandler
SetOnremovetrack(EventHandler) SetOnremovetrack(EventHandler)
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
GetSelectedIndex() float64
GetSelectedIndex() int
} }
type VideoTrackList struct { type VideoTrackList struct {
Value Value
@ -31,9 +31,9 @@ func (v VideoTrackList) GetTrackById(args ...interface{}) VideoTrack {
val := v.Call("getTrackById", args...) val := v.Call("getTrackById", args...)
return JSValueToVideoTrack(val.JSValue()) return JSValueToVideoTrack(val.JSValue())
} }
func (v VideoTrackList) GetLength() float64 {
func (v VideoTrackList) GetLength() int {
val := v.Get("length") val := v.Get("length")
return val.Float()
return val.Int()
} }
func (v VideoTrackList) GetOnaddtrack() EventHandler { func (v VideoTrackList) GetOnaddtrack() EventHandler {
val := v.Get("onaddtrack") val := v.Get("onaddtrack")
@ -56,7 +56,7 @@ func (v VideoTrackList) GetOnremovetrack() EventHandler {
func (v VideoTrackList) SetOnremovetrack(val EventHandler) { func (v VideoTrackList) SetOnremovetrack(val EventHandler) {
v.Set("onremovetrack", val) v.Set("onremovetrack", val)
} }
func (v VideoTrackList) GetSelectedIndex() float64 {
func (v VideoTrackList) GetSelectedIndex() int {
val := v.Get("selectedIndex") val := v.Get("selectedIndex")
return val.Float()
return val.Int()
} }

+ 3
- 3
websocket.go View File

@ -8,7 +8,7 @@ type WebSocketIFace interface {
AddEventListener(args ...interface{}) AddEventListener(args ...interface{})
GetBinaryType() BinaryType GetBinaryType() BinaryType
SetBinaryType(BinaryType) SetBinaryType(BinaryType)
GetBufferedAmount() float64
GetBufferedAmount() int
Close(args ...interface{}) Close(args ...interface{})
DispatchEvent(args ...interface{}) bool DispatchEvent(args ...interface{}) bool
GetExtensions() string GetExtensions() string
@ -43,9 +43,9 @@ func (w WebSocket) GetBinaryType() BinaryType {
func (w WebSocket) SetBinaryType(val BinaryType) { func (w WebSocket) SetBinaryType(val BinaryType) {
w.Set("binaryType", val) w.Set("binaryType", val)
} }
func (w WebSocket) GetBufferedAmount() float64 {
func (w WebSocket) GetBufferedAmount() int {
val := w.Get("bufferedAmount") val := w.Get("bufferedAmount")
return val.Float()
return val.Int()
} }
func (w WebSocket) Close(args ...interface{}) { func (w WebSocket) Close(args ...interface{}) {
w.Call("close", args...) w.Call("close", args...)


+ 12
- 12
window.go View File

@ -27,7 +27,7 @@ type WindowIFace interface {
GetFrameElement() Element GetFrameElement() Element
GetFrames() WindowProxy GetFrames() WindowProxy
GetHistory() History GetHistory() History
GetLength() float64
GetLength() int
GetLocalStorage() Storage GetLocalStorage() Storage
GetLocation() Location GetLocation() Location
GetLocationbar() BarProp GetLocationbar() BarProp
@ -202,12 +202,12 @@ type WindowIFace interface {
Prompt(args ...interface{}) string Prompt(args ...interface{}) string
QueueMicrotask(args ...interface{}) QueueMicrotask(args ...interface{})
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
RequestAnimationFrame(args ...interface{}) float64
RequestAnimationFrame(args ...interface{}) int
GetScrollbars() BarProp GetScrollbars() BarProp
GetSelf() WindowProxy GetSelf() WindowProxy
GetSessionStorage() Storage GetSessionStorage() Storage
SetInterval(args ...interface{}) float64
SetTimeout(args ...interface{}) float64
SetInterval(args ...interface{}) int
SetTimeout(args ...interface{}) int
GetStatus() string GetStatus() string
SetStatus(string) SetStatus(string)
GetStatusbar() BarProp GetStatusbar() BarProp
@ -293,9 +293,9 @@ func (w Window) GetHistory() History {
val := w.Get("history") val := w.Get("history")
return JSValueToHistory(val.JSValue()) return JSValueToHistory(val.JSValue())
} }
func (w Window) GetLength() float64 {
func (w Window) GetLength() int {
val := w.Get("length") val := w.Get("length")
return val.Float()
return val.Int()
} }
func (w Window) GetLocalStorage() Storage { func (w Window) GetLocalStorage() Storage {
val := w.Get("localStorage") val := w.Get("localStorage")
@ -906,9 +906,9 @@ func (w Window) Prompt(args ...interface{}) string {
func (w Window) QueueMicrotask(args ...interface{}) { func (w Window) QueueMicrotask(args ...interface{}) {
w.Call("queueMicrotask", args...) w.Call("queueMicrotask", args...)
} }
func (w Window) RequestAnimationFrame(args ...interface{}) float64 {
func (w Window) RequestAnimationFrame(args ...interface{}) int {
val := w.Call("requestAnimationFrame", args...) val := w.Call("requestAnimationFrame", args...)
return val.Float()
return val.Int()
} }
func (w Window) GetScrollbars() BarProp { func (w Window) GetScrollbars() BarProp {
val := w.Get("scrollbars") val := w.Get("scrollbars")
@ -922,13 +922,13 @@ func (w Window) GetSessionStorage() Storage {
val := w.Get("sessionStorage") val := w.Get("sessionStorage")
return JSValueToStorage(val.JSValue()) return JSValueToStorage(val.JSValue())
} }
func (w Window) SetInterval(args ...interface{}) float64 {
func (w Window) SetInterval(args ...interface{}) int {
val := w.Call("setInterval", args...) val := w.Call("setInterval", args...)
return val.Float()
return val.Int()
} }
func (w Window) SetTimeout(args ...interface{}) float64 {
func (w Window) SetTimeout(args ...interface{}) int {
val := w.Call("setTimeout", args...) val := w.Call("setTimeout", args...)
return val.Float()
return val.Int()
} }
func (w Window) GetStatus() string { func (w Window) GetStatus() string {
val := w.Get("status") val := w.Get("status")


+ 8
- 8
window/window.go View File

@ -2,7 +2,7 @@
// window/window.go // window/window.go
package window package window
import dom "github.com/brettlangdon/go-dom/v1"
import dom "github.com/brettlangdon/go-dom"
import "syscall/js" import "syscall/js"
var value dom.Window var value dom.Window
@ -78,7 +78,7 @@ func GetFrames() dom.WindowProxy {
func GetHistory() dom.History { func GetHistory() dom.History {
return value.GetHistory() return value.GetHistory()
} }
func GetLength() float64 {
func GetLength() int {
return value.GetLength() return value.GetLength()
} }
func GetLocalStorage() dom.Storage { func GetLocalStorage() dom.Storage {
@ -445,9 +445,9 @@ func QueueMicrotask(args ...interface{}) {
func RemoveEventListener(args ...interface{}) { func RemoveEventListener(args ...interface{}) {
value.Call("removeEventListener", args...) value.Call("removeEventListener", args...)
} }
func RequestAnimationFrame(args ...interface{}) float64 {
func RequestAnimationFrame(args ...interface{}) int {
val := value.Call("requestAnimationFrame", args...) val := value.Call("requestAnimationFrame", args...)
return val.Float()
return val.Int()
} }
func GetScrollbars() dom.BarProp { func GetScrollbars() dom.BarProp {
return value.GetScrollbars() return value.GetScrollbars()
@ -458,13 +458,13 @@ func GetSelf() dom.WindowProxy {
func GetSessionStorage() dom.Storage { func GetSessionStorage() dom.Storage {
return value.GetSessionStorage() return value.GetSessionStorage()
} }
func SetInterval(args ...interface{}) float64 {
func SetInterval(args ...interface{}) int {
val := value.Call("setInterval", args...) val := value.Call("setInterval", args...)
return val.Float()
return val.Int()
} }
func SetTimeout(args ...interface{}) float64 {
func SetTimeout(args ...interface{}) int {
val := value.Call("setTimeout", args...) val := value.Call("setTimeout", args...)
return val.Float()
return val.Int()
} }
func GetStatus() string { func GetStatus() string {
return value.GetStatus() return value.GetStatus()


+ 6
- 6
workerglobalscope.go View File

@ -32,8 +32,8 @@ type WorkerGlobalScopeIFace interface {
QueueMicrotask(args ...interface{}) QueueMicrotask(args ...interface{})
RemoveEventListener(args ...interface{}) RemoveEventListener(args ...interface{})
GetSelf() WorkerGlobalScope GetSelf() WorkerGlobalScope
SetInterval(args ...interface{}) float64
SetTimeout(args ...interface{}) float64
SetInterval(args ...interface{}) int
SetTimeout(args ...interface{}) int
} }
type WorkerGlobalScope struct { type WorkerGlobalScope struct {
Value Value
@ -128,11 +128,11 @@ func (w WorkerGlobalScope) GetSelf() WorkerGlobalScope {
val := w.Get("self") val := w.Get("self")
return JSValueToWorkerGlobalScope(val.JSValue()) return JSValueToWorkerGlobalScope(val.JSValue())
} }
func (w WorkerGlobalScope) SetInterval(args ...interface{}) float64 {
func (w WorkerGlobalScope) SetInterval(args ...interface{}) int {
val := w.Call("setInterval", args...) val := w.Call("setInterval", args...)
return val.Float()
return val.Int()
} }
func (w WorkerGlobalScope) SetTimeout(args ...interface{}) float64 {
func (w WorkerGlobalScope) SetTimeout(args ...interface{}) int {
val := w.Call("setTimeout", args...) val := w.Call("setTimeout", args...)
return val.Float()
return val.Int()
} }

+ 3
- 3
workernavigator.go View File

@ -8,7 +8,7 @@ type WorkerNavigatorIFace interface {
GetAppCodeName() string GetAppCodeName() string
GetAppName() string GetAppName() string
GetAppVersion() string GetAppVersion() string
GetHardwareConcurrency() float64
GetHardwareConcurrency() int
GetLanguage() string GetLanguage() string
GetLanguages() GetLanguages()
GetOnLine() bool GetOnLine() bool
@ -40,9 +40,9 @@ func (w WorkerNavigator) GetAppVersion() string {
val := w.Get("appVersion") val := w.Get("appVersion")
return val.String() return val.String()
} }
func (w WorkerNavigator) GetHardwareConcurrency() float64 {
func (w WorkerNavigator) GetHardwareConcurrency() int {
val := w.Get("hardwareConcurrency") val := w.Get("hardwareConcurrency")
return val.Float()
return val.Int()
} }
func (w WorkerNavigator) GetLanguage() string { func (w WorkerNavigator) GetLanguage() string {
val := w.Get("language") val := w.Get("language")


+ 5
- 5
xmlhttprequest.go View File

@ -41,8 +41,8 @@ type XMLHttpRequestIFace interface {
SetRequestHeader(args ...interface{}) SetRequestHeader(args ...interface{})
GetStatus() int GetStatus() int
GetStatusText() []byte GetStatusText() []byte
GetTimeout() float64
SetTimeout(float64)
GetTimeout() int
SetTimeout(int)
GetUpload() XMLHttpRequestUpload GetUpload() XMLHttpRequestUpload
GetWithCredentials() bool GetWithCredentials() bool
SetWithCredentials(bool) SetWithCredentials(bool)
@ -125,11 +125,11 @@ func (x XMLHttpRequest) GetStatusText() []byte {
val := x.Get("statusText") val := x.Get("statusText")
return []byte(val.String()) return []byte(val.String())
} }
func (x XMLHttpRequest) GetTimeout() float64 {
func (x XMLHttpRequest) GetTimeout() int {
val := x.Get("timeout") val := x.Get("timeout")
return val.Float()
return val.Int()
} }
func (x XMLHttpRequest) SetTimeout(val float64) {
func (x XMLHttpRequest) SetTimeout(val int) {
x.Set("timeout", val) x.Set("timeout", val)
} }
func (x XMLHttpRequest) GetUpload() XMLHttpRequestUpload { func (x XMLHttpRequest) GetUpload() XMLHttpRequestUpload {


Loading…
Cancel
Save