@girs/json-1.0 1.7.1-3.2.5 → 1.7.1-3.2.7
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 +1 -1
- package/json-1.0.d.cts +67 -59
- package/json-1.0.d.ts +67 -59
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Json-1.0, generated from library version 1.7.1 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.
|
|
8
|
+
GJS TypeScript type definitions for Json-1.0, generated from library version 1.7.1 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.7.
|
|
9
9
|
|
|
10
10
|
JSON-GLib is a library for reading and parsing JSON using GLib and GObject data types and API.
|
|
11
11
|
|
package/json-1.0.d.cts
CHANGED
|
@@ -140,7 +140,7 @@ export const MINOR_VERSION: number
|
|
|
140
140
|
* The version of JSON-GLib, encoded as a string, useful for printing and
|
|
141
141
|
* concatenation.
|
|
142
142
|
*/
|
|
143
|
-
export const VERSION_S: string
|
|
143
|
+
export const VERSION_S: string
|
|
144
144
|
/**
|
|
145
145
|
* Checks whether it is possible to deserialize a `GBoxed` of
|
|
146
146
|
* type `gboxed_type` from a [struct`Json`.Node] of type `node_type`.
|
|
@@ -193,7 +193,7 @@ export function boxed_serialize(gboxed_type: GObject.GType, boxed: any | null):
|
|
|
193
193
|
* @param length length of the data stream (unused)
|
|
194
194
|
* @returns a new object instance of the given type
|
|
195
195
|
*/
|
|
196
|
-
export function construct_gobject(gtype: GObject.GType, data: string
|
|
196
|
+
export function construct_gobject(gtype: GObject.GType, data: string, length: number): GObject.Object | null
|
|
197
197
|
/**
|
|
198
198
|
* Parses the given string and returns the corresponding JSON tree.
|
|
199
199
|
*
|
|
@@ -204,7 +204,7 @@ export function construct_gobject(gtype: GObject.GType, data: string | null, len
|
|
|
204
204
|
* @param str a valid UTF-8 string containing JSON data
|
|
205
205
|
* @returns the root node of the JSON tree
|
|
206
206
|
*/
|
|
207
|
-
export function from_string(str: string
|
|
207
|
+
export function from_string(str: string): Node | null
|
|
208
208
|
/**
|
|
209
209
|
* Creates a new `GObject` instance of the given type, and constructs it
|
|
210
210
|
* using the members of the object in the given node.
|
|
@@ -228,7 +228,7 @@ export function gobject_deserialize(gtype: GObject.GType, node: Node): GObject.O
|
|
|
228
228
|
* @param length length of the data stream, or -1 if it is `NUL`-terminated
|
|
229
229
|
* @returns a new object instance of the given type
|
|
230
230
|
*/
|
|
231
|
-
export function gobject_from_data(gtype: GObject.GType, data: string
|
|
231
|
+
export function gobject_from_data(gtype: GObject.GType, data: string, length: number): GObject.Object | null
|
|
232
232
|
/**
|
|
233
233
|
* Creates a JSON tree representing the passed object instance.
|
|
234
234
|
*
|
|
@@ -296,7 +296,7 @@ export function gvariant_deserialize(json_node: Node, signature: string | null):
|
|
|
296
296
|
* @param signature A valid `GVariant` type string
|
|
297
297
|
* @returns A newly created `GVariant`D compliant
|
|
298
298
|
*/
|
|
299
|
-
export function gvariant_deserialize_data(json: string
|
|
299
|
+
export function gvariant_deserialize_data(json: string, length: number, signature: string | null): GLib.Variant | null
|
|
300
300
|
/**
|
|
301
301
|
* Converts `variant` to a JSON tree.
|
|
302
302
|
* @param variant A `GVariant` to convert
|
|
@@ -453,7 +453,7 @@ export interface BoxedSerializeFunc {
|
|
|
453
453
|
* @param member_node the value of the member
|
|
454
454
|
*/
|
|
455
455
|
export interface ObjectForeach {
|
|
456
|
-
(object: Object, member_name: string
|
|
456
|
+
(object: Object, member_name: string, member_node: Node): void
|
|
457
457
|
}
|
|
458
458
|
export module Serializable {
|
|
459
459
|
|
|
@@ -492,7 +492,7 @@ export interface Serializable {
|
|
|
492
492
|
* @param property_node the JSON node containing the serialized property
|
|
493
493
|
* @returns `TRUE` if the property was successfully deserialized
|
|
494
494
|
*/
|
|
495
|
-
default_deserialize_property(property_name: string
|
|
495
|
+
default_deserialize_property(property_name: string, value: any, pspec: GObject.ParamSpec, property_node: Node): boolean
|
|
496
496
|
/**
|
|
497
497
|
* Calls the default implementation of the [vfunc`Json`.Serializable.serialize_property]
|
|
498
498
|
* virtual function.
|
|
@@ -518,7 +518,7 @@ export interface Serializable {
|
|
|
518
518
|
* @param pspec a property description
|
|
519
519
|
* @returns a node containing the serialized property
|
|
520
520
|
*/
|
|
521
|
-
default_serialize_property(property_name: string
|
|
521
|
+
default_serialize_property(property_name: string, value: any, pspec: GObject.ParamSpec): Node | null
|
|
522
522
|
/**
|
|
523
523
|
* Asks a `JsonSerializable` implementation to deserialize the
|
|
524
524
|
* property contained inside `property_node` and place its value
|
|
@@ -538,7 +538,7 @@ export interface Serializable {
|
|
|
538
538
|
* @param property_node the JSON node containing the serialized property
|
|
539
539
|
* @returns `TRUE` if the property was successfully deserialized
|
|
540
540
|
*/
|
|
541
|
-
deserialize_property(property_name: string
|
|
541
|
+
deserialize_property(property_name: string, pspec: GObject.ParamSpec, property_node: Node): [ /* returnType */ boolean, /* value */ any ]
|
|
542
542
|
/**
|
|
543
543
|
* Calls the [vfunc`Json`.Serializable.find_property] implementation on
|
|
544
544
|
* the `JsonSerializable` instance, which will return the property
|
|
@@ -546,7 +546,7 @@ export interface Serializable {
|
|
|
546
546
|
* @param name the name of the property
|
|
547
547
|
* @returns the property description
|
|
548
548
|
*/
|
|
549
|
-
find_property(name: string
|
|
549
|
+
find_property(name: string): GObject.ParamSpec | null
|
|
550
550
|
/**
|
|
551
551
|
* Calls the [vfunc`Json`.Serializable.get_property] implementation
|
|
552
552
|
* on the `JsonSerializable` instance, which will get the value of
|
|
@@ -577,7 +577,7 @@ export interface Serializable {
|
|
|
577
577
|
* @param property_name the name of the property to get
|
|
578
578
|
* @param value return location for the property value
|
|
579
579
|
*/
|
|
580
|
-
get_property(property_name: string
|
|
580
|
+
get_property(property_name: string, value: any): void
|
|
581
581
|
/**
|
|
582
582
|
* Calls the [vfunc`Json`.Serializable.list_properties] implementation on
|
|
583
583
|
* the `JsonSerializable` instance, which will return the list of serializable
|
|
@@ -593,7 +593,7 @@ export interface Serializable {
|
|
|
593
593
|
* @param pspec a property description
|
|
594
594
|
* @returns a node containing the serialized property
|
|
595
595
|
*/
|
|
596
|
-
serialize_property(property_name: string
|
|
596
|
+
serialize_property(property_name: string, value: any, pspec: GObject.ParamSpec): Node
|
|
597
597
|
/**
|
|
598
598
|
* Calls the [vfunc`Json`.Serializable.set_property] implementation
|
|
599
599
|
* on the `JsonSerializable` instance, which will set the property
|
|
@@ -610,7 +610,7 @@ export interface Serializable {
|
|
|
610
610
|
* @param property_name the name of the property to set
|
|
611
611
|
* @param value the value
|
|
612
612
|
*/
|
|
613
|
-
set_property(property_name: string
|
|
613
|
+
set_property(property_name: string, value: any): void
|
|
614
614
|
|
|
615
615
|
// Own virtual methods of Json-1.0.Json.Serializable
|
|
616
616
|
|
|
@@ -634,7 +634,7 @@ export interface Serializable {
|
|
|
634
634
|
* @param property_node the JSON node containing the serialized property
|
|
635
635
|
* @returns `TRUE` if the property was successfully deserialized
|
|
636
636
|
*/
|
|
637
|
-
vfunc_deserialize_property(property_name: string
|
|
637
|
+
vfunc_deserialize_property(property_name: string, pspec: GObject.ParamSpec, property_node: Node): [ /* returnType */ boolean, /* value */ any ]
|
|
638
638
|
/**
|
|
639
639
|
* Calls the [vfunc`Json`.Serializable.find_property] implementation on
|
|
640
640
|
* the `JsonSerializable` instance, which will return the property
|
|
@@ -643,7 +643,7 @@ export interface Serializable {
|
|
|
643
643
|
* @param name the name of the property
|
|
644
644
|
* @returns the property description
|
|
645
645
|
*/
|
|
646
|
-
vfunc_find_property(name: string
|
|
646
|
+
vfunc_find_property(name: string): GObject.ParamSpec | null
|
|
647
647
|
/**
|
|
648
648
|
* Calls the [vfunc`Json`.Serializable.get_property] implementation
|
|
649
649
|
* on the `JsonSerializable` instance, which will get the value of
|
|
@@ -665,7 +665,7 @@ export interface Serializable {
|
|
|
665
665
|
* @param pspec a property description
|
|
666
666
|
* @returns a node containing the serialized property
|
|
667
667
|
*/
|
|
668
|
-
vfunc_serialize_property(property_name: string
|
|
668
|
+
vfunc_serialize_property(property_name: string, value: any, pspec: GObject.ParamSpec): Node
|
|
669
669
|
/**
|
|
670
670
|
* Calls the [vfunc`Json`.Serializable.set_property] implementation
|
|
671
671
|
* on the `JsonSerializable` instance, which will set the property
|
|
@@ -801,7 +801,7 @@ export interface Builder {
|
|
|
801
801
|
* @param value the value of the member or element
|
|
802
802
|
* @returns the builder instance
|
|
803
803
|
*/
|
|
804
|
-
add_string_value(value: string
|
|
804
|
+
add_string_value(value: string): Builder | null
|
|
805
805
|
/**
|
|
806
806
|
* Adds a value to the currently open object member or array.
|
|
807
807
|
*
|
|
@@ -879,7 +879,7 @@ export interface Builder {
|
|
|
879
879
|
* @param member_name the name of the member
|
|
880
880
|
* @returns the builder instance
|
|
881
881
|
*/
|
|
882
|
-
set_member_name(member_name: string
|
|
882
|
+
set_member_name(member_name: string): Builder | null
|
|
883
883
|
|
|
884
884
|
// Class property signals of Json-1.0.Json.Builder
|
|
885
885
|
|
|
@@ -998,6 +998,10 @@ export module Generator {
|
|
|
998
998
|
* stream.
|
|
999
999
|
*/
|
|
1000
1000
|
root?: Node | null
|
|
1001
|
+
/**
|
|
1002
|
+
* The character that should be used when indenting in pretty print.
|
|
1003
|
+
*/
|
|
1004
|
+
indentChar?: number | null
|
|
1001
1005
|
}
|
|
1002
1006
|
|
|
1003
1007
|
}
|
|
@@ -1014,6 +1018,10 @@ export interface Generator {
|
|
|
1014
1018
|
* The character that should be used when indenting in pretty print.
|
|
1015
1019
|
*/
|
|
1016
1020
|
indent_char: number
|
|
1021
|
+
/**
|
|
1022
|
+
* The character that should be used when indenting in pretty print.
|
|
1023
|
+
*/
|
|
1024
|
+
indentChar: number
|
|
1017
1025
|
/**
|
|
1018
1026
|
* Whether the output should be "pretty-printed", with indentation and
|
|
1019
1027
|
* newlines.
|
|
@@ -1310,7 +1318,7 @@ export interface Parser {
|
|
|
1310
1318
|
* used.
|
|
1311
1319
|
* @returns `TRUE` if there was an assignment, and `FALSE` otherwise
|
|
1312
1320
|
*/
|
|
1313
|
-
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string
|
|
1321
|
+
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string ]
|
|
1314
1322
|
/**
|
|
1315
1323
|
* Loads a JSON stream from a buffer and parses it.
|
|
1316
1324
|
*
|
|
@@ -1320,7 +1328,7 @@ export interface Parser {
|
|
|
1320
1328
|
* @param length the length of the buffer, or -1 if it is `NUL` terminated
|
|
1321
1329
|
* @returns `TRUE` if the buffer was succesfully parsed
|
|
1322
1330
|
*/
|
|
1323
|
-
load_from_data(data: string
|
|
1331
|
+
load_from_data(data: string, length: number): boolean
|
|
1324
1332
|
/**
|
|
1325
1333
|
* Loads a JSON stream from the content of `filename` and parses it.
|
|
1326
1334
|
*
|
|
@@ -1413,7 +1421,7 @@ export interface Parser {
|
|
|
1413
1421
|
vfunc_array_start(): void
|
|
1414
1422
|
vfunc_error(error: GLib.Error): void
|
|
1415
1423
|
vfunc_object_end(object: Object): void
|
|
1416
|
-
vfunc_object_member(object: Object, member_name: string
|
|
1424
|
+
vfunc_object_member(object: Object, member_name: string): void
|
|
1417
1425
|
vfunc_object_start(): void
|
|
1418
1426
|
vfunc_parse_end(): void
|
|
1419
1427
|
vfunc_parse_start(): void
|
|
@@ -1557,7 +1565,7 @@ export interface Path {
|
|
|
1557
1565
|
* @param expression a JSONPath expression
|
|
1558
1566
|
* @returns `TRUE` if the compilation was successful, and `FALSE` otherwise
|
|
1559
1567
|
*/
|
|
1560
|
-
compile(expression: string
|
|
1568
|
+
compile(expression: string): boolean
|
|
1561
1569
|
/**
|
|
1562
1570
|
* Matches the JSON tree pointed by `root` using the expression compiled
|
|
1563
1571
|
* into the `JsonPath`.
|
|
@@ -1746,7 +1754,7 @@ export class Path extends GObject.Object {
|
|
|
1746
1754
|
* @param root the root of a JSON tree
|
|
1747
1755
|
* @returns a newly-created node of type `JSON_NODE_ARRAY` containing the array of matching nodes
|
|
1748
1756
|
*/
|
|
1749
|
-
static query(expression: string
|
|
1757
|
+
static query(expression: string, root: Node): Node
|
|
1750
1758
|
}
|
|
1751
1759
|
|
|
1752
1760
|
export module Reader {
|
|
@@ -1857,7 +1865,7 @@ export interface Reader {
|
|
|
1857
1865
|
* See also: [method`Json`.Reader.get_value]
|
|
1858
1866
|
* @returns the string value
|
|
1859
1867
|
*/
|
|
1860
|
-
get_string_value(): string
|
|
1868
|
+
get_string_value(): string
|
|
1861
1869
|
/**
|
|
1862
1870
|
* Retrieves the value node at the current position of the reader.
|
|
1863
1871
|
*
|
|
@@ -1994,7 +2002,7 @@ export interface Reader {
|
|
|
1994
2002
|
* @param member_name the name of the member to read
|
|
1995
2003
|
* @returns `TRUE` on success, and `FALSE` otherwise
|
|
1996
2004
|
*/
|
|
1997
|
-
read_member(member_name: string
|
|
2005
|
+
read_member(member_name: string): boolean
|
|
1998
2006
|
/**
|
|
1999
2007
|
* Sets the root node of the JSON tree to be read by `reader`.
|
|
2000
2008
|
*
|
|
@@ -2169,7 +2177,7 @@ export interface Array {
|
|
|
2169
2177
|
* See also: [method`Json`.Array.add_element], [method`Json`.Node.set_string]
|
|
2170
2178
|
* @param value the string value to add
|
|
2171
2179
|
*/
|
|
2172
|
-
add_string_element(value: string
|
|
2180
|
+
add_string_element(value: string): void
|
|
2173
2181
|
/**
|
|
2174
2182
|
* Retrieves a copy of the element at the given position in the array.
|
|
2175
2183
|
* @param index_ the index of the element to retrieve
|
|
@@ -2273,7 +2281,7 @@ export interface Array {
|
|
|
2273
2281
|
* @param index_ the index of the element to retrieve
|
|
2274
2282
|
* @returns the string value
|
|
2275
2283
|
*/
|
|
2276
|
-
get_string_element(index_: number): string
|
|
2284
|
+
get_string_element(index_: number): string
|
|
2277
2285
|
/**
|
|
2278
2286
|
* Calculates a hash value for the given `key`.
|
|
2279
2287
|
*
|
|
@@ -2731,7 +2739,7 @@ export interface Node {
|
|
|
2731
2739
|
* a value node.
|
|
2732
2740
|
* @param value a string value
|
|
2733
2741
|
*/
|
|
2734
|
-
set_string(value: string
|
|
2742
|
+
set_string(value: string): void
|
|
2735
2743
|
/**
|
|
2736
2744
|
* Sets a scalar value inside the given node.
|
|
2737
2745
|
*
|
|
@@ -2781,7 +2789,7 @@ export interface Node {
|
|
|
2781
2789
|
* guarantee the name will stay the same across different versions.
|
|
2782
2790
|
* @returns a string containing the name of the type
|
|
2783
2791
|
*/
|
|
2784
|
-
type_name(): string
|
|
2792
|
+
type_name(): string
|
|
2785
2793
|
/**
|
|
2786
2794
|
* Decrements the reference count of `node`.
|
|
2787
2795
|
*
|
|
@@ -2884,13 +2892,13 @@ export interface Object {
|
|
|
2884
2892
|
* @param member_name the name of the member
|
|
2885
2893
|
* @param node the value of the member
|
|
2886
2894
|
*/
|
|
2887
|
-
add_member(member_name: string
|
|
2895
|
+
add_member(member_name: string, node: Node): void
|
|
2888
2896
|
/**
|
|
2889
2897
|
* Retrieves a copy of the value of the given member inside an object.
|
|
2890
2898
|
* @param member_name the name of the JSON object member to access
|
|
2891
2899
|
* @returns a copy of the value for the requested object member
|
|
2892
2900
|
*/
|
|
2893
|
-
dup_member(member_name: string
|
|
2901
|
+
dup_member(member_name: string): Node | null
|
|
2894
2902
|
/**
|
|
2895
2903
|
* Check whether `a` and `b` are equal objects, meaning they have the same
|
|
2896
2904
|
* set of members, and the values of corresponding members are equal.
|
|
@@ -2922,7 +2930,7 @@ export interface Object {
|
|
|
2922
2930
|
* @param member_name the name of the member
|
|
2923
2931
|
* @returns the array inside the object's member
|
|
2924
2932
|
*/
|
|
2925
|
-
get_array_member(member_name: string
|
|
2933
|
+
get_array_member(member_name: string): Array | null
|
|
2926
2934
|
/**
|
|
2927
2935
|
* Convenience function that retrieves the boolean value
|
|
2928
2936
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2933,7 +2941,7 @@ export interface Object {
|
|
|
2933
2941
|
* @param member_name the name of the member
|
|
2934
2942
|
* @returns the boolean value of the object's member
|
|
2935
2943
|
*/
|
|
2936
|
-
get_boolean_member(member_name: string
|
|
2944
|
+
get_boolean_member(member_name: string): boolean
|
|
2937
2945
|
/**
|
|
2938
2946
|
* Convenience function that retrieves the boolean value
|
|
2939
2947
|
* stored in `member_name` of `object`.
|
|
@@ -2944,7 +2952,7 @@ export interface Object {
|
|
|
2944
2952
|
* @param default_value the value to return if `member_name` is not valid
|
|
2945
2953
|
* @returns the boolean value of the object's member, or the given default
|
|
2946
2954
|
*/
|
|
2947
|
-
get_boolean_member_with_default(member_name: string
|
|
2955
|
+
get_boolean_member_with_default(member_name: string, default_value: boolean): boolean
|
|
2948
2956
|
/**
|
|
2949
2957
|
* Convenience function that retrieves the floating point value
|
|
2950
2958
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2955,7 +2963,7 @@ export interface Object {
|
|
|
2955
2963
|
* @param member_name the name of the member
|
|
2956
2964
|
* @returns the floating point value of the object's member
|
|
2957
2965
|
*/
|
|
2958
|
-
get_double_member(member_name: string
|
|
2966
|
+
get_double_member(member_name: string): number
|
|
2959
2967
|
/**
|
|
2960
2968
|
* Convenience function that retrieves the floating point value
|
|
2961
2969
|
* stored in `member_name` of `object`.
|
|
@@ -2966,7 +2974,7 @@ export interface Object {
|
|
|
2966
2974
|
* @param default_value the value to return if `member_name` is not valid
|
|
2967
2975
|
* @returns the floating point value of the object's member, or the given default
|
|
2968
2976
|
*/
|
|
2969
|
-
get_double_member_with_default(member_name: string
|
|
2977
|
+
get_double_member_with_default(member_name: string, default_value: number): number
|
|
2970
2978
|
/**
|
|
2971
2979
|
* Convenience function that retrieves the integer value
|
|
2972
2980
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2977,7 +2985,7 @@ export interface Object {
|
|
|
2977
2985
|
* @param member_name the name of the object member
|
|
2978
2986
|
* @returns the integer value of the object's member
|
|
2979
2987
|
*/
|
|
2980
|
-
get_int_member(member_name: string
|
|
2988
|
+
get_int_member(member_name: string): number
|
|
2981
2989
|
/**
|
|
2982
2990
|
* Convenience function that retrieves the integer value
|
|
2983
2991
|
* stored in `member_name` of `object`.
|
|
@@ -2988,13 +2996,13 @@ export interface Object {
|
|
|
2988
2996
|
* @param default_value the value to return if `member_name` is not valid
|
|
2989
2997
|
* @returns the integer value of the object's member, or the given default
|
|
2990
2998
|
*/
|
|
2991
|
-
get_int_member_with_default(member_name: string
|
|
2999
|
+
get_int_member_with_default(member_name: string, default_value: number): number
|
|
2992
3000
|
/**
|
|
2993
3001
|
* Retrieves the value of the given member inside an object.
|
|
2994
3002
|
* @param member_name the name of the JSON object member to access
|
|
2995
3003
|
* @returns the value for the requested object member
|
|
2996
3004
|
*/
|
|
2997
|
-
get_member(member_name: string
|
|
3005
|
+
get_member(member_name: string): Node | null
|
|
2998
3006
|
/**
|
|
2999
3007
|
* Retrieves all the names of the members of an object.
|
|
3000
3008
|
*
|
|
@@ -3012,7 +3020,7 @@ export interface Object {
|
|
|
3012
3020
|
* @param member_name the name of the member
|
|
3013
3021
|
* @returns `TRUE` if the value is `null`
|
|
3014
3022
|
*/
|
|
3015
|
-
get_null_member(member_name: string
|
|
3023
|
+
get_null_member(member_name: string): boolean
|
|
3016
3024
|
/**
|
|
3017
3025
|
* Convenience function that retrieves the object
|
|
3018
3026
|
* stored in `member_name` of `object`. It is an error to specify a `member_name`
|
|
@@ -3024,7 +3032,7 @@ export interface Object {
|
|
|
3024
3032
|
* @param member_name the name of the member
|
|
3025
3033
|
* @returns the object inside the object's member
|
|
3026
3034
|
*/
|
|
3027
|
-
get_object_member(member_name: string
|
|
3035
|
+
get_object_member(member_name: string): Object | null
|
|
3028
3036
|
/**
|
|
3029
3037
|
* Retrieves the number of members of a JSON object.
|
|
3030
3038
|
* @returns the number of members
|
|
@@ -3040,7 +3048,7 @@ export interface Object {
|
|
|
3040
3048
|
* @param member_name the name of the member
|
|
3041
3049
|
* @returns the string value of the object's member
|
|
3042
3050
|
*/
|
|
3043
|
-
get_string_member(member_name: string
|
|
3051
|
+
get_string_member(member_name: string): string
|
|
3044
3052
|
/**
|
|
3045
3053
|
* Convenience function that retrieves the string value
|
|
3046
3054
|
* stored in `member_name` of `object`.
|
|
@@ -3051,7 +3059,7 @@ export interface Object {
|
|
|
3051
3059
|
* @param default_value the value to return if `member_name` is not valid
|
|
3052
3060
|
* @returns the string value of the object's member, or the given default
|
|
3053
3061
|
*/
|
|
3054
|
-
get_string_member_with_default(member_name: string
|
|
3062
|
+
get_string_member_with_default(member_name: string, default_value: string): string
|
|
3055
3063
|
/**
|
|
3056
3064
|
* Retrieves all the values of the members of an object.
|
|
3057
3065
|
* @returns the member values of the object
|
|
@@ -3062,7 +3070,7 @@ export interface Object {
|
|
|
3062
3070
|
* @param member_name the name of a JSON object member
|
|
3063
3071
|
* @returns `TRUE` if the JSON object has the requested member
|
|
3064
3072
|
*/
|
|
3065
|
-
has_member(member_name: string
|
|
3073
|
+
has_member(member_name: string): boolean
|
|
3066
3074
|
/**
|
|
3067
3075
|
* Calculate a hash value for the given `key` (a JSON object).
|
|
3068
3076
|
*
|
|
@@ -3087,7 +3095,7 @@ export interface Object {
|
|
|
3087
3095
|
* Removes `member_name` from `object,` freeing its allocated resources.
|
|
3088
3096
|
* @param member_name the name of the member to remove
|
|
3089
3097
|
*/
|
|
3090
|
-
remove_member(member_name: string
|
|
3098
|
+
remove_member(member_name: string): void
|
|
3091
3099
|
/**
|
|
3092
3100
|
* Seals the object, making it immutable to further changes.
|
|
3093
3101
|
*
|
|
@@ -3103,7 +3111,7 @@ export interface Object {
|
|
|
3103
3111
|
* @param member_name the name of the member
|
|
3104
3112
|
* @param value the value of the member
|
|
3105
3113
|
*/
|
|
3106
|
-
set_array_member(member_name: string
|
|
3114
|
+
set_array_member(member_name: string, value: Array): void
|
|
3107
3115
|
/**
|
|
3108
3116
|
* Convenience function for setting an object member with a boolean value.
|
|
3109
3117
|
*
|
|
@@ -3111,7 +3119,7 @@ export interface Object {
|
|
|
3111
3119
|
* @param member_name the name of the member
|
|
3112
3120
|
* @param value the value of the member
|
|
3113
3121
|
*/
|
|
3114
|
-
set_boolean_member(member_name: string
|
|
3122
|
+
set_boolean_member(member_name: string, value: boolean): void
|
|
3115
3123
|
/**
|
|
3116
3124
|
* Convenience function for setting an object member with a floating point value.
|
|
3117
3125
|
*
|
|
@@ -3119,7 +3127,7 @@ export interface Object {
|
|
|
3119
3127
|
* @param member_name the name of the member
|
|
3120
3128
|
* @param value the value of the member
|
|
3121
3129
|
*/
|
|
3122
|
-
set_double_member(member_name: string
|
|
3130
|
+
set_double_member(member_name: string, value: number): void
|
|
3123
3131
|
/**
|
|
3124
3132
|
* Convenience function for setting an object member with an integer value.
|
|
3125
3133
|
*
|
|
@@ -3127,7 +3135,7 @@ export interface Object {
|
|
|
3127
3135
|
* @param member_name the name of the member
|
|
3128
3136
|
* @param value the value of the member
|
|
3129
3137
|
*/
|
|
3130
|
-
set_int_member(member_name: string
|
|
3138
|
+
set_int_member(member_name: string, value: number): void
|
|
3131
3139
|
/**
|
|
3132
3140
|
* Sets the value of a member inside an object.
|
|
3133
3141
|
*
|
|
@@ -3139,14 +3147,14 @@ export interface Object {
|
|
|
3139
3147
|
* @param member_name the name of the member
|
|
3140
3148
|
* @param node the value of the member
|
|
3141
3149
|
*/
|
|
3142
|
-
set_member(member_name: string
|
|
3150
|
+
set_member(member_name: string, node: Node): void
|
|
3143
3151
|
/**
|
|
3144
3152
|
* Convenience function for setting an object member with a `null` value.
|
|
3145
3153
|
*
|
|
3146
3154
|
* See also: [method`Json`.Object.set_member], [method`Json`.Node.init_null]
|
|
3147
3155
|
* @param member_name the name of the member
|
|
3148
3156
|
*/
|
|
3149
|
-
set_null_member(member_name: string
|
|
3157
|
+
set_null_member(member_name: string): void
|
|
3150
3158
|
/**
|
|
3151
3159
|
* Convenience function for setting an object member with an object value.
|
|
3152
3160
|
*
|
|
@@ -3154,7 +3162,7 @@ export interface Object {
|
|
|
3154
3162
|
* @param member_name the name of the member
|
|
3155
3163
|
* @param value the value of the member
|
|
3156
3164
|
*/
|
|
3157
|
-
set_object_member(member_name: string
|
|
3165
|
+
set_object_member(member_name: string, value: Object): void
|
|
3158
3166
|
/**
|
|
3159
3167
|
* Convenience function for setting an object member with a string value.
|
|
3160
3168
|
*
|
|
@@ -3162,7 +3170,7 @@ export interface Object {
|
|
|
3162
3170
|
* @param member_name the name of the member
|
|
3163
3171
|
* @param value the value of the member
|
|
3164
3172
|
*/
|
|
3165
|
-
set_string_member(member_name: string
|
|
3173
|
+
set_string_member(member_name: string, value: string): void
|
|
3166
3174
|
/**
|
|
3167
3175
|
* Releases a reference on the given object.
|
|
3168
3176
|
*
|
|
@@ -3278,7 +3286,7 @@ export interface ObjectIter {
|
|
|
3278
3286
|
* See also: [method`Json`.ObjectIter.next_ordered]
|
|
3279
3287
|
* @returns `TRUE` if @member_name and @member_node are valid; `FALSE` if there are no more members
|
|
3280
3288
|
*/
|
|
3281
|
-
next(): [ /* returnType */ boolean, /* member_name */ string
|
|
3289
|
+
next(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3282
3290
|
/**
|
|
3283
3291
|
* Advances the iterator and retrieves the next member in the object.
|
|
3284
3292
|
*
|
|
@@ -3296,7 +3304,7 @@ export interface ObjectIter {
|
|
|
3296
3304
|
* See also: [method`Json`.ObjectIter.next]
|
|
3297
3305
|
* @returns `TRUE `if @member_name and @member_node are valid; `FALSE` if the end of the object has been reached
|
|
3298
3306
|
*/
|
|
3299
|
-
next_ordered(): [ /* returnType */ boolean, /* member_name */ string
|
|
3307
|
+
next_ordered(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3300
3308
|
}
|
|
3301
3309
|
|
|
3302
3310
|
/**
|
|
@@ -3325,7 +3333,7 @@ export interface ParserClass {
|
|
|
3325
3333
|
|
|
3326
3334
|
parse_start: (parser: Parser) => void
|
|
3327
3335
|
object_start: (parser: Parser) => void
|
|
3328
|
-
object_member: (parser: Parser, object: Object, member_name: string
|
|
3336
|
+
object_member: (parser: Parser, object: Object, member_name: string) => void
|
|
3329
3337
|
object_end: (parser: Parser, object: Object) => void
|
|
3330
3338
|
array_start: (parser: Parser) => void
|
|
3331
3339
|
array_element: (parser: Parser, array: Array, index_: number) => void
|
|
@@ -3389,9 +3397,9 @@ export interface SerializableIface {
|
|
|
3389
3397
|
|
|
3390
3398
|
// Own fields of Json-1.0.Json.SerializableIface
|
|
3391
3399
|
|
|
3392
|
-
serialize_property: (serializable: Serializable, property_name: string
|
|
3393
|
-
deserialize_property: (serializable: Serializable, property_name: string
|
|
3394
|
-
find_property: (serializable: Serializable, name: string
|
|
3400
|
+
serialize_property: (serializable: Serializable, property_name: string, value: any, pspec: GObject.ParamSpec) => Node
|
|
3401
|
+
deserialize_property: (serializable: Serializable, property_name: string, pspec: GObject.ParamSpec, property_node: Node) => [ /* returnType */ boolean, /* value */ any ]
|
|
3402
|
+
find_property: (serializable: Serializable, name: string) => GObject.ParamSpec | null
|
|
3395
3403
|
set_property: (serializable: Serializable, pspec: GObject.ParamSpec, value: any) => void
|
|
3396
3404
|
get_property: (serializable: Serializable, pspec: GObject.ParamSpec) => /* value */ any
|
|
3397
3405
|
}
|
package/json-1.0.d.ts
CHANGED
|
@@ -142,7 +142,7 @@ const MINOR_VERSION: number
|
|
|
142
142
|
* The version of JSON-GLib, encoded as a string, useful for printing and
|
|
143
143
|
* concatenation.
|
|
144
144
|
*/
|
|
145
|
-
const VERSION_S: string
|
|
145
|
+
const VERSION_S: string
|
|
146
146
|
/**
|
|
147
147
|
* Checks whether it is possible to deserialize a `GBoxed` of
|
|
148
148
|
* type `gboxed_type` from a [struct`Json`.Node] of type `node_type`.
|
|
@@ -195,7 +195,7 @@ function boxed_serialize(gboxed_type: GObject.GType, boxed: any | null): Node |
|
|
|
195
195
|
* @param length length of the data stream (unused)
|
|
196
196
|
* @returns a new object instance of the given type
|
|
197
197
|
*/
|
|
198
|
-
function construct_gobject(gtype: GObject.GType, data: string
|
|
198
|
+
function construct_gobject(gtype: GObject.GType, data: string, length: number): GObject.Object | null
|
|
199
199
|
/**
|
|
200
200
|
* Parses the given string and returns the corresponding JSON tree.
|
|
201
201
|
*
|
|
@@ -206,7 +206,7 @@ function construct_gobject(gtype: GObject.GType, data: string | null, length: nu
|
|
|
206
206
|
* @param str a valid UTF-8 string containing JSON data
|
|
207
207
|
* @returns the root node of the JSON tree
|
|
208
208
|
*/
|
|
209
|
-
function from_string(str: string
|
|
209
|
+
function from_string(str: string): Node | null
|
|
210
210
|
/**
|
|
211
211
|
* Creates a new `GObject` instance of the given type, and constructs it
|
|
212
212
|
* using the members of the object in the given node.
|
|
@@ -230,7 +230,7 @@ function gobject_deserialize(gtype: GObject.GType, node: Node): GObject.Object
|
|
|
230
230
|
* @param length length of the data stream, or -1 if it is `NUL`-terminated
|
|
231
231
|
* @returns a new object instance of the given type
|
|
232
232
|
*/
|
|
233
|
-
function gobject_from_data(gtype: GObject.GType, data: string
|
|
233
|
+
function gobject_from_data(gtype: GObject.GType, data: string, length: number): GObject.Object | null
|
|
234
234
|
/**
|
|
235
235
|
* Creates a JSON tree representing the passed object instance.
|
|
236
236
|
*
|
|
@@ -298,7 +298,7 @@ function gvariant_deserialize(json_node: Node, signature: string | null): GLib.V
|
|
|
298
298
|
* @param signature A valid `GVariant` type string
|
|
299
299
|
* @returns A newly created `GVariant`D compliant
|
|
300
300
|
*/
|
|
301
|
-
function gvariant_deserialize_data(json: string
|
|
301
|
+
function gvariant_deserialize_data(json: string, length: number, signature: string | null): GLib.Variant | null
|
|
302
302
|
/**
|
|
303
303
|
* Converts `variant` to a JSON tree.
|
|
304
304
|
* @param variant A `GVariant` to convert
|
|
@@ -455,7 +455,7 @@ interface BoxedSerializeFunc {
|
|
|
455
455
|
* @param member_node the value of the member
|
|
456
456
|
*/
|
|
457
457
|
interface ObjectForeach {
|
|
458
|
-
(object: Object, member_name: string
|
|
458
|
+
(object: Object, member_name: string, member_node: Node): void
|
|
459
459
|
}
|
|
460
460
|
module Serializable {
|
|
461
461
|
|
|
@@ -494,7 +494,7 @@ interface Serializable {
|
|
|
494
494
|
* @param property_node the JSON node containing the serialized property
|
|
495
495
|
* @returns `TRUE` if the property was successfully deserialized
|
|
496
496
|
*/
|
|
497
|
-
default_deserialize_property(property_name: string
|
|
497
|
+
default_deserialize_property(property_name: string, value: any, pspec: GObject.ParamSpec, property_node: Node): boolean
|
|
498
498
|
/**
|
|
499
499
|
* Calls the default implementation of the [vfunc`Json`.Serializable.serialize_property]
|
|
500
500
|
* virtual function.
|
|
@@ -520,7 +520,7 @@ interface Serializable {
|
|
|
520
520
|
* @param pspec a property description
|
|
521
521
|
* @returns a node containing the serialized property
|
|
522
522
|
*/
|
|
523
|
-
default_serialize_property(property_name: string
|
|
523
|
+
default_serialize_property(property_name: string, value: any, pspec: GObject.ParamSpec): Node | null
|
|
524
524
|
/**
|
|
525
525
|
* Asks a `JsonSerializable` implementation to deserialize the
|
|
526
526
|
* property contained inside `property_node` and place its value
|
|
@@ -540,7 +540,7 @@ interface Serializable {
|
|
|
540
540
|
* @param property_node the JSON node containing the serialized property
|
|
541
541
|
* @returns `TRUE` if the property was successfully deserialized
|
|
542
542
|
*/
|
|
543
|
-
deserialize_property(property_name: string
|
|
543
|
+
deserialize_property(property_name: string, pspec: GObject.ParamSpec, property_node: Node): [ /* returnType */ boolean, /* value */ any ]
|
|
544
544
|
/**
|
|
545
545
|
* Calls the [vfunc`Json`.Serializable.find_property] implementation on
|
|
546
546
|
* the `JsonSerializable` instance, which will return the property
|
|
@@ -548,7 +548,7 @@ interface Serializable {
|
|
|
548
548
|
* @param name the name of the property
|
|
549
549
|
* @returns the property description
|
|
550
550
|
*/
|
|
551
|
-
find_property(name: string
|
|
551
|
+
find_property(name: string): GObject.ParamSpec | null
|
|
552
552
|
/**
|
|
553
553
|
* Calls the [vfunc`Json`.Serializable.get_property] implementation
|
|
554
554
|
* on the `JsonSerializable` instance, which will get the value of
|
|
@@ -579,7 +579,7 @@ interface Serializable {
|
|
|
579
579
|
* @param property_name the name of the property to get
|
|
580
580
|
* @param value return location for the property value
|
|
581
581
|
*/
|
|
582
|
-
get_property(property_name: string
|
|
582
|
+
get_property(property_name: string, value: any): void
|
|
583
583
|
/**
|
|
584
584
|
* Calls the [vfunc`Json`.Serializable.list_properties] implementation on
|
|
585
585
|
* the `JsonSerializable` instance, which will return the list of serializable
|
|
@@ -595,7 +595,7 @@ interface Serializable {
|
|
|
595
595
|
* @param pspec a property description
|
|
596
596
|
* @returns a node containing the serialized property
|
|
597
597
|
*/
|
|
598
|
-
serialize_property(property_name: string
|
|
598
|
+
serialize_property(property_name: string, value: any, pspec: GObject.ParamSpec): Node
|
|
599
599
|
/**
|
|
600
600
|
* Calls the [vfunc`Json`.Serializable.set_property] implementation
|
|
601
601
|
* on the `JsonSerializable` instance, which will set the property
|
|
@@ -612,7 +612,7 @@ interface Serializable {
|
|
|
612
612
|
* @param property_name the name of the property to set
|
|
613
613
|
* @param value the value
|
|
614
614
|
*/
|
|
615
|
-
set_property(property_name: string
|
|
615
|
+
set_property(property_name: string, value: any): void
|
|
616
616
|
|
|
617
617
|
// Own virtual methods of Json-1.0.Json.Serializable
|
|
618
618
|
|
|
@@ -636,7 +636,7 @@ interface Serializable {
|
|
|
636
636
|
* @param property_node the JSON node containing the serialized property
|
|
637
637
|
* @returns `TRUE` if the property was successfully deserialized
|
|
638
638
|
*/
|
|
639
|
-
vfunc_deserialize_property(property_name: string
|
|
639
|
+
vfunc_deserialize_property(property_name: string, pspec: GObject.ParamSpec, property_node: Node): [ /* returnType */ boolean, /* value */ any ]
|
|
640
640
|
/**
|
|
641
641
|
* Calls the [vfunc`Json`.Serializable.find_property] implementation on
|
|
642
642
|
* the `JsonSerializable` instance, which will return the property
|
|
@@ -645,7 +645,7 @@ interface Serializable {
|
|
|
645
645
|
* @param name the name of the property
|
|
646
646
|
* @returns the property description
|
|
647
647
|
*/
|
|
648
|
-
vfunc_find_property(name: string
|
|
648
|
+
vfunc_find_property(name: string): GObject.ParamSpec | null
|
|
649
649
|
/**
|
|
650
650
|
* Calls the [vfunc`Json`.Serializable.get_property] implementation
|
|
651
651
|
* on the `JsonSerializable` instance, which will get the value of
|
|
@@ -667,7 +667,7 @@ interface Serializable {
|
|
|
667
667
|
* @param pspec a property description
|
|
668
668
|
* @returns a node containing the serialized property
|
|
669
669
|
*/
|
|
670
|
-
vfunc_serialize_property(property_name: string
|
|
670
|
+
vfunc_serialize_property(property_name: string, value: any, pspec: GObject.ParamSpec): Node
|
|
671
671
|
/**
|
|
672
672
|
* Calls the [vfunc`Json`.Serializable.set_property] implementation
|
|
673
673
|
* on the `JsonSerializable` instance, which will set the property
|
|
@@ -803,7 +803,7 @@ interface Builder {
|
|
|
803
803
|
* @param value the value of the member or element
|
|
804
804
|
* @returns the builder instance
|
|
805
805
|
*/
|
|
806
|
-
add_string_value(value: string
|
|
806
|
+
add_string_value(value: string): Builder | null
|
|
807
807
|
/**
|
|
808
808
|
* Adds a value to the currently open object member or array.
|
|
809
809
|
*
|
|
@@ -881,7 +881,7 @@ interface Builder {
|
|
|
881
881
|
* @param member_name the name of the member
|
|
882
882
|
* @returns the builder instance
|
|
883
883
|
*/
|
|
884
|
-
set_member_name(member_name: string
|
|
884
|
+
set_member_name(member_name: string): Builder | null
|
|
885
885
|
|
|
886
886
|
// Class property signals of Json-1.0.Json.Builder
|
|
887
887
|
|
|
@@ -1000,6 +1000,10 @@ module Generator {
|
|
|
1000
1000
|
* stream.
|
|
1001
1001
|
*/
|
|
1002
1002
|
root?: Node | null
|
|
1003
|
+
/**
|
|
1004
|
+
* The character that should be used when indenting in pretty print.
|
|
1005
|
+
*/
|
|
1006
|
+
indentChar?: number | null
|
|
1003
1007
|
}
|
|
1004
1008
|
|
|
1005
1009
|
}
|
|
@@ -1016,6 +1020,10 @@ interface Generator {
|
|
|
1016
1020
|
* The character that should be used when indenting in pretty print.
|
|
1017
1021
|
*/
|
|
1018
1022
|
indent_char: number
|
|
1023
|
+
/**
|
|
1024
|
+
* The character that should be used when indenting in pretty print.
|
|
1025
|
+
*/
|
|
1026
|
+
indentChar: number
|
|
1019
1027
|
/**
|
|
1020
1028
|
* Whether the output should be "pretty-printed", with indentation and
|
|
1021
1029
|
* newlines.
|
|
@@ -1312,7 +1320,7 @@ interface Parser {
|
|
|
1312
1320
|
* used.
|
|
1313
1321
|
* @returns `TRUE` if there was an assignment, and `FALSE` otherwise
|
|
1314
1322
|
*/
|
|
1315
|
-
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string
|
|
1323
|
+
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string ]
|
|
1316
1324
|
/**
|
|
1317
1325
|
* Loads a JSON stream from a buffer and parses it.
|
|
1318
1326
|
*
|
|
@@ -1322,7 +1330,7 @@ interface Parser {
|
|
|
1322
1330
|
* @param length the length of the buffer, or -1 if it is `NUL` terminated
|
|
1323
1331
|
* @returns `TRUE` if the buffer was succesfully parsed
|
|
1324
1332
|
*/
|
|
1325
|
-
load_from_data(data: string
|
|
1333
|
+
load_from_data(data: string, length: number): boolean
|
|
1326
1334
|
/**
|
|
1327
1335
|
* Loads a JSON stream from the content of `filename` and parses it.
|
|
1328
1336
|
*
|
|
@@ -1415,7 +1423,7 @@ interface Parser {
|
|
|
1415
1423
|
vfunc_array_start(): void
|
|
1416
1424
|
vfunc_error(error: GLib.Error): void
|
|
1417
1425
|
vfunc_object_end(object: Object): void
|
|
1418
|
-
vfunc_object_member(object: Object, member_name: string
|
|
1426
|
+
vfunc_object_member(object: Object, member_name: string): void
|
|
1419
1427
|
vfunc_object_start(): void
|
|
1420
1428
|
vfunc_parse_end(): void
|
|
1421
1429
|
vfunc_parse_start(): void
|
|
@@ -1559,7 +1567,7 @@ interface Path {
|
|
|
1559
1567
|
* @param expression a JSONPath expression
|
|
1560
1568
|
* @returns `TRUE` if the compilation was successful, and `FALSE` otherwise
|
|
1561
1569
|
*/
|
|
1562
|
-
compile(expression: string
|
|
1570
|
+
compile(expression: string): boolean
|
|
1563
1571
|
/**
|
|
1564
1572
|
* Matches the JSON tree pointed by `root` using the expression compiled
|
|
1565
1573
|
* into the `JsonPath`.
|
|
@@ -1748,7 +1756,7 @@ class Path extends GObject.Object {
|
|
|
1748
1756
|
* @param root the root of a JSON tree
|
|
1749
1757
|
* @returns a newly-created node of type `JSON_NODE_ARRAY` containing the array of matching nodes
|
|
1750
1758
|
*/
|
|
1751
|
-
static query(expression: string
|
|
1759
|
+
static query(expression: string, root: Node): Node
|
|
1752
1760
|
}
|
|
1753
1761
|
|
|
1754
1762
|
module Reader {
|
|
@@ -1859,7 +1867,7 @@ interface Reader {
|
|
|
1859
1867
|
* See also: [method`Json`.Reader.get_value]
|
|
1860
1868
|
* @returns the string value
|
|
1861
1869
|
*/
|
|
1862
|
-
get_string_value(): string
|
|
1870
|
+
get_string_value(): string
|
|
1863
1871
|
/**
|
|
1864
1872
|
* Retrieves the value node at the current position of the reader.
|
|
1865
1873
|
*
|
|
@@ -1996,7 +2004,7 @@ interface Reader {
|
|
|
1996
2004
|
* @param member_name the name of the member to read
|
|
1997
2005
|
* @returns `TRUE` on success, and `FALSE` otherwise
|
|
1998
2006
|
*/
|
|
1999
|
-
read_member(member_name: string
|
|
2007
|
+
read_member(member_name: string): boolean
|
|
2000
2008
|
/**
|
|
2001
2009
|
* Sets the root node of the JSON tree to be read by `reader`.
|
|
2002
2010
|
*
|
|
@@ -2171,7 +2179,7 @@ interface Array {
|
|
|
2171
2179
|
* See also: [method`Json`.Array.add_element], [method`Json`.Node.set_string]
|
|
2172
2180
|
* @param value the string value to add
|
|
2173
2181
|
*/
|
|
2174
|
-
add_string_element(value: string
|
|
2182
|
+
add_string_element(value: string): void
|
|
2175
2183
|
/**
|
|
2176
2184
|
* Retrieves a copy of the element at the given position in the array.
|
|
2177
2185
|
* @param index_ the index of the element to retrieve
|
|
@@ -2275,7 +2283,7 @@ interface Array {
|
|
|
2275
2283
|
* @param index_ the index of the element to retrieve
|
|
2276
2284
|
* @returns the string value
|
|
2277
2285
|
*/
|
|
2278
|
-
get_string_element(index_: number): string
|
|
2286
|
+
get_string_element(index_: number): string
|
|
2279
2287
|
/**
|
|
2280
2288
|
* Calculates a hash value for the given `key`.
|
|
2281
2289
|
*
|
|
@@ -2733,7 +2741,7 @@ interface Node {
|
|
|
2733
2741
|
* a value node.
|
|
2734
2742
|
* @param value a string value
|
|
2735
2743
|
*/
|
|
2736
|
-
set_string(value: string
|
|
2744
|
+
set_string(value: string): void
|
|
2737
2745
|
/**
|
|
2738
2746
|
* Sets a scalar value inside the given node.
|
|
2739
2747
|
*
|
|
@@ -2783,7 +2791,7 @@ interface Node {
|
|
|
2783
2791
|
* guarantee the name will stay the same across different versions.
|
|
2784
2792
|
* @returns a string containing the name of the type
|
|
2785
2793
|
*/
|
|
2786
|
-
type_name(): string
|
|
2794
|
+
type_name(): string
|
|
2787
2795
|
/**
|
|
2788
2796
|
* Decrements the reference count of `node`.
|
|
2789
2797
|
*
|
|
@@ -2886,13 +2894,13 @@ interface Object {
|
|
|
2886
2894
|
* @param member_name the name of the member
|
|
2887
2895
|
* @param node the value of the member
|
|
2888
2896
|
*/
|
|
2889
|
-
add_member(member_name: string
|
|
2897
|
+
add_member(member_name: string, node: Node): void
|
|
2890
2898
|
/**
|
|
2891
2899
|
* Retrieves a copy of the value of the given member inside an object.
|
|
2892
2900
|
* @param member_name the name of the JSON object member to access
|
|
2893
2901
|
* @returns a copy of the value for the requested object member
|
|
2894
2902
|
*/
|
|
2895
|
-
dup_member(member_name: string
|
|
2903
|
+
dup_member(member_name: string): Node | null
|
|
2896
2904
|
/**
|
|
2897
2905
|
* Check whether `a` and `b` are equal objects, meaning they have the same
|
|
2898
2906
|
* set of members, and the values of corresponding members are equal.
|
|
@@ -2924,7 +2932,7 @@ interface Object {
|
|
|
2924
2932
|
* @param member_name the name of the member
|
|
2925
2933
|
* @returns the array inside the object's member
|
|
2926
2934
|
*/
|
|
2927
|
-
get_array_member(member_name: string
|
|
2935
|
+
get_array_member(member_name: string): Array | null
|
|
2928
2936
|
/**
|
|
2929
2937
|
* Convenience function that retrieves the boolean value
|
|
2930
2938
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2935,7 +2943,7 @@ interface Object {
|
|
|
2935
2943
|
* @param member_name the name of the member
|
|
2936
2944
|
* @returns the boolean value of the object's member
|
|
2937
2945
|
*/
|
|
2938
|
-
get_boolean_member(member_name: string
|
|
2946
|
+
get_boolean_member(member_name: string): boolean
|
|
2939
2947
|
/**
|
|
2940
2948
|
* Convenience function that retrieves the boolean value
|
|
2941
2949
|
* stored in `member_name` of `object`.
|
|
@@ -2946,7 +2954,7 @@ interface Object {
|
|
|
2946
2954
|
* @param default_value the value to return if `member_name` is not valid
|
|
2947
2955
|
* @returns the boolean value of the object's member, or the given default
|
|
2948
2956
|
*/
|
|
2949
|
-
get_boolean_member_with_default(member_name: string
|
|
2957
|
+
get_boolean_member_with_default(member_name: string, default_value: boolean): boolean
|
|
2950
2958
|
/**
|
|
2951
2959
|
* Convenience function that retrieves the floating point value
|
|
2952
2960
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2957,7 +2965,7 @@ interface Object {
|
|
|
2957
2965
|
* @param member_name the name of the member
|
|
2958
2966
|
* @returns the floating point value of the object's member
|
|
2959
2967
|
*/
|
|
2960
|
-
get_double_member(member_name: string
|
|
2968
|
+
get_double_member(member_name: string): number
|
|
2961
2969
|
/**
|
|
2962
2970
|
* Convenience function that retrieves the floating point value
|
|
2963
2971
|
* stored in `member_name` of `object`.
|
|
@@ -2968,7 +2976,7 @@ interface Object {
|
|
|
2968
2976
|
* @param default_value the value to return if `member_name` is not valid
|
|
2969
2977
|
* @returns the floating point value of the object's member, or the given default
|
|
2970
2978
|
*/
|
|
2971
|
-
get_double_member_with_default(member_name: string
|
|
2979
|
+
get_double_member_with_default(member_name: string, default_value: number): number
|
|
2972
2980
|
/**
|
|
2973
2981
|
* Convenience function that retrieves the integer value
|
|
2974
2982
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2979,7 +2987,7 @@ interface Object {
|
|
|
2979
2987
|
* @param member_name the name of the object member
|
|
2980
2988
|
* @returns the integer value of the object's member
|
|
2981
2989
|
*/
|
|
2982
|
-
get_int_member(member_name: string
|
|
2990
|
+
get_int_member(member_name: string): number
|
|
2983
2991
|
/**
|
|
2984
2992
|
* Convenience function that retrieves the integer value
|
|
2985
2993
|
* stored in `member_name` of `object`.
|
|
@@ -2990,13 +2998,13 @@ interface Object {
|
|
|
2990
2998
|
* @param default_value the value to return if `member_name` is not valid
|
|
2991
2999
|
* @returns the integer value of the object's member, or the given default
|
|
2992
3000
|
*/
|
|
2993
|
-
get_int_member_with_default(member_name: string
|
|
3001
|
+
get_int_member_with_default(member_name: string, default_value: number): number
|
|
2994
3002
|
/**
|
|
2995
3003
|
* Retrieves the value of the given member inside an object.
|
|
2996
3004
|
* @param member_name the name of the JSON object member to access
|
|
2997
3005
|
* @returns the value for the requested object member
|
|
2998
3006
|
*/
|
|
2999
|
-
get_member(member_name: string
|
|
3007
|
+
get_member(member_name: string): Node | null
|
|
3000
3008
|
/**
|
|
3001
3009
|
* Retrieves all the names of the members of an object.
|
|
3002
3010
|
*
|
|
@@ -3014,7 +3022,7 @@ interface Object {
|
|
|
3014
3022
|
* @param member_name the name of the member
|
|
3015
3023
|
* @returns `TRUE` if the value is `null`
|
|
3016
3024
|
*/
|
|
3017
|
-
get_null_member(member_name: string
|
|
3025
|
+
get_null_member(member_name: string): boolean
|
|
3018
3026
|
/**
|
|
3019
3027
|
* Convenience function that retrieves the object
|
|
3020
3028
|
* stored in `member_name` of `object`. It is an error to specify a `member_name`
|
|
@@ -3026,7 +3034,7 @@ interface Object {
|
|
|
3026
3034
|
* @param member_name the name of the member
|
|
3027
3035
|
* @returns the object inside the object's member
|
|
3028
3036
|
*/
|
|
3029
|
-
get_object_member(member_name: string
|
|
3037
|
+
get_object_member(member_name: string): Object | null
|
|
3030
3038
|
/**
|
|
3031
3039
|
* Retrieves the number of members of a JSON object.
|
|
3032
3040
|
* @returns the number of members
|
|
@@ -3042,7 +3050,7 @@ interface Object {
|
|
|
3042
3050
|
* @param member_name the name of the member
|
|
3043
3051
|
* @returns the string value of the object's member
|
|
3044
3052
|
*/
|
|
3045
|
-
get_string_member(member_name: string
|
|
3053
|
+
get_string_member(member_name: string): string
|
|
3046
3054
|
/**
|
|
3047
3055
|
* Convenience function that retrieves the string value
|
|
3048
3056
|
* stored in `member_name` of `object`.
|
|
@@ -3053,7 +3061,7 @@ interface Object {
|
|
|
3053
3061
|
* @param default_value the value to return if `member_name` is not valid
|
|
3054
3062
|
* @returns the string value of the object's member, or the given default
|
|
3055
3063
|
*/
|
|
3056
|
-
get_string_member_with_default(member_name: string
|
|
3064
|
+
get_string_member_with_default(member_name: string, default_value: string): string
|
|
3057
3065
|
/**
|
|
3058
3066
|
* Retrieves all the values of the members of an object.
|
|
3059
3067
|
* @returns the member values of the object
|
|
@@ -3064,7 +3072,7 @@ interface Object {
|
|
|
3064
3072
|
* @param member_name the name of a JSON object member
|
|
3065
3073
|
* @returns `TRUE` if the JSON object has the requested member
|
|
3066
3074
|
*/
|
|
3067
|
-
has_member(member_name: string
|
|
3075
|
+
has_member(member_name: string): boolean
|
|
3068
3076
|
/**
|
|
3069
3077
|
* Calculate a hash value for the given `key` (a JSON object).
|
|
3070
3078
|
*
|
|
@@ -3089,7 +3097,7 @@ interface Object {
|
|
|
3089
3097
|
* Removes `member_name` from `object,` freeing its allocated resources.
|
|
3090
3098
|
* @param member_name the name of the member to remove
|
|
3091
3099
|
*/
|
|
3092
|
-
remove_member(member_name: string
|
|
3100
|
+
remove_member(member_name: string): void
|
|
3093
3101
|
/**
|
|
3094
3102
|
* Seals the object, making it immutable to further changes.
|
|
3095
3103
|
*
|
|
@@ -3105,7 +3113,7 @@ interface Object {
|
|
|
3105
3113
|
* @param member_name the name of the member
|
|
3106
3114
|
* @param value the value of the member
|
|
3107
3115
|
*/
|
|
3108
|
-
set_array_member(member_name: string
|
|
3116
|
+
set_array_member(member_name: string, value: Array): void
|
|
3109
3117
|
/**
|
|
3110
3118
|
* Convenience function for setting an object member with a boolean value.
|
|
3111
3119
|
*
|
|
@@ -3113,7 +3121,7 @@ interface Object {
|
|
|
3113
3121
|
* @param member_name the name of the member
|
|
3114
3122
|
* @param value the value of the member
|
|
3115
3123
|
*/
|
|
3116
|
-
set_boolean_member(member_name: string
|
|
3124
|
+
set_boolean_member(member_name: string, value: boolean): void
|
|
3117
3125
|
/**
|
|
3118
3126
|
* Convenience function for setting an object member with a floating point value.
|
|
3119
3127
|
*
|
|
@@ -3121,7 +3129,7 @@ interface Object {
|
|
|
3121
3129
|
* @param member_name the name of the member
|
|
3122
3130
|
* @param value the value of the member
|
|
3123
3131
|
*/
|
|
3124
|
-
set_double_member(member_name: string
|
|
3132
|
+
set_double_member(member_name: string, value: number): void
|
|
3125
3133
|
/**
|
|
3126
3134
|
* Convenience function for setting an object member with an integer value.
|
|
3127
3135
|
*
|
|
@@ -3129,7 +3137,7 @@ interface Object {
|
|
|
3129
3137
|
* @param member_name the name of the member
|
|
3130
3138
|
* @param value the value of the member
|
|
3131
3139
|
*/
|
|
3132
|
-
set_int_member(member_name: string
|
|
3140
|
+
set_int_member(member_name: string, value: number): void
|
|
3133
3141
|
/**
|
|
3134
3142
|
* Sets the value of a member inside an object.
|
|
3135
3143
|
*
|
|
@@ -3141,14 +3149,14 @@ interface Object {
|
|
|
3141
3149
|
* @param member_name the name of the member
|
|
3142
3150
|
* @param node the value of the member
|
|
3143
3151
|
*/
|
|
3144
|
-
set_member(member_name: string
|
|
3152
|
+
set_member(member_name: string, node: Node): void
|
|
3145
3153
|
/**
|
|
3146
3154
|
* Convenience function for setting an object member with a `null` value.
|
|
3147
3155
|
*
|
|
3148
3156
|
* See also: [method`Json`.Object.set_member], [method`Json`.Node.init_null]
|
|
3149
3157
|
* @param member_name the name of the member
|
|
3150
3158
|
*/
|
|
3151
|
-
set_null_member(member_name: string
|
|
3159
|
+
set_null_member(member_name: string): void
|
|
3152
3160
|
/**
|
|
3153
3161
|
* Convenience function for setting an object member with an object value.
|
|
3154
3162
|
*
|
|
@@ -3156,7 +3164,7 @@ interface Object {
|
|
|
3156
3164
|
* @param member_name the name of the member
|
|
3157
3165
|
* @param value the value of the member
|
|
3158
3166
|
*/
|
|
3159
|
-
set_object_member(member_name: string
|
|
3167
|
+
set_object_member(member_name: string, value: Object): void
|
|
3160
3168
|
/**
|
|
3161
3169
|
* Convenience function for setting an object member with a string value.
|
|
3162
3170
|
*
|
|
@@ -3164,7 +3172,7 @@ interface Object {
|
|
|
3164
3172
|
* @param member_name the name of the member
|
|
3165
3173
|
* @param value the value of the member
|
|
3166
3174
|
*/
|
|
3167
|
-
set_string_member(member_name: string
|
|
3175
|
+
set_string_member(member_name: string, value: string): void
|
|
3168
3176
|
/**
|
|
3169
3177
|
* Releases a reference on the given object.
|
|
3170
3178
|
*
|
|
@@ -3280,7 +3288,7 @@ interface ObjectIter {
|
|
|
3280
3288
|
* See also: [method`Json`.ObjectIter.next_ordered]
|
|
3281
3289
|
* @returns `TRUE` if @member_name and @member_node are valid; `FALSE` if there are no more members
|
|
3282
3290
|
*/
|
|
3283
|
-
next(): [ /* returnType */ boolean, /* member_name */ string
|
|
3291
|
+
next(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3284
3292
|
/**
|
|
3285
3293
|
* Advances the iterator and retrieves the next member in the object.
|
|
3286
3294
|
*
|
|
@@ -3298,7 +3306,7 @@ interface ObjectIter {
|
|
|
3298
3306
|
* See also: [method`Json`.ObjectIter.next]
|
|
3299
3307
|
* @returns `TRUE `if @member_name and @member_node are valid; `FALSE` if the end of the object has been reached
|
|
3300
3308
|
*/
|
|
3301
|
-
next_ordered(): [ /* returnType */ boolean, /* member_name */ string
|
|
3309
|
+
next_ordered(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3302
3310
|
}
|
|
3303
3311
|
|
|
3304
3312
|
/**
|
|
@@ -3327,7 +3335,7 @@ interface ParserClass {
|
|
|
3327
3335
|
|
|
3328
3336
|
parse_start: (parser: Parser) => void
|
|
3329
3337
|
object_start: (parser: Parser) => void
|
|
3330
|
-
object_member: (parser: Parser, object: Object, member_name: string
|
|
3338
|
+
object_member: (parser: Parser, object: Object, member_name: string) => void
|
|
3331
3339
|
object_end: (parser: Parser, object: Object) => void
|
|
3332
3340
|
array_start: (parser: Parser) => void
|
|
3333
3341
|
array_element: (parser: Parser, array: Array, index_: number) => void
|
|
@@ -3391,9 +3399,9 @@ interface SerializableIface {
|
|
|
3391
3399
|
|
|
3392
3400
|
// Own fields of Json-1.0.Json.SerializableIface
|
|
3393
3401
|
|
|
3394
|
-
serialize_property: (serializable: Serializable, property_name: string
|
|
3395
|
-
deserialize_property: (serializable: Serializable, property_name: string
|
|
3396
|
-
find_property: (serializable: Serializable, name: string
|
|
3402
|
+
serialize_property: (serializable: Serializable, property_name: string, value: any, pspec: GObject.ParamSpec) => Node
|
|
3403
|
+
deserialize_property: (serializable: Serializable, property_name: string, pspec: GObject.ParamSpec, property_node: Node) => [ /* returnType */ boolean, /* value */ any ]
|
|
3404
|
+
find_property: (serializable: Serializable, name: string) => GObject.ParamSpec | null
|
|
3397
3405
|
set_property: (serializable: Serializable, pspec: GObject.ParamSpec, value: any) => void
|
|
3398
3406
|
get_property: (serializable: Serializable, pspec: GObject.ParamSpec) => /* value */ any
|
|
3399
3407
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/json-1.0",
|
|
3
|
-
"version": "1.7.1-3.2.
|
|
3
|
+
"version": "1.7.1-3.2.7",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Json-1.0, generated from library version 1.7.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "json-1.0.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit json-1.0.d.cts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@girs/gio-2.0": "^2.78.0-3.2.
|
|
29
|
-
"@girs/gjs": "^3.2.
|
|
30
|
-
"@girs/glib-2.0": "^2.78.0-3.2.
|
|
31
|
-
"@girs/gobject-2.0": "^2.78.0-3.2.
|
|
28
|
+
"@girs/gio-2.0": "^2.78.0-3.2.7",
|
|
29
|
+
"@girs/gjs": "^3.2.7",
|
|
30
|
+
"@girs/glib-2.0": "^2.78.0-3.2.7",
|
|
31
|
+
"@girs/gobject-2.0": "^2.78.0-3.2.7"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "*"
|