Documentation
¶
Index ¶
- Constants
- func ResolvePath(path string, mayNotExist bool) (string, error)
- func RunBunCommand(bunCommand BunCommand) error
- func RunTsc(tsconfigPath string) error
- func SourceLoader(jsRuntime *JsRuntime, path string) ([]byte, error)
- func Throw(err error)
- type BunCommand
- type ConstructorRegistration
- type DynamicArray
- type DynamicFunction
- type DynamicObject
- type DynamicObjectCustomGetterSetter
- type DynamicObjectTemplate
- type EmbeddedModule
- type ExtensionMethodRegistration
- type FieldRegistration
- type FunctionRegistration
- type FunctionType
- type Iterator
- type IteratorResult
- type JsError
- type JsRuntime
- func (jsRuntime *JsRuntime) CheckInsideTheMainScriptDirectory(filePath string) error
- func (jsRuntime *JsRuntime) Constructor(function reflect.Value) *FunctionRegistration
- func (jsRuntime *JsRuntime) Function(function reflect.Value) *FunctionRegistration
- func (jsRuntime *JsRuntime) GetEnv(key string) *string
- func (jsRuntime *JsRuntime) GetStackTrace() []sobek.StackFrame
- func (jsRuntime *JsRuntime) InitializeNativeLibraries() error
- func (jsRuntime *JsRuntime) MarshalToGo(jsArg sobek.Value, expectedType reflect.Type) (reflect.Value, error)
- func (jsRuntime *JsRuntime) MarshalToJs(object reflect.Value) (sobek.Value, error)
- func (jsRuntime *JsRuntime) NewDynamicArray(backingSlice reflect.Value) *sobek.Object
- func (jsRuntime *JsRuntime) Run(script *JsScript, args []string) error
- func (jsRuntime *JsRuntime) Type(objectType reflect.Type) *TypeRegistration
- func (jsRuntime *JsRuntime) Variable(jsModule, jsName string, value reflect.Value) *VariableRegistration
- type JsScript
- type MethodRegistration
- type TypeAlias
- type TypeConversion
- type TypeRegistration
- func (t *TypeRegistration) Alias(module, name string) *TypeRegistration
- func (t *TypeRegistration) ClearConstructors() *TypeRegistration
- func (t *TypeRegistration) Constructors(constructors ...*ConstructorRegistration) *TypeRegistration
- func (t *TypeRegistration) DisableObjectMapping() *TypeRegistration
- func (t *TypeRegistration) ExtensionMethods(extensionMethods ...*ExtensionMethodRegistration) *TypeRegistration
- func (t *TypeRegistration) Fields(fields ...*FieldRegistration) *TypeRegistration
- func (t *TypeRegistration) JsModule(module string) *TypeRegistration
- func (t *TypeRegistration) JsName(name string) *TypeRegistration
- func (t *TypeRegistration) Methods(methods ...*MethodRegistration) *TypeRegistration
- func (t *TypeRegistration) TypeConversion(converter reflect.Value) *TypeRegistration
- type VariableRegistration
- type WeakMap
Constants ¶
View Source
const PackageName = "@ohayocorp/anemos"
Variables ¶
This section is empty.
Functions ¶
func RunBunCommand ¶
func RunBunCommand(bunCommand BunCommand) error
Types ¶
type BunCommand ¶
type ConstructorRegistration ¶
type ConstructorRegistration struct {
// contains filtered or unexported fields
}
func Constructor ¶
func Constructor(function reflect.Value) *ConstructorRegistration
type DynamicArray ¶
type DynamicArray struct {
// contains filtered or unexported fields
}
func (*DynamicArray) Len ¶
func (d *DynamicArray) Len() int
func (*DynamicArray) SetLen ¶
func (d *DynamicArray) SetLen(newLen int) bool
type DynamicFunction ¶
type DynamicFunction struct {
// contains filtered or unexported fields
}
type DynamicObject ¶
type DynamicObject struct {
// contains filtered or unexported fields
}
func (*DynamicObject) Delete ¶
func (d *DynamicObject) Delete(key string) bool
func (*DynamicObject) Has ¶
func (d *DynamicObject) Has(key string) bool
func (*DynamicObject) Keys ¶
func (d *DynamicObject) Keys() []string
type DynamicObjectTemplate ¶
type DynamicObjectTemplate struct {
// contains filtered or unexported fields
}
func NewDynamicObjectTemplate ¶
func NewDynamicObjectTemplate(jsRuntime *JsRuntime, objectType reflect.Type) *DynamicObjectTemplate
func (*DynamicObjectTemplate) Initialize ¶
func (template *DynamicObjectTemplate) Initialize(module *sobek.Object)
type EmbeddedModule ¶
type ExtensionMethodRegistration ¶
type ExtensionMethodRegistration struct {
// contains filtered or unexported fields
}
func ExtensionMethod ¶
func ExtensionMethod(function reflect.Value) *ExtensionMethodRegistration
func (*ExtensionMethodRegistration) JsName ¶
func (e *ExtensionMethodRegistration) JsName(name string) *ExtensionMethodRegistration
type FieldRegistration ¶
type FieldRegistration struct {
// contains filtered or unexported fields
}
func Field ¶
func Field(name string) *FieldRegistration
func (*FieldRegistration) JsName ¶
func (f *FieldRegistration) JsName(name string) *FieldRegistration
type FunctionRegistration ¶
type FunctionRegistration struct {
// contains filtered or unexported fields
}
func (*FunctionRegistration) JsModule ¶ added in v0.2.0
func (f *FunctionRegistration) JsModule(module string) *FunctionRegistration
func (*FunctionRegistration) JsName ¶
func (f *FunctionRegistration) JsName(name string) *FunctionRegistration
type FunctionType ¶
type FunctionType string
type Iterator ¶
type Iterator interface {
Next(jsRuntime *JsRuntime, index int) IteratorResult
}
type IteratorResult ¶
type JsRuntime ¶
type JsRuntime struct {
MainScriptPath string
Registry *require.Registry
Runtime *sobek.Runtime
Flags map[string]string
EmbeddedModules []*EmbeddedModule
// contains filtered or unexported fields
}
func NewJsRuntime ¶
func NewJsRuntime() *JsRuntime
func (*JsRuntime) CheckInsideTheMainScriptDirectory ¶
func (*JsRuntime) Constructor ¶ added in v0.2.0
func (jsRuntime *JsRuntime) Constructor(function reflect.Value) *FunctionRegistration
func (*JsRuntime) Function ¶
func (jsRuntime *JsRuntime) Function(function reflect.Value) *FunctionRegistration
func (*JsRuntime) GetStackTrace ¶
func (jsRuntime *JsRuntime) GetStackTrace() []sobek.StackFrame
func (*JsRuntime) InitializeNativeLibraries ¶ added in v0.2.0
func (*JsRuntime) MarshalToGo ¶
func (*JsRuntime) MarshalToJs ¶
func (*JsRuntime) NewDynamicArray ¶
type MethodRegistration ¶
type MethodRegistration struct {
// contains filtered or unexported fields
}
func Method ¶
func Method(name string) *MethodRegistration
func (*MethodRegistration) JsName ¶
func (m *MethodRegistration) JsName(name string) *MethodRegistration
type TypeConversion ¶
type TypeConversion struct {
// contains filtered or unexported fields
}
type TypeRegistration ¶
type TypeRegistration struct {
// contains filtered or unexported fields
}
func (*TypeRegistration) Alias ¶
func (t *TypeRegistration) Alias(module, name string) *TypeRegistration
func (*TypeRegistration) ClearConstructors ¶
func (t *TypeRegistration) ClearConstructors() *TypeRegistration
func (*TypeRegistration) Constructors ¶
func (t *TypeRegistration) Constructors(constructors ...*ConstructorRegistration) *TypeRegistration
func (*TypeRegistration) DisableObjectMapping ¶
func (t *TypeRegistration) DisableObjectMapping() *TypeRegistration
func (*TypeRegistration) ExtensionMethods ¶
func (t *TypeRegistration) ExtensionMethods(extensionMethods ...*ExtensionMethodRegistration) *TypeRegistration
func (*TypeRegistration) Fields ¶
func (t *TypeRegistration) Fields(fields ...*FieldRegistration) *TypeRegistration
func (*TypeRegistration) JsModule ¶ added in v0.2.0
func (t *TypeRegistration) JsModule(module string) *TypeRegistration
func (*TypeRegistration) JsName ¶
func (t *TypeRegistration) JsName(name string) *TypeRegistration
func (*TypeRegistration) Methods ¶
func (t *TypeRegistration) Methods(methods ...*MethodRegistration) *TypeRegistration
func (*TypeRegistration) TypeConversion ¶
func (t *TypeRegistration) TypeConversion(converter reflect.Value) *TypeRegistration
type VariableRegistration ¶
type VariableRegistration struct {
// contains filtered or unexported fields
}
type WeakMap ¶
type WeakMap[K comparable, V any] struct { // contains filtered or unexported fields }
WeakMap copied from: https://github.com/golang/go/issues/43615#issuecomment-2985815833
Click to show internal directories.
Click to hide internal directories.