[CCode (lower_case_cprefix = "JS", cheader_filename = "JavaScriptCore/JavaScript.h")] namespace JS { [CCode (cname = "JSObjectCallAsFunctionCallback", has_target = false)] public delegate JS.Value? Callback (JS.Context context, JS.Object function, JS.Object this_object, [CCode (array_length_pos = 3.9, array_length_type = "size_t")] JS.Value[] arguments, out JS.Value exception); [Compact] [CCode (cname = "struct OpaqueJSContext")] public class Context { [CCode (cname = "JSContextGetGlobalObject")] public unowned JS.Object get_global_object (); [CCode (cname = "JSObjectMakeFunctionWithCallback")] public unowned JS.Object make_function_with_callback (JS.String? name, JS.Callback call_as_function); [CCode (cname = "JSObjectSetProperty")] public void set_property (JS.Object object, JS.String property_name, JS.Value value, uint attributes = 0, out JS.Value exception = null); } [Compact] [CCode (cname = "struct OpaqueJSValue")] public class Value { } [Compact] [CCode (cname = "struct OpaqueJSValue")] public class Object : JS.Value { } [Compact] [CCode (cname = "struct OpaqueJSString", free_function = "JSStringRelease")] public class String { [CCode (cname = "JSStringCreateWithUTF8CString")] public String (string utf8_cstring); } }