1 /* javascriptcoregtk-4.0.vapi generated by vapigen, do not modify. */
3 [CCode (cprefix = "JS", gir_namespace = "JavaScriptCore", gir_version = "4.0", lower_case_cprefix = "JS_")]
5 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "void", free_function = "JSClassRelease", has_type_id = false)]
8 [CCode (cname = "JSClassRelease")]
10 public void release ();
11 [CCode (cname = "JSClassRetain")]
12 public JS.Class retain ();
14 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "const struct OpaqueJSContext", free_function = "", has_type_id = false)]
16 public class Context {
17 [CCode (cname = "JSCheckScriptSyntax")]
18 public bool check_script_syntax (JS.String script, JS.String? source_url = null, int starting_line_number = 1, out JS.Value? exception = null);
19 [CCode (cname = "JSGarbageCollect")]
20 public void collect_garbage ();
21 [CCode (cname = "JSEvaluateScript")]
22 public unowned JS.Value? evaluate_script (JS.String script, JS.Object? this_object = null, JS.String? source_url = null, int starting_line_number = 1, out JS.Value? exception = null);
24 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "struct OpaqueJSContext", free_function = "JSGlobalContextRelease", has_type_id = false)]
26 public class GlobalContext : JS.Context {
27 [CCode (cname = "JSGlobalContextCreate")]
28 public GlobalContext (JS.Class? global_object_class = null);
29 [CCode (cname = "JSGlobalContextRelease")]
31 public void release ();
32 [CCode (cname = "JSGlobalContextRetain")]
33 public JS.GlobalContext retain ();
35 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "struct OpaqueJSValue", free_function = "", has_type_id = false)]
38 [CCode (cname = "JSObjectCallAsFunction", instance_pos = 1.1)]
39 public JS.Value call_as_function (JS.Context ctx, JS.Object? this_object, [CCode (array_length_pos = 2.5)] JS.Value[]? arguments, out JS.Value? exception);
40 [CCode (cname = "JSObjectGetProperty", instance_pos = 1.1)]
41 public JS.Value get_property (JS.Context ctx, JS.String property_name, out JS.Value? exception);
42 [CCode (cname = "JSObjectHasProperty", instance_pos = 1.1)]
43 public bool has_property (JS.Context ctx, JS.String property_name);
44 [CCode (cname = "JSObjectMakeFunction")]
45 public Object.make_function (JS.String? name, [CCode (array_length_pos = 1.5)] JS.String[]? parameter_names, JS.String body, JS.String? source_url, int starting_line_number, out JS.Value? exception);
47 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "struct OpaqueJSString", free_function = "JSStringRelease", has_type_id = false)]
50 [CCode (cname = "JSStringCreateWithUTF8CString")]
51 public String.create_with_utf8_cstring (string str);
52 [CCode (cname = "JSStringGetLength")]
53 public size_t get_length ();
54 [CCode (cname = "JSStringGetMaximumUTF8CStringSize")]
55 public size_t get_maximum_utf8_cstring_size ();
56 [CCode (cname = "JSStringGetUTF8CString")]
57 public size_t get_utf8_cstring ([CCode (array_length_type = "gsize")] ref uint8[] buffer);
58 [CCode (cname = "JSStringIsEqual")]
59 public bool is_equal (JS.String b);
60 [CCode (cname = "JSStringIsEqualToUTF8CString")]
61 public bool is_equal_to_utf8_cstring (string b);
62 [CCode (cname = "JSStringRelease")]
64 public void release ();
65 [CCode (cname = "JSStringRetain")]
66 public JS.String retain ();
68 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "const struct OpaqueJSValue", free_function = "", has_type_id = false)]
71 [CCode (cname = "JSValueGetType", instance_pos = 1.1)]
72 public JS.Type get_type (JS.Context ctx);
73 [CCode (cname = "JSValueGetTypedArrayType", instance_pos = 1.1)]
74 public JS.TypedArrayType get_typed_array_type (JS.Context ctx);
75 [CCode (cname = "JSValueIsArray", instance_pos = 1.1)]
76 public bool is_array (JS.Context ctx);
77 [CCode (cname = "JSValueIsBoolean", instance_pos = 1.1)]
78 public bool is_boolean (JS.Context ctx);
79 [CCode (cname = "JSValueIsDate", instance_pos = 1.1)]
80 public bool is_date (JS.Context ctx);
81 [CCode (cname = "JSValueIsEqual", instance_pos = 1.1)]
82 public bool is_equal (JS.Context ctx, JS.Value b, out JS.Value? exception = null);
83 [CCode (cname = "JSValueIsNull", instance_pos = 1.1)]
84 public bool is_null (JS.Context ctx);
85 [CCode (cname = "JSValueIsNumber", instance_pos = 1.1)]
86 public bool is_number (JS.Context ctx);
87 [CCode (cname = "JSValueIsObject", instance_pos = 1.1)]
88 public bool is_object (JS.Context ctx);
89 [CCode (cname = "JSValueIsObjectOfClass", instance_pos = 1.1)]
90 public bool is_object_of_class (JS.Context ctx, JS.Class js_class);
91 [CCode (cname = "JSValueIsStrictEqual", instance_pos = 1.1)]
92 public bool is_strict_equal (JS.Context ctx, JS.Value b);
93 [CCode (cname = "JSValueIsString", instance_pos = 1.1)]
94 public bool is_string (JS.Context ctx);
95 [CCode (cname = "JSValueIsUndefined", instance_pos = 1.1)]
96 public bool is_undefined (JS.Context ctx);
97 [CCode (cname = "JSValueProtect", instance_pos = 1.1)]
98 public void protect (JS.Context ctx);
99 [CCode (cname = "JSValueToBoolean", instance_pos = 1.1)]
100 public bool to_boolean (JS.Context ctx);
101 [CCode (cname = "JSValueToNumber", instance_pos = 1.1)]
102 public double to_number (JS.Context ctx, out JS.Value? exception = null);
103 [CCode (cname = "JSValueToObject", instance_pos = 1.1)]
104 public JS.Object to_object (JS.Context ctx, out JS.Value? exception = null);
105 [CCode (cname = "JSValueToStringCopy", instance_pos = 1.1)]
106 public JS.String to_string_copy (JS.Context ctx, out JS.Value? exception = null);
107 [CCode (cname = "JSValueUnprotect", instance_pos = 1.1)]
108 public void unprotect (JS.Context ctx);
110 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "JSType", has_type_id = false)]
112 [CCode (cname = "kJSTypeUndefined")]
114 [CCode (cname = "kJSTypeNull")]
116 [CCode (cname = "kJSTypeBoolean")]
118 [CCode (cname = "kJSTypeNumber")]
120 [CCode (cname = "kJSTypeString")]
122 [CCode (cname = "kJSTypeObject")]
125 [CCode (cheader_filename = "JavaScriptCore/JavaScript.h", cname = "JSTypedArrayType", has_type_id = false)]
126 public enum TypedArrayType {
127 [CCode (cname = "kJSTypedArrayTypeInt8Array")]
129 [CCode (cname = "kJSTypedArrayTypeInt16Array")]
131 [CCode (cname = "kJSTypedArrayTypeInt32Array")]
133 [CCode (cname = "kJSTypedArrayTypeUint8Array")]
135 [CCode (cname = "kJSTypedArrayTypeUint8ClampedArray")]
137 [CCode (cname = "kJSTypedArrayTypeUint16Array")]
139 [CCode (cname = "kJSTypedArrayTypeUint32Array")]
141 [CCode (cname = "kJSTypedArrayTypeFloat32Array")]
143 [CCode (cname = "kJSTypedArrayTypeFloat64Array")]
145 [CCode (cname = "kJSTypedArrayTypeArrayBuffer")]
147 [CCode (cname = "kJSTypedArrayTypeNone")]