This commit is contained in:
2026-01-27 16:20:46 -05:00
parent 7bf4f115b1
commit c3a16c9e92
21 changed files with 1192 additions and 577 deletions

27
internal/builtin/types.go Normal file
View 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)