Documentation
¶
Index ¶
- Constants
- func GetInstanceData(env Env) (interface{}, error)
- func SetInstanceData(env Env, data interface{}, finalizeFunc finalizeFunc) error
- func SetModuleInit(init func(env Env, exports Value) (Value, error))
- type Callback
- type CallbackInfo
- type Env
- func (env Env) CallFunction(recv Value, fun Value, argv []Value) (Value, error)
- func (env Env) CheckObjectTypeTag(jsObject Value, typeTag *TypeTag) (bool, error)
- func (env Env) CreateArrayWithLength(length int) (Value, error)
- func (env Env) CreateDouble(value float64) (Value, error)
- func (env Env) CreateFunction(name string, data unsafe.Pointer, cb Callback) (Value, error)
- func (env Env) CreateInt64(value int64) (Value, error)
- func (env Env) CreateObject() (Value, error)
- func (env Env) CreateReference(value Value, initialRefcount uint32) (Ref, error)
- func (env Env) CreateString(str string) (Value, error)
- func (env Env) CreateUint32(value uint32) (Value, error)
- func (env Env) DefineClass(name string, constructor Callback, data unsafe.Pointer, ...) (Value, error)
- func (env Env) DefineProperties(object Value, properties []PropertyDescriptor) error
- func (env Env) DeleteReference(ref Ref) error
- func (env Env) FatalException(errValue Value) error
- func (env Env) GetAllPropertyNames(object Value, keyMode KeyCollectionMode, keyFilter KeyFilter, ...) (Value, error)
- func (env Env) GetArrayLength(value Value) (uint32, error)
- func (env Env) GetBoolean(value bool) (Value, error)
- func (env Env) GetCbInfo(cbinfo CallbackInfo, argc *int, argv *Value, thisArg *Value, ...) error
- func (env Env) GetElement(object Value, index uint32) (Value, error)
- func (env Env) GetInstanceData() (unsafe.Pointer, error)
- func (env Env) GetLastErrorInfo() (*ExtendedErrorInfo, error)
- func (env Env) GetNull() (Value, error)
- func (env Env) GetProperty(object Value, key Value) (Value, error)
- func (env Env) GetPropertyNames(object Value) (Value, error)
- func (env Env) GetReferenceValue(ref Ref) (Value, error)
- func (env Env) GetUndefined() (Value, error)
- func (env Env) GetValueBigintWords(value Value, signBit *int, wordCount *int, words *uint64) error
- func (env Env) GetValueBool(value Value) (bool, error)
- func (env Env) GetValueDouble(value Value) (float64, error)
- func (env Env) GetValueString(value Value, buf []byte) (int, error)
- func (env Env) IsArray(value Value) (bool, error)
- func (env Env) IsExceptionPending() (bool, error)
- func (env Env) NewInstance(cons Value, argv []Value) (Value, error)
- func (env Env) ReferenceRef(ref Ref) (uint32, error)
- func (env Env) ReferenceUnref(ref Ref) (uint32, error)
- func (env Env) SetElement(object Value, index uint32, value Value) error
- func (env Env) SetInstanceData(data unsafe.Pointer, finalizeCb Finalize, finalizeHint unsafe.Pointer) error
- func (env Env) SetProperty(object Value, key Value, value Value) error
- func (env Env) ThrowError(code string, msg string) error
- func (env Env) ThrowTypeError(code string, msg string) error
- func (env Env) TypeTagObject(jsObject Value, typeTag *TypeTag) error
- func (env Env) Typeof(value Value) (ValueType, error)
- func (env Env) Unwrap(jsObject Value) (unsafe.Pointer, error)
- func (env Env) Wrap(jsObject Value, nativeObject unsafe.Pointer, finalizeCb Finalize, ...) error
- type ExtendedErrorInfo
- type Finalize
- type KeyCollectionMode
- type KeyConversion
- type KeyFilter
- type PropertyAttributes
- type PropertyDescriptor
- type Ref
- type SafeWrapper
- type TypeTag
- type Value
- type ValueType
Constants ¶
View Source
const ( KeyIncludePrototypes KeyCollectionMode = C.napi_key_include_prototypes KeyOwnOnly KeyCollectionMode = C.napi_key_own_only KeyAllProperties KeyFilter = C.napi_key_all_properties KeyWritable KeyFilter = C.napi_key_writable KeyEnumerable KeyFilter = C.napi_key_enumerable KeyConfigurable KeyFilter = C.napi_key_configurable KeySkipStrings KeyFilter = C.napi_key_skip_strings KeySkipSymbols KeyFilter = C.napi_key_skip_symbols KeyKeepNumbers KeyConversion = C.napi_key_keep_numbers KeyNumbersToStrings KeyConversion = C.napi_key_numbers_to_strings )
Variables ¶
This section is empty.
Functions ¶
func GetInstanceData ¶
func SetInstanceData ¶
Types ¶
type CallbackInfo ¶
type CallbackInfo C.napi_callback_info
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func (Env) CallFunction ¶
func (Env) CheckObjectTypeTag ¶
func (Env) CreateFunction ¶
func (Env) CreateObject ¶
func (Env) CreateReference ¶
func (Env) DefineClass ¶
func (Env) DefineProperties ¶
func (env Env) DefineProperties(object Value, properties []PropertyDescriptor) error
func (Env) DeleteReference ¶
func (Env) FatalException ¶
func (Env) GetAllPropertyNames ¶
func (env Env) GetAllPropertyNames(object Value, keyMode KeyCollectionMode, keyFilter KeyFilter, keyConversion KeyConversion) (Value, error)
func (Env) GetLastErrorInfo ¶
func (env Env) GetLastErrorInfo() (*ExtendedErrorInfo, error)
func (Env) GetUndefined ¶
func (Env) GetValueBigintWords ¶
func (Env) IsExceptionPending ¶
func (Env) SetInstanceData ¶
type ExtendedErrorInfo ¶
type ExtendedErrorInfo struct {
// contains filtered or unexported fields
}
type Finalize ¶
type Finalize C.napi_finalize
type KeyCollectionMode ¶
type KeyCollectionMode C.napi_key_collection_mode
type KeyConversion ¶
type KeyConversion C.napi_key_conversion
type KeyFilter ¶
type KeyFilter C.napi_key_filter
type PropertyAttributes ¶
type PropertyAttributes C.napi_property_attributes
const ( Default PropertyAttributes = C.napi_default Writable PropertyAttributes = C.napi_writable Enumerable PropertyAttributes = C.napi_enumerable Configurable PropertyAttributes = C.napi_configurable Static PropertyAttributes = C.napi_static DefaultMethod PropertyAttributes = C.napi_default_method DefaultJsProperty PropertyAttributes = C.napi_default_jsproperty )
type PropertyDescriptor ¶
type SafeWrapper ¶
type SafeWrapper[T any] struct { // contains filtered or unexported fields }
func NewSafeWrapper ¶
func NewSafeWrapper[T any](tag1 uint64, tag2 uint64) SafeWrapper[T]
type TypeTag ¶
type TypeTag C.napi_type_tag
type Value ¶
type Value C.napi_value
type ValueType ¶
type ValueType C.napi_valuetype
const ( Undefined ValueType = C.napi_undefined Null ValueType = C.napi_null Boolean ValueType = C.napi_boolean Number ValueType = C.napi_number String ValueType = C.napi_string Symbol ValueType = C.napi_symbol Object ValueType = C.napi_object Function ValueType = C.napi_function External ValueType = C.napi_external Bigint ValueType = C.napi_bigint )
Click to show internal directories.
Click to hide internal directories.