@girs/javascriptcore-6.0 2.39.90-3.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/javascriptcore-6.0.cjs +9 -0
- package/javascriptcore-6.0.d.cts +1761 -0
- package/javascriptcore-6.0.d.ts +1766 -0
- package/javascriptcore-6.0.js +8 -0
- package/package.json +53 -0
- package/tsconfig.doc.json +19 -0
|
@@ -0,0 +1,1761 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
4
|
+
*
|
|
5
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
6
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* JavaScriptCore-6.0
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type GObject from '@girs/gobject-2.0';
|
|
13
|
+
import type GLib from '@girs/glib-2.0';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Enum values to specify a mode to check for syntax errors in jsc_context_check_syntax().
|
|
17
|
+
*/
|
|
18
|
+
export enum CheckSyntaxMode {
|
|
19
|
+
/**
|
|
20
|
+
* mode to check syntax of a script
|
|
21
|
+
*/
|
|
22
|
+
SCRIPT,
|
|
23
|
+
/**
|
|
24
|
+
* mode to check syntax of a module
|
|
25
|
+
*/
|
|
26
|
+
MODULE,
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Enum values to specify the result of jsc_context_check_syntax().
|
|
30
|
+
*/
|
|
31
|
+
export enum CheckSyntaxResult {
|
|
32
|
+
/**
|
|
33
|
+
* no errors
|
|
34
|
+
*/
|
|
35
|
+
SUCCESS,
|
|
36
|
+
/**
|
|
37
|
+
* recoverable syntax error
|
|
38
|
+
*/
|
|
39
|
+
RECOVERABLE_ERROR,
|
|
40
|
+
/**
|
|
41
|
+
* irrecoverable syntax error
|
|
42
|
+
*/
|
|
43
|
+
IRRECOVERABLE_ERROR,
|
|
44
|
+
/**
|
|
45
|
+
* unterminated literal error
|
|
46
|
+
*/
|
|
47
|
+
UNTERMINATED_LITERAL_ERROR,
|
|
48
|
+
/**
|
|
49
|
+
* out of memory error
|
|
50
|
+
*/
|
|
51
|
+
OUT_OF_MEMORY_ERROR,
|
|
52
|
+
/**
|
|
53
|
+
* stack overflow error
|
|
54
|
+
*/
|
|
55
|
+
STACK_OVERFLOW_ERROR,
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Enum values for options types.
|
|
59
|
+
*/
|
|
60
|
+
export enum OptionType {
|
|
61
|
+
/**
|
|
62
|
+
* A #gboolean option type.
|
|
63
|
+
*/
|
|
64
|
+
BOOLEAN,
|
|
65
|
+
/**
|
|
66
|
+
* A #gint option type.
|
|
67
|
+
*/
|
|
68
|
+
INT,
|
|
69
|
+
/**
|
|
70
|
+
* A #guint option type.
|
|
71
|
+
*/
|
|
72
|
+
UINT,
|
|
73
|
+
/**
|
|
74
|
+
* A #gsize options type.
|
|
75
|
+
*/
|
|
76
|
+
SIZE,
|
|
77
|
+
/**
|
|
78
|
+
* A #gdouble options type.
|
|
79
|
+
*/
|
|
80
|
+
DOUBLE,
|
|
81
|
+
/**
|
|
82
|
+
* A string option type.
|
|
83
|
+
*/
|
|
84
|
+
STRING,
|
|
85
|
+
/**
|
|
86
|
+
* A range string option type.
|
|
87
|
+
*/
|
|
88
|
+
RANGE_STRING,
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Possible types of the elements contained in a typed array.
|
|
92
|
+
*/
|
|
93
|
+
export enum TypedArrayType {
|
|
94
|
+
/**
|
|
95
|
+
* Not a typed array, or type unsupported.
|
|
96
|
+
*/
|
|
97
|
+
NONE,
|
|
98
|
+
/**
|
|
99
|
+
* Array elements are 8-bit signed integers (int8_t).
|
|
100
|
+
*/
|
|
101
|
+
INT8,
|
|
102
|
+
/**
|
|
103
|
+
* Array elements are 16-bit signed integers (int16_t).
|
|
104
|
+
*/
|
|
105
|
+
INT16,
|
|
106
|
+
/**
|
|
107
|
+
* Array elements are 32-bit signed integers (int32_t).
|
|
108
|
+
*/
|
|
109
|
+
INT32,
|
|
110
|
+
/**
|
|
111
|
+
* Array elements are 64-bit signed integers (int64_t).
|
|
112
|
+
*/
|
|
113
|
+
INT64,
|
|
114
|
+
/**
|
|
115
|
+
* Array elements are 8-bit unsigned integers (uint8_t).
|
|
116
|
+
*/
|
|
117
|
+
UINT8,
|
|
118
|
+
/**
|
|
119
|
+
* Array elements are 8-bit unsigned integers (uint8_t).
|
|
120
|
+
*/
|
|
121
|
+
UINT8_CLAMPED,
|
|
122
|
+
/**
|
|
123
|
+
* Array elements are 16-bit unsigned integers (uint16_t).
|
|
124
|
+
*/
|
|
125
|
+
UINT16,
|
|
126
|
+
/**
|
|
127
|
+
* Array elements are 32-bit unsigned integers (uint32_t).
|
|
128
|
+
*/
|
|
129
|
+
UINT32,
|
|
130
|
+
/**
|
|
131
|
+
* Array elements are 64-bit unsigned integers (uint64_t).
|
|
132
|
+
*/
|
|
133
|
+
UINT64,
|
|
134
|
+
/**
|
|
135
|
+
* Array elements are 32-bit floating point numbers (float).
|
|
136
|
+
*/
|
|
137
|
+
FLOAT32,
|
|
138
|
+
/**
|
|
139
|
+
* Array elements are 64-bit floating point numbers (double).
|
|
140
|
+
*/
|
|
141
|
+
FLOAT64,
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Flags used when defining properties with jsc_value_object_define_property_data() and
|
|
145
|
+
* jsc_value_object_define_property_accessor().
|
|
146
|
+
* @bitfield
|
|
147
|
+
*/
|
|
148
|
+
export enum ValuePropertyFlags {
|
|
149
|
+
/**
|
|
150
|
+
* the type of the property descriptor may be changed and the
|
|
151
|
+
* property may be deleted from the corresponding object.
|
|
152
|
+
*/
|
|
153
|
+
CONFIGURABLE,
|
|
154
|
+
/**
|
|
155
|
+
* the property shows up during enumeration of the properties on
|
|
156
|
+
* the corresponding object.
|
|
157
|
+
*/
|
|
158
|
+
ENUMERABLE,
|
|
159
|
+
/**
|
|
160
|
+
* the value associated with the property may be changed with an
|
|
161
|
+
* assignment operator. This doesn't have any effect when passed to jsc_value_object_define_property_accessor().
|
|
162
|
+
*/
|
|
163
|
+
WRITABLE,
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Like jsc_get_major_version(), but from the headers used at
|
|
167
|
+
* application compile time, rather than from the library linked
|
|
168
|
+
* against at application run time.
|
|
169
|
+
*/
|
|
170
|
+
export const MAJOR_VERSION: number
|
|
171
|
+
/**
|
|
172
|
+
* Like jsc_get_micro_version(), but from the headers used at
|
|
173
|
+
* application compile time, rather than from the library linked
|
|
174
|
+
* against at application run time.
|
|
175
|
+
*/
|
|
176
|
+
export const MICRO_VERSION: number
|
|
177
|
+
/**
|
|
178
|
+
* Like jsc_get_minor_version(), but from the headers used at
|
|
179
|
+
* application compile time, rather than from the library linked
|
|
180
|
+
* against at application run time.
|
|
181
|
+
*/
|
|
182
|
+
export const MINOR_VERSION: number
|
|
183
|
+
/**
|
|
184
|
+
* Allows the DFG JIT to be used if %TRUE.
|
|
185
|
+
* Option type: %JSC_OPTION_BOOLEAN
|
|
186
|
+
* Default value: %TRUE.
|
|
187
|
+
*/
|
|
188
|
+
export const OPTIONS_USE_DFG: string | null
|
|
189
|
+
/**
|
|
190
|
+
* Allows the FTL JIT to be used if %TRUE.
|
|
191
|
+
* Option type: %JSC_OPTION_BOOLEAN
|
|
192
|
+
* Default value: %TRUE.
|
|
193
|
+
*/
|
|
194
|
+
export const OPTIONS_USE_FTL: string | null
|
|
195
|
+
/**
|
|
196
|
+
* Allows the executable pages to be allocated for JIT and thunks if %TRUE.
|
|
197
|
+
* Option type: %JSC_OPTION_BOOLEAN
|
|
198
|
+
* Default value: %TRUE.
|
|
199
|
+
*/
|
|
200
|
+
export const OPTIONS_USE_JIT: string | null
|
|
201
|
+
/**
|
|
202
|
+
* Allows the LLINT to be used if %TRUE.
|
|
203
|
+
* Option type: %JSC_OPTION_BOOLEAN
|
|
204
|
+
* Default value: %TRUE.
|
|
205
|
+
*/
|
|
206
|
+
export const OPTIONS_USE_LLINT: string | null
|
|
207
|
+
/**
|
|
208
|
+
* Returns the major version number of the JavaScriptCore library.
|
|
209
|
+
* (e.g. in JavaScriptCore version 1.8.3 this is 1.)
|
|
210
|
+
*
|
|
211
|
+
* This function is in the library, so it represents the JavaScriptCore library
|
|
212
|
+
* your code is running against. Contrast with the #JSC_MAJOR_VERSION
|
|
213
|
+
* macro, which represents the major version of the JavaScriptCore headers you
|
|
214
|
+
* have included when compiling your code.
|
|
215
|
+
* @returns the major version number of the JavaScriptCore library
|
|
216
|
+
*/
|
|
217
|
+
export function get_major_version(): number
|
|
218
|
+
/**
|
|
219
|
+
* Returns the micro version number of the JavaScriptCore library.
|
|
220
|
+
* (e.g. in JavaScriptCore version 1.8.3 this is 3.)
|
|
221
|
+
*
|
|
222
|
+
* This function is in the library, so it represents the JavaScriptCore library
|
|
223
|
+
* your code is running against. Contrast with the #JSC_MICRO_VERSION
|
|
224
|
+
* macro, which represents the micro version of the JavaScriptCore headers you
|
|
225
|
+
* have included when compiling your code.
|
|
226
|
+
* @returns the micro version number of the JavaScriptCore library
|
|
227
|
+
*/
|
|
228
|
+
export function get_micro_version(): number
|
|
229
|
+
/**
|
|
230
|
+
* Returns the minor version number of the JavaScriptCore library.
|
|
231
|
+
* (e.g. in JavaScriptCore version 1.8.3 this is 8.)
|
|
232
|
+
*
|
|
233
|
+
* This function is in the library, so it represents the JavaScriptCore library
|
|
234
|
+
* your code is running against. Contrast with the #JSC_MINOR_VERSION
|
|
235
|
+
* macro, which represents the minor version of the JavaScriptCore headers you
|
|
236
|
+
* have included when compiling your code.
|
|
237
|
+
* @returns the minor version number of the JavaScriptCore library
|
|
238
|
+
*/
|
|
239
|
+
export function get_minor_version(): number
|
|
240
|
+
/**
|
|
241
|
+
* Iterates all available options calling `function` for each one. Iteration can
|
|
242
|
+
* stop early if `function` returns %FALSE.
|
|
243
|
+
* @param function_ a #JSCOptionsFunc callback
|
|
244
|
+
*/
|
|
245
|
+
export function options_foreach(function_: OptionsFunc): void
|
|
246
|
+
/**
|
|
247
|
+
* Get `option` as a #gboolean value.
|
|
248
|
+
* @param option the option identifier
|
|
249
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
250
|
+
*/
|
|
251
|
+
export function options_get_boolean(option: string | null): [ /* returnType */ boolean, /* value */ boolean ]
|
|
252
|
+
/**
|
|
253
|
+
* Get `option` as a #gdouble value.
|
|
254
|
+
* @param option the option identifier
|
|
255
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
256
|
+
*/
|
|
257
|
+
export function options_get_double(option: string | null): [ /* returnType */ boolean, /* value */ number ]
|
|
258
|
+
/**
|
|
259
|
+
* Get `option` as a #gint value.
|
|
260
|
+
* @param option the option identifier
|
|
261
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
262
|
+
*/
|
|
263
|
+
export function options_get_int(option: string | null): [ /* returnType */ boolean, /* value */ number ]
|
|
264
|
+
/**
|
|
265
|
+
* Create a #GOptionGroup to handle JSCOptions as command line arguments.
|
|
266
|
+
* The options will be exposed as command line arguments with the form
|
|
267
|
+
* <emphasis>--jsc-<option>=<value></emphasis>.
|
|
268
|
+
* Each entry in the returned #GOptionGroup is configured to apply the
|
|
269
|
+
* corresponding option during command line parsing. Applications only need to
|
|
270
|
+
* pass the returned group to g_option_context_add_group(), and the rest will
|
|
271
|
+
* be taken care for automatically.
|
|
272
|
+
* @returns a #GOptionGroup for the JSCOptions
|
|
273
|
+
*/
|
|
274
|
+
export function options_get_option_group(): GLib.OptionGroup
|
|
275
|
+
/**
|
|
276
|
+
* Get `option` as a range string. The string must be in the
|
|
277
|
+
* format <emphasis>[!]<low>[:<high>]</emphasis> where low and high are #guint values.
|
|
278
|
+
* Values between low and high (both included) will be considered in
|
|
279
|
+
* the range, unless <emphasis>!</emphasis> is used to invert the range.
|
|
280
|
+
* @param option the option identifier
|
|
281
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
282
|
+
*/
|
|
283
|
+
export function options_get_range_string(option: string | null): [ /* returnType */ boolean, /* value */ string | null ]
|
|
284
|
+
/**
|
|
285
|
+
* Get `option` as a #gsize value.
|
|
286
|
+
* @param option the option identifier
|
|
287
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
288
|
+
*/
|
|
289
|
+
export function options_get_size(option: string | null): [ /* returnType */ boolean, /* value */ number ]
|
|
290
|
+
/**
|
|
291
|
+
* Get `option` as a string.
|
|
292
|
+
* @param option the option identifier
|
|
293
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
294
|
+
*/
|
|
295
|
+
export function options_get_string(option: string | null): [ /* returnType */ boolean, /* value */ string | null ]
|
|
296
|
+
/**
|
|
297
|
+
* Get `option` as a #guint value.
|
|
298
|
+
* @param option the option identifier
|
|
299
|
+
* @returns %TRUE if @value has been set or %FALSE if the option doesn't exist
|
|
300
|
+
*/
|
|
301
|
+
export function options_get_uint(option: string | null): [ /* returnType */ boolean, /* value */ number ]
|
|
302
|
+
/**
|
|
303
|
+
* Set `option` as a #gboolean value.
|
|
304
|
+
* @param option the option identifier
|
|
305
|
+
* @param value the value to set
|
|
306
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
307
|
+
*/
|
|
308
|
+
export function options_set_boolean(option: string | null, value: boolean): boolean
|
|
309
|
+
/**
|
|
310
|
+
* Set `option` as a #gdouble value.
|
|
311
|
+
* @param option the option identifier
|
|
312
|
+
* @param value the value to set
|
|
313
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
314
|
+
*/
|
|
315
|
+
export function options_set_double(option: string | null, value: number): boolean
|
|
316
|
+
/**
|
|
317
|
+
* Set `option` as a #gint value.
|
|
318
|
+
* @param option the option identifier
|
|
319
|
+
* @param value the value to set
|
|
320
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
321
|
+
*/
|
|
322
|
+
export function options_set_int(option: string | null, value: number): boolean
|
|
323
|
+
/**
|
|
324
|
+
* Set `option` as a range string. The string must be in the
|
|
325
|
+
* format <emphasis>[!]<low>[:<high>]</emphasis> where low and high are #guint values.
|
|
326
|
+
* Values between low and high (both included) will be considered in
|
|
327
|
+
* the range, unless <emphasis>!</emphasis> is used to invert the range.
|
|
328
|
+
* @param option the option identifier
|
|
329
|
+
* @param value the value to set
|
|
330
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
331
|
+
*/
|
|
332
|
+
export function options_set_range_string(option: string | null, value: string | null): boolean
|
|
333
|
+
/**
|
|
334
|
+
* Set `option` as a #gsize value.
|
|
335
|
+
* @param option the option identifier
|
|
336
|
+
* @param value the value to set
|
|
337
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
338
|
+
*/
|
|
339
|
+
export function options_set_size(option: string | null, value: number): boolean
|
|
340
|
+
/**
|
|
341
|
+
* Set `option` as a string.
|
|
342
|
+
* @param option the option identifier
|
|
343
|
+
* @param value the value to set
|
|
344
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
345
|
+
*/
|
|
346
|
+
export function options_set_string(option: string | null, value: string | null): boolean
|
|
347
|
+
/**
|
|
348
|
+
* Set `option` as a #guint value.
|
|
349
|
+
* @param option the option identifier
|
|
350
|
+
* @param value the value to set
|
|
351
|
+
* @returns %TRUE if option was correctly set or %FALSE otherwise.
|
|
352
|
+
*/
|
|
353
|
+
export function options_set_uint(option: string | null, value: number): boolean
|
|
354
|
+
/**
|
|
355
|
+
* The type of delete_property in #JSCClassVTable. This is only required when you need to handle
|
|
356
|
+
* external properties not added to the prototype.
|
|
357
|
+
* @callback
|
|
358
|
+
* @param jsc_class a #JSCClass
|
|
359
|
+
* @param context a #JSCContext
|
|
360
|
+
* @param instance the `jsc_class` instance
|
|
361
|
+
* @param name the property name
|
|
362
|
+
* @returns %TRUE if handled or %FALSE to to forward the request to the parent class or prototype chain.
|
|
363
|
+
*/
|
|
364
|
+
export interface ClassDeletePropertyFunction {
|
|
365
|
+
(jsc_class: Class, context: Context, instance: any | null, name: string | null): boolean
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* The type of enumerate_properties in #JSCClassVTable. This is only required when you need to handle
|
|
369
|
+
* external properties not added to the prototype.
|
|
370
|
+
* @callback
|
|
371
|
+
* @param jsc_class a #JSCClass
|
|
372
|
+
* @param context a #JSCContext
|
|
373
|
+
* @param instance the `jsc_class` instance
|
|
374
|
+
* @returns a %NULL-terminated array of strings containing the property names, or %NULL if @instance doesn't have enumerable properties.
|
|
375
|
+
*/
|
|
376
|
+
export interface ClassEnumeratePropertiesFunction {
|
|
377
|
+
(jsc_class: Class, context: Context, instance: any | null): string[] | null
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* The type of get_property in #JSCClassVTable. This is only required when you need to handle
|
|
381
|
+
* external properties not added to the prototype.
|
|
382
|
+
* @callback
|
|
383
|
+
* @param jsc_class a #JSCClass
|
|
384
|
+
* @param context a #JSCContext
|
|
385
|
+
* @param instance the `jsc_class` instance
|
|
386
|
+
* @param name the property name
|
|
387
|
+
* @returns a #JSCValue or %NULL to forward the request to the parent class or prototype chain
|
|
388
|
+
*/
|
|
389
|
+
export interface ClassGetPropertyFunction {
|
|
390
|
+
(jsc_class: Class, context: Context, instance: any | null, name: string | null): Value | null
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* The type of has_property in #JSCClassVTable. This is only required when you need to handle
|
|
394
|
+
* external properties not added to the prototype.
|
|
395
|
+
* @callback
|
|
396
|
+
* @param jsc_class a #JSCClass
|
|
397
|
+
* @param context a #JSCContext
|
|
398
|
+
* @param instance the `jsc_class` instance
|
|
399
|
+
* @param name the property name
|
|
400
|
+
* @returns %TRUE if @instance has a property with @name or %FALSE to forward the request to the parent class or prototype chain.
|
|
401
|
+
*/
|
|
402
|
+
export interface ClassHasPropertyFunction {
|
|
403
|
+
(jsc_class: Class, context: Context, instance: any | null, name: string | null): boolean
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* The type of set_property in #JSCClassVTable. This is only required when you need to handle
|
|
407
|
+
* external properties not added to the prototype.
|
|
408
|
+
* @callback
|
|
409
|
+
* @param jsc_class a #JSCClass
|
|
410
|
+
* @param context a #JSCContext
|
|
411
|
+
* @param instance the `jsc_class` instance
|
|
412
|
+
* @param name the property name
|
|
413
|
+
* @param value the #JSCValue to set
|
|
414
|
+
* @returns %TRUE if handled or %FALSE to forward the request to the parent class or prototype chain.
|
|
415
|
+
*/
|
|
416
|
+
export interface ClassSetPropertyFunction {
|
|
417
|
+
(jsc_class: Class, context: Context, instance: any | null, name: string | null, value: Value): boolean
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Function used to handle JavaScript exceptions in a #JSCContext.
|
|
421
|
+
* @callback
|
|
422
|
+
* @param context a #JSCContext
|
|
423
|
+
* @param exception a #JSCException
|
|
424
|
+
*/
|
|
425
|
+
export interface ExceptionHandler {
|
|
426
|
+
(context: Context, exception: Exception): void
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Function used to iterate options.
|
|
430
|
+
*
|
|
431
|
+
* Not that `description` string is not localized.
|
|
432
|
+
* @callback
|
|
433
|
+
* @param option the option name
|
|
434
|
+
* @param type the option #JSCOptionType
|
|
435
|
+
* @param description the option description, or %NULL
|
|
436
|
+
* @returns %TRUE to stop the iteration, or %FALSE otherwise
|
|
437
|
+
*/
|
|
438
|
+
export interface OptionsFunc {
|
|
439
|
+
(option: string | null, type: OptionType, description: string | null): boolean
|
|
440
|
+
}
|
|
441
|
+
export module Class {
|
|
442
|
+
|
|
443
|
+
// Constructor properties interface
|
|
444
|
+
|
|
445
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
446
|
+
|
|
447
|
+
// Own constructor properties of JavaScriptCore-6.0.JavaScriptCore.Class
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* The #JSCContext in which the class was registered.
|
|
451
|
+
*/
|
|
452
|
+
context?: Context | null
|
|
453
|
+
/**
|
|
454
|
+
* The name of the class.
|
|
455
|
+
*/
|
|
456
|
+
name?: string | null
|
|
457
|
+
/**
|
|
458
|
+
* The parent class or %NULL in case of final classes.
|
|
459
|
+
*/
|
|
460
|
+
parent?: Class | null
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
export interface Class {
|
|
466
|
+
|
|
467
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Class
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* The #JSCContext in which the class was registered.
|
|
471
|
+
*/
|
|
472
|
+
readonly context: Context
|
|
473
|
+
/**
|
|
474
|
+
* The name of the class.
|
|
475
|
+
*/
|
|
476
|
+
readonly name: string | null
|
|
477
|
+
/**
|
|
478
|
+
* The parent class or %NULL in case of final classes.
|
|
479
|
+
*/
|
|
480
|
+
readonly parent: Class
|
|
481
|
+
|
|
482
|
+
// Owm methods of JavaScriptCore-6.0.JavaScriptCore.Class
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Add a constructor to `jsc_class`. If `name` is %NULL, the class name will be used. When <function>new</function>
|
|
486
|
+
* is used with the constructor or jsc_value_constructor_call() is called, `callback` is invoked receiving
|
|
487
|
+
* a #GPtrArray of #JSCValue<!-- -->s as arguments and `user_data` as the last parameter. When the constructor object
|
|
488
|
+
* is cleared in the #JSCClass context, `destroy_notify` is called with `user_data` as parameter.
|
|
489
|
+
*
|
|
490
|
+
* This function creates the constructor, which needs to be added to an object as a property to be able to use it. Use
|
|
491
|
+
* jsc_context_set_value() to make the constructor available in the global object.
|
|
492
|
+
*
|
|
493
|
+
* Note that the value returned by `callback` is adopted by `jsc_class,` and the #GDestroyNotify passed to
|
|
494
|
+
* jsc_context_register_class() is responsible for disposing of it.
|
|
495
|
+
* @param name the constructor name or %NULL
|
|
496
|
+
* @param callback a #GCallback to be called to create an instance of `jsc_class`
|
|
497
|
+
* @param return_type the #GType of the constructor return value
|
|
498
|
+
* @returns a #JSCValue representing the class constructor.
|
|
499
|
+
*/
|
|
500
|
+
add_constructor_variadic(name: string | null, callback: GObject.Callback, return_type: GObject.GType): Value
|
|
501
|
+
/**
|
|
502
|
+
* Add a constructor to `jsc_class`. If `name` is %NULL, the class name will be used. When <function>new</function>
|
|
503
|
+
* is used with the constructor or jsc_value_constructor_call() is called, `callback` is invoked receiving the
|
|
504
|
+
* parameters and `user_data` as the last parameter. When the constructor object is cleared in the #JSCClass context,
|
|
505
|
+
* `destroy_notify` is called with `user_data` as parameter.
|
|
506
|
+
*
|
|
507
|
+
* This function creates the constructor, which needs to be added to an object as a property to be able to use it. Use
|
|
508
|
+
* jsc_context_set_value() to make the constructor available in the global object.
|
|
509
|
+
*
|
|
510
|
+
* Note that the value returned by `callback` is adopted by `jsc_class,` and the #GDestroyNotify passed to
|
|
511
|
+
* jsc_context_register_class() is responsible for disposing of it.
|
|
512
|
+
* @param name the constructor name or %NULL
|
|
513
|
+
* @param callback a #GCallback to be called to create an instance of `jsc_class`
|
|
514
|
+
* @param return_type the #GType of the constructor return value
|
|
515
|
+
* @param parameter_types a list of #GType<!-- -->s, one for each parameter, or %NULL
|
|
516
|
+
* @returns a #JSCValue representing the class constructor.
|
|
517
|
+
*/
|
|
518
|
+
add_constructor(name: string | null, callback: GObject.Callback, return_type: GObject.GType, parameter_types: GObject.GType[] | null): Value
|
|
519
|
+
/**
|
|
520
|
+
* Add method with `name` to `jsc_class`. When the method is called by JavaScript or jsc_value_object_invoke_method(),
|
|
521
|
+
* `callback` is called receiving the class instance as first parameter, followed by a #GPtrArray of #JSCValue<!-- -->s
|
|
522
|
+
* with the method arguments and then `user_data` as last parameter. When the method is cleared in the #JSCClass context,
|
|
523
|
+
* `destroy_notify` is called with `user_data` as parameter.
|
|
524
|
+
*
|
|
525
|
+
* Note that the value returned by `callback` must be transfer full. In case of non-refcounted boxed types, you should use
|
|
526
|
+
* %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used.
|
|
527
|
+
* If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created
|
|
528
|
+
* with jsc_value_new_object() that receives the copy as the instance parameter.
|
|
529
|
+
* @param name the method name
|
|
530
|
+
* @param callback a #GCallback to be called to invoke method `name` of `jsc_class`
|
|
531
|
+
* @param return_type the #GType of the method return value, or %G_TYPE_NONE if the method is void.
|
|
532
|
+
*/
|
|
533
|
+
add_method_variadic(name: string | null, callback: GObject.Callback, return_type: GObject.GType): void
|
|
534
|
+
/**
|
|
535
|
+
* Add method with `name` to `jsc_class`. When the method is called by JavaScript or jsc_value_object_invoke_method(),
|
|
536
|
+
* `callback` is called receiving the class instance as first parameter, followed by the method parameters and then
|
|
537
|
+
* `user_data` as last parameter. When the method is cleared in the #JSCClass context, `destroy_notify` is called with
|
|
538
|
+
* `user_data` as parameter.
|
|
539
|
+
*
|
|
540
|
+
* Note that the value returned by `callback` must be transfer full. In case of non-refcounted boxed types, you should use
|
|
541
|
+
* %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used.
|
|
542
|
+
* If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created
|
|
543
|
+
* with jsc_value_new_object() that receives the copy as the instance parameter.
|
|
544
|
+
* @param name the method name
|
|
545
|
+
* @param callback a #GCallback to be called to invoke method `name` of `jsc_class`
|
|
546
|
+
* @param return_type the #GType of the method return value, or %G_TYPE_NONE if the method is void.
|
|
547
|
+
* @param parameter_types a list of #GType<!-- -->s, one for each parameter, or %NULL
|
|
548
|
+
*/
|
|
549
|
+
add_method(name: string | null, callback: GObject.Callback, return_type: GObject.GType, parameter_types: GObject.GType[] | null): void
|
|
550
|
+
/**
|
|
551
|
+
* Add a property with `name` to `jsc_class`. When the property value needs to be getted, `getter` is called
|
|
552
|
+
* receiving the the class instance as first parameter and `user_data` as last parameter. When the property
|
|
553
|
+
* value needs to be set, `setter` is called receiving the the class instance as first parameter, followed
|
|
554
|
+
* by the value to be set and then `user_data` as the last parameter. When the property is cleared in the
|
|
555
|
+
* #JSCClass context, `destroy_notify` is called with `user_data` as parameter.
|
|
556
|
+
*
|
|
557
|
+
* Note that the value returned by `getter` must be transfer full. In case of non-refcounted boxed types, you should use
|
|
558
|
+
* %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used.
|
|
559
|
+
* If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created
|
|
560
|
+
* with jsc_value_new_object() that receives the copy as the instance parameter.
|
|
561
|
+
* @param name the property name
|
|
562
|
+
* @param property_type the #GType of the property value
|
|
563
|
+
* @param getter a #GCallback to be called to get the property value
|
|
564
|
+
* @param setter a #GCallback to be called to set the property value
|
|
565
|
+
*/
|
|
566
|
+
add_property(name: string | null, property_type: GObject.GType, getter: GObject.Callback | null, setter: GObject.Callback | null): void
|
|
567
|
+
/**
|
|
568
|
+
* Get the class name of `jsc_class`
|
|
569
|
+
* @returns the name of @jsc_class
|
|
570
|
+
*/
|
|
571
|
+
get_name(): string | null
|
|
572
|
+
/**
|
|
573
|
+
* Get the parent class of `jsc_class`
|
|
574
|
+
* @returns the parent class of @jsc_class
|
|
575
|
+
*/
|
|
576
|
+
get_parent(): Class
|
|
577
|
+
|
|
578
|
+
// Class property signals of JavaScriptCore-6.0.JavaScriptCore.Class
|
|
579
|
+
|
|
580
|
+
connect(sigName: "notify::context", callback: (($obj: Class, pspec: GObject.ParamSpec) => void)): number
|
|
581
|
+
connect_after(sigName: "notify::context", callback: (($obj: Class, pspec: GObject.ParamSpec) => void)): number
|
|
582
|
+
emit(sigName: "notify::context", ...args: any[]): void
|
|
583
|
+
connect(sigName: "notify::name", callback: (($obj: Class, pspec: GObject.ParamSpec) => void)): number
|
|
584
|
+
connect_after(sigName: "notify::name", callback: (($obj: Class, pspec: GObject.ParamSpec) => void)): number
|
|
585
|
+
emit(sigName: "notify::name", ...args: any[]): void
|
|
586
|
+
connect(sigName: "notify::parent", callback: (($obj: Class, pspec: GObject.ParamSpec) => void)): number
|
|
587
|
+
connect_after(sigName: "notify::parent", callback: (($obj: Class, pspec: GObject.ParamSpec) => void)): number
|
|
588
|
+
emit(sigName: "notify::parent", ...args: any[]): void
|
|
589
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
590
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
591
|
+
emit(sigName: string, ...args: any[]): void
|
|
592
|
+
disconnect(id: number): void
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* A JSSClass represents a custom JavaScript class registered by the user in a #JSCContext.
|
|
597
|
+
* It allows to create new JavaScripts objects whose instances are created by the user using
|
|
598
|
+
* this API.
|
|
599
|
+
* It's possible to add constructors, properties and methods for a JSSClass by providing
|
|
600
|
+
* #GCallback<!-- -->s to implement them.
|
|
601
|
+
* @class
|
|
602
|
+
*/
|
|
603
|
+
export class Class extends GObject.Object {
|
|
604
|
+
|
|
605
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Class
|
|
606
|
+
|
|
607
|
+
static name: string
|
|
608
|
+
static $gtype: GObject.GType<Class>
|
|
609
|
+
|
|
610
|
+
// Constructors of JavaScriptCore-6.0.JavaScriptCore.Class
|
|
611
|
+
|
|
612
|
+
constructor(config?: Class.ConstructorProperties)
|
|
613
|
+
_init(config?: Class.ConstructorProperties): void
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export module Context {
|
|
617
|
+
|
|
618
|
+
// Constructor properties interface
|
|
619
|
+
|
|
620
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
621
|
+
|
|
622
|
+
// Own constructor properties of JavaScriptCore-6.0.JavaScriptCore.Context
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* The #JSCVirtualMachine in which the context was created.
|
|
626
|
+
*/
|
|
627
|
+
virtual_machine?: VirtualMachine | null
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export interface Context {
|
|
633
|
+
|
|
634
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Context
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* The #JSCVirtualMachine in which the context was created.
|
|
638
|
+
*/
|
|
639
|
+
readonly virtual_machine: VirtualMachine
|
|
640
|
+
|
|
641
|
+
// Owm methods of JavaScriptCore-6.0.JavaScriptCore.Context
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Check the given `code` in `context` for syntax errors. The `line_number` is the starting line number in `uri;`
|
|
645
|
+
* the value is one-based so the first line is 1. `uri` and `line_number` are only used to fill the `exception`.
|
|
646
|
+
* In case of errors `exception` will be set to a new #JSCException with the details. You can pass %NULL to
|
|
647
|
+
* `exception` to ignore the error details.
|
|
648
|
+
* @param code a JavaScript script to check
|
|
649
|
+
* @param length length of `code,` or -1 if `code` is a nul-terminated string
|
|
650
|
+
* @param mode a #JSCCheckSyntaxMode
|
|
651
|
+
* @param uri the source URI
|
|
652
|
+
* @param line_number the starting line number
|
|
653
|
+
* @returns a #JSCCheckSyntaxResult
|
|
654
|
+
*/
|
|
655
|
+
check_syntax(code: string | null, length: number, mode: CheckSyntaxMode, uri: string | null, line_number: number): [ /* returnType */ CheckSyntaxResult, /* exception */ Exception ]
|
|
656
|
+
/**
|
|
657
|
+
* Clear the uncaught exception in `context` if any.
|
|
658
|
+
*/
|
|
659
|
+
clear_exception(): void
|
|
660
|
+
/**
|
|
661
|
+
* Evaluate `code` in `context`.
|
|
662
|
+
* @param code a JavaScript script to evaluate
|
|
663
|
+
* @param length length of `code,` or -1 if `code` is a nul-terminated string
|
|
664
|
+
* @returns a #JSCValue representing the last value generated by the script.
|
|
665
|
+
*/
|
|
666
|
+
evaluate(code: string | null, length: number): Value
|
|
667
|
+
/**
|
|
668
|
+
* Evaluate `code` and create an new object where symbols defined in `code` will be added as properties,
|
|
669
|
+
* instead of being added to `context` global object. The new object is returned as `object` parameter.
|
|
670
|
+
* Similar to how jsc_value_new_object() works, if `object_instance` is not %NULL `object_class` must be provided too.
|
|
671
|
+
* The `line_number` is the starting line number in `uri;` the value is one-based so the first line is 1.
|
|
672
|
+
* `uri` and `line_number` will be shown in exceptions and they don't affect the behavior of the script.
|
|
673
|
+
* @param code a JavaScript script to evaluate
|
|
674
|
+
* @param length length of `code,` or -1 if `code` is a nul-terminated string
|
|
675
|
+
* @param object_instance an object instance
|
|
676
|
+
* @param object_class a #JSCClass or %NULL to use the default
|
|
677
|
+
* @param uri the source URI
|
|
678
|
+
* @param line_number the starting line number
|
|
679
|
+
* @returns a #JSCValue representing the last value generated by the script.
|
|
680
|
+
*/
|
|
681
|
+
evaluate_in_object(code: string | null, length: number, object_instance: any | null, object_class: Class | null, uri: string | null, line_number: number): [ /* returnType */ Value, /* object */ Value ]
|
|
682
|
+
/**
|
|
683
|
+
* Evaluate `code` in `context` using `uri` as the source URI. The `line_number` is the starting line number
|
|
684
|
+
* in `uri;` the value is one-based so the first line is 1. `uri` and `line_number` will be shown in exceptions and
|
|
685
|
+
* they don't affect the behavior of the script.
|
|
686
|
+
* @param code a JavaScript script to evaluate
|
|
687
|
+
* @param length length of `code,` or -1 if `code` is a nul-terminated string
|
|
688
|
+
* @param uri the source URI
|
|
689
|
+
* @param line_number the starting line number
|
|
690
|
+
* @returns a #JSCValue representing the last value generated by the script.
|
|
691
|
+
*/
|
|
692
|
+
evaluate_with_source_uri(code: string | null, length: number, uri: string | null, line_number: number): Value
|
|
693
|
+
/**
|
|
694
|
+
* Get the last unhandled exception thrown in `context` by API functions calls.
|
|
695
|
+
* @returns a #JSCException or %NULL if there isn't any unhandled exception in the #JSCContext.
|
|
696
|
+
*/
|
|
697
|
+
get_exception(): Exception | null
|
|
698
|
+
/**
|
|
699
|
+
* Get a #JSCValue referencing the `context` global object
|
|
700
|
+
* @returns a #JSCValue
|
|
701
|
+
*/
|
|
702
|
+
get_global_object(): Value
|
|
703
|
+
/**
|
|
704
|
+
* Get a property of `context` global object with `name`.
|
|
705
|
+
* @param name the value name
|
|
706
|
+
* @returns a #JSCValue
|
|
707
|
+
*/
|
|
708
|
+
get_value(name: string | null): Value
|
|
709
|
+
/**
|
|
710
|
+
* Get the #JSCVirtualMachine where `context` was created.
|
|
711
|
+
* @returns the #JSCVirtualMachine where the #JSCContext was created.
|
|
712
|
+
*/
|
|
713
|
+
get_virtual_machine(): VirtualMachine
|
|
714
|
+
/**
|
|
715
|
+
* Remove the last #JSCExceptionHandler previously pushed to `context` with
|
|
716
|
+
* jsc_context_push_exception_handler().
|
|
717
|
+
*/
|
|
718
|
+
pop_exception_handler(): void
|
|
719
|
+
/**
|
|
720
|
+
* Push an exception handler in `context`. Whenever a JavaScript exception happens in
|
|
721
|
+
* the #JSCContext, the given `handler` will be called. The default #JSCExceptionHandler
|
|
722
|
+
* simply calls jsc_context_throw_exception() to throw the exception to the #JSCContext.
|
|
723
|
+
* If you don't want to catch the exception, but only get notified about it, call
|
|
724
|
+
* jsc_context_throw_exception() in `handler` like the default one does.
|
|
725
|
+
* The last exception handler pushed is the only one used by the #JSCContext, use
|
|
726
|
+
* jsc_context_pop_exception_handler() to remove it and set the previous one. When `handler`
|
|
727
|
+
* is removed from the context, `destroy_notify` i called with `user_data` as parameter.
|
|
728
|
+
* @param handler a #JSCExceptionHandler
|
|
729
|
+
*/
|
|
730
|
+
push_exception_handler(handler: ExceptionHandler): void
|
|
731
|
+
/**
|
|
732
|
+
* Register a custom class in `context` using the given `name`. If the new class inherits from
|
|
733
|
+
* another #JSCClass, the parent should be passed as `parent_class,` otherwise %NULL should be
|
|
734
|
+
* used. The optional `vtable` parameter allows to provide a custom implementation for handling
|
|
735
|
+
* the class, for example, to handle external properties not added to the prototype.
|
|
736
|
+
* When an instance of the #JSCClass is cleared in the context, `destroy_notify` is called with
|
|
737
|
+
* the instance as parameter.
|
|
738
|
+
* @param name the class name
|
|
739
|
+
* @param parent_class a #JSCClass or %NULL
|
|
740
|
+
* @param vtable an optional #JSCClassVTable or %NULL
|
|
741
|
+
* @param destroy_notify a destroy notifier for class instances
|
|
742
|
+
* @returns a #JSCClass
|
|
743
|
+
*/
|
|
744
|
+
register_class(name: string | null, parent_class: Class | null, vtable: ClassVTable | null, destroy_notify: GLib.DestroyNotify | null): Class
|
|
745
|
+
/**
|
|
746
|
+
* Set a property of `context` global object with `name` and `value`.
|
|
747
|
+
* @param name the value name
|
|
748
|
+
* @param value a #JSCValue
|
|
749
|
+
*/
|
|
750
|
+
set_value(name: string | null, value: Value): void
|
|
751
|
+
/**
|
|
752
|
+
* Throw an exception to `context` using the given error message. The created #JSCException
|
|
753
|
+
* can be retrieved with jsc_context_get_exception().
|
|
754
|
+
* @param error_message an error message
|
|
755
|
+
*/
|
|
756
|
+
throw(error_message: string | null): void
|
|
757
|
+
/**
|
|
758
|
+
* Throw `exception` to `context`.
|
|
759
|
+
* @param exception a #JSCException
|
|
760
|
+
*/
|
|
761
|
+
throw_exception(exception: Exception): void
|
|
762
|
+
/**
|
|
763
|
+
* Throw an exception to `context` using the given error name and message. The created #JSCException
|
|
764
|
+
* can be retrieved with jsc_context_get_exception().
|
|
765
|
+
* @param error_name the error name
|
|
766
|
+
* @param error_message an error message
|
|
767
|
+
*/
|
|
768
|
+
throw_with_name(error_name: string | null, error_message: string | null): void
|
|
769
|
+
|
|
770
|
+
// Class property signals of JavaScriptCore-6.0.JavaScriptCore.Context
|
|
771
|
+
|
|
772
|
+
connect(sigName: "notify::virtual-machine", callback: (($obj: Context, pspec: GObject.ParamSpec) => void)): number
|
|
773
|
+
connect_after(sigName: "notify::virtual-machine", callback: (($obj: Context, pspec: GObject.ParamSpec) => void)): number
|
|
774
|
+
emit(sigName: "notify::virtual-machine", ...args: any[]): void
|
|
775
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
776
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
777
|
+
emit(sigName: string, ...args: any[]): void
|
|
778
|
+
disconnect(id: number): void
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* JSCContext represents a JavaScript execution context, where all operations
|
|
783
|
+
* take place and where the values will be associated.
|
|
784
|
+
*
|
|
785
|
+
* When a new context is created, a global object is allocated and the built-in JavaScript
|
|
786
|
+
* objects (Object, Function, String, Array) are populated. You can execute JavaScript in
|
|
787
|
+
* the context by using jsc_context_evaluate() or jsc_context_evaluate_with_source_uri().
|
|
788
|
+
* It's also possible to register custom objects in the context with jsc_context_register_class().
|
|
789
|
+
* @class
|
|
790
|
+
*/
|
|
791
|
+
export class Context extends GObject.Object {
|
|
792
|
+
|
|
793
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Context
|
|
794
|
+
|
|
795
|
+
static name: string
|
|
796
|
+
static $gtype: GObject.GType<Context>
|
|
797
|
+
|
|
798
|
+
// Constructors of JavaScriptCore-6.0.JavaScriptCore.Context
|
|
799
|
+
|
|
800
|
+
constructor(config?: Context.ConstructorProperties)
|
|
801
|
+
/**
|
|
802
|
+
* Create a new #JSCContext. The context is created in a new #JSCVirtualMachine.
|
|
803
|
+
* Use jsc_context_new_with_virtual_machine() to create a new #JSCContext in an
|
|
804
|
+
* existing #JSCVirtualMachine.
|
|
805
|
+
* @constructor
|
|
806
|
+
* @returns the newly created #JSCContext.
|
|
807
|
+
*/
|
|
808
|
+
constructor()
|
|
809
|
+
/**
|
|
810
|
+
* Create a new #JSCContext. The context is created in a new #JSCVirtualMachine.
|
|
811
|
+
* Use jsc_context_new_with_virtual_machine() to create a new #JSCContext in an
|
|
812
|
+
* existing #JSCVirtualMachine.
|
|
813
|
+
* @constructor
|
|
814
|
+
* @returns the newly created #JSCContext.
|
|
815
|
+
*/
|
|
816
|
+
static new(): Context
|
|
817
|
+
/**
|
|
818
|
+
* Create a new #JSCContext in `virtual_machine`.
|
|
819
|
+
* @constructor
|
|
820
|
+
* @param vm a #JSCVirtualMachine
|
|
821
|
+
* @returns the newly created #JSCContext.
|
|
822
|
+
*/
|
|
823
|
+
static new_with_virtual_machine(vm: VirtualMachine): Context
|
|
824
|
+
_init(config?: Context.ConstructorProperties): void
|
|
825
|
+
/**
|
|
826
|
+
* Get the #JSCContext that is currently executing a function. This should only be
|
|
827
|
+
* called within a function or method callback, otherwise %NULL will be returned.
|
|
828
|
+
* @returns the #JSCContext that is currently executing.
|
|
829
|
+
*/
|
|
830
|
+
static get_current(): Context | null
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
export module Exception {
|
|
834
|
+
|
|
835
|
+
// Constructor properties interface
|
|
836
|
+
|
|
837
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export interface Exception {
|
|
843
|
+
|
|
844
|
+
// Owm methods of JavaScriptCore-6.0.JavaScriptCore.Exception
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* Get a string with the exception backtrace.
|
|
848
|
+
* @returns the exception backtrace string or %NULL.
|
|
849
|
+
*/
|
|
850
|
+
get_backtrace_string(): string | null
|
|
851
|
+
/**
|
|
852
|
+
* Get the column number at which `exception` happened.
|
|
853
|
+
* @returns the column number of @exception.
|
|
854
|
+
*/
|
|
855
|
+
get_column_number(): number
|
|
856
|
+
/**
|
|
857
|
+
* Get the line number at which `exception` happened.
|
|
858
|
+
* @returns the line number of @exception.
|
|
859
|
+
*/
|
|
860
|
+
get_line_number(): number
|
|
861
|
+
/**
|
|
862
|
+
* Get the error message of `exception`.
|
|
863
|
+
* @returns the @exception error message.
|
|
864
|
+
*/
|
|
865
|
+
get_message(): string | null
|
|
866
|
+
/**
|
|
867
|
+
* Get the error name of `exception`
|
|
868
|
+
* @returns the @exception error name.
|
|
869
|
+
*/
|
|
870
|
+
get_name(): string | null
|
|
871
|
+
/**
|
|
872
|
+
* Get the source URI of `exception`.
|
|
873
|
+
* @returns the the source URI of @exception, or %NULL.
|
|
874
|
+
*/
|
|
875
|
+
get_source_uri(): string | null
|
|
876
|
+
/**
|
|
877
|
+
* Return a report message of `exception,` containing all the possible details such us
|
|
878
|
+
* source URI, line, column and backtrace, and formatted to be printed.
|
|
879
|
+
* @returns a new string with the exception report
|
|
880
|
+
*/
|
|
881
|
+
report(): string | null
|
|
882
|
+
/**
|
|
883
|
+
* Get the string representation of `exception` error.
|
|
884
|
+
* @returns the string representation of @exception.
|
|
885
|
+
*/
|
|
886
|
+
to_string(): string | null
|
|
887
|
+
|
|
888
|
+
// Class property signals of JavaScriptCore-6.0.JavaScriptCore.Exception
|
|
889
|
+
|
|
890
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
891
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
892
|
+
emit(sigName: string, ...args: any[]): void
|
|
893
|
+
disconnect(id: number): void
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* JSCException represents a JavaScript exception.
|
|
898
|
+
* @class
|
|
899
|
+
*/
|
|
900
|
+
export class Exception extends GObject.Object {
|
|
901
|
+
|
|
902
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Exception
|
|
903
|
+
|
|
904
|
+
static name: string
|
|
905
|
+
static $gtype: GObject.GType<Exception>
|
|
906
|
+
|
|
907
|
+
// Constructors of JavaScriptCore-6.0.JavaScriptCore.Exception
|
|
908
|
+
|
|
909
|
+
constructor(config?: Exception.ConstructorProperties)
|
|
910
|
+
/**
|
|
911
|
+
* Create a new #JSCException in `context` with `message`.
|
|
912
|
+
* @constructor
|
|
913
|
+
* @param context a #JSCContext
|
|
914
|
+
* @param message the error message
|
|
915
|
+
* @returns a new #JSCException.
|
|
916
|
+
*/
|
|
917
|
+
constructor(context: Context, message: string | null)
|
|
918
|
+
/**
|
|
919
|
+
* Create a new #JSCException in `context` with `message`.
|
|
920
|
+
* @constructor
|
|
921
|
+
* @param context a #JSCContext
|
|
922
|
+
* @param message the error message
|
|
923
|
+
* @returns a new #JSCException.
|
|
924
|
+
*/
|
|
925
|
+
static new(context: Context, message: string | null): Exception
|
|
926
|
+
/**
|
|
927
|
+
* Create a new #JSCException in `context` with `name` and `message`.
|
|
928
|
+
* @constructor
|
|
929
|
+
* @param context a #JSCContext
|
|
930
|
+
* @param name the error name
|
|
931
|
+
* @param message the error message
|
|
932
|
+
* @returns a new #JSCException.
|
|
933
|
+
*/
|
|
934
|
+
static new_with_name(context: Context, name: string | null, message: string | null): Exception
|
|
935
|
+
_init(config?: Exception.ConstructorProperties): void
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
export module Value {
|
|
939
|
+
|
|
940
|
+
// Constructor properties interface
|
|
941
|
+
|
|
942
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
943
|
+
|
|
944
|
+
// Own constructor properties of JavaScriptCore-6.0.JavaScriptCore.Value
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* The #JSCContext in which the value was created.
|
|
948
|
+
*/
|
|
949
|
+
context?: Context | null
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
export interface Value {
|
|
955
|
+
|
|
956
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Value
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* The #JSCContext in which the value was created.
|
|
960
|
+
*/
|
|
961
|
+
readonly context: Context
|
|
962
|
+
|
|
963
|
+
// Owm methods of JavaScriptCore-6.0.JavaScriptCore.Value
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Gets a pointer to memory that contains the array buffer data.
|
|
967
|
+
*
|
|
968
|
+
* Obtains a pointer to the memory region that holds the contents of the
|
|
969
|
+
* %ArrayBuffer; modifications done to the data will be visible to JavaScript
|
|
970
|
+
* code. If `size` is not %NULL, the size in bytes of the memory region
|
|
971
|
+
* will also be stored in the pointed location.
|
|
972
|
+
*
|
|
973
|
+
* Note that the pointer returned by this function is not guaranteed to remain
|
|
974
|
+
* the same after calls to other JSC API functions. If you plan to access the
|
|
975
|
+
* data of the %ArrayBuffer later, you can keep a reference to the `value` and
|
|
976
|
+
* obtain the data pointer at a later point. Keep in mind that if JavaScript
|
|
977
|
+
* code has a chance to run, for example due to main loop events that result
|
|
978
|
+
* in JSC being called, the contents of the memory region might be modified in
|
|
979
|
+
* the meantime. Consider taking a copy of the data and using the copy instead
|
|
980
|
+
* in asynchronous code.
|
|
981
|
+
* @param size location where to store the size of the memory region.
|
|
982
|
+
* @returns pointer to memory.
|
|
983
|
+
*/
|
|
984
|
+
array_buffer_get_data(size: number | null): any | null
|
|
985
|
+
/**
|
|
986
|
+
* Gets the size in bytes of the array buffer.
|
|
987
|
+
*
|
|
988
|
+
* Obtains the size in bytes of the memory region that holds the contents of
|
|
989
|
+
* an %ArrayBuffer.
|
|
990
|
+
* @returns size, in bytes.
|
|
991
|
+
*/
|
|
992
|
+
array_buffer_get_size(): number
|
|
993
|
+
/**
|
|
994
|
+
* Invoke <function>new</function> with constructor referenced by `value`. If `n_parameters`
|
|
995
|
+
* is 0 no parameters will be passed to the constructor.
|
|
996
|
+
* @param parameters the #JSCValue<!-- -->s to pass as parameters to the constructor, or %NULL
|
|
997
|
+
* @returns a #JSCValue referencing the newly created object instance.
|
|
998
|
+
*/
|
|
999
|
+
constructor_call(parameters: Value[] | null): Value
|
|
1000
|
+
/**
|
|
1001
|
+
* Call function referenced by `value,` passing the given `parameters`. If `n_parameters`
|
|
1002
|
+
* is 0 no parameters will be passed to the function.
|
|
1003
|
+
*
|
|
1004
|
+
* This function always returns a #JSCValue, in case of void functions a #JSCValue referencing
|
|
1005
|
+
* <function>undefined</function> is returned
|
|
1006
|
+
* @param parameters the #JSCValue<!-- -->s to pass as parameters to the function, or %NULL
|
|
1007
|
+
* @returns a #JSCValue with the return value of the function.
|
|
1008
|
+
*/
|
|
1009
|
+
function_call(parameters: Value[] | null): Value
|
|
1010
|
+
/**
|
|
1011
|
+
* Get the #JSCContext in which `value` was created.
|
|
1012
|
+
* @returns the #JSCValue context.
|
|
1013
|
+
*/
|
|
1014
|
+
get_context(): Context
|
|
1015
|
+
/**
|
|
1016
|
+
* Get whether the value referenced by `value` is an array.
|
|
1017
|
+
* @returns whether the value is an array.
|
|
1018
|
+
*/
|
|
1019
|
+
is_array(): boolean
|
|
1020
|
+
/**
|
|
1021
|
+
* Check whether the `value` is an %ArrayBuffer.
|
|
1022
|
+
* @returns whether the value is an %ArrayBuffer
|
|
1023
|
+
*/
|
|
1024
|
+
is_array_buffer(): boolean
|
|
1025
|
+
/**
|
|
1026
|
+
* Get whether the value referenced by `value` is a boolean.
|
|
1027
|
+
* @returns whether the value is a boolean.
|
|
1028
|
+
*/
|
|
1029
|
+
is_boolean(): boolean
|
|
1030
|
+
/**
|
|
1031
|
+
* Get whether the value referenced by `value` is a constructor.
|
|
1032
|
+
* @returns whether the value is a constructor.
|
|
1033
|
+
*/
|
|
1034
|
+
is_constructor(): boolean
|
|
1035
|
+
/**
|
|
1036
|
+
* Get whether the value referenced by `value` is a function
|
|
1037
|
+
* @returns whether the value is a function.
|
|
1038
|
+
*/
|
|
1039
|
+
is_function(): boolean
|
|
1040
|
+
/**
|
|
1041
|
+
* Get whether the value referenced by `value` is <function>null</function>.
|
|
1042
|
+
* @returns whether the value is null.
|
|
1043
|
+
*/
|
|
1044
|
+
is_null(): boolean
|
|
1045
|
+
/**
|
|
1046
|
+
* Get whether the value referenced by `value` is a number.
|
|
1047
|
+
* @returns whether the value is a number.
|
|
1048
|
+
*/
|
|
1049
|
+
is_number(): boolean
|
|
1050
|
+
/**
|
|
1051
|
+
* Get whether the value referenced by `value` is an object.
|
|
1052
|
+
* @returns whether the value is an object.
|
|
1053
|
+
*/
|
|
1054
|
+
is_object(): boolean
|
|
1055
|
+
/**
|
|
1056
|
+
* Get whether the value referenced by `value` is a string
|
|
1057
|
+
* @returns whether the value is a string
|
|
1058
|
+
*/
|
|
1059
|
+
is_string(): boolean
|
|
1060
|
+
/**
|
|
1061
|
+
* Determines whether a value is a typed array.
|
|
1062
|
+
* @returns Whether @value is a typed array.
|
|
1063
|
+
*/
|
|
1064
|
+
is_typed_array(): boolean
|
|
1065
|
+
/**
|
|
1066
|
+
* Get whether the value referenced by `value` is <function>undefined</function>.
|
|
1067
|
+
* @returns whether the value is undefined.
|
|
1068
|
+
*/
|
|
1069
|
+
is_undefined(): boolean
|
|
1070
|
+
/**
|
|
1071
|
+
* Create a new typed array value with elements from an array buffer.
|
|
1072
|
+
*
|
|
1073
|
+
* Create a #JSCValue referencing a new typed array value containing
|
|
1074
|
+
* elements of the given `type,` where the elements are stored at the memory
|
|
1075
|
+
* region represented by the `array_buffer`.
|
|
1076
|
+
*
|
|
1077
|
+
* The `type` must *not* be %JSC_TYPED_ARRAY_NONE.
|
|
1078
|
+
*
|
|
1079
|
+
* The `offset` and `length` parameters can be used to indicate which part of
|
|
1080
|
+
* the array buffer can be accessed through the typed array. If both are
|
|
1081
|
+
* omitted (passing zero as `offset,` and `-1` as `length)`, the whole
|
|
1082
|
+
* `array_buffer` is exposed through the typed array. Omitting the `length`
|
|
1083
|
+
* with a non-zero `offset` will expose the remainder of the `array_buffer`
|
|
1084
|
+
* starting at the indicated offset.
|
|
1085
|
+
* @param type type of array elements.
|
|
1086
|
+
* @param offset offset, in bytes.
|
|
1087
|
+
* @param length number of array elements, or `-1`.
|
|
1088
|
+
* @returns a #JSCValue
|
|
1089
|
+
*/
|
|
1090
|
+
new_typed_array_with_buffer(type: TypedArrayType, offset: number, length: number): Value
|
|
1091
|
+
/**
|
|
1092
|
+
* Define or modify a property with `property_name` in object referenced by `value`. When the
|
|
1093
|
+
* property value needs to be getted or set, `getter` and `setter` callbacks will be called.
|
|
1094
|
+
* When the property is cleared in the #JSCClass context, `destroy_notify` is called with
|
|
1095
|
+
* `user_data` as parameter. This is equivalent to JavaScript <function>Object.defineProperty()</function>
|
|
1096
|
+
* when used with an accessor descriptor.
|
|
1097
|
+
*
|
|
1098
|
+
* Note that the value returned by `getter` must be fully transferred. In case of boxed types, you could use
|
|
1099
|
+
* %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used.
|
|
1100
|
+
* If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created
|
|
1101
|
+
* with jsc_value_new_object() that receives the copy as instance parameter.
|
|
1102
|
+
*
|
|
1103
|
+
* Note that `getter` and `setter` are called as functions and not methods, so they don't receive an instance as
|
|
1104
|
+
* first parameter. Use jsc_class_add_property() if you want to add property accessor invoked as a method.
|
|
1105
|
+
* @param property_name the name of the property to define
|
|
1106
|
+
* @param flags #JSCValuePropertyFlags
|
|
1107
|
+
* @param property_type the #GType of the property
|
|
1108
|
+
* @param getter a #GCallback to be called to get the property value
|
|
1109
|
+
* @param setter a #GCallback to be called to set the property value
|
|
1110
|
+
*/
|
|
1111
|
+
object_define_property_accessor(property_name: string | null, flags: ValuePropertyFlags, property_type: GObject.GType, getter: GObject.Callback | null, setter: GObject.Callback | null): void
|
|
1112
|
+
/**
|
|
1113
|
+
* Define or modify a property with `property_name` in object referenced by `value`. This is equivalent to
|
|
1114
|
+
* JavaScript <function>Object.defineProperty()</function> when used with a data descriptor.
|
|
1115
|
+
* @param property_name the name of the property to define
|
|
1116
|
+
* @param flags #JSCValuePropertyFlags
|
|
1117
|
+
* @param property_value the default property value
|
|
1118
|
+
*/
|
|
1119
|
+
object_define_property_data(property_name: string | null, flags: ValuePropertyFlags, property_value: Value | null): void
|
|
1120
|
+
/**
|
|
1121
|
+
* Try to delete property with `name` from `value`. This function will return %FALSE if
|
|
1122
|
+
* the property was defined without %JSC_VALUE_PROPERTY_CONFIGURABLE flag.
|
|
1123
|
+
* @param name the property name
|
|
1124
|
+
* @returns %TRUE if the property was deleted, or %FALSE otherwise.
|
|
1125
|
+
*/
|
|
1126
|
+
object_delete_property(name: string | null): boolean
|
|
1127
|
+
/**
|
|
1128
|
+
* Get the list of property names of `value`. Only properties defined with %JSC_VALUE_PROPERTY_ENUMERABLE
|
|
1129
|
+
* flag will be collected.
|
|
1130
|
+
* @returns a %NULL-terminated array of strings containing the property names, or %NULL if @value doesn't have enumerable properties. Use g_strfreev() to free.
|
|
1131
|
+
*/
|
|
1132
|
+
object_enumerate_properties(): string[] | null
|
|
1133
|
+
/**
|
|
1134
|
+
* Get property with `name` from `value`.
|
|
1135
|
+
* @param name the property name
|
|
1136
|
+
* @returns the property #JSCValue.
|
|
1137
|
+
*/
|
|
1138
|
+
object_get_property(name: string | null): Value
|
|
1139
|
+
/**
|
|
1140
|
+
* Get property at `index` from `value`.
|
|
1141
|
+
* @param index the property index
|
|
1142
|
+
* @returns the property #JSCValue.
|
|
1143
|
+
*/
|
|
1144
|
+
object_get_property_at_index(index: number): Value
|
|
1145
|
+
/**
|
|
1146
|
+
* Get whether `value` has property with `name`.
|
|
1147
|
+
* @param name the property name
|
|
1148
|
+
* @returns %TRUE if @value has a property with @name, or %FALSE otherwise
|
|
1149
|
+
*/
|
|
1150
|
+
object_has_property(name: string | null): boolean
|
|
1151
|
+
/**
|
|
1152
|
+
* Invoke method with `name` on object referenced by `value,` passing the given `parameters`. If
|
|
1153
|
+
* `n_parameters` is 0 no parameters will be passed to the method.
|
|
1154
|
+
* The object instance will be handled automatically even when the method is a custom one
|
|
1155
|
+
* registered with jsc_class_add_method(), so it should never be passed explicitly as parameter
|
|
1156
|
+
* of this function.
|
|
1157
|
+
*
|
|
1158
|
+
* This function always returns a #JSCValue, in case of void methods a #JSCValue referencing
|
|
1159
|
+
* <function>undefined</function> is returned.
|
|
1160
|
+
* @param name the method name
|
|
1161
|
+
* @param parameters the #JSCValue<!-- -->s to pass as parameters to the method, or %NULL
|
|
1162
|
+
* @returns a #JSCValue with the return value of the method.
|
|
1163
|
+
*/
|
|
1164
|
+
object_invoke_method(name: string | null, parameters: Value[] | null): Value
|
|
1165
|
+
/**
|
|
1166
|
+
* Get whether the value referenced by `value` is an instance of class `name`.
|
|
1167
|
+
* @param name a class name
|
|
1168
|
+
* @returns whether the value is an object instance of class @name.
|
|
1169
|
+
*/
|
|
1170
|
+
object_is_instance_of(name: string | null): boolean
|
|
1171
|
+
/**
|
|
1172
|
+
* Set `property` with `name` on `value`.
|
|
1173
|
+
* @param name the property name
|
|
1174
|
+
* @param property the #JSCValue to set
|
|
1175
|
+
*/
|
|
1176
|
+
object_set_property(name: string | null, property: Value): void
|
|
1177
|
+
/**
|
|
1178
|
+
* Set `property` at `index` on `value`.
|
|
1179
|
+
* @param index the property index
|
|
1180
|
+
* @param property the #JSCValue to set
|
|
1181
|
+
*/
|
|
1182
|
+
object_set_property_at_index(index: number, property: Value): void
|
|
1183
|
+
/**
|
|
1184
|
+
* Convert `value` to a boolean.
|
|
1185
|
+
* @returns a #gboolean result of the conversion.
|
|
1186
|
+
*/
|
|
1187
|
+
to_boolean(): boolean
|
|
1188
|
+
/**
|
|
1189
|
+
* Convert `value` to a double.
|
|
1190
|
+
* @returns a #gdouble result of the conversion.
|
|
1191
|
+
*/
|
|
1192
|
+
to_double(): number
|
|
1193
|
+
/**
|
|
1194
|
+
* Convert `value` to a #gint32.
|
|
1195
|
+
* @returns a #gint32 result of the conversion.
|
|
1196
|
+
*/
|
|
1197
|
+
to_int32(): number
|
|
1198
|
+
/**
|
|
1199
|
+
* Create a JSON string of `value` serialization. If `indent` is 0, the resulting JSON will
|
|
1200
|
+
* not contain newlines. The size of the indent is clamped to 10 spaces.
|
|
1201
|
+
* @param indent The number of spaces to indent when nesting.
|
|
1202
|
+
* @returns a null-terminated JSON string with serialization of @value
|
|
1203
|
+
*/
|
|
1204
|
+
to_json(indent: number): string | null
|
|
1205
|
+
/**
|
|
1206
|
+
* Convert `value` to a string. Use jsc_value_to_string_as_bytes() instead, if you need to
|
|
1207
|
+
* handle strings containing null characters.
|
|
1208
|
+
* @returns a null-terminated string result of the conversion.
|
|
1209
|
+
*/
|
|
1210
|
+
to_string(): string | null
|
|
1211
|
+
/**
|
|
1212
|
+
* Convert `value` to a string and return the results as #GBytes. This is needed
|
|
1213
|
+
* to handle strings with null characters.
|
|
1214
|
+
* @returns a #GBytes with the result of the conversion.
|
|
1215
|
+
*/
|
|
1216
|
+
to_string_as_bytes(): GLib.Bytes
|
|
1217
|
+
/**
|
|
1218
|
+
* Obtain the %ArrayBuffer for the memory region of the typed array elements.
|
|
1219
|
+
* @returns A #JSCValue
|
|
1220
|
+
*/
|
|
1221
|
+
typed_array_get_buffer(): Value
|
|
1222
|
+
/**
|
|
1223
|
+
* Obtains a pointer to the memory region that holds the elements of the typed
|
|
1224
|
+
* array; modifications done to them will be visible to JavaScript code. If
|
|
1225
|
+
* `length` is not %NULL, the number of elements contained in the typed array
|
|
1226
|
+
* are also stored in the pointed location.
|
|
1227
|
+
*
|
|
1228
|
+
* The returned pointer needs to be casted to the appropriate type (see
|
|
1229
|
+
* #JSCTypedArrayType), and has the `offset` over the underlying array
|
|
1230
|
+
* buffer data applied—that is, points to the first element of the typed
|
|
1231
|
+
* array:
|
|
1232
|
+
*
|
|
1233
|
+
*
|
|
1234
|
+
* ```c
|
|
1235
|
+
* if (jsc_value_typed_array_get_type(value) != JSC_TYPED_ARRAY_UINT32)
|
|
1236
|
+
* g_error ("Only arrays of uint32_t are supported");
|
|
1237
|
+
*
|
|
1238
|
+
* gsize count = 0;
|
|
1239
|
+
* uint32_t *elements = jsc_value_typed_array_get_contents (value, &count);
|
|
1240
|
+
* for (gsize i = 0; i < count; i++)
|
|
1241
|
+
* g_print ("index %zu, value %" PRIu32 "\n", i, elements[i]);
|
|
1242
|
+
* ```
|
|
1243
|
+
*
|
|
1244
|
+
*
|
|
1245
|
+
* Note that the pointer returned by this function is not guaranteed to remain
|
|
1246
|
+
* the same after calls to other JSC API functions. See
|
|
1247
|
+
* jsc_value_array_buffer_get_data() for details.
|
|
1248
|
+
* @returns pointer to memory.
|
|
1249
|
+
*/
|
|
1250
|
+
typed_array_get_data(): [ /* returnType */ any | null, /* length */ number | null ]
|
|
1251
|
+
/**
|
|
1252
|
+
* Gets the number of elements in a typed array.
|
|
1253
|
+
* @returns number of elements.
|
|
1254
|
+
*/
|
|
1255
|
+
typed_array_get_length(): number
|
|
1256
|
+
/**
|
|
1257
|
+
* Gets the offset over the underlying array buffer data.
|
|
1258
|
+
* @returns offset, in bytes.
|
|
1259
|
+
*/
|
|
1260
|
+
typed_array_get_offset(): number
|
|
1261
|
+
/**
|
|
1262
|
+
* Gets the size of a typed array.
|
|
1263
|
+
* @returns size, in bytes.
|
|
1264
|
+
*/
|
|
1265
|
+
typed_array_get_size(): number
|
|
1266
|
+
/**
|
|
1267
|
+
* Gets the type of elements contained in a typed array.
|
|
1268
|
+
* @returns type of the elements, or %JSC_TYPED_ARRAY_NONE if @value is not a typed array.
|
|
1269
|
+
*/
|
|
1270
|
+
typed_array_get_type(): TypedArrayType
|
|
1271
|
+
|
|
1272
|
+
// Class property signals of JavaScriptCore-6.0.JavaScriptCore.Value
|
|
1273
|
+
|
|
1274
|
+
connect(sigName: "notify::context", callback: (($obj: Value, pspec: GObject.ParamSpec) => void)): number
|
|
1275
|
+
connect_after(sigName: "notify::context", callback: (($obj: Value, pspec: GObject.ParamSpec) => void)): number
|
|
1276
|
+
emit(sigName: "notify::context", ...args: any[]): void
|
|
1277
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1278
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1279
|
+
emit(sigName: string, ...args: any[]): void
|
|
1280
|
+
disconnect(id: number): void
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* JSCValue represents a reference to a value in a #JSCContext. The JSCValue
|
|
1285
|
+
* protects the referenced value from being garbage collected.
|
|
1286
|
+
* @class
|
|
1287
|
+
*/
|
|
1288
|
+
export class Value extends GObject.Object {
|
|
1289
|
+
|
|
1290
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.Value
|
|
1291
|
+
|
|
1292
|
+
static name: string
|
|
1293
|
+
static $gtype: GObject.GType<Value>
|
|
1294
|
+
|
|
1295
|
+
// Constructors of JavaScriptCore-6.0.JavaScriptCore.Value
|
|
1296
|
+
|
|
1297
|
+
constructor(config?: Value.ConstructorProperties)
|
|
1298
|
+
/**
|
|
1299
|
+
* Creates a new %ArrayBuffer from existing `data` in memory.
|
|
1300
|
+
*
|
|
1301
|
+
* The `data` is not copied: while this allows sharing data with JavaScript
|
|
1302
|
+
* efficiently, the caller must ensure that the memory region remains valid
|
|
1303
|
+
* until the newly created object is released by JSC.
|
|
1304
|
+
*
|
|
1305
|
+
* Optionally, a `destroy_notify` callback can be provided, which will be
|
|
1306
|
+
* invoked with `user_data` as parameter when the %ArrayBuffer object is
|
|
1307
|
+
* released. This is intended to be used for freeing resources related to
|
|
1308
|
+
* the memory region which contains the data:
|
|
1309
|
+
*
|
|
1310
|
+
*
|
|
1311
|
+
* ```!<-- language="C" -->
|
|
1312
|
+
* GMappedFile *f = g_mapped_file_new (file_path, TRUE, NULL);
|
|
1313
|
+
* JSCValue *value = jsc_value_new_array_buffer (context,
|
|
1314
|
+
* g_mapped_file_get_contents (f), g_mapped_file_get_length (f),
|
|
1315
|
+
* (GDestroyNotify) g_mapped_file_unref, f);
|
|
1316
|
+
* ```
|
|
1317
|
+
*
|
|
1318
|
+
*
|
|
1319
|
+
* Note that the `user_data` can be the same value as `data:`
|
|
1320
|
+
*
|
|
1321
|
+
*
|
|
1322
|
+
* ```!<-- language="C" -->
|
|
1323
|
+
* void *bytes = g_malloc0 (100);
|
|
1324
|
+
* JSCValue *value = jsc_value_new_array_buffer (context, bytes, 100, g_free, bytes);
|
|
1325
|
+
* ```
|
|
1326
|
+
*
|
|
1327
|
+
* @constructor
|
|
1328
|
+
* @param context A #JSCContext
|
|
1329
|
+
* @param data Pointer to a region of memory.
|
|
1330
|
+
* @param size Size in bytes of the memory region.
|
|
1331
|
+
* @param destroy_notify destroy notifier for `user_data`.
|
|
1332
|
+
* @param user_data user data.
|
|
1333
|
+
* @returns A #JSCValue, or %NULL in case of exception.
|
|
1334
|
+
*/
|
|
1335
|
+
static new_array_buffer(context: Context, data: any | null, size: number, destroy_notify: GLib.DestroyNotify | null, user_data: any | null): Value
|
|
1336
|
+
/**
|
|
1337
|
+
* Create a new #JSCValue referencing an array with the items from `array`. If `array`
|
|
1338
|
+
* is %NULL or empty a new empty array will be created. Elements of `array` should be
|
|
1339
|
+
* pointers to a #JSCValue.
|
|
1340
|
+
* @constructor
|
|
1341
|
+
* @param context a #JSCContext
|
|
1342
|
+
* @param array a #GPtrArray
|
|
1343
|
+
* @returns a #JSCValue.
|
|
1344
|
+
*/
|
|
1345
|
+
static new_array_from_garray(context: Context, array: Value[] | null): Value
|
|
1346
|
+
/**
|
|
1347
|
+
* Create a new #JSCValue referencing an array of strings with the items from `strv`. If `array`
|
|
1348
|
+
* is %NULL or empty a new empty array will be created.
|
|
1349
|
+
* @constructor
|
|
1350
|
+
* @param context a #JSCContext
|
|
1351
|
+
* @param strv a %NULL-terminated array of strings
|
|
1352
|
+
* @returns a #JSCValue.
|
|
1353
|
+
*/
|
|
1354
|
+
static new_array_from_strv(context: Context, strv: string[]): Value
|
|
1355
|
+
/**
|
|
1356
|
+
* Create a new #JSCValue from `value`
|
|
1357
|
+
* @constructor
|
|
1358
|
+
* @param context a #JSCContext
|
|
1359
|
+
* @param value a #gboolean
|
|
1360
|
+
* @returns a #JSCValue.
|
|
1361
|
+
*/
|
|
1362
|
+
static new_boolean(context: Context, value: boolean): Value
|
|
1363
|
+
/**
|
|
1364
|
+
* Create a new #JSCValue referencing a new value created by parsing `json`.
|
|
1365
|
+
* @constructor
|
|
1366
|
+
* @param context a #JSCContext
|
|
1367
|
+
* @param json the JSON string to be parsed
|
|
1368
|
+
* @returns a #JSCValue.
|
|
1369
|
+
*/
|
|
1370
|
+
static new_from_json(context: Context, json: string | null): Value
|
|
1371
|
+
/**
|
|
1372
|
+
* Create a function in `context`. If `name` is %NULL an anonymous function will be created.
|
|
1373
|
+
* When the function is called by JavaScript or jsc_value_function_call(), `callback` is called
|
|
1374
|
+
* receiving an #GPtrArray of #JSCValue<!-- -->s with the arguments and then `user_data` as last parameter.
|
|
1375
|
+
* When the function is cleared in `context,` `destroy_notify` is called with `user_data` as parameter.
|
|
1376
|
+
*
|
|
1377
|
+
* Note that the value returned by `callback` must be fully transferred. In case of boxed types, you could use
|
|
1378
|
+
* %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used.
|
|
1379
|
+
* If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created
|
|
1380
|
+
* with jsc_value_new_object() that receives the copy as instance parameter.
|
|
1381
|
+
* @constructor
|
|
1382
|
+
* @param context a #JSCContext
|
|
1383
|
+
* @param name the function name or %NULL
|
|
1384
|
+
* @param callback a #GCallback.
|
|
1385
|
+
* @param return_type the #GType of the function return value, or %G_TYPE_NONE if the function is void.
|
|
1386
|
+
* @returns a #JSCValue.
|
|
1387
|
+
*/
|
|
1388
|
+
static new_function_variadic(context: Context, name: string | null, callback: GObject.Callback, return_type: GObject.GType): Value
|
|
1389
|
+
/**
|
|
1390
|
+
* Create a function in `context`. If `name` is %NULL an anonymous function will be created.
|
|
1391
|
+
* When the function is called by JavaScript or jsc_value_function_call(), `callback` is called
|
|
1392
|
+
* receiving the function parameters and then `user_data` as last parameter. When the function is
|
|
1393
|
+
* cleared in `context,` `destroy_notify` is called with `user_data` as parameter.
|
|
1394
|
+
*
|
|
1395
|
+
* Note that the value returned by `callback` must be fully transferred. In case of boxed types, you could use
|
|
1396
|
+
* %G_TYPE_POINTER instead of the actual boxed #GType to ensure that the instance owned by #JSCClass is used.
|
|
1397
|
+
* If you really want to return a new copy of the boxed type, use #JSC_TYPE_VALUE and return a #JSCValue created
|
|
1398
|
+
* with jsc_value_new_object() that receives the copy as instance parameter.
|
|
1399
|
+
* @constructor
|
|
1400
|
+
* @param context a #JSCContext
|
|
1401
|
+
* @param name the function name or %NULL
|
|
1402
|
+
* @param callback a #GCallback.
|
|
1403
|
+
* @param return_type the #GType of the function return value, or %G_TYPE_NONE if the function is void.
|
|
1404
|
+
* @param parameter_types a list of #GType<!-- -->s, one for each parameter, or %NULL
|
|
1405
|
+
* @returns a #JSCValue.
|
|
1406
|
+
*/
|
|
1407
|
+
static new_function(context: Context, name: string | null, callback: GObject.Callback, return_type: GObject.GType, parameter_types: GObject.GType[] | null): Value
|
|
1408
|
+
/**
|
|
1409
|
+
* Create a new #JSCValue referencing <function>null</function> in `context`.
|
|
1410
|
+
* @constructor
|
|
1411
|
+
* @param context a #JSCContext
|
|
1412
|
+
* @returns a #JSCValue.
|
|
1413
|
+
*/
|
|
1414
|
+
static new_null(context: Context): Value
|
|
1415
|
+
/**
|
|
1416
|
+
* Create a new #JSCValue from `number`.
|
|
1417
|
+
* @constructor
|
|
1418
|
+
* @param context a #JSCContext
|
|
1419
|
+
* @param number a number
|
|
1420
|
+
* @returns a #JSCValue.
|
|
1421
|
+
*/
|
|
1422
|
+
static new_number(context: Context, number: number): Value
|
|
1423
|
+
/**
|
|
1424
|
+
* Create a new #JSCValue from `instance`. If `instance` is %NULL a new empty object is created.
|
|
1425
|
+
* When `instance` is provided, `jsc_class` must be provided too. `jsc_class` takes ownership of
|
|
1426
|
+
* `instance` that will be freed by the #GDestroyNotify passed to jsc_context_register_class().
|
|
1427
|
+
* @constructor
|
|
1428
|
+
* @param context a #JSCContext
|
|
1429
|
+
* @param instance an object instance or %NULL
|
|
1430
|
+
* @param jsc_class the #JSCClass of `instance`
|
|
1431
|
+
* @returns a #JSCValue.
|
|
1432
|
+
*/
|
|
1433
|
+
static new_object(context: Context, instance: any | null, jsc_class: Class | null): Value
|
|
1434
|
+
/**
|
|
1435
|
+
* Create a new #JSCValue from `string`. If you need to create a #JSCValue from a
|
|
1436
|
+
* string containing null characters, use jsc_value_new_string_from_bytes() instead.
|
|
1437
|
+
* @constructor
|
|
1438
|
+
* @param context a #JSCContext
|
|
1439
|
+
* @param string a null-terminated string
|
|
1440
|
+
* @returns a #JSCValue.
|
|
1441
|
+
*/
|
|
1442
|
+
static new_string(context: Context, string: string | null): Value
|
|
1443
|
+
/**
|
|
1444
|
+
* Create a new #JSCValue from `bytes`.
|
|
1445
|
+
* @constructor
|
|
1446
|
+
* @param context a #JSCContext
|
|
1447
|
+
* @param bytes a #GBytes
|
|
1448
|
+
* @returns a #JSCValue.
|
|
1449
|
+
*/
|
|
1450
|
+
static new_string_from_bytes(context: Context, bytes: GLib.Bytes | null): Value
|
|
1451
|
+
/**
|
|
1452
|
+
* Create a new typed array containing a given amount of elements.
|
|
1453
|
+
*
|
|
1454
|
+
* Create a #JSCValue referencing a new typed array with space for `length`
|
|
1455
|
+
* elements of a given `type`. As all typed arrays must have an associated
|
|
1456
|
+
* `ArrayBuffer`, a new one of suitable size will be allocated to store
|
|
1457
|
+
* the elements, which will be initialized to zero.
|
|
1458
|
+
*
|
|
1459
|
+
* The `type` must *not* be %JSC_TYPED_ARRAY_NONE.
|
|
1460
|
+
* @constructor
|
|
1461
|
+
* @param context a #JSCContext
|
|
1462
|
+
* @param type the type of array elements
|
|
1463
|
+
* @param length number of elements in the array
|
|
1464
|
+
* @returns a #JSCValue
|
|
1465
|
+
*/
|
|
1466
|
+
static new_typed_array(context: Context, type: TypedArrayType, length: number): Value
|
|
1467
|
+
/**
|
|
1468
|
+
* Create a new #JSCValue referencing <function>undefined</function> in `context`.
|
|
1469
|
+
* @constructor
|
|
1470
|
+
* @param context a #JSCContext
|
|
1471
|
+
* @returns a #JSCValue.
|
|
1472
|
+
*/
|
|
1473
|
+
static new_undefined(context: Context): Value
|
|
1474
|
+
_init(config?: Value.ConstructorProperties): void
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
export module VirtualMachine {
|
|
1478
|
+
|
|
1479
|
+
// Constructor properties interface
|
|
1480
|
+
|
|
1481
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
export interface VirtualMachine {
|
|
1487
|
+
|
|
1488
|
+
// Class property signals of JavaScriptCore-6.0.JavaScriptCore.VirtualMachine
|
|
1489
|
+
|
|
1490
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1491
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1492
|
+
emit(sigName: string, ...args: any[]): void
|
|
1493
|
+
disconnect(id: number): void
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
/**
|
|
1497
|
+
* JSCVirtualMachine represents a group of JSCContext<!-- -->s. It allows
|
|
1498
|
+
* concurrent JavaScript execution by creating a different instance of
|
|
1499
|
+
* JSCVirtualMachine in each thread.
|
|
1500
|
+
*
|
|
1501
|
+
* To create a group of JSCContext<!-- -->s pass the same JSCVirtualMachine
|
|
1502
|
+
* instance to every JSCContext constructor.
|
|
1503
|
+
* @class
|
|
1504
|
+
*/
|
|
1505
|
+
export class VirtualMachine extends GObject.Object {
|
|
1506
|
+
|
|
1507
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.VirtualMachine
|
|
1508
|
+
|
|
1509
|
+
static name: string
|
|
1510
|
+
static $gtype: GObject.GType<VirtualMachine>
|
|
1511
|
+
|
|
1512
|
+
// Constructors of JavaScriptCore-6.0.JavaScriptCore.VirtualMachine
|
|
1513
|
+
|
|
1514
|
+
constructor(config?: VirtualMachine.ConstructorProperties)
|
|
1515
|
+
/**
|
|
1516
|
+
* Create a new #JSCVirtualMachine.
|
|
1517
|
+
* @constructor
|
|
1518
|
+
* @returns the newly created #JSCVirtualMachine.
|
|
1519
|
+
*/
|
|
1520
|
+
constructor()
|
|
1521
|
+
/**
|
|
1522
|
+
* Create a new #JSCVirtualMachine.
|
|
1523
|
+
* @constructor
|
|
1524
|
+
* @returns the newly created #JSCVirtualMachine.
|
|
1525
|
+
*/
|
|
1526
|
+
static new(): VirtualMachine
|
|
1527
|
+
_init(config?: VirtualMachine.ConstructorProperties): void
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
export module WeakValue {
|
|
1531
|
+
|
|
1532
|
+
// Signal callback interfaces
|
|
1533
|
+
|
|
1534
|
+
/**
|
|
1535
|
+
* Signal callback interface for `cleared`
|
|
1536
|
+
*/
|
|
1537
|
+
export interface ClearedSignalCallback {
|
|
1538
|
+
($obj: WeakValue): void
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
// Constructor properties interface
|
|
1543
|
+
|
|
1544
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
1545
|
+
|
|
1546
|
+
// Own constructor properties of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1547
|
+
|
|
1548
|
+
/**
|
|
1549
|
+
* The #JSCValue referencing the JavaScript value.
|
|
1550
|
+
*/
|
|
1551
|
+
value?: Value | null
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
export interface WeakValue {
|
|
1557
|
+
|
|
1558
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* The #JSCValue referencing the JavaScript value.
|
|
1562
|
+
*/
|
|
1563
|
+
readonly value: Value
|
|
1564
|
+
|
|
1565
|
+
// Owm methods of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Get a #JSCValue referencing the JavaScript value of `weak_value`.
|
|
1569
|
+
* @returns a new #JSCValue or %NULL if @weak_value was cleared.
|
|
1570
|
+
*/
|
|
1571
|
+
get_value(): Value
|
|
1572
|
+
|
|
1573
|
+
// Own signals of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1574
|
+
|
|
1575
|
+
connect(sigName: "cleared", callback: WeakValue.ClearedSignalCallback): number
|
|
1576
|
+
connect_after(sigName: "cleared", callback: WeakValue.ClearedSignalCallback): number
|
|
1577
|
+
emit(sigName: "cleared", ...args: any[]): void
|
|
1578
|
+
|
|
1579
|
+
// Class property signals of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1580
|
+
|
|
1581
|
+
connect(sigName: "notify::value", callback: (($obj: WeakValue, pspec: GObject.ParamSpec) => void)): number
|
|
1582
|
+
connect_after(sigName: "notify::value", callback: (($obj: WeakValue, pspec: GObject.ParamSpec) => void)): number
|
|
1583
|
+
emit(sigName: "notify::value", ...args: any[]): void
|
|
1584
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1585
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1586
|
+
emit(sigName: string, ...args: any[]): void
|
|
1587
|
+
disconnect(id: number): void
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* JSCWeakValue represents a weak reference to a value in a #JSCContext. It can be used
|
|
1592
|
+
* to keep a reference to a JavaScript value without protecting it from being garbage
|
|
1593
|
+
* collected and without referencing the #JSCContext either.
|
|
1594
|
+
* @class
|
|
1595
|
+
*/
|
|
1596
|
+
export class WeakValue extends GObject.Object {
|
|
1597
|
+
|
|
1598
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1599
|
+
|
|
1600
|
+
static name: string
|
|
1601
|
+
static $gtype: GObject.GType<WeakValue>
|
|
1602
|
+
|
|
1603
|
+
// Constructors of JavaScriptCore-6.0.JavaScriptCore.WeakValue
|
|
1604
|
+
|
|
1605
|
+
constructor(config?: WeakValue.ConstructorProperties)
|
|
1606
|
+
/**
|
|
1607
|
+
* Create a new #JSCWeakValue for the JavaScript value referenced by `value`.
|
|
1608
|
+
* @constructor
|
|
1609
|
+
* @param value a #JSCValue
|
|
1610
|
+
* @returns a new #JSCWeakValue
|
|
1611
|
+
*/
|
|
1612
|
+
constructor(value: Value)
|
|
1613
|
+
/**
|
|
1614
|
+
* Create a new #JSCWeakValue for the JavaScript value referenced by `value`.
|
|
1615
|
+
* @constructor
|
|
1616
|
+
* @param value a #JSCValue
|
|
1617
|
+
* @returns a new #JSCWeakValue
|
|
1618
|
+
*/
|
|
1619
|
+
static new(value: Value): WeakValue
|
|
1620
|
+
_init(config?: WeakValue.ConstructorProperties): void
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
export interface ClassClass {
|
|
1624
|
+
|
|
1625
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.ClassClass
|
|
1626
|
+
|
|
1627
|
+
parent_class: GObject.ObjectClass
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
export abstract class ClassClass {
|
|
1631
|
+
|
|
1632
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.ClassClass
|
|
1633
|
+
|
|
1634
|
+
static name: string
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
export interface ClassVTable {
|
|
1638
|
+
|
|
1639
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.ClassVTable
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* a #JSCClassGetPropertyFunction for getting a property.
|
|
1643
|
+
* @field
|
|
1644
|
+
*/
|
|
1645
|
+
get_property: ClassGetPropertyFunction
|
|
1646
|
+
/**
|
|
1647
|
+
* a #JSCClassSetPropertyFunction for setting a property.
|
|
1648
|
+
* @field
|
|
1649
|
+
*/
|
|
1650
|
+
set_property: ClassSetPropertyFunction
|
|
1651
|
+
/**
|
|
1652
|
+
* a #JSCClassHasPropertyFunction for querying a property.
|
|
1653
|
+
* @field
|
|
1654
|
+
*/
|
|
1655
|
+
has_property: ClassHasPropertyFunction
|
|
1656
|
+
/**
|
|
1657
|
+
* a #JSCClassDeletePropertyFunction for deleting a property.
|
|
1658
|
+
* @field
|
|
1659
|
+
*/
|
|
1660
|
+
delete_property: ClassDeletePropertyFunction
|
|
1661
|
+
/**
|
|
1662
|
+
* a #JSCClassEnumeratePropertiesFunction for enumerating properties.
|
|
1663
|
+
* @field
|
|
1664
|
+
*/
|
|
1665
|
+
enumerate_properties: ClassEnumeratePropertiesFunction
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* Virtual table for a JSCClass. This can be optionally used when registering a #JSCClass in a #JSCContext
|
|
1670
|
+
* to provide a custom implementation for the class. All virtual functions are optional and can be set to
|
|
1671
|
+
* %NULL to fallback to the default implementation.
|
|
1672
|
+
* @record
|
|
1673
|
+
*/
|
|
1674
|
+
export class ClassVTable {
|
|
1675
|
+
|
|
1676
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.ClassVTable
|
|
1677
|
+
|
|
1678
|
+
static name: string
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
export interface ContextClass {
|
|
1682
|
+
|
|
1683
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.ContextClass
|
|
1684
|
+
|
|
1685
|
+
parent_class: GObject.ObjectClass
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
export abstract class ContextClass {
|
|
1689
|
+
|
|
1690
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.ContextClass
|
|
1691
|
+
|
|
1692
|
+
static name: string
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
export interface ExceptionClass {
|
|
1696
|
+
|
|
1697
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.ExceptionClass
|
|
1698
|
+
|
|
1699
|
+
parent_class: GObject.ObjectClass
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
export abstract class ExceptionClass {
|
|
1703
|
+
|
|
1704
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.ExceptionClass
|
|
1705
|
+
|
|
1706
|
+
static name: string
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
export interface ValueClass {
|
|
1710
|
+
|
|
1711
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.ValueClass
|
|
1712
|
+
|
|
1713
|
+
parent_class: GObject.ObjectClass
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
export abstract class ValueClass {
|
|
1717
|
+
|
|
1718
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.ValueClass
|
|
1719
|
+
|
|
1720
|
+
static name: string
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
export interface VirtualMachineClass {
|
|
1724
|
+
|
|
1725
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.VirtualMachineClass
|
|
1726
|
+
|
|
1727
|
+
parent_class: GObject.ObjectClass
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
export abstract class VirtualMachineClass {
|
|
1731
|
+
|
|
1732
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.VirtualMachineClass
|
|
1733
|
+
|
|
1734
|
+
static name: string
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
export interface WeakValueClass {
|
|
1738
|
+
|
|
1739
|
+
// Own fields of JavaScriptCore-6.0.JavaScriptCore.WeakValueClass
|
|
1740
|
+
|
|
1741
|
+
parent_class: GObject.ObjectClass
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
export abstract class WeakValueClass {
|
|
1745
|
+
|
|
1746
|
+
// Own properties of JavaScriptCore-6.0.JavaScriptCore.WeakValueClass
|
|
1747
|
+
|
|
1748
|
+
static name: string
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Name of the imported GIR library
|
|
1753
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
1754
|
+
*/
|
|
1755
|
+
export const __name__: string
|
|
1756
|
+
/**
|
|
1757
|
+
* Version of the imported GIR library
|
|
1758
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
1759
|
+
*/
|
|
1760
|
+
export const __version__: string
|
|
1761
|
+
// END
|