asd
This commit is contained in:
27
internal/builtin/types.go
Normal file
27
internal/builtin/types.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package builtin
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/dop251/goja"
|
||||
)
|
||||
|
||||
type Builtin struct {
|
||||
Name string
|
||||
Function func(*goja.Runtime) func(goja.FunctionCall) goja.Value
|
||||
Definition string
|
||||
Types []string
|
||||
ParamTypes map[string]bool
|
||||
}
|
||||
|
||||
func (b *Builtin) HasParamType(typeName string) bool {
|
||||
return b.ParamTypes[typeName]
|
||||
}
|
||||
|
||||
type EmptyArgs struct{}
|
||||
|
||||
type Args interface {
|
||||
Validate() error
|
||||
}
|
||||
|
||||
type Func[T Args, R any] func(ctx context.Context, args T) (R, error)
|
||||
Reference in New Issue
Block a user