func (_this *FileReader) OnLoadStart() domcore.EventHandlerFunc {
	var ret domcore.EventHandlerFunc
	value := _this.Value_JS.Get("onloadstart")
	if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
		ret = domcore.EventHandlerFromJS(value)
	}
	return ret
}
OnLoadStart returning attribute 'onloadstart' with
type domcore.EventHandler (idl: EventHandlerNonNull).
package file
import "syscall/js"
import (
	"github.com/gowebapi/webapi/communication/xhr"
	"github.com/gowebapi/webapi/dom/domcore"
	"github.com/gowebapi/webapi/javascript"
)
func unused(value interface{}) {
}
type Union struct {
	Value js.Value
}
func (u *Union) JSValue() js.Value {
	return u.Value
}
func UnionFromJS(value js.Value) *Union {
	return &Union{Value: value}
}
type EndingType int
const (
	TransparentEndingType EndingType = iota
	NativeEndingType
)
var endingTypeToWasmTable = []string{
	"transparent", "native",
}
var endingTypeFromWasmTable = map[string]EndingType{
	"transparent": TransparentEndingType, "native": NativeEndingType,
}
func (this *EndingType) JSValue() js.Value {
	return js.ValueOf(this.Value())
}
func (this EndingType) Value() string {
	idx := int(this)
	if idx >= 0 && idx < len(endingTypeToWasmTable) {
		return endingTypeToWasmTable[idx]
	}
	panic("unknown input value")
}
func EndingTypeFromJS(value js.Value) EndingType {
	key := value.String()
	conv, ok := endingTypeFromWasmTable[key]
	if !ok {
		panic("unable to convert '" + key + "'")
	}
	return conv
}
type BlobCallbackFunc func(blob *Blob)
type BlobCallback js.Func
func BlobCallbackToJS(callback BlobCallbackFunc) *BlobCallback {
	if callback == nil {
		return nil
	}
	ret := BlobCallback(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *Blob  
		)
		if args[0].Type() != js.TypeNull && args[0].Type() != js.TypeUndefined {
			_p0 = BlobFromJS(args[0])
		}
		callback(_p0)
		return nil
	}))
	return &ret
}
func BlobCallbackFromJS(_value js.Value) BlobCallbackFunc {
	return func(blob *Blob) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := blob.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseBlobOnFulfilledFunc func(value *Blob)
type PromiseBlobOnFulfilled js.Func
func PromiseBlobOnFulfilledToJS(callback PromiseBlobOnFulfilledFunc) *PromiseBlobOnFulfilled {
	if callback == nil {
		return nil
	}
	ret := PromiseBlobOnFulfilled(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 *Blob  
		)
		_p0 = BlobFromJS(args[0])
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseBlobOnFulfilledFromJS(_value js.Value) PromiseBlobOnFulfilledFunc {
	return func(value *Blob) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := value.JSValue()
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type PromiseBlobOnRejectedFunc func(reason js.Value)
type PromiseBlobOnRejected js.Func
func PromiseBlobOnRejectedToJS(callback PromiseBlobOnRejectedFunc) *PromiseBlobOnRejected {
	if callback == nil {
		return nil
	}
	ret := PromiseBlobOnRejected(js.FuncOf(func(this js.Value, args []js.Value) interface{} {
		var (
			_p0 js.Value  
		)
		_p0 = args[0]
		callback(_p0)
		return nil
	}))
	return &ret
}
func PromiseBlobOnRejectedFromJS(_value js.Value) PromiseBlobOnRejectedFunc {
	return func(reason js.Value) {
		var (
			_args [1]interface{}
			_end  int
		)
		_p0 := reason
		_args[0] = _p0
		_end++
		_value.Invoke(_args[0:_end]...)
		return
	}
}
type BlobPropertyBag struct {
	Type    string
	Endings EndingType
}
func (_this *BlobPropertyBag) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Type
	out.Set("type", value0)
	value1 := _this.Endings.JSValue()
	out.Set("endings", value1)
	return out
}
func BlobPropertyBagFromJS(value js.Wrapper) *BlobPropertyBag {
	input := value.JSValue()
	var out BlobPropertyBag
	var (
		value0 string      
		value1 EndingType  
	)
	value0 = (input.Get("type")).String()
	out.Type = value0
	value1 = EndingTypeFromJS(input.Get("endings"))
	out.Endings = value1
	return &out
}
type FilePropertyBag struct {
	Type         string
	Endings      EndingType
	LastModified int
}
func (_this *FilePropertyBag) JSValue() js.Value {
	out := js.Global().Get("Object").New()
	value0 := _this.Type
	out.Set("type", value0)
	value1 := _this.Endings.JSValue()
	out.Set("endings", value1)
	value2 := _this.LastModified
	out.Set("lastModified", value2)
	return out
}
func FilePropertyBagFromJS(value js.Wrapper) *FilePropertyBag {
	input := value.JSValue()
	var out FilePropertyBag
	var (
		value0 string      
		value1 EndingType  
		value2 int         
	)
	value0 = (input.Get("type")).String()
	out.Type = value0
	value1 = EndingTypeFromJS(input.Get("endings"))
	out.Endings = value1
	value2 = (input.Get("lastModified")).Int()
	out.LastModified = value2
	return &out
}
type Blob struct {
	Value_JS js.Value
}
func (_this *Blob) JSValue() js.Value {
	return _this.Value_JS
}
func BlobFromJS(value js.Wrapper) *Blob {
	input := value.JSValue()
	if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
		return nil
	}
	ret := &Blob{}
	ret.Value_JS = input
	return ret
}
func NewBlob(blobParts []*Union, options *BlobPropertyBag) (_result *Blob) {
	_klass := js.Global().Get("Blob")
	var (
		_args [2]interface{}
		_end  int
	)
	if blobParts != nil {
		_p0 := js.Global().Get("Array").New(len(blobParts))
		for __idx0, __seq_in0 := range blobParts {
			__seq_out0 := __seq_in0.JSValue()
			_p0.SetIndex(__idx0, __seq_out0)
		}
		_args[0] = _p0
		_end++
	}
	if options != nil {
		_p1 := options.JSValue()
		_args[1] = _p1
		_end++
	}
	_returned := _klass.New(_args[0:_end]...)
	var (
		_converted *Blob  
	)
	_converted = BlobFromJS(_returned)
	_result = _converted
	return
}
func (_this *Blob) Size() int {
	var ret int
	value := _this.Value_JS.Get("size")
	ret = (value).Int()
	return ret
}
func (_this *Blob) Type() string {
	var ret string
	value := _this.Value_JS.Get("type")
	ret = (value).String()
	return ret
}
func (_this *Blob) Slice(start *int, end *int, contentType *string) (_result *Blob) {
	var (
		_args [3]interface{}
		_end  int
	)
	if start != nil {
		var _p0 interface{}
		if start != nil {
			_p0 = *(start)
		} else {
			_p0 = nil
		}
		_args[0] = _p0
		_end++
	}
	if end != nil {
		var _p1 interface{}
		if end != nil {
			_p1 = *(end)
		} else {
			_p1 = nil
		}
		_args[1] = _p1
		_end++
	}
	if contentType != nil {
		var _p2 interface{}
		if contentType != nil {
			_p2 = *(contentType)
		} else {
			_p2 = nil
		}
		_args[2] = _p2
		_end++
	}
	_returned := _this.Value_JS.Call("slice", _args[0:_end]...)
	var (
		_converted *Blob  
	)
	_converted = BlobFromJS(_returned)
	_result = _converted
	return
}
type File struct {
	Blob
}
func FileFromJS(value js.Wrapper) *File {
	input := value.JSValue()
	if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
		return nil
	}
	ret := &File{}
	ret.Value_JS = input
	return ret
}
func NewFile(fileBits []*Union, fileName string, options *FilePropertyBag) (_result *File) {
	_klass := js.Global().Get("File")
	var (
		_args [3]interface{}
		_end  int
	)
	_p0 := js.Global().Get("Array").New(len(fileBits))
	for __idx0, __seq_in0 := range fileBits {
		__seq_out0 := __seq_in0.JSValue()
		_p0.SetIndex(__idx0, __seq_out0)
	}
	_args[0] = _p0
	_end++
	_p1 := fileName
	_args[1] = _p1
	_end++
	if options != nil {
		_p2 := options.JSValue()
		_args[2] = _p2
		_end++
	}
	_returned := _klass.New(_args[0:_end]...)
	var (
		_converted *File  
	)
	_converted = FileFromJS(_returned)
	_result = _converted
	return
}
func (_this *File) Name() string {
	var ret string
	value := _this.Value_JS.Get("name")
	ret = (value).String()
	return ret
}
func (_this *File) LastModified() int {
	var ret int
	value := _this.Value_JS.Get("lastModified")
	ret = (value).Int()
	return ret
}
func (_this *File) WebkitRelativePath() string {
	var ret string
	value := _this.Value_JS.Get("webkitRelativePath")
	ret = (value).String()
	return ret
}
type FileList struct {
	Value_JS js.Value
}
func (_this *FileList) JSValue() js.Value {
	return _this.Value_JS
}
func FileListFromJS(value js.Wrapper) *FileList {
	input := value.JSValue()
	if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
		return nil
	}
	ret := &FileList{}
	ret.Value_JS = input
	return ret
}
func (_this *FileList) Length() uint {
	var ret uint
	value := _this.Value_JS.Get("length")
	ret = (uint)((value).Int())
	return ret
}
func (_this *FileList) Index(index uint) (_result *File) {
	var (
		_args [1]interface{}
		_end  int
	)
	_p0 := index
	_args[0] = _p0
	_end++
	_returned := _this.Value_JS.Call("item", _args[0:_end]...)
	var (
		_converted *File  
	)
	if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
		_converted = FileFromJS(_returned)
	}
	_result = _converted
	return
}
func (_this *FileList) Item(index uint) (_result *File) {
	var (
		_args [1]interface{}
		_end  int
	)
	_p0 := index
	_args[0] = _p0
	_end++
	_returned := _this.Value_JS.Call("item", _args[0:_end]...)
	var (
		_converted *File  
	)
	if _returned.Type() != js.TypeNull && _returned.Type() != js.TypeUndefined {
		_converted = FileFromJS(_returned)
	}
	_result = _converted
	return
}
type FileReader struct {
	domcore.EventTarget
}
func FileReaderFromJS(value js.Wrapper) *FileReader {
	input := value.JSValue()
	if typ := input.Type(); typ == js.TypeNull || typ == js.TypeUndefined {
		return nil
	}
	ret := &FileReader{}
	ret.Value_JS = input
	return ret
}
const (
	EMPTY   int = 0
	LOADING int = 1
	DONE    int = 2
)
func NewFileReader() (_result *FileReader) {
	_klass := js.Global().Get("FileReader")
	var (
		_args [0]interface{}
		_end  int
	)
	_returned := _klass.New(_args[0:_end]...)
	var (
		_converted *FileReader  
	)
	_converted = FileReaderFromJS(_returned)
	_result = _converted
	return
}
func (_this *FileReader) ReadyState() int {
	var ret int
	value := _this.Value_JS.Get("readyState")
	ret = (value).Int()
	return ret
}
func (_this *FileReader) Result() *Union {
	var ret *Union
	value := _this.Value_JS.Get("result")
	if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
		ret = UnionFromJS(value)
	}
	return ret
}
func (_this *FileReader) Error() *domcore.DOMException {
	var ret *domcore.DOMException
	value := _this.Value_JS.Get("error")
	if value.Type() != js.TypeNull && value.Type() != js.TypeUndefined {
		ret = domcore.DOMExceptionFromJS(value)
	}
	return ret
}