@girs/json-1.0 1.7.1-3.2.6 → 1.7.1-3.2.8
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-ambient.js +2 -0
- package/json-1.0-import.js +3 -0
- package/json-1.0.d.cts +60 -68
- package/json-1.0.d.ts +60 -68
- package/package.json +14 -8
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.8.
|
|
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
|
|
|
@@ -984,7 +984,7 @@ export module Generator {
|
|
|
984
984
|
/**
|
|
985
985
|
* The character that should be used when indenting in pretty print.
|
|
986
986
|
*/
|
|
987
|
-
|
|
987
|
+
indentChar?: number | null
|
|
988
988
|
/**
|
|
989
989
|
* Whether the output should be "pretty-printed", with indentation and
|
|
990
990
|
* newlines.
|
|
@@ -998,10 +998,6 @@ 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
|
|
1005
1001
|
}
|
|
1006
1002
|
|
|
1007
1003
|
}
|
|
@@ -1014,10 +1010,6 @@ export interface Generator {
|
|
|
1014
1010
|
* Number of spaces to be used to indent when pretty printing.
|
|
1015
1011
|
*/
|
|
1016
1012
|
indent: number
|
|
1017
|
-
/**
|
|
1018
|
-
* The character that should be used when indenting in pretty print.
|
|
1019
|
-
*/
|
|
1020
|
-
indent_char: number
|
|
1021
1013
|
/**
|
|
1022
1014
|
* The character that should be used when indenting in pretty print.
|
|
1023
1015
|
*/
|
|
@@ -1318,7 +1310,7 @@ export interface Parser {
|
|
|
1318
1310
|
* used.
|
|
1319
1311
|
* @returns `TRUE` if there was an assignment, and `FALSE` otherwise
|
|
1320
1312
|
*/
|
|
1321
|
-
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string
|
|
1313
|
+
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string ]
|
|
1322
1314
|
/**
|
|
1323
1315
|
* Loads a JSON stream from a buffer and parses it.
|
|
1324
1316
|
*
|
|
@@ -1328,7 +1320,7 @@ export interface Parser {
|
|
|
1328
1320
|
* @param length the length of the buffer, or -1 if it is `NUL` terminated
|
|
1329
1321
|
* @returns `TRUE` if the buffer was succesfully parsed
|
|
1330
1322
|
*/
|
|
1331
|
-
load_from_data(data: string
|
|
1323
|
+
load_from_data(data: string, length: number): boolean
|
|
1332
1324
|
/**
|
|
1333
1325
|
* Loads a JSON stream from the content of `filename` and parses it.
|
|
1334
1326
|
*
|
|
@@ -1421,7 +1413,7 @@ export interface Parser {
|
|
|
1421
1413
|
vfunc_array_start(): void
|
|
1422
1414
|
vfunc_error(error: GLib.Error): void
|
|
1423
1415
|
vfunc_object_end(object: Object): void
|
|
1424
|
-
vfunc_object_member(object: Object, member_name: string
|
|
1416
|
+
vfunc_object_member(object: Object, member_name: string): void
|
|
1425
1417
|
vfunc_object_start(): void
|
|
1426
1418
|
vfunc_parse_end(): void
|
|
1427
1419
|
vfunc_parse_start(): void
|
|
@@ -1565,7 +1557,7 @@ export interface Path {
|
|
|
1565
1557
|
* @param expression a JSONPath expression
|
|
1566
1558
|
* @returns `TRUE` if the compilation was successful, and `FALSE` otherwise
|
|
1567
1559
|
*/
|
|
1568
|
-
compile(expression: string
|
|
1560
|
+
compile(expression: string): boolean
|
|
1569
1561
|
/**
|
|
1570
1562
|
* Matches the JSON tree pointed by `root` using the expression compiled
|
|
1571
1563
|
* into the `JsonPath`.
|
|
@@ -1754,7 +1746,7 @@ export class Path extends GObject.Object {
|
|
|
1754
1746
|
* @param root the root of a JSON tree
|
|
1755
1747
|
* @returns a newly-created node of type `JSON_NODE_ARRAY` containing the array of matching nodes
|
|
1756
1748
|
*/
|
|
1757
|
-
static query(expression: string
|
|
1749
|
+
static query(expression: string, root: Node): Node
|
|
1758
1750
|
}
|
|
1759
1751
|
|
|
1760
1752
|
export module Reader {
|
|
@@ -1865,7 +1857,7 @@ export interface Reader {
|
|
|
1865
1857
|
* See also: [method`Json`.Reader.get_value]
|
|
1866
1858
|
* @returns the string value
|
|
1867
1859
|
*/
|
|
1868
|
-
get_string_value(): string
|
|
1860
|
+
get_string_value(): string
|
|
1869
1861
|
/**
|
|
1870
1862
|
* Retrieves the value node at the current position of the reader.
|
|
1871
1863
|
*
|
|
@@ -2002,7 +1994,7 @@ export interface Reader {
|
|
|
2002
1994
|
* @param member_name the name of the member to read
|
|
2003
1995
|
* @returns `TRUE` on success, and `FALSE` otherwise
|
|
2004
1996
|
*/
|
|
2005
|
-
read_member(member_name: string
|
|
1997
|
+
read_member(member_name: string): boolean
|
|
2006
1998
|
/**
|
|
2007
1999
|
* Sets the root node of the JSON tree to be read by `reader`.
|
|
2008
2000
|
*
|
|
@@ -2177,7 +2169,7 @@ export interface Array {
|
|
|
2177
2169
|
* See also: [method`Json`.Array.add_element], [method`Json`.Node.set_string]
|
|
2178
2170
|
* @param value the string value to add
|
|
2179
2171
|
*/
|
|
2180
|
-
add_string_element(value: string
|
|
2172
|
+
add_string_element(value: string): void
|
|
2181
2173
|
/**
|
|
2182
2174
|
* Retrieves a copy of the element at the given position in the array.
|
|
2183
2175
|
* @param index_ the index of the element to retrieve
|
|
@@ -2281,7 +2273,7 @@ export interface Array {
|
|
|
2281
2273
|
* @param index_ the index of the element to retrieve
|
|
2282
2274
|
* @returns the string value
|
|
2283
2275
|
*/
|
|
2284
|
-
get_string_element(index_: number): string
|
|
2276
|
+
get_string_element(index_: number): string
|
|
2285
2277
|
/**
|
|
2286
2278
|
* Calculates a hash value for the given `key`.
|
|
2287
2279
|
*
|
|
@@ -2739,7 +2731,7 @@ export interface Node {
|
|
|
2739
2731
|
* a value node.
|
|
2740
2732
|
* @param value a string value
|
|
2741
2733
|
*/
|
|
2742
|
-
set_string(value: string
|
|
2734
|
+
set_string(value: string): void
|
|
2743
2735
|
/**
|
|
2744
2736
|
* Sets a scalar value inside the given node.
|
|
2745
2737
|
*
|
|
@@ -2789,7 +2781,7 @@ export interface Node {
|
|
|
2789
2781
|
* guarantee the name will stay the same across different versions.
|
|
2790
2782
|
* @returns a string containing the name of the type
|
|
2791
2783
|
*/
|
|
2792
|
-
type_name(): string
|
|
2784
|
+
type_name(): string
|
|
2793
2785
|
/**
|
|
2794
2786
|
* Decrements the reference count of `node`.
|
|
2795
2787
|
*
|
|
@@ -2892,13 +2884,13 @@ export interface Object {
|
|
|
2892
2884
|
* @param member_name the name of the member
|
|
2893
2885
|
* @param node the value of the member
|
|
2894
2886
|
*/
|
|
2895
|
-
add_member(member_name: string
|
|
2887
|
+
add_member(member_name: string, node: Node): void
|
|
2896
2888
|
/**
|
|
2897
2889
|
* Retrieves a copy of the value of the given member inside an object.
|
|
2898
2890
|
* @param member_name the name of the JSON object member to access
|
|
2899
2891
|
* @returns a copy of the value for the requested object member
|
|
2900
2892
|
*/
|
|
2901
|
-
dup_member(member_name: string
|
|
2893
|
+
dup_member(member_name: string): Node | null
|
|
2902
2894
|
/**
|
|
2903
2895
|
* Check whether `a` and `b` are equal objects, meaning they have the same
|
|
2904
2896
|
* set of members, and the values of corresponding members are equal.
|
|
@@ -2930,7 +2922,7 @@ export interface Object {
|
|
|
2930
2922
|
* @param member_name the name of the member
|
|
2931
2923
|
* @returns the array inside the object's member
|
|
2932
2924
|
*/
|
|
2933
|
-
get_array_member(member_name: string
|
|
2925
|
+
get_array_member(member_name: string): Array | null
|
|
2934
2926
|
/**
|
|
2935
2927
|
* Convenience function that retrieves the boolean value
|
|
2936
2928
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2941,7 +2933,7 @@ export interface Object {
|
|
|
2941
2933
|
* @param member_name the name of the member
|
|
2942
2934
|
* @returns the boolean value of the object's member
|
|
2943
2935
|
*/
|
|
2944
|
-
get_boolean_member(member_name: string
|
|
2936
|
+
get_boolean_member(member_name: string): boolean
|
|
2945
2937
|
/**
|
|
2946
2938
|
* Convenience function that retrieves the boolean value
|
|
2947
2939
|
* stored in `member_name` of `object`.
|
|
@@ -2952,7 +2944,7 @@ export interface Object {
|
|
|
2952
2944
|
* @param default_value the value to return if `member_name` is not valid
|
|
2953
2945
|
* @returns the boolean value of the object's member, or the given default
|
|
2954
2946
|
*/
|
|
2955
|
-
get_boolean_member_with_default(member_name: string
|
|
2947
|
+
get_boolean_member_with_default(member_name: string, default_value: boolean): boolean
|
|
2956
2948
|
/**
|
|
2957
2949
|
* Convenience function that retrieves the floating point value
|
|
2958
2950
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2963,7 +2955,7 @@ export interface Object {
|
|
|
2963
2955
|
* @param member_name the name of the member
|
|
2964
2956
|
* @returns the floating point value of the object's member
|
|
2965
2957
|
*/
|
|
2966
|
-
get_double_member(member_name: string
|
|
2958
|
+
get_double_member(member_name: string): number
|
|
2967
2959
|
/**
|
|
2968
2960
|
* Convenience function that retrieves the floating point value
|
|
2969
2961
|
* stored in `member_name` of `object`.
|
|
@@ -2974,7 +2966,7 @@ export interface Object {
|
|
|
2974
2966
|
* @param default_value the value to return if `member_name` is not valid
|
|
2975
2967
|
* @returns the floating point value of the object's member, or the given default
|
|
2976
2968
|
*/
|
|
2977
|
-
get_double_member_with_default(member_name: string
|
|
2969
|
+
get_double_member_with_default(member_name: string, default_value: number): number
|
|
2978
2970
|
/**
|
|
2979
2971
|
* Convenience function that retrieves the integer value
|
|
2980
2972
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2985,7 +2977,7 @@ export interface Object {
|
|
|
2985
2977
|
* @param member_name the name of the object member
|
|
2986
2978
|
* @returns the integer value of the object's member
|
|
2987
2979
|
*/
|
|
2988
|
-
get_int_member(member_name: string
|
|
2980
|
+
get_int_member(member_name: string): number
|
|
2989
2981
|
/**
|
|
2990
2982
|
* Convenience function that retrieves the integer value
|
|
2991
2983
|
* stored in `member_name` of `object`.
|
|
@@ -2996,13 +2988,13 @@ export interface Object {
|
|
|
2996
2988
|
* @param default_value the value to return if `member_name` is not valid
|
|
2997
2989
|
* @returns the integer value of the object's member, or the given default
|
|
2998
2990
|
*/
|
|
2999
|
-
get_int_member_with_default(member_name: string
|
|
2991
|
+
get_int_member_with_default(member_name: string, default_value: number): number
|
|
3000
2992
|
/**
|
|
3001
2993
|
* Retrieves the value of the given member inside an object.
|
|
3002
2994
|
* @param member_name the name of the JSON object member to access
|
|
3003
2995
|
* @returns the value for the requested object member
|
|
3004
2996
|
*/
|
|
3005
|
-
get_member(member_name: string
|
|
2997
|
+
get_member(member_name: string): Node | null
|
|
3006
2998
|
/**
|
|
3007
2999
|
* Retrieves all the names of the members of an object.
|
|
3008
3000
|
*
|
|
@@ -3020,7 +3012,7 @@ export interface Object {
|
|
|
3020
3012
|
* @param member_name the name of the member
|
|
3021
3013
|
* @returns `TRUE` if the value is `null`
|
|
3022
3014
|
*/
|
|
3023
|
-
get_null_member(member_name: string
|
|
3015
|
+
get_null_member(member_name: string): boolean
|
|
3024
3016
|
/**
|
|
3025
3017
|
* Convenience function that retrieves the object
|
|
3026
3018
|
* stored in `member_name` of `object`. It is an error to specify a `member_name`
|
|
@@ -3032,7 +3024,7 @@ export interface Object {
|
|
|
3032
3024
|
* @param member_name the name of the member
|
|
3033
3025
|
* @returns the object inside the object's member
|
|
3034
3026
|
*/
|
|
3035
|
-
get_object_member(member_name: string
|
|
3027
|
+
get_object_member(member_name: string): Object | null
|
|
3036
3028
|
/**
|
|
3037
3029
|
* Retrieves the number of members of a JSON object.
|
|
3038
3030
|
* @returns the number of members
|
|
@@ -3048,7 +3040,7 @@ export interface Object {
|
|
|
3048
3040
|
* @param member_name the name of the member
|
|
3049
3041
|
* @returns the string value of the object's member
|
|
3050
3042
|
*/
|
|
3051
|
-
get_string_member(member_name: string
|
|
3043
|
+
get_string_member(member_name: string): string
|
|
3052
3044
|
/**
|
|
3053
3045
|
* Convenience function that retrieves the string value
|
|
3054
3046
|
* stored in `member_name` of `object`.
|
|
@@ -3059,7 +3051,7 @@ export interface Object {
|
|
|
3059
3051
|
* @param default_value the value to return if `member_name` is not valid
|
|
3060
3052
|
* @returns the string value of the object's member, or the given default
|
|
3061
3053
|
*/
|
|
3062
|
-
get_string_member_with_default(member_name: string
|
|
3054
|
+
get_string_member_with_default(member_name: string, default_value: string): string
|
|
3063
3055
|
/**
|
|
3064
3056
|
* Retrieves all the values of the members of an object.
|
|
3065
3057
|
* @returns the member values of the object
|
|
@@ -3070,7 +3062,7 @@ export interface Object {
|
|
|
3070
3062
|
* @param member_name the name of a JSON object member
|
|
3071
3063
|
* @returns `TRUE` if the JSON object has the requested member
|
|
3072
3064
|
*/
|
|
3073
|
-
has_member(member_name: string
|
|
3065
|
+
has_member(member_name: string): boolean
|
|
3074
3066
|
/**
|
|
3075
3067
|
* Calculate a hash value for the given `key` (a JSON object).
|
|
3076
3068
|
*
|
|
@@ -3095,7 +3087,7 @@ export interface Object {
|
|
|
3095
3087
|
* Removes `member_name` from `object,` freeing its allocated resources.
|
|
3096
3088
|
* @param member_name the name of the member to remove
|
|
3097
3089
|
*/
|
|
3098
|
-
remove_member(member_name: string
|
|
3090
|
+
remove_member(member_name: string): void
|
|
3099
3091
|
/**
|
|
3100
3092
|
* Seals the object, making it immutable to further changes.
|
|
3101
3093
|
*
|
|
@@ -3111,7 +3103,7 @@ export interface Object {
|
|
|
3111
3103
|
* @param member_name the name of the member
|
|
3112
3104
|
* @param value the value of the member
|
|
3113
3105
|
*/
|
|
3114
|
-
set_array_member(member_name: string
|
|
3106
|
+
set_array_member(member_name: string, value: Array): void
|
|
3115
3107
|
/**
|
|
3116
3108
|
* Convenience function for setting an object member with a boolean value.
|
|
3117
3109
|
*
|
|
@@ -3119,7 +3111,7 @@ export interface Object {
|
|
|
3119
3111
|
* @param member_name the name of the member
|
|
3120
3112
|
* @param value the value of the member
|
|
3121
3113
|
*/
|
|
3122
|
-
set_boolean_member(member_name: string
|
|
3114
|
+
set_boolean_member(member_name: string, value: boolean): void
|
|
3123
3115
|
/**
|
|
3124
3116
|
* Convenience function for setting an object member with a floating point value.
|
|
3125
3117
|
*
|
|
@@ -3127,7 +3119,7 @@ export interface Object {
|
|
|
3127
3119
|
* @param member_name the name of the member
|
|
3128
3120
|
* @param value the value of the member
|
|
3129
3121
|
*/
|
|
3130
|
-
set_double_member(member_name: string
|
|
3122
|
+
set_double_member(member_name: string, value: number): void
|
|
3131
3123
|
/**
|
|
3132
3124
|
* Convenience function for setting an object member with an integer value.
|
|
3133
3125
|
*
|
|
@@ -3135,7 +3127,7 @@ export interface Object {
|
|
|
3135
3127
|
* @param member_name the name of the member
|
|
3136
3128
|
* @param value the value of the member
|
|
3137
3129
|
*/
|
|
3138
|
-
set_int_member(member_name: string
|
|
3130
|
+
set_int_member(member_name: string, value: number): void
|
|
3139
3131
|
/**
|
|
3140
3132
|
* Sets the value of a member inside an object.
|
|
3141
3133
|
*
|
|
@@ -3147,14 +3139,14 @@ export interface Object {
|
|
|
3147
3139
|
* @param member_name the name of the member
|
|
3148
3140
|
* @param node the value of the member
|
|
3149
3141
|
*/
|
|
3150
|
-
set_member(member_name: string
|
|
3142
|
+
set_member(member_name: string, node: Node): void
|
|
3151
3143
|
/**
|
|
3152
3144
|
* Convenience function for setting an object member with a `null` value.
|
|
3153
3145
|
*
|
|
3154
3146
|
* See also: [method`Json`.Object.set_member], [method`Json`.Node.init_null]
|
|
3155
3147
|
* @param member_name the name of the member
|
|
3156
3148
|
*/
|
|
3157
|
-
set_null_member(member_name: string
|
|
3149
|
+
set_null_member(member_name: string): void
|
|
3158
3150
|
/**
|
|
3159
3151
|
* Convenience function for setting an object member with an object value.
|
|
3160
3152
|
*
|
|
@@ -3162,7 +3154,7 @@ export interface Object {
|
|
|
3162
3154
|
* @param member_name the name of the member
|
|
3163
3155
|
* @param value the value of the member
|
|
3164
3156
|
*/
|
|
3165
|
-
set_object_member(member_name: string
|
|
3157
|
+
set_object_member(member_name: string, value: Object): void
|
|
3166
3158
|
/**
|
|
3167
3159
|
* Convenience function for setting an object member with a string value.
|
|
3168
3160
|
*
|
|
@@ -3170,7 +3162,7 @@ export interface Object {
|
|
|
3170
3162
|
* @param member_name the name of the member
|
|
3171
3163
|
* @param value the value of the member
|
|
3172
3164
|
*/
|
|
3173
|
-
set_string_member(member_name: string
|
|
3165
|
+
set_string_member(member_name: string, value: string): void
|
|
3174
3166
|
/**
|
|
3175
3167
|
* Releases a reference on the given object.
|
|
3176
3168
|
*
|
|
@@ -3286,7 +3278,7 @@ export interface ObjectIter {
|
|
|
3286
3278
|
* See also: [method`Json`.ObjectIter.next_ordered]
|
|
3287
3279
|
* @returns `TRUE` if @member_name and @member_node are valid; `FALSE` if there are no more members
|
|
3288
3280
|
*/
|
|
3289
|
-
next(): [ /* returnType */ boolean, /* member_name */ string
|
|
3281
|
+
next(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3290
3282
|
/**
|
|
3291
3283
|
* Advances the iterator and retrieves the next member in the object.
|
|
3292
3284
|
*
|
|
@@ -3304,7 +3296,7 @@ export interface ObjectIter {
|
|
|
3304
3296
|
* See also: [method`Json`.ObjectIter.next]
|
|
3305
3297
|
* @returns `TRUE `if @member_name and @member_node are valid; `FALSE` if the end of the object has been reached
|
|
3306
3298
|
*/
|
|
3307
|
-
next_ordered(): [ /* returnType */ boolean, /* member_name */ string
|
|
3299
|
+
next_ordered(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3308
3300
|
}
|
|
3309
3301
|
|
|
3310
3302
|
/**
|
|
@@ -3333,7 +3325,7 @@ export interface ParserClass {
|
|
|
3333
3325
|
|
|
3334
3326
|
parse_start: (parser: Parser) => void
|
|
3335
3327
|
object_start: (parser: Parser) => void
|
|
3336
|
-
object_member: (parser: Parser, object: Object, member_name: string
|
|
3328
|
+
object_member: (parser: Parser, object: Object, member_name: string) => void
|
|
3337
3329
|
object_end: (parser: Parser, object: Object) => void
|
|
3338
3330
|
array_start: (parser: Parser) => void
|
|
3339
3331
|
array_element: (parser: Parser, array: Array, index_: number) => void
|
|
@@ -3397,9 +3389,9 @@ export interface SerializableIface {
|
|
|
3397
3389
|
|
|
3398
3390
|
// Own fields of Json-1.0.Json.SerializableIface
|
|
3399
3391
|
|
|
3400
|
-
serialize_property: (serializable: Serializable, property_name: string
|
|
3401
|
-
deserialize_property: (serializable: Serializable, property_name: string
|
|
3402
|
-
find_property: (serializable: Serializable, name: string
|
|
3392
|
+
serialize_property: (serializable: Serializable, property_name: string, value: any, pspec: GObject.ParamSpec) => Node
|
|
3393
|
+
deserialize_property: (serializable: Serializable, property_name: string, pspec: GObject.ParamSpec, property_node: Node) => [ /* returnType */ boolean, /* value */ any ]
|
|
3394
|
+
find_property: (serializable: Serializable, name: string) => GObject.ParamSpec | null
|
|
3403
3395
|
set_property: (serializable: Serializable, pspec: GObject.ParamSpec, value: any) => void
|
|
3404
3396
|
get_property: (serializable: Serializable, pspec: GObject.ParamSpec) => /* value */ any
|
|
3405
3397
|
}
|
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
|
|
|
@@ -986,7 +986,7 @@ module Generator {
|
|
|
986
986
|
/**
|
|
987
987
|
* The character that should be used when indenting in pretty print.
|
|
988
988
|
*/
|
|
989
|
-
|
|
989
|
+
indentChar?: number | null
|
|
990
990
|
/**
|
|
991
991
|
* Whether the output should be "pretty-printed", with indentation and
|
|
992
992
|
* newlines.
|
|
@@ -1000,10 +1000,6 @@ 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
|
|
1007
1003
|
}
|
|
1008
1004
|
|
|
1009
1005
|
}
|
|
@@ -1016,10 +1012,6 @@ interface Generator {
|
|
|
1016
1012
|
* Number of spaces to be used to indent when pretty printing.
|
|
1017
1013
|
*/
|
|
1018
1014
|
indent: number
|
|
1019
|
-
/**
|
|
1020
|
-
* The character that should be used when indenting in pretty print.
|
|
1021
|
-
*/
|
|
1022
|
-
indent_char: number
|
|
1023
1015
|
/**
|
|
1024
1016
|
* The character that should be used when indenting in pretty print.
|
|
1025
1017
|
*/
|
|
@@ -1320,7 +1312,7 @@ interface Parser {
|
|
|
1320
1312
|
* used.
|
|
1321
1313
|
* @returns `TRUE` if there was an assignment, and `FALSE` otherwise
|
|
1322
1314
|
*/
|
|
1323
|
-
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string
|
|
1315
|
+
has_assignment(): [ /* returnType */ boolean, /* variable_name */ string ]
|
|
1324
1316
|
/**
|
|
1325
1317
|
* Loads a JSON stream from a buffer and parses it.
|
|
1326
1318
|
*
|
|
@@ -1330,7 +1322,7 @@ interface Parser {
|
|
|
1330
1322
|
* @param length the length of the buffer, or -1 if it is `NUL` terminated
|
|
1331
1323
|
* @returns `TRUE` if the buffer was succesfully parsed
|
|
1332
1324
|
*/
|
|
1333
|
-
load_from_data(data: string
|
|
1325
|
+
load_from_data(data: string, length: number): boolean
|
|
1334
1326
|
/**
|
|
1335
1327
|
* Loads a JSON stream from the content of `filename` and parses it.
|
|
1336
1328
|
*
|
|
@@ -1423,7 +1415,7 @@ interface Parser {
|
|
|
1423
1415
|
vfunc_array_start(): void
|
|
1424
1416
|
vfunc_error(error: GLib.Error): void
|
|
1425
1417
|
vfunc_object_end(object: Object): void
|
|
1426
|
-
vfunc_object_member(object: Object, member_name: string
|
|
1418
|
+
vfunc_object_member(object: Object, member_name: string): void
|
|
1427
1419
|
vfunc_object_start(): void
|
|
1428
1420
|
vfunc_parse_end(): void
|
|
1429
1421
|
vfunc_parse_start(): void
|
|
@@ -1567,7 +1559,7 @@ interface Path {
|
|
|
1567
1559
|
* @param expression a JSONPath expression
|
|
1568
1560
|
* @returns `TRUE` if the compilation was successful, and `FALSE` otherwise
|
|
1569
1561
|
*/
|
|
1570
|
-
compile(expression: string
|
|
1562
|
+
compile(expression: string): boolean
|
|
1571
1563
|
/**
|
|
1572
1564
|
* Matches the JSON tree pointed by `root` using the expression compiled
|
|
1573
1565
|
* into the `JsonPath`.
|
|
@@ -1756,7 +1748,7 @@ class Path extends GObject.Object {
|
|
|
1756
1748
|
* @param root the root of a JSON tree
|
|
1757
1749
|
* @returns a newly-created node of type `JSON_NODE_ARRAY` containing the array of matching nodes
|
|
1758
1750
|
*/
|
|
1759
|
-
static query(expression: string
|
|
1751
|
+
static query(expression: string, root: Node): Node
|
|
1760
1752
|
}
|
|
1761
1753
|
|
|
1762
1754
|
module Reader {
|
|
@@ -1867,7 +1859,7 @@ interface Reader {
|
|
|
1867
1859
|
* See also: [method`Json`.Reader.get_value]
|
|
1868
1860
|
* @returns the string value
|
|
1869
1861
|
*/
|
|
1870
|
-
get_string_value(): string
|
|
1862
|
+
get_string_value(): string
|
|
1871
1863
|
/**
|
|
1872
1864
|
* Retrieves the value node at the current position of the reader.
|
|
1873
1865
|
*
|
|
@@ -2004,7 +1996,7 @@ interface Reader {
|
|
|
2004
1996
|
* @param member_name the name of the member to read
|
|
2005
1997
|
* @returns `TRUE` on success, and `FALSE` otherwise
|
|
2006
1998
|
*/
|
|
2007
|
-
read_member(member_name: string
|
|
1999
|
+
read_member(member_name: string): boolean
|
|
2008
2000
|
/**
|
|
2009
2001
|
* Sets the root node of the JSON tree to be read by `reader`.
|
|
2010
2002
|
*
|
|
@@ -2179,7 +2171,7 @@ interface Array {
|
|
|
2179
2171
|
* See also: [method`Json`.Array.add_element], [method`Json`.Node.set_string]
|
|
2180
2172
|
* @param value the string value to add
|
|
2181
2173
|
*/
|
|
2182
|
-
add_string_element(value: string
|
|
2174
|
+
add_string_element(value: string): void
|
|
2183
2175
|
/**
|
|
2184
2176
|
* Retrieves a copy of the element at the given position in the array.
|
|
2185
2177
|
* @param index_ the index of the element to retrieve
|
|
@@ -2283,7 +2275,7 @@ interface Array {
|
|
|
2283
2275
|
* @param index_ the index of the element to retrieve
|
|
2284
2276
|
* @returns the string value
|
|
2285
2277
|
*/
|
|
2286
|
-
get_string_element(index_: number): string
|
|
2278
|
+
get_string_element(index_: number): string
|
|
2287
2279
|
/**
|
|
2288
2280
|
* Calculates a hash value for the given `key`.
|
|
2289
2281
|
*
|
|
@@ -2741,7 +2733,7 @@ interface Node {
|
|
|
2741
2733
|
* a value node.
|
|
2742
2734
|
* @param value a string value
|
|
2743
2735
|
*/
|
|
2744
|
-
set_string(value: string
|
|
2736
|
+
set_string(value: string): void
|
|
2745
2737
|
/**
|
|
2746
2738
|
* Sets a scalar value inside the given node.
|
|
2747
2739
|
*
|
|
@@ -2791,7 +2783,7 @@ interface Node {
|
|
|
2791
2783
|
* guarantee the name will stay the same across different versions.
|
|
2792
2784
|
* @returns a string containing the name of the type
|
|
2793
2785
|
*/
|
|
2794
|
-
type_name(): string
|
|
2786
|
+
type_name(): string
|
|
2795
2787
|
/**
|
|
2796
2788
|
* Decrements the reference count of `node`.
|
|
2797
2789
|
*
|
|
@@ -2894,13 +2886,13 @@ interface Object {
|
|
|
2894
2886
|
* @param member_name the name of the member
|
|
2895
2887
|
* @param node the value of the member
|
|
2896
2888
|
*/
|
|
2897
|
-
add_member(member_name: string
|
|
2889
|
+
add_member(member_name: string, node: Node): void
|
|
2898
2890
|
/**
|
|
2899
2891
|
* Retrieves a copy of the value of the given member inside an object.
|
|
2900
2892
|
* @param member_name the name of the JSON object member to access
|
|
2901
2893
|
* @returns a copy of the value for the requested object member
|
|
2902
2894
|
*/
|
|
2903
|
-
dup_member(member_name: string
|
|
2895
|
+
dup_member(member_name: string): Node | null
|
|
2904
2896
|
/**
|
|
2905
2897
|
* Check whether `a` and `b` are equal objects, meaning they have the same
|
|
2906
2898
|
* set of members, and the values of corresponding members are equal.
|
|
@@ -2932,7 +2924,7 @@ interface Object {
|
|
|
2932
2924
|
* @param member_name the name of the member
|
|
2933
2925
|
* @returns the array inside the object's member
|
|
2934
2926
|
*/
|
|
2935
|
-
get_array_member(member_name: string
|
|
2927
|
+
get_array_member(member_name: string): Array | null
|
|
2936
2928
|
/**
|
|
2937
2929
|
* Convenience function that retrieves the boolean value
|
|
2938
2930
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2943,7 +2935,7 @@ interface Object {
|
|
|
2943
2935
|
* @param member_name the name of the member
|
|
2944
2936
|
* @returns the boolean value of the object's member
|
|
2945
2937
|
*/
|
|
2946
|
-
get_boolean_member(member_name: string
|
|
2938
|
+
get_boolean_member(member_name: string): boolean
|
|
2947
2939
|
/**
|
|
2948
2940
|
* Convenience function that retrieves the boolean value
|
|
2949
2941
|
* stored in `member_name` of `object`.
|
|
@@ -2954,7 +2946,7 @@ interface Object {
|
|
|
2954
2946
|
* @param default_value the value to return if `member_name` is not valid
|
|
2955
2947
|
* @returns the boolean value of the object's member, or the given default
|
|
2956
2948
|
*/
|
|
2957
|
-
get_boolean_member_with_default(member_name: string
|
|
2949
|
+
get_boolean_member_with_default(member_name: string, default_value: boolean): boolean
|
|
2958
2950
|
/**
|
|
2959
2951
|
* Convenience function that retrieves the floating point value
|
|
2960
2952
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2965,7 +2957,7 @@ interface Object {
|
|
|
2965
2957
|
* @param member_name the name of the member
|
|
2966
2958
|
* @returns the floating point value of the object's member
|
|
2967
2959
|
*/
|
|
2968
|
-
get_double_member(member_name: string
|
|
2960
|
+
get_double_member(member_name: string): number
|
|
2969
2961
|
/**
|
|
2970
2962
|
* Convenience function that retrieves the floating point value
|
|
2971
2963
|
* stored in `member_name` of `object`.
|
|
@@ -2976,7 +2968,7 @@ interface Object {
|
|
|
2976
2968
|
* @param default_value the value to return if `member_name` is not valid
|
|
2977
2969
|
* @returns the floating point value of the object's member, or the given default
|
|
2978
2970
|
*/
|
|
2979
|
-
get_double_member_with_default(member_name: string
|
|
2971
|
+
get_double_member_with_default(member_name: string, default_value: number): number
|
|
2980
2972
|
/**
|
|
2981
2973
|
* Convenience function that retrieves the integer value
|
|
2982
2974
|
* stored in `member_name` of `object`. It is an error to specify a
|
|
@@ -2987,7 +2979,7 @@ interface Object {
|
|
|
2987
2979
|
* @param member_name the name of the object member
|
|
2988
2980
|
* @returns the integer value of the object's member
|
|
2989
2981
|
*/
|
|
2990
|
-
get_int_member(member_name: string
|
|
2982
|
+
get_int_member(member_name: string): number
|
|
2991
2983
|
/**
|
|
2992
2984
|
* Convenience function that retrieves the integer value
|
|
2993
2985
|
* stored in `member_name` of `object`.
|
|
@@ -2998,13 +2990,13 @@ interface Object {
|
|
|
2998
2990
|
* @param default_value the value to return if `member_name` is not valid
|
|
2999
2991
|
* @returns the integer value of the object's member, or the given default
|
|
3000
2992
|
*/
|
|
3001
|
-
get_int_member_with_default(member_name: string
|
|
2993
|
+
get_int_member_with_default(member_name: string, default_value: number): number
|
|
3002
2994
|
/**
|
|
3003
2995
|
* Retrieves the value of the given member inside an object.
|
|
3004
2996
|
* @param member_name the name of the JSON object member to access
|
|
3005
2997
|
* @returns the value for the requested object member
|
|
3006
2998
|
*/
|
|
3007
|
-
get_member(member_name: string
|
|
2999
|
+
get_member(member_name: string): Node | null
|
|
3008
3000
|
/**
|
|
3009
3001
|
* Retrieves all the names of the members of an object.
|
|
3010
3002
|
*
|
|
@@ -3022,7 +3014,7 @@ interface Object {
|
|
|
3022
3014
|
* @param member_name the name of the member
|
|
3023
3015
|
* @returns `TRUE` if the value is `null`
|
|
3024
3016
|
*/
|
|
3025
|
-
get_null_member(member_name: string
|
|
3017
|
+
get_null_member(member_name: string): boolean
|
|
3026
3018
|
/**
|
|
3027
3019
|
* Convenience function that retrieves the object
|
|
3028
3020
|
* stored in `member_name` of `object`. It is an error to specify a `member_name`
|
|
@@ -3034,7 +3026,7 @@ interface Object {
|
|
|
3034
3026
|
* @param member_name the name of the member
|
|
3035
3027
|
* @returns the object inside the object's member
|
|
3036
3028
|
*/
|
|
3037
|
-
get_object_member(member_name: string
|
|
3029
|
+
get_object_member(member_name: string): Object | null
|
|
3038
3030
|
/**
|
|
3039
3031
|
* Retrieves the number of members of a JSON object.
|
|
3040
3032
|
* @returns the number of members
|
|
@@ -3050,7 +3042,7 @@ interface Object {
|
|
|
3050
3042
|
* @param member_name the name of the member
|
|
3051
3043
|
* @returns the string value of the object's member
|
|
3052
3044
|
*/
|
|
3053
|
-
get_string_member(member_name: string
|
|
3045
|
+
get_string_member(member_name: string): string
|
|
3054
3046
|
/**
|
|
3055
3047
|
* Convenience function that retrieves the string value
|
|
3056
3048
|
* stored in `member_name` of `object`.
|
|
@@ -3061,7 +3053,7 @@ interface Object {
|
|
|
3061
3053
|
* @param default_value the value to return if `member_name` is not valid
|
|
3062
3054
|
* @returns the string value of the object's member, or the given default
|
|
3063
3055
|
*/
|
|
3064
|
-
get_string_member_with_default(member_name: string
|
|
3056
|
+
get_string_member_with_default(member_name: string, default_value: string): string
|
|
3065
3057
|
/**
|
|
3066
3058
|
* Retrieves all the values of the members of an object.
|
|
3067
3059
|
* @returns the member values of the object
|
|
@@ -3072,7 +3064,7 @@ interface Object {
|
|
|
3072
3064
|
* @param member_name the name of a JSON object member
|
|
3073
3065
|
* @returns `TRUE` if the JSON object has the requested member
|
|
3074
3066
|
*/
|
|
3075
|
-
has_member(member_name: string
|
|
3067
|
+
has_member(member_name: string): boolean
|
|
3076
3068
|
/**
|
|
3077
3069
|
* Calculate a hash value for the given `key` (a JSON object).
|
|
3078
3070
|
*
|
|
@@ -3097,7 +3089,7 @@ interface Object {
|
|
|
3097
3089
|
* Removes `member_name` from `object,` freeing its allocated resources.
|
|
3098
3090
|
* @param member_name the name of the member to remove
|
|
3099
3091
|
*/
|
|
3100
|
-
remove_member(member_name: string
|
|
3092
|
+
remove_member(member_name: string): void
|
|
3101
3093
|
/**
|
|
3102
3094
|
* Seals the object, making it immutable to further changes.
|
|
3103
3095
|
*
|
|
@@ -3113,7 +3105,7 @@ interface Object {
|
|
|
3113
3105
|
* @param member_name the name of the member
|
|
3114
3106
|
* @param value the value of the member
|
|
3115
3107
|
*/
|
|
3116
|
-
set_array_member(member_name: string
|
|
3108
|
+
set_array_member(member_name: string, value: Array): void
|
|
3117
3109
|
/**
|
|
3118
3110
|
* Convenience function for setting an object member with a boolean value.
|
|
3119
3111
|
*
|
|
@@ -3121,7 +3113,7 @@ interface Object {
|
|
|
3121
3113
|
* @param member_name the name of the member
|
|
3122
3114
|
* @param value the value of the member
|
|
3123
3115
|
*/
|
|
3124
|
-
set_boolean_member(member_name: string
|
|
3116
|
+
set_boolean_member(member_name: string, value: boolean): void
|
|
3125
3117
|
/**
|
|
3126
3118
|
* Convenience function for setting an object member with a floating point value.
|
|
3127
3119
|
*
|
|
@@ -3129,7 +3121,7 @@ interface Object {
|
|
|
3129
3121
|
* @param member_name the name of the member
|
|
3130
3122
|
* @param value the value of the member
|
|
3131
3123
|
*/
|
|
3132
|
-
set_double_member(member_name: string
|
|
3124
|
+
set_double_member(member_name: string, value: number): void
|
|
3133
3125
|
/**
|
|
3134
3126
|
* Convenience function for setting an object member with an integer value.
|
|
3135
3127
|
*
|
|
@@ -3137,7 +3129,7 @@ interface Object {
|
|
|
3137
3129
|
* @param member_name the name of the member
|
|
3138
3130
|
* @param value the value of the member
|
|
3139
3131
|
*/
|
|
3140
|
-
set_int_member(member_name: string
|
|
3132
|
+
set_int_member(member_name: string, value: number): void
|
|
3141
3133
|
/**
|
|
3142
3134
|
* Sets the value of a member inside an object.
|
|
3143
3135
|
*
|
|
@@ -3149,14 +3141,14 @@ interface Object {
|
|
|
3149
3141
|
* @param member_name the name of the member
|
|
3150
3142
|
* @param node the value of the member
|
|
3151
3143
|
*/
|
|
3152
|
-
set_member(member_name: string
|
|
3144
|
+
set_member(member_name: string, node: Node): void
|
|
3153
3145
|
/**
|
|
3154
3146
|
* Convenience function for setting an object member with a `null` value.
|
|
3155
3147
|
*
|
|
3156
3148
|
* See also: [method`Json`.Object.set_member], [method`Json`.Node.init_null]
|
|
3157
3149
|
* @param member_name the name of the member
|
|
3158
3150
|
*/
|
|
3159
|
-
set_null_member(member_name: string
|
|
3151
|
+
set_null_member(member_name: string): void
|
|
3160
3152
|
/**
|
|
3161
3153
|
* Convenience function for setting an object member with an object value.
|
|
3162
3154
|
*
|
|
@@ -3164,7 +3156,7 @@ interface Object {
|
|
|
3164
3156
|
* @param member_name the name of the member
|
|
3165
3157
|
* @param value the value of the member
|
|
3166
3158
|
*/
|
|
3167
|
-
set_object_member(member_name: string
|
|
3159
|
+
set_object_member(member_name: string, value: Object): void
|
|
3168
3160
|
/**
|
|
3169
3161
|
* Convenience function for setting an object member with a string value.
|
|
3170
3162
|
*
|
|
@@ -3172,7 +3164,7 @@ interface Object {
|
|
|
3172
3164
|
* @param member_name the name of the member
|
|
3173
3165
|
* @param value the value of the member
|
|
3174
3166
|
*/
|
|
3175
|
-
set_string_member(member_name: string
|
|
3167
|
+
set_string_member(member_name: string, value: string): void
|
|
3176
3168
|
/**
|
|
3177
3169
|
* Releases a reference on the given object.
|
|
3178
3170
|
*
|
|
@@ -3288,7 +3280,7 @@ interface ObjectIter {
|
|
|
3288
3280
|
* See also: [method`Json`.ObjectIter.next_ordered]
|
|
3289
3281
|
* @returns `TRUE` if @member_name and @member_node are valid; `FALSE` if there are no more members
|
|
3290
3282
|
*/
|
|
3291
|
-
next(): [ /* returnType */ boolean, /* member_name */ string
|
|
3283
|
+
next(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3292
3284
|
/**
|
|
3293
3285
|
* Advances the iterator and retrieves the next member in the object.
|
|
3294
3286
|
*
|
|
@@ -3306,7 +3298,7 @@ interface ObjectIter {
|
|
|
3306
3298
|
* See also: [method`Json`.ObjectIter.next]
|
|
3307
3299
|
* @returns `TRUE `if @member_name and @member_node are valid; `FALSE` if the end of the object has been reached
|
|
3308
3300
|
*/
|
|
3309
|
-
next_ordered(): [ /* returnType */ boolean, /* member_name */ string
|
|
3301
|
+
next_ordered(): [ /* returnType */ boolean, /* member_name */ string, /* member_node */ Node ]
|
|
3310
3302
|
}
|
|
3311
3303
|
|
|
3312
3304
|
/**
|
|
@@ -3335,7 +3327,7 @@ interface ParserClass {
|
|
|
3335
3327
|
|
|
3336
3328
|
parse_start: (parser: Parser) => void
|
|
3337
3329
|
object_start: (parser: Parser) => void
|
|
3338
|
-
object_member: (parser: Parser, object: Object, member_name: string
|
|
3330
|
+
object_member: (parser: Parser, object: Object, member_name: string) => void
|
|
3339
3331
|
object_end: (parser: Parser, object: Object) => void
|
|
3340
3332
|
array_start: (parser: Parser) => void
|
|
3341
3333
|
array_element: (parser: Parser, array: Array, index_: number) => void
|
|
@@ -3399,9 +3391,9 @@ interface SerializableIface {
|
|
|
3399
3391
|
|
|
3400
3392
|
// Own fields of Json-1.0.Json.SerializableIface
|
|
3401
3393
|
|
|
3402
|
-
serialize_property: (serializable: Serializable, property_name: string
|
|
3403
|
-
deserialize_property: (serializable: Serializable, property_name: string
|
|
3404
|
-
find_property: (serializable: Serializable, name: string
|
|
3394
|
+
serialize_property: (serializable: Serializable, property_name: string, value: any, pspec: GObject.ParamSpec) => Node
|
|
3395
|
+
deserialize_property: (serializable: Serializable, property_name: string, pspec: GObject.ParamSpec, property_node: Node) => [ /* returnType */ boolean, /* value */ any ]
|
|
3396
|
+
find_property: (serializable: Serializable, name: string) => GObject.ParamSpec | null
|
|
3405
3397
|
set_property: (serializable: Serializable, pspec: GObject.ParamSpec, value: any) => void
|
|
3406
3398
|
get_property: (serializable: Serializable, pspec: GObject.ParamSpec) => /* value */ any
|
|
3407
3399
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/json-1.0",
|
|
3
|
-
"version": "1.7.1-3.2.
|
|
3
|
+
"version": "1.7.1-3.2.8",
|
|
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",
|
|
7
7
|
"main": "json-1.0.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"./ambient":
|
|
10
|
-
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./json-1.0-ambient.d.ts",
|
|
11
|
+
"default": "./json-1.0-ambient.js"
|
|
12
|
+
},
|
|
13
|
+
"./import": {
|
|
14
|
+
"types": "./json-1.0-import.d.ts",
|
|
15
|
+
"default": "./json-1.0-import.js"
|
|
16
|
+
},
|
|
11
17
|
".": {
|
|
12
18
|
"import": {
|
|
13
19
|
"types": "./json-1.0.d.ts",
|
|
@@ -25,10 +31,10 @@
|
|
|
25
31
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit json-1.0.d.cts"
|
|
26
32
|
},
|
|
27
33
|
"dependencies": {
|
|
28
|
-
"@girs/gio-2.0": "^2.
|
|
29
|
-
"@girs/gjs": "^3.2.
|
|
30
|
-
"@girs/glib-2.0": "^2.
|
|
31
|
-
"@girs/gobject-2.0": "^2.
|
|
34
|
+
"@girs/gio-2.0": "^2.77.0-3.2.8",
|
|
35
|
+
"@girs/gjs": "^3.2.8",
|
|
36
|
+
"@girs/glib-2.0": "^2.77.0-3.2.8",
|
|
37
|
+
"@girs/gobject-2.0": "^2.77.0-3.2.8"
|
|
32
38
|
},
|
|
33
39
|
"devDependencies": {
|
|
34
40
|
"typescript": "*"
|
|
@@ -45,7 +51,7 @@
|
|
|
45
51
|
"license": "MIT",
|
|
46
52
|
"repository": {
|
|
47
53
|
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/gjsify/
|
|
54
|
+
"url": "git+https://github.com/gjsify/ts-for-gir.git"
|
|
49
55
|
},
|
|
50
56
|
"bugs": {
|
|
51
57
|
"url": "https://github.com/gjsify/ts-for-gir/issues"
|