github.com/goplus/igop@v0.25.0/pkg/syscall/js/go115_export.go (about)

     1  // export by github.com/goplus/igop/cmd/qexp
     2  
     3  //go:build go1.15 && !go1.16 && js
     4  // +build go1.15,!go1.16,js
     5  
     6  package js
     7  
     8  import (
     9  	q "syscall/js"
    10  
    11  	"go/constant"
    12  	"reflect"
    13  
    14  	"github.com/goplus/igop"
    15  )
    16  
    17  func init() {
    18  	igop.RegisterPackage(&igop.Package{
    19  		Name: "js",
    20  		Path: "syscall/js",
    21  		Deps: map[string]string{
    22  			"runtime": "runtime",
    23  			"sync":    "sync",
    24  			"unsafe":  "unsafe",
    25  		},
    26  		Interfaces: map[string]reflect.Type{
    27  			"Wrapper": reflect.TypeOf((*q.Wrapper)(nil)).Elem(),
    28  		},
    29  		NamedTypes: map[string]reflect.Type{
    30  			"Error":      reflect.TypeOf((*q.Error)(nil)).Elem(),
    31  			"Func":       reflect.TypeOf((*q.Func)(nil)).Elem(),
    32  			"Type":       reflect.TypeOf((*q.Type)(nil)).Elem(),
    33  			"Value":      reflect.TypeOf((*q.Value)(nil)).Elem(),
    34  			"ValueError": reflect.TypeOf((*q.ValueError)(nil)).Elem(),
    35  		},
    36  		AliasTypes: map[string]reflect.Type{},
    37  		Vars:       map[string]reflect.Value{},
    38  		Funcs: map[string]reflect.Value{
    39  			"CopyBytesToGo": reflect.ValueOf(q.CopyBytesToGo),
    40  			"CopyBytesToJS": reflect.ValueOf(q.CopyBytesToJS),
    41  			"FuncOf":        reflect.ValueOf(q.FuncOf),
    42  			"Global":        reflect.ValueOf(q.Global),
    43  			"Null":          reflect.ValueOf(q.Null),
    44  			"Undefined":     reflect.ValueOf(q.Undefined),
    45  			"ValueOf":       reflect.ValueOf(q.ValueOf),
    46  		},
    47  		TypedConsts: map[string]igop.TypedConst{
    48  			"TypeBoolean":   {reflect.TypeOf(q.TypeBoolean), constant.MakeInt64(int64(q.TypeBoolean))},
    49  			"TypeFunction":  {reflect.TypeOf(q.TypeFunction), constant.MakeInt64(int64(q.TypeFunction))},
    50  			"TypeNull":      {reflect.TypeOf(q.TypeNull), constant.MakeInt64(int64(q.TypeNull))},
    51  			"TypeNumber":    {reflect.TypeOf(q.TypeNumber), constant.MakeInt64(int64(q.TypeNumber))},
    52  			"TypeObject":    {reflect.TypeOf(q.TypeObject), constant.MakeInt64(int64(q.TypeObject))},
    53  			"TypeString":    {reflect.TypeOf(q.TypeString), constant.MakeInt64(int64(q.TypeString))},
    54  			"TypeSymbol":    {reflect.TypeOf(q.TypeSymbol), constant.MakeInt64(int64(q.TypeSymbol))},
    55  			"TypeUndefined": {reflect.TypeOf(q.TypeUndefined), constant.MakeInt64(int64(q.TypeUndefined))},
    56  		},
    57  		UntypedConsts: map[string]igop.UntypedConst{},
    58  	})
    59  }