@girs/glib-2.0 2.76.1-3.2.3 → 2.77.0-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 +14 -1
- package/glib-2.0-ambient.d.ts +0 -1
- package/glib-2.0-ambient.js +2 -0
- package/glib-2.0-import.d.ts +0 -1
- package/glib-2.0-import.js +3 -0
- package/glib-2.0.d.cts +967 -527
- package/glib-2.0.d.ts +967 -527
- package/package.json +13 -7
package/glib-2.0.d.cts
CHANGED
|
@@ -1388,7 +1388,7 @@ export enum TraverseType {
|
|
|
1388
1388
|
* Since new unicode versions may add new types here, applications should be ready
|
|
1389
1389
|
* to handle unknown values. They may be regarded as %G_UNICODE_BREAK_UNKNOWN.
|
|
1390
1390
|
*
|
|
1391
|
-
* See [Unicode Line Breaking Algorithm](
|
|
1391
|
+
* See [Unicode Line Breaking Algorithm](https://www.unicode.org/reports/tr14/).
|
|
1392
1392
|
*/
|
|
1393
1393
|
export enum UnicodeBreakType {
|
|
1394
1394
|
/**
|
|
@@ -3647,6 +3647,29 @@ export const ANALYZER_ANALYZING: number
|
|
|
3647
3647
|
*
|
|
3648
3648
|
*/
|
|
3649
3649
|
export const ASCII_DTOSTR_BUF_SIZE: number
|
|
3650
|
+
/**
|
|
3651
|
+
* Evaluates to the initial reference count for `gatomicrefcount`.
|
|
3652
|
+
*
|
|
3653
|
+
* This macro is useful for initializing `gatomicrefcount` fields inside
|
|
3654
|
+
* structures, for instance:
|
|
3655
|
+
*
|
|
3656
|
+
*
|
|
3657
|
+
* ```c
|
|
3658
|
+
* typedef struct {
|
|
3659
|
+
* gatomicrefcount ref_count;
|
|
3660
|
+
* char *name;
|
|
3661
|
+
* char *address;
|
|
3662
|
+
* } Person;
|
|
3663
|
+
*
|
|
3664
|
+
* static const Person default_person = {
|
|
3665
|
+
* .ref_count = G_ATOMIC_REF_COUNT_INIT,
|
|
3666
|
+
* .name = "Default name",
|
|
3667
|
+
* .address = "Default address",
|
|
3668
|
+
* };
|
|
3669
|
+
* ```
|
|
3670
|
+
*
|
|
3671
|
+
*/
|
|
3672
|
+
export const ATOMIC_REF_COUNT_INIT: number
|
|
3650
3673
|
/**
|
|
3651
3674
|
* Specifies one of the possible types of byte order.
|
|
3652
3675
|
* See %G_BYTE_ORDER.
|
|
@@ -3657,19 +3680,19 @@ export const BIG_ENDIAN: number
|
|
|
3657
3680
|
* Used for specifying valid identifier characters
|
|
3658
3681
|
* in #GScannerConfig.
|
|
3659
3682
|
*/
|
|
3660
|
-
export const CSET_A_2_Z: string
|
|
3683
|
+
export const CSET_A_2_Z: string
|
|
3661
3684
|
/**
|
|
3662
3685
|
* The set of ASCII digits.
|
|
3663
3686
|
* Used for specifying valid identifier characters
|
|
3664
3687
|
* in #GScannerConfig.
|
|
3665
3688
|
*/
|
|
3666
|
-
export const CSET_DIGITS: string
|
|
3689
|
+
export const CSET_DIGITS: string
|
|
3667
3690
|
/**
|
|
3668
3691
|
* The set of lowercase ASCII alphabet characters.
|
|
3669
3692
|
* Used for specifying valid identifier characters
|
|
3670
3693
|
* in #GScannerConfig.
|
|
3671
3694
|
*/
|
|
3672
|
-
export const CSET_a_2_z: string
|
|
3695
|
+
export const CSET_a_2_z: string
|
|
3673
3696
|
/**
|
|
3674
3697
|
* The C standard version the code is compiling against, it's normally
|
|
3675
3698
|
* defined with the same value of `__STDC_VERSION__` for C standard
|
|
@@ -3709,7 +3732,7 @@ export const DIR_SEPARATOR: number
|
|
|
3709
3732
|
* The directory separator as a string.
|
|
3710
3733
|
* This is "/" on UNIX machines and "\" under Windows.
|
|
3711
3734
|
*/
|
|
3712
|
-
export const DIR_SEPARATOR_S: string
|
|
3735
|
+
export const DIR_SEPARATOR_S: string
|
|
3713
3736
|
/**
|
|
3714
3737
|
* The base of natural logarithms.
|
|
3715
3738
|
*/
|
|
@@ -3734,7 +3757,7 @@ export const E: number
|
|
|
3734
3757
|
* ```
|
|
3735
3758
|
*
|
|
3736
3759
|
*/
|
|
3737
|
-
export const GINT16_FORMAT: string
|
|
3760
|
+
export const GINT16_FORMAT: string
|
|
3738
3761
|
/**
|
|
3739
3762
|
* The platform dependent length modifier for conversion specifiers
|
|
3740
3763
|
* for scanning and printing values of type #gint16 or #guint16. It
|
|
@@ -3754,7 +3777,7 @@ export const GINT16_FORMAT: string | null
|
|
|
3754
3777
|
* `int16_t` values, even though the in-memory representation is the same.
|
|
3755
3778
|
* Standard C macros like `PRId16` and `SCNd16` should be used for `int16_t`.
|
|
3756
3779
|
*/
|
|
3757
|
-
export const GINT16_MODIFIER: string
|
|
3780
|
+
export const GINT16_MODIFIER: string
|
|
3758
3781
|
/**
|
|
3759
3782
|
* This is the platform dependent conversion specifier for scanning
|
|
3760
3783
|
* and printing values of type #gint32. See also %G_GINT16_FORMAT.
|
|
@@ -3763,7 +3786,7 @@ export const GINT16_MODIFIER: string | null
|
|
|
3763
3786
|
* `int32_t` values, even though the in-memory representation is the same.
|
|
3764
3787
|
* Standard C macros like `PRId32` and `SCNd32` should be used for `int32_t`.
|
|
3765
3788
|
*/
|
|
3766
|
-
export const GINT32_FORMAT: string
|
|
3789
|
+
export const GINT32_FORMAT: string
|
|
3767
3790
|
/**
|
|
3768
3791
|
* The platform dependent length modifier for conversion specifiers
|
|
3769
3792
|
* for scanning and printing values of type #gint32 or #guint32. It
|
|
@@ -3773,7 +3796,7 @@ export const GINT32_FORMAT: string | null
|
|
|
3773
3796
|
* `int32_t` values, even though the in-memory representation is the same.
|
|
3774
3797
|
* Standard C macros like `PRId32` and `SCNd32` should be used for `int32_t`.
|
|
3775
3798
|
*/
|
|
3776
|
-
export const GINT32_MODIFIER: string
|
|
3799
|
+
export const GINT32_MODIFIER: string
|
|
3777
3800
|
/**
|
|
3778
3801
|
* This is the platform dependent conversion specifier for scanning
|
|
3779
3802
|
* and printing values of type #gint64. See also %G_GINT16_FORMAT.
|
|
@@ -3789,7 +3812,7 @@ export const GINT32_MODIFIER: string | null
|
|
|
3789
3812
|
* `int64_t` values, even though the in-memory representation is the same.
|
|
3790
3813
|
* Standard C macros like `PRId64` and `SCNd64` should be used for `int64_t`.
|
|
3791
3814
|
*/
|
|
3792
|
-
export const GINT64_FORMAT: string
|
|
3815
|
+
export const GINT64_FORMAT: string
|
|
3793
3816
|
/**
|
|
3794
3817
|
* The platform dependent length modifier for conversion specifiers
|
|
3795
3818
|
* for scanning and printing values of type #gint64 or #guint64.
|
|
@@ -3803,7 +3826,7 @@ export const GINT64_FORMAT: string | null
|
|
|
3803
3826
|
* `int64_t` values, even though the in-memory representation is the same.
|
|
3804
3827
|
* Standard C macros like `PRId64` and `SCNd64` should be used for `int64_t`.
|
|
3805
3828
|
*/
|
|
3806
|
-
export const GINT64_MODIFIER: string
|
|
3829
|
+
export const GINT64_MODIFIER: string
|
|
3807
3830
|
/**
|
|
3808
3831
|
* This is the platform dependent conversion specifier for scanning
|
|
3809
3832
|
* and printing values of type #gintptr.
|
|
@@ -3814,7 +3837,7 @@ export const GINT64_MODIFIER: string | null
|
|
|
3814
3837
|
* Standard C macros like `PRIdPTR` and `SCNdPTR` should be used for
|
|
3815
3838
|
* `intptr_t`.
|
|
3816
3839
|
*/
|
|
3817
|
-
export const GINTPTR_FORMAT: string
|
|
3840
|
+
export const GINTPTR_FORMAT: string
|
|
3818
3841
|
/**
|
|
3819
3842
|
* The platform dependent length modifier for conversion specifiers
|
|
3820
3843
|
* for scanning and printing values of type #gintptr or #guintptr.
|
|
@@ -3826,17 +3849,17 @@ export const GINTPTR_FORMAT: string | null
|
|
|
3826
3849
|
* Standard C macros like `PRIdPTR` and `SCNdPTR` should be used for
|
|
3827
3850
|
* `intptr_t`.
|
|
3828
3851
|
*/
|
|
3829
|
-
export const GINTPTR_MODIFIER: string
|
|
3852
|
+
export const GINTPTR_MODIFIER: string
|
|
3830
3853
|
/**
|
|
3831
3854
|
* Expands to "" on all modern compilers, and to __FUNCTION__ on gcc
|
|
3832
3855
|
* version 2.x. Don't use it.
|
|
3833
3856
|
*/
|
|
3834
|
-
export const GNUC_FUNCTION: string
|
|
3857
|
+
export const GNUC_FUNCTION: string
|
|
3835
3858
|
/**
|
|
3836
3859
|
* Expands to "" on all modern compilers, and to __PRETTY_FUNCTION__
|
|
3837
3860
|
* on gcc version 2.x. Don't use it.
|
|
3838
3861
|
*/
|
|
3839
|
-
export const GNUC_PRETTY_FUNCTION: string
|
|
3862
|
+
export const GNUC_PRETTY_FUNCTION: string
|
|
3840
3863
|
/**
|
|
3841
3864
|
* This is the platform dependent conversion specifier for scanning
|
|
3842
3865
|
* and printing values of type #gsize. See also %G_GINT16_FORMAT.
|
|
@@ -3846,7 +3869,7 @@ export const GNUC_PRETTY_FUNCTION: string | null
|
|
|
3846
3869
|
* same. The standard C `"zu"` format should be used for `size_t`,
|
|
3847
3870
|
* assuming a C99-compliant `printf` implementation is available.
|
|
3848
3871
|
*/
|
|
3849
|
-
export const GSIZE_FORMAT: string
|
|
3872
|
+
export const GSIZE_FORMAT: string
|
|
3850
3873
|
/**
|
|
3851
3874
|
* The platform dependent length modifier for conversion specifiers
|
|
3852
3875
|
* for scanning and printing values of type #gsize. It
|
|
@@ -3857,7 +3880,7 @@ export const GSIZE_FORMAT: string | null
|
|
|
3857
3880
|
* same. The Standard C `"z"` modifier should be used for `size_t`,
|
|
3858
3881
|
* assuming a C99-compliant `printf` implementation is available.
|
|
3859
3882
|
*/
|
|
3860
|
-
export const GSIZE_MODIFIER: string
|
|
3883
|
+
export const GSIZE_MODIFIER: string
|
|
3861
3884
|
/**
|
|
3862
3885
|
* This is the platform dependent conversion specifier for scanning
|
|
3863
3886
|
* and printing values of type #gssize. See also %G_GINT16_FORMAT.
|
|
@@ -3867,7 +3890,7 @@ export const GSIZE_MODIFIER: string | null
|
|
|
3867
3890
|
* representation is the same.
|
|
3868
3891
|
* On POSIX platforms, the `"zd"` format should be used for `ssize_t`.
|
|
3869
3892
|
*/
|
|
3870
|
-
export const GSSIZE_FORMAT: string
|
|
3893
|
+
export const GSSIZE_FORMAT: string
|
|
3871
3894
|
/**
|
|
3872
3895
|
* The platform dependent length modifier for conversion specifiers
|
|
3873
3896
|
* for scanning and printing values of type #gssize. It
|
|
@@ -3878,7 +3901,7 @@ export const GSSIZE_FORMAT: string | null
|
|
|
3878
3901
|
* representation is the same.
|
|
3879
3902
|
* On POSIX platforms, the `"z"` modifier should be used for `ssize_t`.
|
|
3880
3903
|
*/
|
|
3881
|
-
export const GSSIZE_MODIFIER: string
|
|
3904
|
+
export const GSSIZE_MODIFIER: string
|
|
3882
3905
|
/**
|
|
3883
3906
|
* This is the platform dependent conversion specifier for scanning
|
|
3884
3907
|
* and printing values of type #guint16. See also %G_GINT16_FORMAT
|
|
@@ -3887,7 +3910,7 @@ export const GSSIZE_MODIFIER: string | null
|
|
|
3887
3910
|
* `uint16_t` values, even though the in-memory representation is the same.
|
|
3888
3911
|
* Standard C macros like `PRIu16` and `SCNu16` should be used for `uint16_t`.
|
|
3889
3912
|
*/
|
|
3890
|
-
export const GUINT16_FORMAT: string
|
|
3913
|
+
export const GUINT16_FORMAT: string
|
|
3891
3914
|
/**
|
|
3892
3915
|
* This is the platform dependent conversion specifier for scanning
|
|
3893
3916
|
* and printing values of type #guint32. See also %G_GINT16_FORMAT.
|
|
@@ -3896,7 +3919,7 @@ export const GUINT16_FORMAT: string | null
|
|
|
3896
3919
|
* `uint32_t` values, even though the in-memory representation is the same.
|
|
3897
3920
|
* Standard C macros like `PRIu32` and `SCNu32` should be used for `uint32_t`.
|
|
3898
3921
|
*/
|
|
3899
|
-
export const GUINT32_FORMAT: string
|
|
3922
|
+
export const GUINT32_FORMAT: string
|
|
3900
3923
|
/**
|
|
3901
3924
|
* This is the platform dependent conversion specifier for scanning
|
|
3902
3925
|
* and printing values of type #guint64. See also %G_GINT16_FORMAT.
|
|
@@ -3912,7 +3935,7 @@ export const GUINT32_FORMAT: string | null
|
|
|
3912
3935
|
* `uint64_t` values, even though the in-memory representation is the same.
|
|
3913
3936
|
* Standard C macros like `PRIu64` and `SCNu64` should be used for `uint64_t`.
|
|
3914
3937
|
*/
|
|
3915
|
-
export const GUINT64_FORMAT: string
|
|
3938
|
+
export const GUINT64_FORMAT: string
|
|
3916
3939
|
/**
|
|
3917
3940
|
* This is the platform dependent conversion specifier
|
|
3918
3941
|
* for scanning and printing values of type #guintptr.
|
|
@@ -3923,7 +3946,7 @@ export const GUINT64_FORMAT: string | null
|
|
|
3923
3946
|
* Standard C macros like `PRIuPTR` and `SCNuPTR` should be used for
|
|
3924
3947
|
* `uintptr_t`.
|
|
3925
3948
|
*/
|
|
3926
|
-
export const GUINTPTR_FORMAT: string
|
|
3949
|
+
export const GUINTPTR_FORMAT: string
|
|
3927
3950
|
export const HAVE_GINT64: number
|
|
3928
3951
|
export const HAVE_GNUC_VARARGS: number
|
|
3929
3952
|
/**
|
|
@@ -3953,110 +3976,110 @@ export const IEEE754_FLOAT_BIAS: number
|
|
|
3953
3976
|
* Consult the specification for more
|
|
3954
3977
|
* details about the meanings of the keys below.
|
|
3955
3978
|
*/
|
|
3956
|
-
export const KEY_FILE_DESKTOP_GROUP: string
|
|
3979
|
+
export const KEY_FILE_DESKTOP_GROUP: string
|
|
3957
3980
|
/**
|
|
3958
3981
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string list
|
|
3959
3982
|
* giving the available application actions.
|
|
3960
3983
|
*/
|
|
3961
|
-
export const KEY_FILE_DESKTOP_KEY_ACTIONS: string
|
|
3984
|
+
export const KEY_FILE_DESKTOP_KEY_ACTIONS: string
|
|
3962
3985
|
/**
|
|
3963
3986
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list
|
|
3964
3987
|
* of strings giving the categories in which the desktop entry
|
|
3965
3988
|
* should be shown in a menu.
|
|
3966
3989
|
*/
|
|
3967
|
-
export const KEY_FILE_DESKTOP_KEY_CATEGORIES: string
|
|
3990
|
+
export const KEY_FILE_DESKTOP_KEY_CATEGORIES: string
|
|
3968
3991
|
/**
|
|
3969
3992
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
3970
3993
|
* string giving the tooltip for the desktop entry.
|
|
3971
3994
|
*/
|
|
3972
|
-
export const KEY_FILE_DESKTOP_KEY_COMMENT: string
|
|
3995
|
+
export const KEY_FILE_DESKTOP_KEY_COMMENT: string
|
|
3973
3996
|
/**
|
|
3974
3997
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
3975
3998
|
* set to true if the application is D-Bus activatable.
|
|
3976
3999
|
*/
|
|
3977
|
-
export const KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: string
|
|
4000
|
+
export const KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: string
|
|
3978
4001
|
/**
|
|
3979
4002
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
3980
4003
|
* giving the command line to execute. It is only valid for desktop
|
|
3981
4004
|
* entries with the `Application` type.
|
|
3982
4005
|
*/
|
|
3983
|
-
export const KEY_FILE_DESKTOP_KEY_EXEC: string
|
|
4006
|
+
export const KEY_FILE_DESKTOP_KEY_EXEC: string
|
|
3984
4007
|
/**
|
|
3985
4008
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
3986
4009
|
* string giving the generic name of the desktop entry.
|
|
3987
4010
|
*/
|
|
3988
|
-
export const KEY_FILE_DESKTOP_KEY_GENERIC_NAME: string
|
|
4011
|
+
export const KEY_FILE_DESKTOP_KEY_GENERIC_NAME: string
|
|
3989
4012
|
/**
|
|
3990
4013
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
3991
4014
|
* stating whether the desktop entry has been deleted by the user.
|
|
3992
4015
|
*/
|
|
3993
|
-
export const KEY_FILE_DESKTOP_KEY_HIDDEN: string
|
|
4016
|
+
export const KEY_FILE_DESKTOP_KEY_HIDDEN: string
|
|
3994
4017
|
/**
|
|
3995
4018
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
3996
4019
|
* string giving the name of the icon to be displayed for the desktop
|
|
3997
4020
|
* entry.
|
|
3998
4021
|
*/
|
|
3999
|
-
export const KEY_FILE_DESKTOP_KEY_ICON: string
|
|
4022
|
+
export const KEY_FILE_DESKTOP_KEY_ICON: string
|
|
4000
4023
|
/**
|
|
4001
4024
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list
|
|
4002
4025
|
* of strings giving the MIME types supported by this desktop entry.
|
|
4003
4026
|
*/
|
|
4004
|
-
export const KEY_FILE_DESKTOP_KEY_MIME_TYPE: string
|
|
4027
|
+
export const KEY_FILE_DESKTOP_KEY_MIME_TYPE: string
|
|
4005
4028
|
/**
|
|
4006
4029
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a localized
|
|
4007
4030
|
* string giving the specific name of the desktop entry.
|
|
4008
4031
|
*/
|
|
4009
|
-
export const KEY_FILE_DESKTOP_KEY_NAME: string
|
|
4032
|
+
export const KEY_FILE_DESKTOP_KEY_NAME: string
|
|
4010
4033
|
/**
|
|
4011
4034
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
|
|
4012
4035
|
* strings identifying the environments that should not display the
|
|
4013
4036
|
* desktop entry.
|
|
4014
4037
|
*/
|
|
4015
|
-
export const KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: string
|
|
4038
|
+
export const KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: string
|
|
4016
4039
|
/**
|
|
4017
4040
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
4018
4041
|
* stating whether the desktop entry should be shown in menus.
|
|
4019
4042
|
*/
|
|
4020
|
-
export const KEY_FILE_DESKTOP_KEY_NO_DISPLAY: string
|
|
4043
|
+
export const KEY_FILE_DESKTOP_KEY_NO_DISPLAY: string
|
|
4021
4044
|
/**
|
|
4022
4045
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a list of
|
|
4023
4046
|
* strings identifying the environments that should display the
|
|
4024
4047
|
* desktop entry.
|
|
4025
4048
|
*/
|
|
4026
|
-
export const KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: string
|
|
4049
|
+
export const KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: string
|
|
4027
4050
|
/**
|
|
4028
4051
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4029
4052
|
* containing the working directory to run the program in. It is only
|
|
4030
4053
|
* valid for desktop entries with the `Application` type.
|
|
4031
4054
|
*/
|
|
4032
|
-
export const KEY_FILE_DESKTOP_KEY_PATH: string
|
|
4055
|
+
export const KEY_FILE_DESKTOP_KEY_PATH: string
|
|
4033
4056
|
/**
|
|
4034
4057
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
4035
4058
|
* stating whether the application supports the
|
|
4036
4059
|
* [Startup Notification Protocol Specification](http://www.freedesktop.org/Standards/startup-notification-spec).
|
|
4037
4060
|
*/
|
|
4038
|
-
export const KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: string
|
|
4061
|
+
export const KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: string
|
|
4039
4062
|
/**
|
|
4040
4063
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is string
|
|
4041
4064
|
* identifying the WM class or name hint of a window that the application
|
|
4042
4065
|
* will create, which can be used to emulate Startup Notification with
|
|
4043
4066
|
* older applications.
|
|
4044
4067
|
*/
|
|
4045
|
-
export const KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: string
|
|
4068
|
+
export const KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: string
|
|
4046
4069
|
/**
|
|
4047
4070
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a boolean
|
|
4048
4071
|
* stating whether the program should be run in a terminal window.
|
|
4049
4072
|
*
|
|
4050
4073
|
* It is only valid for desktop entries with the `Application` type.
|
|
4051
4074
|
*/
|
|
4052
|
-
export const KEY_FILE_DESKTOP_KEY_TERMINAL: string
|
|
4075
|
+
export const KEY_FILE_DESKTOP_KEY_TERMINAL: string
|
|
4053
4076
|
/**
|
|
4054
4077
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4055
4078
|
* giving the file name of a binary on disk used to determine if the
|
|
4056
4079
|
* program is actually installed. It is only valid for desktop entries
|
|
4057
4080
|
* with the `Application` type.
|
|
4058
4081
|
*/
|
|
4059
|
-
export const KEY_FILE_DESKTOP_KEY_TRY_EXEC: string
|
|
4082
|
+
export const KEY_FILE_DESKTOP_KEY_TRY_EXEC: string
|
|
4060
4083
|
/**
|
|
4061
4084
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4062
4085
|
* giving the type of the desktop entry.
|
|
@@ -4065,34 +4088,34 @@ export const KEY_FILE_DESKTOP_KEY_TRY_EXEC: string | null
|
|
|
4065
4088
|
* %G_KEY_FILE_DESKTOP_TYPE_LINK, or
|
|
4066
4089
|
* %G_KEY_FILE_DESKTOP_TYPE_DIRECTORY.
|
|
4067
4090
|
*/
|
|
4068
|
-
export const KEY_FILE_DESKTOP_KEY_TYPE: string
|
|
4091
|
+
export const KEY_FILE_DESKTOP_KEY_TYPE: string
|
|
4069
4092
|
/**
|
|
4070
4093
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4071
4094
|
* giving the URL to access. It is only valid for desktop entries
|
|
4072
4095
|
* with the `Link` type.
|
|
4073
4096
|
*/
|
|
4074
|
-
export const KEY_FILE_DESKTOP_KEY_URL: string
|
|
4097
|
+
export const KEY_FILE_DESKTOP_KEY_URL: string
|
|
4075
4098
|
/**
|
|
4076
4099
|
* A key under %G_KEY_FILE_DESKTOP_GROUP, whose value is a string
|
|
4077
4100
|
* giving the version of the Desktop Entry Specification used for
|
|
4078
4101
|
* the desktop entry file.
|
|
4079
4102
|
*/
|
|
4080
|
-
export const KEY_FILE_DESKTOP_KEY_VERSION: string
|
|
4103
|
+
export const KEY_FILE_DESKTOP_KEY_VERSION: string
|
|
4081
4104
|
/**
|
|
4082
4105
|
* The value of the %G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
|
|
4083
4106
|
* entries representing applications.
|
|
4084
4107
|
*/
|
|
4085
|
-
export const KEY_FILE_DESKTOP_TYPE_APPLICATION: string
|
|
4108
|
+
export const KEY_FILE_DESKTOP_TYPE_APPLICATION: string
|
|
4086
4109
|
/**
|
|
4087
4110
|
* The value of the %G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
|
|
4088
4111
|
* entries representing directories.
|
|
4089
4112
|
*/
|
|
4090
|
-
export const KEY_FILE_DESKTOP_TYPE_DIRECTORY: string
|
|
4113
|
+
export const KEY_FILE_DESKTOP_TYPE_DIRECTORY: string
|
|
4091
4114
|
/**
|
|
4092
4115
|
* The value of the %G_KEY_FILE_DESKTOP_KEY_TYPE, key for desktop
|
|
4093
4116
|
* entries representing links to documents.
|
|
4094
4117
|
*/
|
|
4095
|
-
export const KEY_FILE_DESKTOP_TYPE_LINK: string
|
|
4118
|
+
export const KEY_FILE_DESKTOP_TYPE_LINK: string
|
|
4096
4119
|
/**
|
|
4097
4120
|
* Specifies one of the possible types of byte order.
|
|
4098
4121
|
* See %G_BYTE_ORDER.
|
|
@@ -4126,7 +4149,7 @@ export const LOG_2_BASE_10: number
|
|
|
4126
4149
|
* not advisable, as it cannot be filtered against using the `G_MESSAGES_DEBUG`
|
|
4127
4150
|
* environment variable.
|
|
4128
4151
|
*
|
|
4129
|
-
* For example, GTK
|
|
4152
|
+
* For example, GTK uses this in its `Makefile.am`:
|
|
4130
4153
|
*
|
|
4131
4154
|
* ```
|
|
4132
4155
|
* AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gtk\"
|
|
@@ -4243,7 +4266,7 @@ export const MININT8: number
|
|
|
4243
4266
|
* linked against at application run time.
|
|
4244
4267
|
*/
|
|
4245
4268
|
export const MINOR_VERSION: number
|
|
4246
|
-
export const MODULE_SUFFIX: string
|
|
4269
|
+
export const MODULE_SUFFIX: string
|
|
4247
4270
|
/**
|
|
4248
4271
|
* If a long option in the main group has this name, it is not treated as a
|
|
4249
4272
|
* regular option. Instead it collects all non-option arguments which would
|
|
@@ -4256,7 +4279,7 @@ export const MODULE_SUFFIX: string | null
|
|
|
4256
4279
|
* for leftover arguments has the advantage that GOption takes care of
|
|
4257
4280
|
* necessary encoding conversions for strings or filenames.
|
|
4258
4281
|
*/
|
|
4259
|
-
export const OPTION_REMAINING: string
|
|
4282
|
+
export const OPTION_REMAINING: string
|
|
4260
4283
|
/**
|
|
4261
4284
|
* Specifies one of the possible types of byte order
|
|
4262
4285
|
* (currently unused). See %G_BYTE_ORDER.
|
|
@@ -4270,7 +4293,7 @@ export const PI: number
|
|
|
4270
4293
|
* A format specifier that can be used in printf()-style format strings
|
|
4271
4294
|
* when printing a #GPid.
|
|
4272
4295
|
*/
|
|
4273
|
-
export const PID_FORMAT: string
|
|
4296
|
+
export const PID_FORMAT: string
|
|
4274
4297
|
/**
|
|
4275
4298
|
* Pi divided by 2.
|
|
4276
4299
|
*/
|
|
@@ -4283,7 +4306,7 @@ export const PI_4: number
|
|
|
4283
4306
|
* A format specifier that can be used in printf()-style format strings
|
|
4284
4307
|
* when printing the `fd` member of a #GPollFD.
|
|
4285
4308
|
*/
|
|
4286
|
-
export const POLLFD_FORMAT: string
|
|
4309
|
+
export const POLLFD_FORMAT: string
|
|
4287
4310
|
/**
|
|
4288
4311
|
* Use this for default priority event sources.
|
|
4289
4312
|
*
|
|
@@ -4302,13 +4325,13 @@ export const PRIORITY_DEFAULT_IDLE: number
|
|
|
4302
4325
|
/**
|
|
4303
4326
|
* Use this for high priority event sources.
|
|
4304
4327
|
*
|
|
4305
|
-
* It is not used within GLib or GTK
|
|
4328
|
+
* It is not used within GLib or GTK.
|
|
4306
4329
|
*/
|
|
4307
4330
|
export const PRIORITY_HIGH: number
|
|
4308
4331
|
/**
|
|
4309
4332
|
* Use this for high priority idle functions.
|
|
4310
4333
|
*
|
|
4311
|
-
* GTK
|
|
4334
|
+
* GTK uses %G_PRIORITY_HIGH_IDLE + 10 for resizing operations,
|
|
4312
4335
|
* and %G_PRIORITY_HIGH_IDLE + 20 for redrawing operations. (This is
|
|
4313
4336
|
* done to ensure that any pending resizes are processed before any
|
|
4314
4337
|
* pending redraws, so that widgets are not redrawn twice unnecessarily.)
|
|
@@ -4317,9 +4340,32 @@ export const PRIORITY_HIGH_IDLE: number
|
|
|
4317
4340
|
/**
|
|
4318
4341
|
* Use this for very low priority background tasks.
|
|
4319
4342
|
*
|
|
4320
|
-
* It is not used within GLib or GTK
|
|
4343
|
+
* It is not used within GLib or GTK.
|
|
4321
4344
|
*/
|
|
4322
4345
|
export const PRIORITY_LOW: number
|
|
4346
|
+
/**
|
|
4347
|
+
* Evaluates to the initial reference count for `grefcount`.
|
|
4348
|
+
*
|
|
4349
|
+
* This macro is useful for initializing `grefcount` fields inside
|
|
4350
|
+
* structures, for instance:
|
|
4351
|
+
*
|
|
4352
|
+
*
|
|
4353
|
+
* ```c
|
|
4354
|
+
* typedef struct {
|
|
4355
|
+
* grefcount ref_count;
|
|
4356
|
+
* char *name;
|
|
4357
|
+
* char *address;
|
|
4358
|
+
* } Person;
|
|
4359
|
+
*
|
|
4360
|
+
* static const Person default_person = {
|
|
4361
|
+
* .ref_count = G_REF_COUNT_INIT,
|
|
4362
|
+
* .name = "Default name",
|
|
4363
|
+
* .address = "Default address",
|
|
4364
|
+
* };
|
|
4365
|
+
* ```
|
|
4366
|
+
*
|
|
4367
|
+
*/
|
|
4368
|
+
export const REF_COUNT_INIT: number
|
|
4323
4369
|
/**
|
|
4324
4370
|
* The search path separator character.
|
|
4325
4371
|
* This is ':' on UNIX machines and ';' under Windows.
|
|
@@ -4329,7 +4375,7 @@ export const SEARCHPATH_SEPARATOR: number
|
|
|
4329
4375
|
* The search path separator as a string.
|
|
4330
4376
|
* This is ":" on UNIX machines and ";" under Windows.
|
|
4331
4377
|
*/
|
|
4332
|
-
export const SEARCHPATH_SEPARATOR_S: string
|
|
4378
|
+
export const SEARCHPATH_SEPARATOR_S: string
|
|
4333
4379
|
export const SIZEOF_LONG: number
|
|
4334
4380
|
export const SIZEOF_SIZE_T: number
|
|
4335
4381
|
export const SIZEOF_SSIZE_T: number
|
|
@@ -4351,7 +4397,7 @@ export const SQRT2: number
|
|
|
4351
4397
|
/**
|
|
4352
4398
|
* The standard delimiters, used in g_strdelimit().
|
|
4353
4399
|
*/
|
|
4354
|
-
export const STR_DELIMITERS: string
|
|
4400
|
+
export const STR_DELIMITERS: string
|
|
4355
4401
|
export const SYSDEF_AF_INET: number
|
|
4356
4402
|
export const SYSDEF_AF_INET6: number
|
|
4357
4403
|
export const SYSDEF_AF_UNIX: number
|
|
@@ -4383,7 +4429,7 @@ export const SYSDEF_MSG_PEEK: number
|
|
|
4383
4429
|
* calls to functions like g_get_user_cache_dir(), the caller must be prepared
|
|
4384
4430
|
* to create the directory if it doesn’t exist.
|
|
4385
4431
|
*/
|
|
4386
|
-
export const TEST_OPTION_ISOLATE_DIRS: string
|
|
4432
|
+
export const TEST_OPTION_ISOLATE_DIRS: string
|
|
4387
4433
|
/**
|
|
4388
4434
|
* Evaluates to a time span of one day.
|
|
4389
4435
|
*/
|
|
@@ -4415,12 +4461,12 @@ export const UNICHAR_MAX_DECOMPOSITION_LENGTH: number
|
|
|
4415
4461
|
* Generic delimiters characters as defined in
|
|
4416
4462
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `:/?#[]```.
|
|
4417
4463
|
*/
|
|
4418
|
-
export const URI_RESERVED_CHARS_GENERIC_DELIMITERS: string
|
|
4464
|
+
export const URI_RESERVED_CHARS_GENERIC_DELIMITERS: string
|
|
4419
4465
|
/**
|
|
4420
4466
|
* Subcomponent delimiter characters as defined in
|
|
4421
4467
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `!$&'()*+,;=`.
|
|
4422
4468
|
*/
|
|
4423
|
-
export const URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: string
|
|
4469
|
+
export const URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: string
|
|
4424
4470
|
/**
|
|
4425
4471
|
* Number of microseconds in one second (1 million).
|
|
4426
4472
|
* This macro is provided for code readability.
|
|
@@ -4551,7 +4597,7 @@ export function ascii_dtostr(buffer: string | null, buf_len: number, d: number):
|
|
|
4551
4597
|
* @param d The #gdouble to convert
|
|
4552
4598
|
* @returns The pointer to the buffer with the converted string.
|
|
4553
4599
|
*/
|
|
4554
|
-
export function ascii_formatd(buffer: string | null, buf_len: number, format: string
|
|
4600
|
+
export function ascii_formatd(buffer: string | null, buf_len: number, format: string, d: number): string | null
|
|
4555
4601
|
/**
|
|
4556
4602
|
* Compare two strings, ignoring the case of ASCII characters.
|
|
4557
4603
|
*
|
|
@@ -4572,14 +4618,14 @@ export function ascii_formatd(buffer: string | null, buf_len: number, format: st
|
|
|
4572
4618
|
* @param s2 string to compare with `s1`
|
|
4573
4619
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
4574
4620
|
*/
|
|
4575
|
-
export function ascii_strcasecmp(s1: string
|
|
4621
|
+
export function ascii_strcasecmp(s1: string, s2: string): number
|
|
4576
4622
|
/**
|
|
4577
4623
|
* Converts all upper case ASCII letters to lower case ASCII letters.
|
|
4578
4624
|
* @param str a string
|
|
4579
4625
|
* @param len length of `str` in bytes, or -1 if `str` is nul-terminated
|
|
4580
4626
|
* @returns a newly-allocated string, with all the upper case characters in @str converted to lower case, with semantics that exactly match g_ascii_tolower(). (Note that this is unlike the old g_strdown(), which modified the string in place.)
|
|
4581
4627
|
*/
|
|
4582
|
-
export function ascii_strdown(str: string
|
|
4628
|
+
export function ascii_strdown(str: string, len: number): string | null
|
|
4583
4629
|
/**
|
|
4584
4630
|
* A convenience function for converting a string to a signed number.
|
|
4585
4631
|
*
|
|
@@ -4608,7 +4654,7 @@ export function ascii_strdown(str: string | null, len: number): string | null
|
|
|
4608
4654
|
* @param max an upper bound (inclusive)
|
|
4609
4655
|
* @returns %TRUE if @str was a number, otherwise %FALSE.
|
|
4610
4656
|
*/
|
|
4611
|
-
export function ascii_string_to_signed(str: string
|
|
4657
|
+
export function ascii_string_to_signed(str: string, base: number, min: number, max: number): [ /* returnType */ boolean, /* out_num */ number ]
|
|
4612
4658
|
/**
|
|
4613
4659
|
* A convenience function for converting a string to an unsigned number.
|
|
4614
4660
|
*
|
|
@@ -4638,7 +4684,7 @@ export function ascii_string_to_signed(str: string | null, base: number, min: nu
|
|
|
4638
4684
|
* @param max an upper bound (inclusive)
|
|
4639
4685
|
* @returns %TRUE if @str was a number, otherwise %FALSE.
|
|
4640
4686
|
*/
|
|
4641
|
-
export function ascii_string_to_unsigned(str: string
|
|
4687
|
+
export function ascii_string_to_unsigned(str: string, base: number, min: number, max: number): [ /* returnType */ boolean, /* out_num */ number ]
|
|
4642
4688
|
/**
|
|
4643
4689
|
* Compare `s1` and `s2`, ignoring the case of ASCII characters and any
|
|
4644
4690
|
* characters after the first `n` in each string. If either string is
|
|
@@ -4657,7 +4703,7 @@ export function ascii_string_to_unsigned(str: string | null, base: number, min:
|
|
|
4657
4703
|
* @param n number of characters to compare
|
|
4658
4704
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
4659
4705
|
*/
|
|
4660
|
-
export function ascii_strncasecmp(s1: string
|
|
4706
|
+
export function ascii_strncasecmp(s1: string, s2: string, n: number): number
|
|
4661
4707
|
/**
|
|
4662
4708
|
* Converts a string to a #gdouble value.
|
|
4663
4709
|
*
|
|
@@ -4685,7 +4731,7 @@ export function ascii_strncasecmp(s1: string | null, s2: string | null, n: numbe
|
|
|
4685
4731
|
* @param nptr the string to convert to a numeric value.
|
|
4686
4732
|
* @returns the #gdouble value.
|
|
4687
4733
|
*/
|
|
4688
|
-
export function ascii_strtod(nptr: string
|
|
4734
|
+
export function ascii_strtod(nptr: string): [ /* returnType */ number, /* endptr */ string ]
|
|
4689
4735
|
/**
|
|
4690
4736
|
* Converts a string to a #gint64 value.
|
|
4691
4737
|
* This function behaves like the standard strtoll() function
|
|
@@ -4708,7 +4754,7 @@ export function ascii_strtod(nptr: string | null): [ /* returnType */ number, /*
|
|
|
4708
4754
|
* @param base to be used for the conversion, 2..36 or 0
|
|
4709
4755
|
* @returns the #gint64 value or zero on error.
|
|
4710
4756
|
*/
|
|
4711
|
-
export function ascii_strtoll(nptr: string
|
|
4757
|
+
export function ascii_strtoll(nptr: string, base: number): [ /* returnType */ number, /* endptr */ string ]
|
|
4712
4758
|
/**
|
|
4713
4759
|
* Converts a string to a #guint64 value.
|
|
4714
4760
|
* This function behaves like the standard strtoull() function
|
|
@@ -4736,14 +4782,14 @@ export function ascii_strtoll(nptr: string | null, base: number): [ /* returnTyp
|
|
|
4736
4782
|
* @param base to be used for the conversion, 2..36 or 0
|
|
4737
4783
|
* @returns the #guint64 value or zero on error.
|
|
4738
4784
|
*/
|
|
4739
|
-
export function ascii_strtoull(nptr: string
|
|
4785
|
+
export function ascii_strtoull(nptr: string, base: number): [ /* returnType */ number, /* endptr */ string ]
|
|
4740
4786
|
/**
|
|
4741
4787
|
* Converts all lower case ASCII letters to upper case ASCII letters.
|
|
4742
4788
|
* @param str a string
|
|
4743
4789
|
* @param len length of `str` in bytes, or -1 if `str` is nul-terminated
|
|
4744
4790
|
* @returns a newly allocated string, with all the lower case characters in @str converted to upper case, with semantics that exactly match g_ascii_toupper(). (Note that this is unlike the old g_strup(), which modified the string in place.)
|
|
4745
4791
|
*/
|
|
4746
|
-
export function ascii_strup(str: string
|
|
4792
|
+
export function ascii_strup(str: string, len: number): string | null
|
|
4747
4793
|
/**
|
|
4748
4794
|
* Convert a character to ASCII lower case.
|
|
4749
4795
|
*
|
|
@@ -4781,11 +4827,12 @@ export function ascii_toupper(c: number): number
|
|
|
4781
4827
|
* @returns If @c is a hex digit (according to g_ascii_isxdigit()), its numeric value. Otherwise, -1.
|
|
4782
4828
|
*/
|
|
4783
4829
|
export function ascii_xdigit_value(c: number): number
|
|
4784
|
-
export function assert_warning(log_domain: string
|
|
4785
|
-
export function assertion_message(domain: string
|
|
4786
|
-
export function
|
|
4787
|
-
export function
|
|
4788
|
-
export function
|
|
4830
|
+
export function assert_warning(log_domain: string, file: string, line: number, pretty_function: string, expression: string): void
|
|
4831
|
+
export function assertion_message(domain: string, file: string, line: number, func: string, message: string): void
|
|
4832
|
+
export function assertion_message_cmpint(domain: string, file: string, line: number, func: string, expr: string, arg1: number, cmp: string, arg2: number, numtype: number): void
|
|
4833
|
+
export function assertion_message_cmpstr(domain: string, file: string, line: number, func: string, expr: string, arg1: string, cmp: string, arg2: string): void
|
|
4834
|
+
export function assertion_message_cmpstrv(domain: string, file: string, line: number, func: string, expr: string, arg1: string, arg2: string, first_wrong_idx: number): void
|
|
4835
|
+
export function assertion_message_error(domain: string, file: string, line: number, func: string, expr: string, error: Error, error_domain: Quark, error_code: number): void
|
|
4789
4836
|
/**
|
|
4790
4837
|
* Specifies a function to be called at normal program termination.
|
|
4791
4838
|
*
|
|
@@ -5237,7 +5284,7 @@ export function atomic_ref_count_init(arc: number): void
|
|
|
5237
5284
|
* @param text zero-terminated string with base64 text to decode
|
|
5238
5285
|
* @returns newly allocated buffer containing the binary data that @text represents. The returned buffer must be freed with g_free().
|
|
5239
5286
|
*/
|
|
5240
|
-
export function base64_decode(text: string
|
|
5287
|
+
export function base64_decode(text: string): Uint8Array
|
|
5241
5288
|
/**
|
|
5242
5289
|
* Decode a sequence of Base-64 encoded text into binary data
|
|
5243
5290
|
* by overwriting the input data.
|
|
@@ -5404,7 +5451,7 @@ export function build_filenamev(args: string[]): string
|
|
|
5404
5451
|
* @param args %NULL-terminated array of strings containing the path elements.
|
|
5405
5452
|
* @returns a newly-allocated string that must be freed with g_free().
|
|
5406
5453
|
*/
|
|
5407
|
-
export function build_pathv(separator: string
|
|
5454
|
+
export function build_pathv(separator: string, args: string[]): string
|
|
5408
5455
|
/**
|
|
5409
5456
|
* Frees the memory allocated by the #GByteArray. If `free_segment` is
|
|
5410
5457
|
* %TRUE it frees the actual byte data. If the reference count of
|
|
@@ -5434,8 +5481,10 @@ export function byte_array_free_to_bytes(array: Uint8Array): Bytes
|
|
|
5434
5481
|
*/
|
|
5435
5482
|
export function byte_array_new(): Uint8Array
|
|
5436
5483
|
/**
|
|
5437
|
-
*
|
|
5438
|
-
*
|
|
5484
|
+
* Creates a byte array containing the `data`.
|
|
5485
|
+
* After this call, `data` belongs to the #GByteArray and may no longer be
|
|
5486
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
5487
|
+
* allocated and will eventually be freed with g_free().
|
|
5439
5488
|
*
|
|
5440
5489
|
* Do not use it if `len` is greater than %G_MAXUINT. #GByteArray
|
|
5441
5490
|
* stores the length of its data in #guint, which may be shorter than
|
|
@@ -5574,6 +5623,14 @@ export function child_watch_add(priority: number, pid: Pid, function_: ChildWatc
|
|
|
5574
5623
|
* mechanism, including `waitpid(pid, ...)` or a second child-watch
|
|
5575
5624
|
* source for the same `pid`
|
|
5576
5625
|
* * the application must not ignore `SIGCHLD`
|
|
5626
|
+
* * Before 2.78, the application could not send a signal (`kill()`) to the
|
|
5627
|
+
* watched `pid` in a race free manner. Since 2.78, you can do that while the
|
|
5628
|
+
* associated #GMainContext is acquired.
|
|
5629
|
+
* * Before 2.78, even after destroying the #GSource, you could not
|
|
5630
|
+
* be sure that `pid` wasn't already reaped. Hence, it was also not
|
|
5631
|
+
* safe to `kill()` or `waitpid()` on the process ID after the child watch
|
|
5632
|
+
* source was gone. Destroying the source before it fired made it
|
|
5633
|
+
* impossible to reliably reap the process.
|
|
5577
5634
|
*
|
|
5578
5635
|
* If any of those conditions are not met, this and related APIs will
|
|
5579
5636
|
* not work correctly. This can often be diagnosed via a GLib warning
|
|
@@ -5602,8 +5659,12 @@ export function clear_error(): void
|
|
|
5602
5659
|
*
|
|
5603
5660
|
* It is a bug to call this function with an invalid file descriptor.
|
|
5604
5661
|
*
|
|
5605
|
-
*
|
|
5606
|
-
* if) `error` is %NULL and `fd` is a valid open file descriptor.
|
|
5662
|
+
* On POSIX platforms since GLib 2.76, this function is async-signal safe
|
|
5663
|
+
* if (and only if) `error` is %NULL and `fd` is a valid open file descriptor.
|
|
5664
|
+
* This makes it safe to call from a signal handler or a #GSpawnChildSetupFunc
|
|
5665
|
+
* under those conditions.
|
|
5666
|
+
* See [`signal(7)`](man:signal(7)) and
|
|
5667
|
+
* [`signal-safety(7)`](man:signal-safety(7)) for more details.
|
|
5607
5668
|
* @param fd A file descriptor
|
|
5608
5669
|
* @returns %TRUE on success, %FALSE if there was an error.
|
|
5609
5670
|
*/
|
|
@@ -5639,7 +5700,7 @@ export function compute_checksum_for_data(checksum_type: ChecksumType, data: Uin
|
|
|
5639
5700
|
* @param length the length of the string, or -1 if the string is null-terminated.
|
|
5640
5701
|
* @returns the checksum as a hexadecimal string, or %NULL if g_checksum_new() fails for @checksum_type. The returned string should be freed with g_free() when done using it.
|
|
5641
5702
|
*/
|
|
5642
|
-
export function compute_checksum_for_string(checksum_type: ChecksumType, str: string
|
|
5703
|
+
export function compute_checksum_for_string(checksum_type: ChecksumType, str: string, length: number): string | null
|
|
5643
5704
|
/**
|
|
5644
5705
|
* Computes the HMAC for a binary `data`. This is a
|
|
5645
5706
|
* convenience wrapper for g_hmac_new(), g_hmac_get_string()
|
|
@@ -5674,7 +5735,7 @@ export function compute_hmac_for_data(digest_type: ChecksumType, key: Uint8Array
|
|
|
5674
5735
|
* @param length the length of the string, or -1 if the string is nul-terminated
|
|
5675
5736
|
* @returns the HMAC as a hexadecimal string. The returned string should be freed with g_free() when done using it.
|
|
5676
5737
|
*/
|
|
5677
|
-
export function compute_hmac_for_string(digest_type: ChecksumType, key: Uint8Array, str: string
|
|
5738
|
+
export function compute_hmac_for_string(digest_type: ChecksumType, key: Uint8Array, str: string, length: number): string | null
|
|
5678
5739
|
/**
|
|
5679
5740
|
* Converts a string from one character set to another.
|
|
5680
5741
|
*
|
|
@@ -5695,7 +5756,7 @@ export function compute_hmac_for_string(digest_type: ChecksumType, key: Uint8Arr
|
|
|
5695
5756
|
* @param from_codeset character set of `str`.
|
|
5696
5757
|
* @returns If the conversion was successful, a newly allocated buffer containing the converted string, which must be freed with g_free(). Otherwise %NULL and @error will be set.
|
|
5697
5758
|
*/
|
|
5698
|
-
export function convert(str: Uint8Array, to_codeset: string
|
|
5759
|
+
export function convert(str: Uint8Array, to_codeset: string, from_codeset: string): [ /* returnType */ Uint8Array, /* bytes_read */ number ]
|
|
5699
5760
|
export function convert_error_quark(): Quark
|
|
5700
5761
|
/**
|
|
5701
5762
|
* Converts a string from one character set to another, possibly
|
|
@@ -5721,7 +5782,7 @@ export function convert_error_quark(): Quark
|
|
|
5721
5782
|
* @param fallback UTF-8 string to use in place of characters not present in the target encoding. (The string must be representable in the target encoding). If %NULL, characters not in the target encoding will be represented as Unicode escapes \uxxxx or \Uxxxxyyyy.
|
|
5722
5783
|
* @returns If the conversion was successful, a newly allocated buffer containing the converted string, which must be freed with g_free(). Otherwise %NULL and @error will be set.
|
|
5723
5784
|
*/
|
|
5724
|
-
export function convert_with_fallback(str: Uint8Array, to_codeset: string
|
|
5785
|
+
export function convert_with_fallback(str: Uint8Array, to_codeset: string, from_codeset: string, fallback: string): [ /* returnType */ Uint8Array, /* bytes_read */ number ]
|
|
5725
5786
|
/**
|
|
5726
5787
|
* Calls the given function for each data element of the datalist. The
|
|
5727
5788
|
* function is called with each data element's #GQuark id and data,
|
|
@@ -5744,7 +5805,7 @@ export function datalist_foreach(datalist: Data, func: DataForeachFunc): void
|
|
|
5744
5805
|
* @param key the string identifying a data element.
|
|
5745
5806
|
* @returns the data element, or %NULL if it is not found.
|
|
5746
5807
|
*/
|
|
5747
|
-
export function datalist_get_data(datalist: Data, key: string
|
|
5808
|
+
export function datalist_get_data(datalist: Data, key: string): any | null
|
|
5748
5809
|
/**
|
|
5749
5810
|
* Gets flags values packed in together with the datalist.
|
|
5750
5811
|
* See g_datalist_set_flags().
|
|
@@ -5874,7 +5935,7 @@ export function date_is_leap_year(year: DateYear): boolean
|
|
|
5874
5935
|
* @param date valid #GDate
|
|
5875
5936
|
* @returns number of characters written to the buffer, or 0 the buffer was too small
|
|
5876
5937
|
*/
|
|
5877
|
-
export function date_strftime(s: string | null, slen: number, format: string
|
|
5938
|
+
export function date_strftime(s: string | null, slen: number, format: string, date: Date): number
|
|
5878
5939
|
/**
|
|
5879
5940
|
* Returns %TRUE if the day of the month is valid (a day is valid if it's
|
|
5880
5941
|
* between 1 and 31 inclusive).
|
|
@@ -5930,19 +5991,19 @@ export function date_valid_year(year: DateYear): boolean
|
|
|
5930
5991
|
* @param category a locale category
|
|
5931
5992
|
* @returns the translated string for the given locale category
|
|
5932
5993
|
*/
|
|
5933
|
-
export function dcgettext(domain: string | null, msgid: string
|
|
5994
|
+
export function dcgettext(domain: string | null, msgid: string, category: number): string
|
|
5934
5995
|
/**
|
|
5935
5996
|
* This function is a wrapper of dgettext() which does not translate
|
|
5936
5997
|
* the message if the default domain as set with textdomain() has no
|
|
5937
5998
|
* translations for the current locale.
|
|
5938
5999
|
*
|
|
5939
6000
|
* The advantage of using this function over dgettext() proper is that
|
|
5940
|
-
* libraries using this function (like GTK
|
|
6001
|
+
* libraries using this function (like GTK) will not use translations
|
|
5941
6002
|
* if the application using the library does not have translations for
|
|
5942
6003
|
* the current locale. This results in a consistent English-only
|
|
5943
6004
|
* interface instead of one having partial translations. For this
|
|
5944
6005
|
* feature to work, the call to textdomain() and setlocale() should
|
|
5945
|
-
* precede any g_dgettext() invocations. For GTK
|
|
6006
|
+
* precede any g_dgettext() invocations. For GTK, it means calling
|
|
5946
6007
|
* textdomain() before gtk_init or its variants.
|
|
5947
6008
|
*
|
|
5948
6009
|
* This function disables translations if and only if upon its first
|
|
@@ -5960,7 +6021,7 @@ export function dcgettext(domain: string | null, msgid: string | null, category:
|
|
|
5960
6021
|
*
|
|
5961
6022
|
* Note that this behavior may not be desired for example if an application
|
|
5962
6023
|
* has its untranslated messages in a language other than English. In those
|
|
5963
|
-
* cases the application should call textdomain() after initializing GTK
|
|
6024
|
+
* cases the application should call textdomain() after initializing GTK.
|
|
5964
6025
|
*
|
|
5965
6026
|
* Applications should normally not use this function directly,
|
|
5966
6027
|
* but use the _() macro for translations.
|
|
@@ -5968,7 +6029,7 @@ export function dcgettext(domain: string | null, msgid: string | null, category:
|
|
|
5968
6029
|
* @param msgid message to translate
|
|
5969
6030
|
* @returns The translated string
|
|
5970
6031
|
*/
|
|
5971
|
-
export function dgettext(domain: string | null, msgid: string
|
|
6032
|
+
export function dgettext(domain: string | null, msgid: string): string
|
|
5972
6033
|
/**
|
|
5973
6034
|
* Creates a subdirectory in the preferred directory for temporary
|
|
5974
6035
|
* files (as returned by g_get_tmp_dir()).
|
|
@@ -6023,7 +6084,7 @@ export function direct_hash(v: any | null): number
|
|
|
6023
6084
|
* @param n the quantity for which translation is needed
|
|
6024
6085
|
* @returns The translated string
|
|
6025
6086
|
*/
|
|
6026
|
-
export function dngettext(domain: string | null, msgid: string
|
|
6087
|
+
export function dngettext(domain: string | null, msgid: string, msgid_plural: string, n: number): string
|
|
6027
6088
|
/**
|
|
6028
6089
|
* Compares the two #gdouble values being pointed to and returns
|
|
6029
6090
|
* %TRUE if they are equal.
|
|
@@ -6063,7 +6124,7 @@ export function double_hash(v: any): number
|
|
|
6063
6124
|
* @param msgidoffset the offset of the message id in `msgctxid`
|
|
6064
6125
|
* @returns The translated string
|
|
6065
6126
|
*/
|
|
6066
|
-
export function dpgettext(domain: string | null, msgctxtid: string
|
|
6127
|
+
export function dpgettext(domain: string | null, msgctxtid: string, msgidoffset: number): string
|
|
6067
6128
|
/**
|
|
6068
6129
|
* This function is a variant of g_dgettext() which supports
|
|
6069
6130
|
* a disambiguating message context. GNU gettext uses the
|
|
@@ -6080,7 +6141,7 @@ export function dpgettext(domain: string | null, msgctxtid: string | null, msgid
|
|
|
6080
6141
|
* @param msgid the message
|
|
6081
6142
|
* @returns The translated string
|
|
6082
6143
|
*/
|
|
6083
|
-
export function dpgettext2(domain: string | null, context: string
|
|
6144
|
+
export function dpgettext2(domain: string | null, context: string, msgid: string): string
|
|
6084
6145
|
/**
|
|
6085
6146
|
* Returns the value of the environment variable `variable` in the
|
|
6086
6147
|
* provided list `envp`.
|
|
@@ -6374,7 +6435,7 @@ export function filename_display_name(filename: string): string | null
|
|
|
6374
6435
|
* @param uri a uri describing a filename (escaped, encoded in ASCII).
|
|
6375
6436
|
* @returns a newly-allocated string holding the resulting filename, or %NULL on an error.
|
|
6376
6437
|
*/
|
|
6377
|
-
export function filename_from_uri(uri: string
|
|
6438
|
+
export function filename_from_uri(uri: string): [ /* returnType */ string, /* hostname */ string | null ]
|
|
6378
6439
|
/**
|
|
6379
6440
|
* Converts a string from UTF-8 to the encoding GLib uses for
|
|
6380
6441
|
* filenames. Note that on Windows GLib uses UTF-8 for filenames;
|
|
@@ -6390,7 +6451,7 @@ export function filename_from_uri(uri: string | null): [ /* returnType */ string
|
|
|
6390
6451
|
* @param len the length of the string, or -1 if the string is nul-terminated.
|
|
6391
6452
|
* @returns The converted string, or %NULL on an error.
|
|
6392
6453
|
*/
|
|
6393
|
-
export function filename_from_utf8(utf8string: string
|
|
6454
|
+
export function filename_from_utf8(utf8string: string, len: number): [ /* returnType */ string, /* bytes_read */ number, /* bytes_written */ number ]
|
|
6394
6455
|
/**
|
|
6395
6456
|
* Converts an absolute filename to an escaped ASCII-encoded URI, with the path
|
|
6396
6457
|
* component following Section 3.3. of RFC 2396.
|
|
@@ -6487,6 +6548,12 @@ export function format_size_full(size: number, flags: FormatSizeFlags): string |
|
|
|
6487
6548
|
* If you know the allocated size of `mem,` calling g_free_sized() may be faster,
|
|
6488
6549
|
* depending on the libc implementation in use.
|
|
6489
6550
|
*
|
|
6551
|
+
* Starting from GLib 2.78, this may happen automatically in case a GCC
|
|
6552
|
+
* compatible compiler is used with some optimization level and the allocated
|
|
6553
|
+
* size is known at compile time (see [documentation of
|
|
6554
|
+
* `__builtin_object_size()`](https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html)
|
|
6555
|
+
* to understand its caveats).
|
|
6556
|
+
*
|
|
6490
6557
|
* If `mem` is %NULL it simply returns, so there is no need to check `mem`
|
|
6491
6558
|
* against %NULL before calling this function.
|
|
6492
6559
|
* @param mem the memory to free
|
|
@@ -6500,6 +6567,10 @@ export function free(mem: any | null): void
|
|
|
6500
6567
|
* It is an error if `size` doesn’t match the size passed when `mem` was
|
|
6501
6568
|
* allocated. `size` is passed to this function to allow optimizations in the
|
|
6502
6569
|
* allocator. If you don’t know the allocation size, use g_free() instead.
|
|
6570
|
+
*
|
|
6571
|
+
* In case a GCC compatible compiler is used, this function may be used
|
|
6572
|
+
* automatically via g_free() if the allocated size is known at compile time,
|
|
6573
|
+
* since GLib 2.78.
|
|
6503
6574
|
* @param mem the memory to free
|
|
6504
6575
|
* @param size size of `mem,` in bytes
|
|
6505
6576
|
*/
|
|
@@ -6539,7 +6610,7 @@ export function get_application_name(): string | null
|
|
|
6539
6610
|
* freed.
|
|
6540
6611
|
* @returns %TRUE if the returned charset is UTF-8
|
|
6541
6612
|
*/
|
|
6542
|
-
export function get_charset(): [ /* returnType */ boolean, /* charset */ string
|
|
6613
|
+
export function get_charset(): [ /* returnType */ boolean, /* charset */ string ]
|
|
6543
6614
|
/**
|
|
6544
6615
|
* Gets the character set for the current locale.
|
|
6545
6616
|
* @returns a newly allocated string containing the name of the character set. This string must be freed with g_free().
|
|
@@ -6565,7 +6636,7 @@ export function get_codeset(): string | null
|
|
|
6565
6636
|
* freed.
|
|
6566
6637
|
* @returns %TRUE if the returned charset is UTF-8
|
|
6567
6638
|
*/
|
|
6568
|
-
export function get_console_charset(): [ /* returnType */ boolean, /* charset */ string
|
|
6639
|
+
export function get_console_charset(): [ /* returnType */ boolean, /* charset */ string ]
|
|
6569
6640
|
/**
|
|
6570
6641
|
* Gets the current directory.
|
|
6571
6642
|
*
|
|
@@ -6670,7 +6741,7 @@ export function get_home_dir(): string
|
|
|
6670
6741
|
* The encoding of the returned string is UTF-8.
|
|
6671
6742
|
* @returns the host name of the machine.
|
|
6672
6743
|
*/
|
|
6673
|
-
export function get_host_name(): string
|
|
6744
|
+
export function get_host_name(): string
|
|
6674
6745
|
/**
|
|
6675
6746
|
* Computes a list of applicable locale names, which can be used to
|
|
6676
6747
|
* e.g. construct locale-dependent filenames or search paths. The returned
|
|
@@ -6700,7 +6771,7 @@ export function get_language_names(): string[]
|
|
|
6700
6771
|
* @param category_name a locale category name
|
|
6701
6772
|
* @returns a %NULL-terminated array of strings owned by the thread g_get_language_names_with_category was called from. It must not be modified or freed. It must be copied if planned to be used in another thread.
|
|
6702
6773
|
*/
|
|
6703
|
-
export function get_language_names_with_category(category_name: string
|
|
6774
|
+
export function get_language_names_with_category(category_name: string): string[]
|
|
6704
6775
|
/**
|
|
6705
6776
|
* Returns a list of derived variants of `locale,` which can be used to
|
|
6706
6777
|
* e.g. construct locale-dependent filenames or search paths. The returned
|
|
@@ -6720,7 +6791,7 @@ export function get_language_names_with_category(category_name: string | null):
|
|
|
6720
6791
|
* @param locale a locale identifier
|
|
6721
6792
|
* @returns a newly allocated array of newly allocated strings with the locale variants. Free with g_strfreev().
|
|
6722
6793
|
*/
|
|
6723
|
-
export function get_locale_variants(locale: string
|
|
6794
|
+
export function get_locale_variants(locale: string): string[]
|
|
6724
6795
|
/**
|
|
6725
6796
|
* Queries the system monotonic time.
|
|
6726
6797
|
*
|
|
@@ -6755,13 +6826,13 @@ export function get_num_processors(): number
|
|
|
6755
6826
|
* @param key_name a key for the OS info being requested, for example %G_OS_INFO_KEY_NAME.
|
|
6756
6827
|
* @returns The associated value for the requested key or %NULL if this information is not provided.
|
|
6757
6828
|
*/
|
|
6758
|
-
export function get_os_info(key_name: string
|
|
6829
|
+
export function get_os_info(key_name: string): string | null
|
|
6759
6830
|
/**
|
|
6760
6831
|
* Gets the name of the program. This name should not be localized,
|
|
6761
6832
|
* in contrast to g_get_application_name().
|
|
6762
6833
|
*
|
|
6763
6834
|
* If you are using #GApplication the program name is set in
|
|
6764
|
-
* g_application_run(). In case of GDK or GTK
|
|
6835
|
+
* g_application_run(). In case of GDK or GTK it is set in
|
|
6765
6836
|
* gdk_init(), which is called by gtk_init() and the
|
|
6766
6837
|
* #GtkApplication::startup handler. The program name is found by
|
|
6767
6838
|
* taking the last component of `argv[`0].
|
|
@@ -7243,7 +7314,7 @@ export function hook_unref(hook_list: HookList, hook: Hook): void
|
|
|
7243
7314
|
* @param hostname a hostname
|
|
7244
7315
|
* @returns %TRUE if @hostname contains any ASCII-encoded segments.
|
|
7245
7316
|
*/
|
|
7246
|
-
export function hostname_is_ascii_encoded(hostname: string
|
|
7317
|
+
export function hostname_is_ascii_encoded(hostname: string): boolean
|
|
7247
7318
|
/**
|
|
7248
7319
|
* Tests if `hostname` is the string form of an IPv4 or IPv6 address.
|
|
7249
7320
|
* (Eg, "192.168.0.1".)
|
|
@@ -7252,7 +7323,7 @@ export function hostname_is_ascii_encoded(hostname: string | null): boolean
|
|
|
7252
7323
|
* @param hostname a hostname (or IP address in string form)
|
|
7253
7324
|
* @returns %TRUE if @hostname is an IP address
|
|
7254
7325
|
*/
|
|
7255
|
-
export function hostname_is_ip_address(hostname: string
|
|
7326
|
+
export function hostname_is_ip_address(hostname: string): boolean
|
|
7256
7327
|
/**
|
|
7257
7328
|
* Tests if `hostname` contains Unicode characters. If this returns
|
|
7258
7329
|
* %TRUE, you need to encode the hostname with g_hostname_to_ascii()
|
|
@@ -7264,7 +7335,7 @@ export function hostname_is_ip_address(hostname: string | null): boolean
|
|
|
7264
7335
|
* @param hostname a hostname
|
|
7265
7336
|
* @returns %TRUE if @hostname contains any non-ASCII characters
|
|
7266
7337
|
*/
|
|
7267
|
-
export function hostname_is_non_ascii(hostname: string
|
|
7338
|
+
export function hostname_is_non_ascii(hostname: string): boolean
|
|
7268
7339
|
/**
|
|
7269
7340
|
* Converts `hostname` to its canonical ASCII form; an ASCII-only
|
|
7270
7341
|
* string containing no uppercase letters and not ending with a
|
|
@@ -7272,7 +7343,7 @@ export function hostname_is_non_ascii(hostname: string | null): boolean
|
|
|
7272
7343
|
* @param hostname a valid UTF-8 or ASCII hostname
|
|
7273
7344
|
* @returns an ASCII hostname, which must be freed, or %NULL if @hostname is in some way invalid.
|
|
7274
7345
|
*/
|
|
7275
|
-
export function hostname_to_ascii(hostname: string
|
|
7346
|
+
export function hostname_to_ascii(hostname: string): string | null
|
|
7276
7347
|
/**
|
|
7277
7348
|
* Converts `hostname` to its canonical presentation form; a UTF-8
|
|
7278
7349
|
* string in Unicode normalization form C, containing no uppercase
|
|
@@ -7284,7 +7355,7 @@ export function hostname_to_ascii(hostname: string | null): string | null
|
|
|
7284
7355
|
* @param hostname a valid UTF-8 or ASCII hostname
|
|
7285
7356
|
* @returns a UTF-8 hostname, which must be freed, or %NULL if @hostname is in some way invalid.
|
|
7286
7357
|
*/
|
|
7287
|
-
export function hostname_to_unicode(hostname: string
|
|
7358
|
+
export function hostname_to_unicode(hostname: string): string | null
|
|
7288
7359
|
/**
|
|
7289
7360
|
* Adds a function to be called whenever there are no higher priority
|
|
7290
7361
|
* events pending.
|
|
@@ -7382,7 +7453,7 @@ export function int_hash(v: any): number
|
|
|
7382
7453
|
* @param string a static string
|
|
7383
7454
|
* @returns a canonical representation for the string
|
|
7384
7455
|
*/
|
|
7385
|
-
export function intern_static_string(string: string | null): string
|
|
7456
|
+
export function intern_static_string(string: string | null): string
|
|
7386
7457
|
/**
|
|
7387
7458
|
* Returns a canonical representation for `string`. Interned strings
|
|
7388
7459
|
* can be compared for equality by comparing the pointers, instead of
|
|
@@ -7394,7 +7465,7 @@ export function intern_static_string(string: string | null): string | null
|
|
|
7394
7465
|
* @param string a string
|
|
7395
7466
|
* @returns a canonical representation for the string
|
|
7396
7467
|
*/
|
|
7397
|
-
export function intern_string(string: string | null): string
|
|
7468
|
+
export function intern_string(string: string | null): string
|
|
7398
7469
|
/**
|
|
7399
7470
|
* Adds the #GIOChannel into the default main loop context
|
|
7400
7471
|
* with the given priority.
|
|
@@ -7463,7 +7534,7 @@ export function listenv(): string[]
|
|
|
7463
7534
|
* @param len the length of the string, or -1 if the string is nul-terminated.
|
|
7464
7535
|
* @returns A newly-allocated buffer containing the converted string, or %NULL on an error, and error will be set.
|
|
7465
7536
|
*/
|
|
7466
|
-
export function locale_from_utf8(utf8string: string
|
|
7537
|
+
export function locale_from_utf8(utf8string: string, len: number): [ /* returnType */ Uint8Array, /* bytes_read */ number ]
|
|
7467
7538
|
/**
|
|
7468
7539
|
* Converts a string which is in the encoding used for strings by
|
|
7469
7540
|
* the C runtime (usually the same as that used by the operating
|
|
@@ -7533,7 +7604,7 @@ export function log_get_debug_enabled(): boolean
|
|
|
7533
7604
|
* @param log_domain the log domain
|
|
7534
7605
|
* @param handler_id the id of the handler, which was returned in g_log_set_handler()
|
|
7535
7606
|
*/
|
|
7536
|
-
export function log_remove_handler(log_domain: string
|
|
7607
|
+
export function log_remove_handler(log_domain: string, handler_id: number): void
|
|
7537
7608
|
/**
|
|
7538
7609
|
* Sets the message levels which are always fatal, in any log domain.
|
|
7539
7610
|
* When a message with any of these levels is logged the program terminates.
|
|
@@ -7583,7 +7654,7 @@ export function log_set_debug_enabled(enabled: boolean): void
|
|
|
7583
7654
|
* @param fatal_mask the new fatal mask
|
|
7584
7655
|
* @returns the old fatal mask for the log domain
|
|
7585
7656
|
*/
|
|
7586
|
-
export function log_set_fatal_mask(log_domain: string
|
|
7657
|
+
export function log_set_fatal_mask(log_domain: string, fatal_mask: LogLevelFlags): LogLevelFlags
|
|
7587
7658
|
/**
|
|
7588
7659
|
* Like g_log_set_handler(), but takes a destroy notify for the `user_data`.
|
|
7589
7660
|
*
|
|
@@ -7839,7 +7910,7 @@ export function main_current_source(): Source | null
|
|
|
7839
7910
|
/**
|
|
7840
7911
|
* Returns the depth of the stack of calls to
|
|
7841
7912
|
* g_main_context_dispatch() on any #GMainContext in the current thread.
|
|
7842
|
-
*
|
|
7913
|
+
* That is, when called from the toplevel, it gives 0. When
|
|
7843
7914
|
* called from within a callback from g_main_context_iteration()
|
|
7844
7915
|
* (or g_main_loop_run(), etc.) it returns 1. When called from within
|
|
7845
7916
|
* a callback to a recursive call to g_main_context_iteration(),
|
|
@@ -8007,7 +8078,7 @@ export function markup_error_quark(): Quark
|
|
|
8007
8078
|
* @param length length of `text` in bytes, or -1 if the text is nul-terminated
|
|
8008
8079
|
* @returns a newly allocated string with the escaped text
|
|
8009
8080
|
*/
|
|
8010
|
-
export function markup_escape_text(text: string
|
|
8081
|
+
export function markup_escape_text(text: string, length: number): string | null
|
|
8011
8082
|
/**
|
|
8012
8083
|
* Checks whether the allocator used by g_malloc() is the system's
|
|
8013
8084
|
* malloc implementation. If it returns %TRUE memory allocated with
|
|
@@ -8115,7 +8186,7 @@ export function number_parser_error_quark(): Quark
|
|
|
8115
8186
|
* calling g_on_error_stack_trace() instead.
|
|
8116
8187
|
* @param prg_name the program name, needed by gdb for the "[S]tack trace" option. If `prg_name` is %NULL, g_get_prgname() is called to get the program name (which will work correctly if gdk_init() or gtk_init() has been called)
|
|
8117
8188
|
*/
|
|
8118
|
-
export function on_error_query(prg_name: string
|
|
8189
|
+
export function on_error_query(prg_name: string): void
|
|
8119
8190
|
/**
|
|
8120
8191
|
* Invokes gdb, which attaches to the current process and shows a
|
|
8121
8192
|
* stack trace. Called by g_on_error_query() when the "[S]tack trace"
|
|
@@ -8132,7 +8203,7 @@ export function on_error_query(prg_name: string | null): void
|
|
|
8132
8203
|
* handle that exception (see [Running GLib Applications](glib-running.html)).
|
|
8133
8204
|
* @param prg_name the program name, needed by gdb for the "[S]tack trace" option
|
|
8134
8205
|
*/
|
|
8135
|
-
export function on_error_stack_trace(prg_name: string
|
|
8206
|
+
export function on_error_stack_trace(prg_name: string): void
|
|
8136
8207
|
/**
|
|
8137
8208
|
* Function to be called when starting a critical initialization
|
|
8138
8209
|
* section. The argument `location` must point to a static
|
|
@@ -8182,7 +8253,7 @@ export function option_error_quark(): Quark
|
|
|
8182
8253
|
/**
|
|
8183
8254
|
* Parses a string containing debugging options
|
|
8184
8255
|
* into a %guint containing bit flags. This is used
|
|
8185
|
-
* within GDK and GTK
|
|
8256
|
+
* within GDK and GTK to parse the debug options passed on the
|
|
8186
8257
|
* command line or through environment variables.
|
|
8187
8258
|
*
|
|
8188
8259
|
* If `string` is equal to "all", all flags are set. Any flags
|
|
@@ -8280,7 +8351,7 @@ export function path_skip_root(file_name: string): string | null
|
|
|
8280
8351
|
* @param string the UTF-8 encoded string to match
|
|
8281
8352
|
* @returns %TRUE if @string matches @pspec
|
|
8282
8353
|
*/
|
|
8283
|
-
export function pattern_match_simple(pattern: string
|
|
8354
|
+
export function pattern_match_simple(pattern: string, string: string): boolean
|
|
8284
8355
|
/**
|
|
8285
8356
|
* This is equivalent to g_bit_lock, but working on pointers (or other
|
|
8286
8357
|
* pointer-sized values).
|
|
@@ -8351,7 +8422,7 @@ export function poll(fds: PollFD, nfds: number, timeout: number): number
|
|
|
8351
8422
|
* @param err a return location for a #GError, or %NULL
|
|
8352
8423
|
* @param prefix string to prefix `err` with
|
|
8353
8424
|
*/
|
|
8354
|
-
export function prefix_error_literal(err: Error | null, prefix: string
|
|
8425
|
+
export function prefix_error_literal(err: Error | null, prefix: string): void
|
|
8355
8426
|
/**
|
|
8356
8427
|
* If `dest` is %NULL, free `src;` otherwise, moves `src` into *`dest`.
|
|
8357
8428
|
* The error variable `dest` points to must be %NULL.
|
|
@@ -8376,7 +8447,7 @@ export function propagate_error(src: Error): /* dest */ Error | null
|
|
|
8376
8447
|
* with statically allocated strings in the main program, but not with
|
|
8377
8448
|
* statically allocated memory in dynamically loaded modules, if you
|
|
8378
8449
|
* expect to ever unload the module again (e.g. do not use this
|
|
8379
|
-
* function in GTK
|
|
8450
|
+
* function in GTK theme engines).
|
|
8380
8451
|
*
|
|
8381
8452
|
* This function must not be used before library constructors have finished
|
|
8382
8453
|
* running. In particular, this means it cannot be used to initialize global
|
|
@@ -8402,7 +8473,7 @@ export function quark_from_string(string: string | null): Quark
|
|
|
8402
8473
|
* @param quark a #GQuark.
|
|
8403
8474
|
* @returns the string associated with the #GQuark
|
|
8404
8475
|
*/
|
|
8405
|
-
export function quark_to_string(quark: Quark): string
|
|
8476
|
+
export function quark_to_string(quark: Quark): string
|
|
8406
8477
|
/**
|
|
8407
8478
|
* Gets the #GQuark associated with the given string, or 0 if string is
|
|
8408
8479
|
* %NULL or it has no associated #GQuark.
|
|
@@ -8587,7 +8658,7 @@ export function ref_string_length(str: string | null): number
|
|
|
8587
8658
|
* @param str a NUL-terminated string
|
|
8588
8659
|
* @returns the newly created reference counted string
|
|
8589
8660
|
*/
|
|
8590
|
-
export function ref_string_new(str: string
|
|
8661
|
+
export function ref_string_new(str: string): string | null
|
|
8591
8662
|
/**
|
|
8592
8663
|
* Creates a new reference counted string and copies the content of `str`
|
|
8593
8664
|
* into it.
|
|
@@ -8598,7 +8669,7 @@ export function ref_string_new(str: string | null): string | null
|
|
|
8598
8669
|
* @param str a NUL-terminated string
|
|
8599
8670
|
* @returns the newly created reference counted string, or a new reference to an existing string
|
|
8600
8671
|
*/
|
|
8601
|
-
export function ref_string_new_intern(str: string
|
|
8672
|
+
export function ref_string_new_intern(str: string): string | null
|
|
8602
8673
|
/**
|
|
8603
8674
|
* Creates a new reference counted string and copies the contents of `str`
|
|
8604
8675
|
* into it, up to `len` bytes.
|
|
@@ -8609,7 +8680,7 @@ export function ref_string_new_intern(str: string | null): string | null
|
|
|
8609
8680
|
* @param len length of `str` to use, or -1 if `str` is nul-terminated
|
|
8610
8681
|
* @returns the newly created reference counted string
|
|
8611
8682
|
*/
|
|
8612
|
-
export function ref_string_new_len(str: string
|
|
8683
|
+
export function ref_string_new_len(str: string, len: number): string | null
|
|
8613
8684
|
/**
|
|
8614
8685
|
* Releases a reference on a string; if it was the last reference, the
|
|
8615
8686
|
* resources allocated by the string are freed as well.
|
|
@@ -8629,7 +8700,7 @@ export function ref_string_release(str: string | null): void
|
|
|
8629
8700
|
* @param replacement the replacement string
|
|
8630
8701
|
* @returns whether @replacement is a valid replacement string
|
|
8631
8702
|
*/
|
|
8632
|
-
export function regex_check_replacement(replacement: string
|
|
8703
|
+
export function regex_check_replacement(replacement: string): [ /* returnType */ boolean, /* has_references */ boolean ]
|
|
8633
8704
|
export function regex_error_quark(): Quark
|
|
8634
8705
|
/**
|
|
8635
8706
|
* Escapes the nul characters in `string` to "\x00". It can be used
|
|
@@ -8641,7 +8712,7 @@ export function regex_error_quark(): Quark
|
|
|
8641
8712
|
* @param length the length of `string`
|
|
8642
8713
|
* @returns a newly-allocated escaped string
|
|
8643
8714
|
*/
|
|
8644
|
-
export function regex_escape_nul(string: string
|
|
8715
|
+
export function regex_escape_nul(string: string, length: number): string | null
|
|
8645
8716
|
/**
|
|
8646
8717
|
* Escapes the special characters used for regular expressions
|
|
8647
8718
|
* in `string,` for instance "a.b*c" becomes "a\.b\*c". This
|
|
@@ -8654,7 +8725,7 @@ export function regex_escape_nul(string: string | null, length: number): string
|
|
|
8654
8725
|
* @param length the length of `string,` in bytes, or -1 if `string` is nul-terminated
|
|
8655
8726
|
* @returns a newly-allocated escaped string
|
|
8656
8727
|
*/
|
|
8657
|
-
export function regex_escape_string(string: string
|
|
8728
|
+
export function regex_escape_string(string: string, length: number): string | null
|
|
8658
8729
|
/**
|
|
8659
8730
|
* Scans for a match in `string` for `pattern`.
|
|
8660
8731
|
*
|
|
@@ -8672,7 +8743,7 @@ export function regex_escape_string(string: string | null, length: number): stri
|
|
|
8672
8743
|
* @param match_options match options, or 0
|
|
8673
8744
|
* @returns %TRUE if the string matched, %FALSE otherwise
|
|
8674
8745
|
*/
|
|
8675
|
-
export function regex_match_simple(pattern: string
|
|
8746
|
+
export function regex_match_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): boolean
|
|
8676
8747
|
/**
|
|
8677
8748
|
* Breaks the string on the pattern, and returns an array of
|
|
8678
8749
|
* the tokens. If the pattern contains capturing parentheses,
|
|
@@ -8707,7 +8778,7 @@ export function regex_match_simple(pattern: string | null, string: string | null
|
|
|
8707
8778
|
* @param match_options match options, or 0
|
|
8708
8779
|
* @returns a %NULL-terminated array of strings. Free it using g_strfreev()
|
|
8709
8780
|
*/
|
|
8710
|
-
export function regex_split_simple(pattern: string
|
|
8781
|
+
export function regex_split_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): string[]
|
|
8711
8782
|
/**
|
|
8712
8783
|
* Resets the cache used for g_get_user_special_dir(), so
|
|
8713
8784
|
* that the latest on-disk version is used. Call this only
|
|
@@ -8824,7 +8895,7 @@ export function sequence_swap(a: SequenceIter, b: SequenceIter): void
|
|
|
8824
8895
|
* or when displaying an application's name in the task list.
|
|
8825
8896
|
* @param application_name localized name of the application
|
|
8826
8897
|
*/
|
|
8827
|
-
export function set_application_name(application_name: string
|
|
8898
|
+
export function set_application_name(application_name: string): void
|
|
8828
8899
|
/**
|
|
8829
8900
|
* Does nothing if `err` is %NULL; if `err` is non-%NULL, then *`err`
|
|
8830
8901
|
* must be %NULL. A new #GError is created and assigned to *`err`.
|
|
@@ -8835,13 +8906,13 @@ export function set_application_name(application_name: string | null): void
|
|
|
8835
8906
|
* @param code error code
|
|
8836
8907
|
* @param message error message
|
|
8837
8908
|
*/
|
|
8838
|
-
export function set_error_literal(domain: Quark, code: number, message: string
|
|
8909
|
+
export function set_error_literal(domain: Quark, code: number, message: string): /* err */ Error
|
|
8839
8910
|
/**
|
|
8840
8911
|
* Sets the name of the program. This name should not be localized,
|
|
8841
8912
|
* in contrast to g_set_application_name().
|
|
8842
8913
|
*
|
|
8843
8914
|
* If you are using #GApplication the program name is set in
|
|
8844
|
-
* g_application_run(). In case of GDK or GTK
|
|
8915
|
+
* g_application_run(). In case of GDK or GTK it is set in
|
|
8845
8916
|
* gdk_init(), which is called by gtk_init() and the
|
|
8846
8917
|
* #GtkApplication::startup handler. The program name is found by
|
|
8847
8918
|
* taking the last component of `argv[`0].
|
|
@@ -8851,7 +8922,7 @@ export function set_error_literal(domain: Quark, code: number, message: string |
|
|
|
8851
8922
|
* could only be called once per process.
|
|
8852
8923
|
* @param prgname the name of the program.
|
|
8853
8924
|
*/
|
|
8854
|
-
export function set_prgname(prgname: string
|
|
8925
|
+
export function set_prgname(prgname: string): void
|
|
8855
8926
|
/**
|
|
8856
8927
|
* Sets an environment variable. On UNIX, both the variable's name and
|
|
8857
8928
|
* value can be arbitrary byte strings, except that the variable's name
|
|
@@ -9084,7 +9155,7 @@ export function source_remove_by_user_data(user_data: any | null): boolean
|
|
|
9084
9155
|
* @param tag a #GSource ID
|
|
9085
9156
|
* @param name debug name for the source
|
|
9086
9157
|
*/
|
|
9087
|
-
export function source_set_name_by_id(tag: number, name: string
|
|
9158
|
+
export function source_set_name_by_id(tag: number, name: string): void
|
|
9088
9159
|
/**
|
|
9089
9160
|
* Gets the smallest prime number from a built-in array of primes which
|
|
9090
9161
|
* is larger than `num`. This is used within GLib to calculate the optimum
|
|
@@ -9513,7 +9584,7 @@ export function spawn_sync(working_directory: string | null, argv: string[], env
|
|
|
9513
9584
|
* @param src source string.
|
|
9514
9585
|
* @returns a pointer to the trailing nul byte in `dest`.
|
|
9515
9586
|
*/
|
|
9516
|
-
export function stpcpy(dest: string | null, src: string
|
|
9587
|
+
export function stpcpy(dest: string | null, src: string): string | null
|
|
9517
9588
|
/**
|
|
9518
9589
|
* Compares two strings for byte-by-byte equality and returns %TRUE
|
|
9519
9590
|
* if they are equal. It can be passed to g_hash_table_new() as the
|
|
@@ -9534,14 +9605,14 @@ export function str_equal(v1: any, v2: any): boolean
|
|
|
9534
9605
|
* @param prefix the nul-terminated prefix to look for
|
|
9535
9606
|
* @returns %TRUE if @str begins with @prefix, %FALSE otherwise.
|
|
9536
9607
|
*/
|
|
9537
|
-
export function str_has_prefix(str: string
|
|
9608
|
+
export function str_has_prefix(str: string, prefix: string): boolean
|
|
9538
9609
|
/**
|
|
9539
9610
|
* Looks whether the string `str` ends with `suffix`.
|
|
9540
9611
|
* @param str a nul-terminated string
|
|
9541
9612
|
* @param suffix the nul-terminated suffix to look for
|
|
9542
9613
|
* @returns %TRUE if @str end with @suffix, %FALSE otherwise.
|
|
9543
9614
|
*/
|
|
9544
|
-
export function str_has_suffix(str: string
|
|
9615
|
+
export function str_has_suffix(str: string, suffix: string): boolean
|
|
9545
9616
|
/**
|
|
9546
9617
|
* Converts a string to a hash value.
|
|
9547
9618
|
*
|
|
@@ -9567,7 +9638,7 @@ export function str_hash(v: any): number
|
|
|
9567
9638
|
* @param str a string
|
|
9568
9639
|
* @returns %TRUE if @str is ASCII
|
|
9569
9640
|
*/
|
|
9570
|
-
export function str_is_ascii(str: string
|
|
9641
|
+
export function str_is_ascii(str: string): boolean
|
|
9571
9642
|
/**
|
|
9572
9643
|
* Checks if a search conducted for `search_term` should match
|
|
9573
9644
|
* `potential_hit`.
|
|
@@ -9596,7 +9667,7 @@ export function str_is_ascii(str: string | null): boolean
|
|
|
9596
9667
|
* @param accept_alternates %TRUE to accept ASCII alternates
|
|
9597
9668
|
* @returns %TRUE if @potential_hit is a hit
|
|
9598
9669
|
*/
|
|
9599
|
-
export function str_match_string(search_term: string
|
|
9670
|
+
export function str_match_string(search_term: string, potential_hit: string, accept_alternates: boolean): boolean
|
|
9600
9671
|
/**
|
|
9601
9672
|
* Transliterate `str` to plain ASCII.
|
|
9602
9673
|
*
|
|
@@ -9620,7 +9691,7 @@ export function str_match_string(search_term: string | null, potential_hit: stri
|
|
|
9620
9691
|
* @param from_locale the source locale, if known
|
|
9621
9692
|
* @returns a string in plain ASCII
|
|
9622
9693
|
*/
|
|
9623
|
-
export function str_to_ascii(str: string
|
|
9694
|
+
export function str_to_ascii(str: string, from_locale: string | null): string | null
|
|
9624
9695
|
/**
|
|
9625
9696
|
* Tokenises `string` and performs folding on each token.
|
|
9626
9697
|
*
|
|
@@ -9641,7 +9712,7 @@ export function str_to_ascii(str: string | null, from_locale: string | null): st
|
|
|
9641
9712
|
* @param translit_locale the language code (like 'de' or 'en_GB') from which `string` originates
|
|
9642
9713
|
* @returns the folded tokens
|
|
9643
9714
|
*/
|
|
9644
|
-
export function str_tokenize_and_fold(string: string
|
|
9715
|
+
export function str_tokenize_and_fold(string: string, translit_locale: string | null): [ /* returnType */ string[], /* ascii_alternates */ string[] ]
|
|
9645
9716
|
/**
|
|
9646
9717
|
* For each character in `string,` if the character is not in `valid_chars,`
|
|
9647
9718
|
* replaces the character with `substitutor`.
|
|
@@ -9669,7 +9740,7 @@ export function str_tokenize_and_fold(string: string | null, translit_locale: st
|
|
|
9669
9740
|
* @param substitutor replacement character for disallowed bytes
|
|
9670
9741
|
* @returns the modified @string
|
|
9671
9742
|
*/
|
|
9672
|
-
export function strcanon(string: string | null, valid_chars: string
|
|
9743
|
+
export function strcanon(string: string | null, valid_chars: string, substitutor: number): string | null
|
|
9673
9744
|
/**
|
|
9674
9745
|
* A case-insensitive string comparison, corresponding to the standard
|
|
9675
9746
|
* strcasecmp() function on platforms which support it.
|
|
@@ -9677,7 +9748,7 @@ export function strcanon(string: string | null, valid_chars: string | null, subs
|
|
|
9677
9748
|
* @param s2 a string to compare with `s1`
|
|
9678
9749
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
9679
9750
|
*/
|
|
9680
|
-
export function strcasecmp(s1: string
|
|
9751
|
+
export function strcasecmp(s1: string, s2: string): number
|
|
9681
9752
|
/**
|
|
9682
9753
|
* Removes trailing whitespace from a string.
|
|
9683
9754
|
*
|
|
@@ -9723,7 +9794,7 @@ export function strcmp0(str1: string | null, str2: string | null): number
|
|
|
9723
9794
|
* @param source a string to compress
|
|
9724
9795
|
* @returns a newly-allocated copy of @source with all escaped character compressed
|
|
9725
9796
|
*/
|
|
9726
|
-
export function strcompress(source: string
|
|
9797
|
+
export function strcompress(source: string): string | null
|
|
9727
9798
|
/**
|
|
9728
9799
|
* Converts any delimiter characters in `string` to `new_delimiter`.
|
|
9729
9800
|
*
|
|
@@ -9792,7 +9863,7 @@ export function strdup(str: string | null): string | null
|
|
|
9792
9863
|
* @param errnum the system error number. See the standard C %errno documentation
|
|
9793
9864
|
* @returns a UTF-8 string describing the error code. If the error code is unknown, it returns a string like "Unknown error: <code>".
|
|
9794
9865
|
*/
|
|
9795
|
-
export function strerror(errnum: number): string
|
|
9866
|
+
export function strerror(errnum: number): string
|
|
9796
9867
|
/**
|
|
9797
9868
|
* Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\'
|
|
9798
9869
|
* and '"' in the string `source` by inserting a '\' before
|
|
@@ -9806,7 +9877,7 @@ export function strerror(errnum: number): string | null
|
|
|
9806
9877
|
* @param exceptions a string of characters not to escape in `source`
|
|
9807
9878
|
* @returns a newly-allocated copy of @source with certain characters escaped. See above.
|
|
9808
9879
|
*/
|
|
9809
|
-
export function strescape(source: string
|
|
9880
|
+
export function strescape(source: string, exceptions: string | null): string | null
|
|
9810
9881
|
/**
|
|
9811
9882
|
* Frees a %NULL-terminated array of strings, as well as each
|
|
9812
9883
|
* string it contains.
|
|
@@ -9821,7 +9892,7 @@ export function strfreev(str_array: string | null): void
|
|
|
9821
9892
|
* @param msgval another string
|
|
9822
9893
|
* @returns @msgval, unless @msgval is identical to @msgid and contains a '|' character, in which case a pointer to the substring of msgid after the first '|' character is returned.
|
|
9823
9894
|
*/
|
|
9824
|
-
export function strip_context(msgid: string
|
|
9895
|
+
export function strip_context(msgid: string, msgval: string): string
|
|
9825
9896
|
/**
|
|
9826
9897
|
* Joins a number of strings together to form one long string, with the
|
|
9827
9898
|
* optional `separator` inserted between each of them. The returned string
|
|
@@ -9854,7 +9925,7 @@ export function strjoinv(separator: string | null, str_array: string | null): st
|
|
|
9854
9925
|
* @param dest_size length of `dest` buffer in bytes (not length of existing string inside `dest)`
|
|
9855
9926
|
* @returns size of attempted result, which is MIN (dest_size, strlen (original dest)) + strlen (src), so if retval >= dest_size, truncation occurred.
|
|
9856
9927
|
*/
|
|
9857
|
-
export function strlcat(dest: string | null, src: string
|
|
9928
|
+
export function strlcat(dest: string | null, src: string, dest_size: number): number
|
|
9858
9929
|
/**
|
|
9859
9930
|
* Portability wrapper that calls strlcpy() on systems which have it,
|
|
9860
9931
|
* and emulates strlcpy() otherwise. Copies `src` to `dest;` `dest` is
|
|
@@ -9875,7 +9946,7 @@ export function strlcat(dest: string | null, src: string | null, dest_size: numb
|
|
|
9875
9946
|
* @param dest_size length of `dest` in bytes
|
|
9876
9947
|
* @returns length of @src
|
|
9877
9948
|
*/
|
|
9878
|
-
export function strlcpy(dest: string | null, src: string
|
|
9949
|
+
export function strlcpy(dest: string | null, src: string, dest_size: number): number
|
|
9879
9950
|
/**
|
|
9880
9951
|
* A case-insensitive string comparison, corresponding to the standard
|
|
9881
9952
|
* strncasecmp() function on platforms which support it. It is similar
|
|
@@ -9886,7 +9957,7 @@ export function strlcpy(dest: string | null, src: string | null, dest_size: numb
|
|
|
9886
9957
|
* @param n the maximum number of characters to compare
|
|
9887
9958
|
* @returns 0 if the strings match, a negative value if @s1 < @s2, or a positive value if @s1 > @s2.
|
|
9888
9959
|
*/
|
|
9889
|
-
export function strncasecmp(s1: string
|
|
9960
|
+
export function strncasecmp(s1: string, s2: string, n: number): number
|
|
9890
9961
|
/**
|
|
9891
9962
|
* Duplicates the first `n` bytes of a string, returning a newly-allocated
|
|
9892
9963
|
* buffer `n` + 1 bytes long which will always be nul-terminated. If `str`
|
|
@@ -9900,7 +9971,7 @@ export function strncasecmp(s1: string | null, s2: string | null, n: number): nu
|
|
|
9900
9971
|
* @param n the maximum number of bytes to copy from `str`
|
|
9901
9972
|
* @returns a newly-allocated buffer containing the first @n bytes of @str, nul-terminated
|
|
9902
9973
|
*/
|
|
9903
|
-
export function strndup(str: string
|
|
9974
|
+
export function strndup(str: string, n: number): string | null
|
|
9904
9975
|
/**
|
|
9905
9976
|
* Creates a new string `length` bytes long filled with `fill_char`.
|
|
9906
9977
|
* The returned string should be freed when no longer needed.
|
|
@@ -9927,7 +9998,7 @@ export function strreverse(string: string | null): string | null
|
|
|
9927
9998
|
* @param needle the nul-terminated string to search for
|
|
9928
9999
|
* @returns a pointer to the found occurrence, or %NULL if not found.
|
|
9929
10000
|
*/
|
|
9930
|
-
export function strrstr(haystack: string
|
|
10001
|
+
export function strrstr(haystack: string, needle: string): string | null
|
|
9931
10002
|
/**
|
|
9932
10003
|
* Searches the string `haystack` for the last occurrence
|
|
9933
10004
|
* of the string `needle,` limiting the length of the search
|
|
@@ -9937,7 +10008,7 @@ export function strrstr(haystack: string | null, needle: string | null): string
|
|
|
9937
10008
|
* @param needle the nul-terminated string to search for
|
|
9938
10009
|
* @returns a pointer to the found occurrence, or %NULL if not found.
|
|
9939
10010
|
*/
|
|
9940
|
-
export function strrstr_len(haystack: string
|
|
10011
|
+
export function strrstr_len(haystack: string, haystack_len: number, needle: string): string | null
|
|
9941
10012
|
/**
|
|
9942
10013
|
* Returns a string describing the given signal, e.g. "Segmentation fault".
|
|
9943
10014
|
* You should use this function in preference to strsignal(), because it
|
|
@@ -9946,17 +10017,17 @@ export function strrstr_len(haystack: string | null, haystack_len: number, needl
|
|
|
9946
10017
|
* @param signum the signal number. See the `signal` documentation
|
|
9947
10018
|
* @returns a UTF-8 string describing the signal. If the signal is unknown, it returns "unknown signal (<signum>)".
|
|
9948
10019
|
*/
|
|
9949
|
-
export function strsignal(signum: number): string
|
|
10020
|
+
export function strsignal(signum: number): string
|
|
9950
10021
|
/**
|
|
9951
10022
|
* Searches the string `haystack` for the first occurrence
|
|
9952
10023
|
* of the string `needle,` limiting the length of the search
|
|
9953
|
-
* to `haystack_len
|
|
10024
|
+
* to `haystack_len` or a nul terminator byte (whichever is reached first).
|
|
9954
10025
|
* @param haystack a nul-terminated string
|
|
9955
10026
|
* @param haystack_len the maximum length of `haystack` in bytes. A length of -1 can be used to mean "search the entire string", like `strstr()`.
|
|
9956
10027
|
* @param needle the string to search for
|
|
9957
10028
|
* @returns a pointer to the found occurrence, or %NULL if not found.
|
|
9958
10029
|
*/
|
|
9959
|
-
export function strstr_len(haystack: string
|
|
10030
|
+
export function strstr_len(haystack: string, haystack_len: number, needle: string): string | null
|
|
9960
10031
|
/**
|
|
9961
10032
|
* Converts a string to a #gdouble value.
|
|
9962
10033
|
* It calls the standard strtod() function to handle the conversion, but
|
|
@@ -9972,7 +10043,7 @@ export function strstr_len(haystack: string | null, haystack_len: number, needle
|
|
|
9972
10043
|
* @param nptr the string to convert to a numeric value.
|
|
9973
10044
|
* @returns the #gdouble value.
|
|
9974
10045
|
*/
|
|
9975
|
-
export function strtod(nptr: string
|
|
10046
|
+
export function strtod(nptr: string): [ /* returnType */ number, /* endptr */ string ]
|
|
9976
10047
|
/**
|
|
9977
10048
|
* Converts a string to upper case.
|
|
9978
10049
|
* @param string the string to convert
|
|
@@ -9985,7 +10056,7 @@ export function strup(string: string | null): string | null
|
|
|
9985
10056
|
* @param str a string
|
|
9986
10057
|
* @returns %TRUE if @str is an element of @strv, according to g_str_equal().
|
|
9987
10058
|
*/
|
|
9988
|
-
export function strv_contains(strv: string
|
|
10059
|
+
export function strv_contains(strv: string, str: string): boolean
|
|
9989
10060
|
/**
|
|
9990
10061
|
* Checks if `strv1` and `strv2` contain exactly the same elements in exactly the
|
|
9991
10062
|
* same order. Elements are compared using g_str_equal(). To match independently
|
|
@@ -9997,7 +10068,7 @@ export function strv_contains(strv: string | null, str: string | null): boolean
|
|
|
9997
10068
|
* @param strv2 another %NULL-terminated array of strings
|
|
9998
10069
|
* @returns %TRUE if @strv1 and @strv2 are equal
|
|
9999
10070
|
*/
|
|
10000
|
-
export function strv_equal(strv1: string
|
|
10071
|
+
export function strv_equal(strv1: string, strv2: string): boolean
|
|
10001
10072
|
export function strv_get_type(): GObject.GType
|
|
10002
10073
|
/**
|
|
10003
10074
|
* Returns the length of the given %NULL-terminated
|
|
@@ -10024,7 +10095,7 @@ export function strv_length(str_array: string | null): number
|
|
|
10024
10095
|
* @param test_data Test data argument for the test function.
|
|
10025
10096
|
* @param test_func The test function to invoke for this test.
|
|
10026
10097
|
*/
|
|
10027
|
-
export function test_add_data_func(testpath: string
|
|
10098
|
+
export function test_add_data_func(testpath: string, test_data: any | null, test_func: TestDataFunc): void
|
|
10028
10099
|
/**
|
|
10029
10100
|
* Create a new test case, as with g_test_add_data_func(), but freeing
|
|
10030
10101
|
* `test_data` after the test run is complete.
|
|
@@ -10032,7 +10103,7 @@ export function test_add_data_func(testpath: string | null, test_data: any | nul
|
|
|
10032
10103
|
* @param test_data Test data argument for the test function.
|
|
10033
10104
|
* @param test_func The test function to invoke for this test.
|
|
10034
10105
|
*/
|
|
10035
|
-
export function test_add_data_func_full(testpath: string
|
|
10106
|
+
export function test_add_data_func_full(testpath: string, test_data: any | null, test_func: TestDataFunc): void
|
|
10036
10107
|
/**
|
|
10037
10108
|
* Create a new test case, similar to g_test_create_case(). However
|
|
10038
10109
|
* the test is assumed to use no fixture, and test suites are automatically
|
|
@@ -10049,8 +10120,8 @@ export function test_add_data_func_full(testpath: string | null, test_data: any
|
|
|
10049
10120
|
* @param testpath /-separated test case path name for the test.
|
|
10050
10121
|
* @param test_func The test function to invoke for this test.
|
|
10051
10122
|
*/
|
|
10052
|
-
export function test_add_func(testpath: string
|
|
10053
|
-
export function test_assert_expected_messages_internal(domain: string
|
|
10123
|
+
export function test_add_func(testpath: string, test_func: TestFunc): void
|
|
10124
|
+
export function test_assert_expected_messages_internal(domain: string, file: string, line: number, func: string): void
|
|
10054
10125
|
/**
|
|
10055
10126
|
* This function adds a message to test reports that
|
|
10056
10127
|
* associates a bug URI with a test case.
|
|
@@ -10064,7 +10135,7 @@ export function test_assert_expected_messages_internal(domain: string | null, fi
|
|
|
10064
10135
|
* is already a valid URI.
|
|
10065
10136
|
* @param bug_uri_snippet Bug specific bug tracker URI or URI portion.
|
|
10066
10137
|
*/
|
|
10067
|
-
export function test_bug(bug_uri_snippet: string
|
|
10138
|
+
export function test_bug(bug_uri_snippet: string): void
|
|
10068
10139
|
/**
|
|
10069
10140
|
* Specify the base URI for bug reports.
|
|
10070
10141
|
*
|
|
@@ -10082,7 +10153,7 @@ export function test_bug(bug_uri_snippet: string | null): void
|
|
|
10082
10153
|
* from the value provided by g_test_bug().
|
|
10083
10154
|
* @param uri_pattern the base pattern for bug URIs
|
|
10084
10155
|
*/
|
|
10085
|
-
export function test_bug_base(uri_pattern: string
|
|
10156
|
+
export function test_bug_base(uri_pattern: string): void
|
|
10086
10157
|
/**
|
|
10087
10158
|
* Indicates that a message with the given `log_domain` and `log_level,`
|
|
10088
10159
|
* with text matching `pattern,` is expected to be logged. When this
|
|
@@ -10124,7 +10195,7 @@ export function test_bug_base(uri_pattern: string | null): void
|
|
|
10124
10195
|
* @param log_level the log level of the message
|
|
10125
10196
|
* @param pattern a glob-style [pattern][glib-Glob-style-pattern-matching]
|
|
10126
10197
|
*/
|
|
10127
|
-
export function test_expect_message(log_domain: string | null, log_level: LogLevelFlags, pattern: string
|
|
10198
|
+
export function test_expect_message(log_domain: string | null, log_level: LogLevelFlags, pattern: string): void
|
|
10128
10199
|
/**
|
|
10129
10200
|
* Indicates that a test failed. This function can be called
|
|
10130
10201
|
* multiple times from the same test. You can use this function
|
|
@@ -10182,7 +10253,7 @@ export function test_get_dir(file_type: TestFileType): string
|
|
|
10182
10253
|
* Note that this is a test path, not a file system path.
|
|
10183
10254
|
* @returns the test path for the test currently being run
|
|
10184
10255
|
*/
|
|
10185
|
-
export function test_get_path(): string
|
|
10256
|
+
export function test_get_path(): string
|
|
10186
10257
|
/**
|
|
10187
10258
|
* Indicates that a test failed because of some incomplete
|
|
10188
10259
|
* functionality. This function can be called multiple times
|
|
@@ -10197,7 +10268,7 @@ export function test_get_path(): string | null
|
|
|
10197
10268
|
* @param msg explanation
|
|
10198
10269
|
*/
|
|
10199
10270
|
export function test_incomplete(msg: string | null): void
|
|
10200
|
-
export function test_log_type_name(log_type: TestLogType): string
|
|
10271
|
+
export function test_log_type_name(log_type: TestLogType): string
|
|
10201
10272
|
/**
|
|
10202
10273
|
* This function enqueus a callback `destroy_func` to be executed
|
|
10203
10274
|
* during the next test case teardown phase. This is most useful
|
|
@@ -10355,7 +10426,7 @@ export function test_subprocess(): boolean
|
|
|
10355
10426
|
*
|
|
10356
10427
|
* @param summary One or two sentences summarising what the test checks, and how it checks it.
|
|
10357
10428
|
*/
|
|
10358
|
-
export function test_summary(summary: string
|
|
10429
|
+
export function test_summary(summary: string): void
|
|
10359
10430
|
/**
|
|
10360
10431
|
* Get the number of seconds since the last start of the timer with
|
|
10361
10432
|
* g_test_timer_start().
|
|
@@ -10372,7 +10443,7 @@ export function test_timer_last(): number
|
|
|
10372
10443
|
* to be done. Call this function again to restart the timer.
|
|
10373
10444
|
*/
|
|
10374
10445
|
export function test_timer_start(): void
|
|
10375
|
-
export function test_trap_assertions(domain: string
|
|
10446
|
+
export function test_trap_assertions(domain: string, file: string, line: number, func: string, assertion_flags: number, pattern: string): void
|
|
10376
10447
|
/**
|
|
10377
10448
|
* Fork the current test program to execute a test case that might
|
|
10378
10449
|
* not return or that might abort.
|
|
@@ -10597,7 +10668,7 @@ export function thread_yield(): void
|
|
|
10597
10668
|
* @param iso_date an ISO 8601 encoded date string
|
|
10598
10669
|
* @returns %TRUE if the conversion was successful.
|
|
10599
10670
|
*/
|
|
10600
|
-
export function time_val_from_iso8601(iso_date: string
|
|
10671
|
+
export function time_val_from_iso8601(iso_date: string): [ /* returnType */ boolean, /* time_ */ TimeVal ]
|
|
10601
10672
|
/**
|
|
10602
10673
|
* Sets a function to be called at regular intervals, with the given
|
|
10603
10674
|
* priority. The function is called repeatedly until it returns
|
|
@@ -11087,7 +11158,7 @@ export function unichar_iszerowidth(c: string): boolean
|
|
|
11087
11158
|
* @param c a Unicode character code
|
|
11088
11159
|
* @returns number of bytes written
|
|
11089
11160
|
*/
|
|
11090
|
-
export function unichar_to_utf8(c: string): [ /* returnType */ number, /* outbuf */ string
|
|
11161
|
+
export function unichar_to_utf8(c: string): [ /* returnType */ number, /* outbuf */ string ]
|
|
11091
11162
|
/**
|
|
11092
11163
|
* Converts a character to lower case.
|
|
11093
11164
|
* @param c a Unicode character.
|
|
@@ -11186,12 +11257,15 @@ export function unix_error_quark(): Quark
|
|
|
11186
11257
|
*/
|
|
11187
11258
|
export function unix_fd_add_full(priority: number, fd: number, condition: IOCondition, function_: UnixFDSourceFunc): number
|
|
11188
11259
|
/**
|
|
11189
|
-
* Creates a #GSource to watch for a particular
|
|
11260
|
+
* Creates a #GSource to watch for a particular I/O condition on a file
|
|
11190
11261
|
* descriptor.
|
|
11191
11262
|
*
|
|
11192
|
-
* The source will never close the fd
|
|
11263
|
+
* The source will never close the `fd` — you must do it yourself.
|
|
11264
|
+
*
|
|
11265
|
+
* Any callback attached to the returned #GSource must have type
|
|
11266
|
+
* #GUnixFDSourceFunc.
|
|
11193
11267
|
* @param fd a file descriptor
|
|
11194
|
-
* @param condition
|
|
11268
|
+
* @param condition I/O conditions to watch for on `fd`
|
|
11195
11269
|
* @returns the newly created #GSource
|
|
11196
11270
|
*/
|
|
11197
11271
|
export function unix_fd_source_new(fd: number, condition: IOCondition): Source
|
|
@@ -11210,15 +11284,20 @@ export function unix_fd_source_new(fd: number, condition: IOCondition): Source
|
|
|
11210
11284
|
* @param user_name the username to get the passwd file entry for
|
|
11211
11285
|
* @returns passwd entry, or %NULL on error; free the returned value with g_free()
|
|
11212
11286
|
*/
|
|
11213
|
-
export function unix_get_passwd_entry(user_name: string
|
|
11287
|
+
export function unix_get_passwd_entry(user_name: string): any | null
|
|
11214
11288
|
/**
|
|
11215
11289
|
* Similar to the UNIX pipe() call, but on modern systems like Linux
|
|
11216
11290
|
* uses the pipe2() system call, which atomically creates a pipe with
|
|
11217
|
-
* the configured flags.
|
|
11218
|
-
*
|
|
11219
|
-
*
|
|
11291
|
+
* the configured flags.
|
|
11292
|
+
*
|
|
11293
|
+
* As of GLib 2.78, the supported flags are `FD_CLOEXEC` and `O_NONBLOCK`. Prior
|
|
11294
|
+
* to GLib 2.78, only `FD_CLOEXEC` was supported — if you wanted to configure
|
|
11295
|
+
* `O_NONBLOCK` then that had to be done separately with `fcntl()`.
|
|
11220
11296
|
*
|
|
11221
|
-
*
|
|
11297
|
+
* It is a programmer error to call this function with unsupported flags, and a
|
|
11298
|
+
* critical warning will be raised.
|
|
11299
|
+
*
|
|
11300
|
+
* This function does not take `O_CLOEXEC`, it takes `FD_CLOEXEC` as if
|
|
11222
11301
|
* for fcntl(); these are different on Linux/glibc.
|
|
11223
11302
|
* @param fds Array of two integers
|
|
11224
11303
|
* @param flags Bitfield of file descriptor flags, as for fcntl()
|
|
@@ -11321,7 +11400,7 @@ export function unsetenv(variable: string): void
|
|
|
11321
11400
|
* @param fragment the fragment, or %NULL
|
|
11322
11401
|
* @returns a new #GUri
|
|
11323
11402
|
*/
|
|
11324
|
-
export function uri_build(flags: UriFlags, scheme: string
|
|
11403
|
+
export function uri_build(flags: UriFlags, scheme: string, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
11325
11404
|
/**
|
|
11326
11405
|
* Creates a new #GUri from the given components according to `flags`
|
|
11327
11406
|
* (%G_URI_FLAGS_HAS_PASSWORD is added unconditionally). The `flags` must be
|
|
@@ -11343,7 +11422,7 @@ export function uri_build(flags: UriFlags, scheme: string | null, userinfo: stri
|
|
|
11343
11422
|
* @param fragment the fragment, or %NULL
|
|
11344
11423
|
* @returns a new #GUri
|
|
11345
11424
|
*/
|
|
11346
|
-
export function uri_build_with_user(flags: UriFlags, scheme: string
|
|
11425
|
+
export function uri_build_with_user(flags: UriFlags, scheme: string, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
11347
11426
|
export function uri_error_quark(): Quark
|
|
11348
11427
|
/**
|
|
11349
11428
|
* Escapes arbitrary data for use in a URI.
|
|
@@ -11376,7 +11455,7 @@ export function uri_escape_bytes(unescaped: Uint8Array, reserved_chars_allowed:
|
|
|
11376
11455
|
* @param allow_utf8 %TRUE if the result can include UTF-8 characters.
|
|
11377
11456
|
* @returns an escaped version of @unescaped. The returned string should be freed when no longer needed.
|
|
11378
11457
|
*/
|
|
11379
|
-
export function uri_escape_string(unescaped: string
|
|
11458
|
+
export function uri_escape_string(unescaped: string, reserved_chars_allowed: string | null, allow_utf8: boolean): string | null
|
|
11380
11459
|
/**
|
|
11381
11460
|
* Parses `uri_string` according to `flags,` to determine whether it is a valid
|
|
11382
11461
|
* [absolute URI][relative-absolute-uris], i.e. it does not need to be resolved
|
|
@@ -11390,7 +11469,7 @@ export function uri_escape_string(unescaped: string | null, reserved_chars_allow
|
|
|
11390
11469
|
* @param flags flags for parsing `uri_string`
|
|
11391
11470
|
* @returns %TRUE if @uri_string is a valid absolute URI, %FALSE on error.
|
|
11392
11471
|
*/
|
|
11393
|
-
export function uri_is_valid(uri_string: string
|
|
11472
|
+
export function uri_is_valid(uri_string: string, flags: UriFlags): boolean
|
|
11394
11473
|
/**
|
|
11395
11474
|
* Joins the given components together according to `flags` to create
|
|
11396
11475
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -11398,7 +11477,7 @@ export function uri_is_valid(uri_string: string | null, flags: UriFlags): boolea
|
|
|
11398
11477
|
*
|
|
11399
11478
|
* When `host` is present, `path` must either be empty or begin with a slash (`/`)
|
|
11400
11479
|
* character. When `host` is not present, `path` cannot begin with two slash
|
|
11401
|
-
*
|
|
11480
|
+
* characters (`//`). See
|
|
11402
11481
|
* [RFC 3986, section 3](https://tools.ietf.org/html/rfc3986#section-3).
|
|
11403
11482
|
*
|
|
11404
11483
|
* See also g_uri_join_with_user(), which allows specifying the
|
|
@@ -11416,7 +11495,7 @@ export function uri_is_valid(uri_string: string | null, flags: UriFlags): boolea
|
|
|
11416
11495
|
* @param fragment the fragment, or %NULL
|
|
11417
11496
|
* @returns an absolute URI string
|
|
11418
11497
|
*/
|
|
11419
|
-
export function uri_join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string
|
|
11498
|
+
export function uri_join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
11420
11499
|
/**
|
|
11421
11500
|
* Joins the given components together according to `flags` to create
|
|
11422
11501
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -11439,7 +11518,7 @@ export function uri_join(flags: UriFlags, scheme: string | null, userinfo: strin
|
|
|
11439
11518
|
* @param fragment the fragment, or %NULL
|
|
11440
11519
|
* @returns an absolute URI string
|
|
11441
11520
|
*/
|
|
11442
|
-
export function uri_join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string
|
|
11521
|
+
export function uri_join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
11443
11522
|
/**
|
|
11444
11523
|
* Splits an URI list conforming to the text/uri-list
|
|
11445
11524
|
* mime type defined in RFC 2483 into individual URIs,
|
|
@@ -11447,7 +11526,7 @@ export function uri_join_with_user(flags: UriFlags, scheme: string | null, user:
|
|
|
11447
11526
|
* @param uri_list an URI list
|
|
11448
11527
|
* @returns a newly allocated %NULL-terminated list of strings holding the individual URIs. The array should be freed with g_strfreev().
|
|
11449
11528
|
*/
|
|
11450
|
-
export function uri_list_extract_uris(uri_list: string
|
|
11529
|
+
export function uri_list_extract_uris(uri_list: string): string[]
|
|
11451
11530
|
/**
|
|
11452
11531
|
* Parses `uri_string` according to `flags`. If the result is not a
|
|
11453
11532
|
* valid [absolute URI][relative-absolute-uris], it will be discarded, and an
|
|
@@ -11456,7 +11535,7 @@ export function uri_list_extract_uris(uri_list: string | null): string[]
|
|
|
11456
11535
|
* @param flags flags describing how to parse `uri_string`
|
|
11457
11536
|
* @returns a new #GUri, or NULL on error.
|
|
11458
11537
|
*/
|
|
11459
|
-
export function uri_parse(uri_string: string
|
|
11538
|
+
export function uri_parse(uri_string: string, flags: UriFlags): Uri
|
|
11460
11539
|
/**
|
|
11461
11540
|
* Many URI schemes include one or more attribute/value pairs as part of the URI
|
|
11462
11541
|
* value. This method can be used to parse them into a hash table. When an
|
|
@@ -11488,7 +11567,7 @@ export function uri_parse(uri_string: string | null, flags: UriFlags): Uri
|
|
|
11488
11567
|
* @param flags flags to modify the way the parameters are handled.
|
|
11489
11568
|
* @returns A hash table of attribute/value pairs, with both names and values fully-decoded; or %NULL on error.
|
|
11490
11569
|
*/
|
|
11491
|
-
export function uri_parse_params(params: string
|
|
11570
|
+
export function uri_parse_params(params: string, length: number, separators: string, flags: UriParamsFlags): HashTable
|
|
11492
11571
|
/**
|
|
11493
11572
|
* Gets the scheme portion of a URI string.
|
|
11494
11573
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -11502,7 +11581,7 @@ export function uri_parse_params(params: string | null, length: number, separato
|
|
|
11502
11581
|
* @param uri a valid URI.
|
|
11503
11582
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string should be freed when no longer needed.
|
|
11504
11583
|
*/
|
|
11505
|
-
export function uri_parse_scheme(uri: string
|
|
11584
|
+
export function uri_parse_scheme(uri: string): string | null
|
|
11506
11585
|
/**
|
|
11507
11586
|
* Gets the scheme portion of a URI string.
|
|
11508
11587
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -11519,7 +11598,7 @@ export function uri_parse_scheme(uri: string | null): string | null
|
|
|
11519
11598
|
* @param uri a valid URI.
|
|
11520
11599
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string is normalized to all-lowercase, and interned via g_intern_string(), so it does not need to be freed.
|
|
11521
11600
|
*/
|
|
11522
|
-
export function uri_peek_scheme(uri: string
|
|
11601
|
+
export function uri_peek_scheme(uri: string): string | null
|
|
11523
11602
|
/**
|
|
11524
11603
|
* Parses `uri_ref` according to `flags` and, if it is a
|
|
11525
11604
|
* [relative URI][relative-absolute-uris], resolves it relative to
|
|
@@ -11533,7 +11612,7 @@ export function uri_peek_scheme(uri: string | null): string | null
|
|
|
11533
11612
|
* @param flags flags describing how to parse `uri_ref`
|
|
11534
11613
|
* @returns the resolved URI string, or NULL on error.
|
|
11535
11614
|
*/
|
|
11536
|
-
export function uri_resolve_relative(base_uri_string: string | null, uri_ref: string
|
|
11615
|
+
export function uri_resolve_relative(base_uri_string: string | null, uri_ref: string, flags: UriFlags): string | null
|
|
11537
11616
|
/**
|
|
11538
11617
|
* Parses `uri_ref` (which can be an
|
|
11539
11618
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -11555,7 +11634,7 @@ export function uri_resolve_relative(base_uri_string: string | null, uri_ref: st
|
|
|
11555
11634
|
* @param flags flags for parsing `uri_ref`
|
|
11556
11635
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
11557
11636
|
*/
|
|
11558
|
-
export function uri_split(uri_ref: string
|
|
11637
|
+
export function uri_split(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* userinfo */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
11559
11638
|
/**
|
|
11560
11639
|
* Parses `uri_string` (which must be an [absolute URI][relative-absolute-uris])
|
|
11561
11640
|
* according to `flags,` and returns the pieces relevant to connecting to a host.
|
|
@@ -11567,7 +11646,7 @@ export function uri_split(uri_ref: string | null, flags: UriFlags): [ /* returnT
|
|
|
11567
11646
|
* @param flags flags for parsing `uri_string`
|
|
11568
11647
|
* @returns %TRUE if @uri_string parsed successfully, %FALSE on error.
|
|
11569
11648
|
*/
|
|
11570
|
-
export function uri_split_network(uri_string: string
|
|
11649
|
+
export function uri_split_network(uri_string: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* host */ string | null, /* port */ number ]
|
|
11571
11650
|
/**
|
|
11572
11651
|
* Parses `uri_ref` (which can be an
|
|
11573
11652
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -11584,7 +11663,7 @@ export function uri_split_network(uri_string: string | null, flags: UriFlags): [
|
|
|
11584
11663
|
* @param flags flags for parsing `uri_ref`
|
|
11585
11664
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
11586
11665
|
*/
|
|
11587
|
-
export function uri_split_with_user(uri_ref: string
|
|
11666
|
+
export function uri_split_with_user(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* user */ string | null, /* password */ string | null, /* auth_params */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
11588
11667
|
/**
|
|
11589
11668
|
* Unescapes a segment of an escaped string as binary data.
|
|
11590
11669
|
*
|
|
@@ -11601,7 +11680,7 @@ export function uri_split_with_user(uri_ref: string | null, flags: UriFlags): [
|
|
|
11601
11680
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
11602
11681
|
* @returns an unescaped version of @escaped_string or %NULL on error (if decoding failed, using %G_URI_ERROR_FAILED error code). The returned #GBytes should be unreffed when no longer needed.
|
|
11603
11682
|
*/
|
|
11604
|
-
export function uri_unescape_bytes(escaped_string: string
|
|
11683
|
+
export function uri_unescape_bytes(escaped_string: string, length: number, illegal_characters: string | null): Bytes
|
|
11605
11684
|
/**
|
|
11606
11685
|
* Unescapes a segment of an escaped string.
|
|
11607
11686
|
*
|
|
@@ -11631,7 +11710,7 @@ export function uri_unescape_segment(escaped_string: string | null, escaped_stri
|
|
|
11631
11710
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
11632
11711
|
* @returns an unescaped version of @escaped_string. The returned string should be freed when no longer needed.
|
|
11633
11712
|
*/
|
|
11634
|
-
export function uri_unescape_string(escaped_string: string
|
|
11713
|
+
export function uri_unescape_string(escaped_string: string, illegal_characters: string | null): string | null
|
|
11635
11714
|
/**
|
|
11636
11715
|
* Pauses the current thread for the given number of microseconds.
|
|
11637
11716
|
*
|
|
@@ -11683,7 +11762,7 @@ export function utf16_to_utf8(str: number[]): [ /* returnType */ string | null,
|
|
|
11683
11762
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11684
11763
|
* @returns a newly allocated string, that is a case independent form of @str.
|
|
11685
11764
|
*/
|
|
11686
|
-
export function utf8_casefold(str: string
|
|
11765
|
+
export function utf8_casefold(str: string, len: number): string | null
|
|
11687
11766
|
/**
|
|
11688
11767
|
* Compares two strings for ordering using the linguistically
|
|
11689
11768
|
* correct rules for the [current locale][setlocale].
|
|
@@ -11699,7 +11778,7 @@ export function utf8_casefold(str: string | null, len: number): string | null
|
|
|
11699
11778
|
* @param str2 a UTF-8 encoded string
|
|
11700
11779
|
* @returns < 0 if @str1 compares before @str2, 0 if they compare equal, > 0 if @str1 compares after @str2.
|
|
11701
11780
|
*/
|
|
11702
|
-
export function utf8_collate(str1: string
|
|
11781
|
+
export function utf8_collate(str1: string, str2: string): number
|
|
11703
11782
|
/**
|
|
11704
11783
|
* Converts a string into a collation key that can be compared
|
|
11705
11784
|
* with other collation keys produced by the same function using
|
|
@@ -11714,7 +11793,7 @@ export function utf8_collate(str1: string | null, str2: string | null): number
|
|
|
11714
11793
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11715
11794
|
* @returns a newly allocated string. This string should be freed with g_free() when you are done with it.
|
|
11716
11795
|
*/
|
|
11717
|
-
export function utf8_collate_key(str: string
|
|
11796
|
+
export function utf8_collate_key(str: string, len: number): string | null
|
|
11718
11797
|
/**
|
|
11719
11798
|
* Converts a string into a collation key that can be compared
|
|
11720
11799
|
* with other collation keys produced by the same function using strcmp().
|
|
@@ -11731,7 +11810,7 @@ export function utf8_collate_key(str: string | null, len: number): string | null
|
|
|
11731
11810
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11732
11811
|
* @returns a newly allocated string. This string should be freed with g_free() when you are done with it.
|
|
11733
11812
|
*/
|
|
11734
|
-
export function utf8_collate_key_for_filename(str: string
|
|
11813
|
+
export function utf8_collate_key_for_filename(str: string, len: number): string | null
|
|
11735
11814
|
/**
|
|
11736
11815
|
* Finds the start of the next UTF-8 character in the string after `p`.
|
|
11737
11816
|
*
|
|
@@ -11747,7 +11826,7 @@ export function utf8_collate_key_for_filename(str: string | null, len: number):
|
|
|
11747
11826
|
* @param end a pointer to the byte following the end of the string, or %NULL to indicate that the string is nul-terminated
|
|
11748
11827
|
* @returns a pointer to the found character or %NULL if @end is set and is reached
|
|
11749
11828
|
*/
|
|
11750
|
-
export function utf8_find_next_char(p: string
|
|
11829
|
+
export function utf8_find_next_char(p: string, end: string | null): string | null
|
|
11751
11830
|
/**
|
|
11752
11831
|
* Given a position `p` with a UTF-8 encoded string `str,` find the start
|
|
11753
11832
|
* of the previous UTF-8 character starting before `p`. Returns %NULL if no
|
|
@@ -11760,7 +11839,7 @@ export function utf8_find_next_char(p: string | null, end: string | null): strin
|
|
|
11760
11839
|
* @param p pointer to some position within `str`
|
|
11761
11840
|
* @returns a pointer to the found character or %NULL.
|
|
11762
11841
|
*/
|
|
11763
|
-
export function utf8_find_prev_char(str: string
|
|
11842
|
+
export function utf8_find_prev_char(str: string, p: string): string | null
|
|
11764
11843
|
/**
|
|
11765
11844
|
* Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
|
|
11766
11845
|
*
|
|
@@ -11771,7 +11850,7 @@ export function utf8_find_prev_char(str: string | null, p: string | null): strin
|
|
|
11771
11850
|
* @param p a pointer to Unicode character encoded as UTF-8
|
|
11772
11851
|
* @returns the resulting character
|
|
11773
11852
|
*/
|
|
11774
|
-
export function utf8_get_char(p: string
|
|
11853
|
+
export function utf8_get_char(p: string): string
|
|
11775
11854
|
/**
|
|
11776
11855
|
* Convert a sequence of bytes encoded as UTF-8 to a Unicode character.
|
|
11777
11856
|
* This function checks for incomplete characters, for invalid characters
|
|
@@ -11785,7 +11864,7 @@ export function utf8_get_char(p: string | null): string
|
|
|
11785
11864
|
* @param max_len the maximum number of bytes to read, or -1 if `p` is nul-terminated
|
|
11786
11865
|
* @returns the resulting character. If @p points to a partial sequence at the end of a string that could begin a valid character (or if @max_len is zero), returns (gunichar)-2; otherwise, if @p does not point to a valid UTF-8 encoded Unicode character, returns (gunichar)-1.
|
|
11787
11866
|
*/
|
|
11788
|
-
export function utf8_get_char_validated(p: string
|
|
11867
|
+
export function utf8_get_char_validated(p: string, max_len: number): string
|
|
11789
11868
|
/**
|
|
11790
11869
|
* If the provided string is valid UTF-8, return a copy of it. If not,
|
|
11791
11870
|
* return a copy in which bytes that could not be interpreted as valid Unicode
|
|
@@ -11800,7 +11879,7 @@ export function utf8_get_char_validated(p: string | null, max_len: number): stri
|
|
|
11800
11879
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11801
11880
|
* @returns a valid UTF-8 string whose content resembles @str
|
|
11802
11881
|
*/
|
|
11803
|
-
export function utf8_make_valid(str: string
|
|
11882
|
+
export function utf8_make_valid(str: string, len: number): string | null
|
|
11804
11883
|
/**
|
|
11805
11884
|
* Converts a string into canonical form, standardizing
|
|
11806
11885
|
* such issues as whether a character with an accent
|
|
@@ -11832,7 +11911,7 @@ export function utf8_make_valid(str: string | null, len: number): string | null
|
|
|
11832
11911
|
* @param mode the type of normalization to perform.
|
|
11833
11912
|
* @returns a newly allocated string, that is the normalized form of @str, or %NULL if @str is not valid UTF-8.
|
|
11834
11913
|
*/
|
|
11835
|
-
export function utf8_normalize(str: string
|
|
11914
|
+
export function utf8_normalize(str: string, len: number, mode: NormalizeMode): string | null
|
|
11836
11915
|
/**
|
|
11837
11916
|
* Converts from an integer character offset to a pointer to a position
|
|
11838
11917
|
* within the string.
|
|
@@ -11851,7 +11930,7 @@ export function utf8_normalize(str: string | null, len: number, mode: NormalizeM
|
|
|
11851
11930
|
* @param offset a character offset within `str`
|
|
11852
11931
|
* @returns the resulting pointer
|
|
11853
11932
|
*/
|
|
11854
|
-
export function utf8_offset_to_pointer(str: string
|
|
11933
|
+
export function utf8_offset_to_pointer(str: string, offset: number): string | null
|
|
11855
11934
|
/**
|
|
11856
11935
|
* Converts from a pointer to position within a string to an integer
|
|
11857
11936
|
* character offset.
|
|
@@ -11862,7 +11941,7 @@ export function utf8_offset_to_pointer(str: string | null, offset: number): stri
|
|
|
11862
11941
|
* @param pos a pointer to a position within `str`
|
|
11863
11942
|
* @returns the resulting character offset
|
|
11864
11943
|
*/
|
|
11865
|
-
export function utf8_pointer_to_offset(str: string
|
|
11944
|
+
export function utf8_pointer_to_offset(str: string, pos: string): number
|
|
11866
11945
|
/**
|
|
11867
11946
|
* Finds the previous UTF-8 character in the string before `p`.
|
|
11868
11947
|
*
|
|
@@ -11873,7 +11952,7 @@ export function utf8_pointer_to_offset(str: string | null, pos: string | null):
|
|
|
11873
11952
|
* @param p a pointer to a position within a UTF-8 encoded string
|
|
11874
11953
|
* @returns a pointer to the found character
|
|
11875
11954
|
*/
|
|
11876
|
-
export function utf8_prev_char(p: string
|
|
11955
|
+
export function utf8_prev_char(p: string): string | null
|
|
11877
11956
|
/**
|
|
11878
11957
|
* Finds the leftmost occurrence of the given Unicode character
|
|
11879
11958
|
* in a UTF-8 encoded string, while limiting the search to `len` bytes.
|
|
@@ -11883,7 +11962,7 @@ export function utf8_prev_char(p: string | null): string | null
|
|
|
11883
11962
|
* @param c a Unicode character
|
|
11884
11963
|
* @returns %NULL if the string does not contain the character, otherwise, a pointer to the start of the leftmost occurrence of the character in the string.
|
|
11885
11964
|
*/
|
|
11886
|
-
export function utf8_strchr(p: string
|
|
11965
|
+
export function utf8_strchr(p: string, len: number, c: string): string | null
|
|
11887
11966
|
/**
|
|
11888
11967
|
* Converts all Unicode characters in the string that have a case
|
|
11889
11968
|
* to lowercase. The exact manner that this is done depends
|
|
@@ -11893,7 +11972,7 @@ export function utf8_strchr(p: string | null, len: number, c: string): string |
|
|
|
11893
11972
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11894
11973
|
* @returns a newly allocated string, with all characters converted to lowercase.
|
|
11895
11974
|
*/
|
|
11896
|
-
export function utf8_strdown(str: string
|
|
11975
|
+
export function utf8_strdown(str: string, len: number): string | null
|
|
11897
11976
|
/**
|
|
11898
11977
|
* Computes the length of the string in characters, not including
|
|
11899
11978
|
* the terminating nul character. If the `max'`th byte falls in the
|
|
@@ -11902,7 +11981,7 @@ export function utf8_strdown(str: string | null, len: number): string | null
|
|
|
11902
11981
|
* @param max the maximum number of bytes to examine. If `max` is less than 0, then the string is assumed to be nul-terminated. If `max` is 0, `p` will not be examined and may be %NULL. If `max` is greater than 0, up to `max` bytes are examined
|
|
11903
11982
|
* @returns the length of the string in characters
|
|
11904
11983
|
*/
|
|
11905
|
-
export function utf8_strlen(p: string
|
|
11984
|
+
export function utf8_strlen(p: string, max: number): number
|
|
11906
11985
|
/**
|
|
11907
11986
|
* Like the standard C strncpy() function, but copies a given number
|
|
11908
11987
|
* of characters instead of a given number of bytes. The `src` string
|
|
@@ -11916,7 +11995,7 @@ export function utf8_strlen(p: string | null, max: number): number
|
|
|
11916
11995
|
* @param n character count
|
|
11917
11996
|
* @returns @dest
|
|
11918
11997
|
*/
|
|
11919
|
-
export function utf8_strncpy(dest: string | null, src: string
|
|
11998
|
+
export function utf8_strncpy(dest: string | null, src: string, n: number): string | null
|
|
11920
11999
|
/**
|
|
11921
12000
|
* Find the rightmost occurrence of the given Unicode character
|
|
11922
12001
|
* in a UTF-8 encoded string, while limiting the search to `len` bytes.
|
|
@@ -11926,7 +12005,7 @@ export function utf8_strncpy(dest: string | null, src: string | null, n: number)
|
|
|
11926
12005
|
* @param c a Unicode character
|
|
11927
12006
|
* @returns %NULL if the string does not contain the character, otherwise, a pointer to the start of the rightmost occurrence of the character in the string.
|
|
11928
12007
|
*/
|
|
11929
|
-
export function utf8_strrchr(p: string
|
|
12008
|
+
export function utf8_strrchr(p: string, len: number, c: string): string | null
|
|
11930
12009
|
/**
|
|
11931
12010
|
* Reverses a UTF-8 string. `str` must be valid UTF-8 encoded text.
|
|
11932
12011
|
* (Use g_utf8_validate() on all text before trying to use UTF-8
|
|
@@ -11945,7 +12024,7 @@ export function utf8_strrchr(p: string | null, len: number, c: string): string |
|
|
|
11945
12024
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11946
12025
|
* @returns a newly-allocated string which is the reverse of @str
|
|
11947
12026
|
*/
|
|
11948
|
-
export function utf8_strreverse(str: string
|
|
12027
|
+
export function utf8_strreverse(str: string, len: number): string | null
|
|
11949
12028
|
/**
|
|
11950
12029
|
* Converts all Unicode characters in the string that have a case
|
|
11951
12030
|
* to uppercase. The exact manner that this is done depends
|
|
@@ -11956,7 +12035,7 @@ export function utf8_strreverse(str: string | null, len: number): string | null
|
|
|
11956
12035
|
* @param len length of `str,` in bytes, or -1 if `str` is nul-terminated.
|
|
11957
12036
|
* @returns a newly allocated string, with all characters converted to uppercase.
|
|
11958
12037
|
*/
|
|
11959
|
-
export function utf8_strup(str: string
|
|
12038
|
+
export function utf8_strup(str: string, len: number): string | null
|
|
11960
12039
|
/**
|
|
11961
12040
|
* Copies a substring out of a UTF-8 encoded string.
|
|
11962
12041
|
* The substring will contain `end_pos` - `start_pos` characters.
|
|
@@ -11968,7 +12047,7 @@ export function utf8_strup(str: string | null, len: number): string | null
|
|
|
11968
12047
|
* @param end_pos another character offset within `str,` or `-1` to indicate the end of the string
|
|
11969
12048
|
* @returns a newly allocated copy of the requested substring. Free with g_free() when no longer needed.
|
|
11970
12049
|
*/
|
|
11971
|
-
export function utf8_substring(str: string
|
|
12050
|
+
export function utf8_substring(str: string, start_pos: number, end_pos: number): string | null
|
|
11972
12051
|
/**
|
|
11973
12052
|
* Convert a string from UTF-8 to a 32-bit fixed width
|
|
11974
12053
|
* representation as UCS-4. A trailing 0 character will be added to the
|
|
@@ -11977,7 +12056,7 @@ export function utf8_substring(str: string | null, start_pos: number, end_pos: n
|
|
|
11977
12056
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11978
12057
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set.
|
|
11979
12058
|
*/
|
|
11980
|
-
export function utf8_to_ucs4(str: string
|
|
12059
|
+
export function utf8_to_ucs4(str: string, len: number): [ /* returnType */ string, /* items_read */ number, /* items_written */ number ]
|
|
11981
12060
|
/**
|
|
11982
12061
|
* Convert a string from UTF-8 to a 32-bit fixed width
|
|
11983
12062
|
* representation as UCS-4, assuming valid UTF-8 input.
|
|
@@ -11988,7 +12067,7 @@ export function utf8_to_ucs4(str: string | null, len: number): [ /* returnType *
|
|
|
11988
12067
|
* @param len the maximum length of `str` to use, in bytes. If `len` < 0, then the string is nul-terminated.
|
|
11989
12068
|
* @returns a pointer to a newly allocated UCS-4 string. This value must be freed with g_free().
|
|
11990
12069
|
*/
|
|
11991
|
-
export function utf8_to_ucs4_fast(str: string
|
|
12070
|
+
export function utf8_to_ucs4_fast(str: string, len: number): [ /* returnType */ string, /* items_written */ number ]
|
|
11992
12071
|
/**
|
|
11993
12072
|
* Convert a string from UTF-8 to UTF-16. A 0 character will be
|
|
11994
12073
|
* added to the result after the converted text.
|
|
@@ -11996,7 +12075,18 @@ export function utf8_to_ucs4_fast(str: string | null, len: number): [ /* returnT
|
|
|
11996
12075
|
* @param len the maximum length (number of bytes) of `str` to use. If `len` < 0, then the string is nul-terminated.
|
|
11997
12076
|
* @returns a pointer to a newly allocated UTF-16 string. This value must be freed with g_free(). If an error occurs, %NULL will be returned and @error set.
|
|
11998
12077
|
*/
|
|
11999
|
-
export function utf8_to_utf16(str: string
|
|
12078
|
+
export function utf8_to_utf16(str: string, len: number): [ /* returnType */ number, /* items_read */ number, /* items_written */ number ]
|
|
12079
|
+
/**
|
|
12080
|
+
* Cuts off the middle of the string, preserving half of `truncate_length`
|
|
12081
|
+
* characters at the beginning and half at the end.
|
|
12082
|
+
*
|
|
12083
|
+
* If `string` is already short enough, this returns a copy of `string`.
|
|
12084
|
+
* If `truncate_length` is `0`, an empty string is returned.
|
|
12085
|
+
* @param string a nul-terminated UTF-8 encoded string
|
|
12086
|
+
* @param truncate_length the new size of `string,` in characters, including the ellipsis character
|
|
12087
|
+
* @returns a newly-allocated copy of @string ellipsized in the middle
|
|
12088
|
+
*/
|
|
12089
|
+
export function utf8_truncate_middle(string: string, truncate_length: number): string | null
|
|
12000
12090
|
/**
|
|
12001
12091
|
* Validates UTF-8 encoded text. `str` is the text to validate;
|
|
12002
12092
|
* if `str` is nul-terminated, then `max_len` can be -1, otherwise
|
|
@@ -12009,14 +12099,14 @@ export function utf8_to_utf16(str: string | null, len: number): [ /* returnType
|
|
|
12009
12099
|
* Note that g_utf8_validate() returns %FALSE if `max_len` is
|
|
12010
12100
|
* positive and any of the `max_len` bytes are nul.
|
|
12011
12101
|
*
|
|
12012
|
-
* Returns %TRUE if all of `str` was valid. Many GLib and GTK
|
|
12102
|
+
* Returns %TRUE if all of `str` was valid. Many GLib and GTK
|
|
12013
12103
|
* routines require valid UTF-8 as input; so data read from a file
|
|
12014
12104
|
* or the network should be checked with g_utf8_validate() before
|
|
12015
12105
|
* doing anything else with it.
|
|
12016
12106
|
* @param str a pointer to character data
|
|
12017
12107
|
* @returns %TRUE if the text was valid UTF-8
|
|
12018
12108
|
*/
|
|
12019
|
-
export function utf8_validate(str: Uint8Array): [ /* returnType */ boolean, /* end */ string
|
|
12109
|
+
export function utf8_validate(str: Uint8Array): [ /* returnType */ boolean, /* end */ string ]
|
|
12020
12110
|
/**
|
|
12021
12111
|
* Validates UTF-8 encoded text.
|
|
12022
12112
|
*
|
|
@@ -12025,7 +12115,7 @@ export function utf8_validate(str: Uint8Array): [ /* returnType */ boolean, /* e
|
|
|
12025
12115
|
* @param str a pointer to character data
|
|
12026
12116
|
* @returns %TRUE if the text was valid UTF-8
|
|
12027
12117
|
*/
|
|
12028
|
-
export function utf8_validate_len(str: Uint8Array): [ /* returnType */ boolean, /* end */ string
|
|
12118
|
+
export function utf8_validate_len(str: Uint8Array): [ /* returnType */ boolean, /* end */ string ]
|
|
12029
12119
|
/**
|
|
12030
12120
|
* Parses the string `str` and verify if it is a UUID.
|
|
12031
12121
|
*
|
|
@@ -12038,7 +12128,7 @@ export function utf8_validate_len(str: Uint8Array): [ /* returnType */ boolean,
|
|
|
12038
12128
|
* @param str a string representing a UUID
|
|
12039
12129
|
* @returns %TRUE if @str is a valid UUID, %FALSE otherwise.
|
|
12040
12130
|
*/
|
|
12041
|
-
export function uuid_string_is_valid(str: string
|
|
12131
|
+
export function uuid_string_is_valid(str: string): boolean
|
|
12042
12132
|
/**
|
|
12043
12133
|
* Generates a random UUID (RFC 4122 version 4) as a string. It has the same
|
|
12044
12134
|
* randomness guarantees as #GRand, so must not be used for cryptographic
|
|
@@ -12059,7 +12149,7 @@ export function variant_get_gtype(): GObject.GType
|
|
|
12059
12149
|
* @param string a normal C nul-terminated string
|
|
12060
12150
|
* @returns %TRUE if @string is a D-Bus object path
|
|
12061
12151
|
*/
|
|
12062
|
-
export function variant_is_object_path(string: string
|
|
12152
|
+
export function variant_is_object_path(string: string): boolean
|
|
12063
12153
|
/**
|
|
12064
12154
|
* Determines if a given string is a valid D-Bus type signature. You
|
|
12065
12155
|
* should ensure that a string is a valid D-Bus type signature before
|
|
@@ -12070,7 +12160,7 @@ export function variant_is_object_path(string: string | null): boolean
|
|
|
12070
12160
|
* @param string a normal C nul-terminated string
|
|
12071
12161
|
* @returns %TRUE if @string is a D-Bus type signature
|
|
12072
12162
|
*/
|
|
12073
|
-
export function variant_is_signature(string: string
|
|
12163
|
+
export function variant_is_signature(string: string): boolean
|
|
12074
12164
|
/**
|
|
12075
12165
|
* Parses a #GVariant from a text representation.
|
|
12076
12166
|
*
|
|
@@ -12113,7 +12203,7 @@ export function variant_is_signature(string: string | null): boolean
|
|
|
12113
12203
|
* @param endptr a location to store the end pointer, or %NULL
|
|
12114
12204
|
* @returns a non-floating reference to a #GVariant, or %NULL
|
|
12115
12205
|
*/
|
|
12116
|
-
export function variant_parse(type: VariantType | null, text: string
|
|
12206
|
+
export function variant_parse(type: VariantType | null, text: string, limit: string | null, endptr: string | null): Variant
|
|
12117
12207
|
/**
|
|
12118
12208
|
* Pretty-prints a message showing the context of a #GVariant parse
|
|
12119
12209
|
* error within the string for which parsing was attempted.
|
|
@@ -12152,14 +12242,14 @@ export function variant_parse(type: VariantType | null, text: string | null, lim
|
|
|
12152
12242
|
* @param source_str the string that was given to the parser
|
|
12153
12243
|
* @returns the printed message
|
|
12154
12244
|
*/
|
|
12155
|
-
export function variant_parse_error_print_context(error: Error, source_str: string
|
|
12245
|
+
export function variant_parse_error_print_context(error: Error, source_str: string): string | null
|
|
12156
12246
|
export function variant_parse_error_quark(): Quark
|
|
12157
12247
|
/**
|
|
12158
12248
|
* Same as g_variant_error_quark().
|
|
12159
12249
|
*/
|
|
12160
12250
|
export function variant_parser_get_error_quark(): Quark
|
|
12161
|
-
export function variant_type_checked_(arg0: string
|
|
12162
|
-
export function variant_type_string_get_depth_(type_string: string
|
|
12251
|
+
export function variant_type_checked_(arg0: string): VariantType
|
|
12252
|
+
export function variant_type_string_get_depth_(type_string: string): number
|
|
12163
12253
|
/**
|
|
12164
12254
|
* Checks if `type_string` is a valid GVariant type string. This call is
|
|
12165
12255
|
* equivalent to calling g_variant_type_string_scan() and confirming
|
|
@@ -12167,7 +12257,7 @@ export function variant_type_string_get_depth_(type_string: string | null): numb
|
|
|
12167
12257
|
* @param type_string a pointer to any string
|
|
12168
12258
|
* @returns %TRUE if @type_string is exactly one valid type string Since 2.24
|
|
12169
12259
|
*/
|
|
12170
|
-
export function variant_type_string_is_valid(type_string: string
|
|
12260
|
+
export function variant_type_string_is_valid(type_string: string): boolean
|
|
12171
12261
|
/**
|
|
12172
12262
|
* Scan for a single complete and valid GVariant type string in `string`.
|
|
12173
12263
|
* The memory pointed to by `limit` (or bytes beyond it) is never
|
|
@@ -12186,7 +12276,7 @@ export function variant_type_string_is_valid(type_string: string | null): boolea
|
|
|
12186
12276
|
* @param limit the end of `string,` or %NULL
|
|
12187
12277
|
* @returns %TRUE if a valid type string was found
|
|
12188
12278
|
*/
|
|
12189
|
-
export function variant_type_string_scan(string: string
|
|
12279
|
+
export function variant_type_string_scan(string: string, limit: string | null): [ /* returnType */ boolean, /* endptr */ string ]
|
|
12190
12280
|
/**
|
|
12191
12281
|
* Prototype of a #GChildWatchSource callback, called when a child
|
|
12192
12282
|
* process has exited.
|
|
@@ -12356,7 +12446,7 @@ export interface ErrorInitFunc {
|
|
|
12356
12446
|
/**
|
|
12357
12447
|
* Declares a type of function which takes an arbitrary
|
|
12358
12448
|
* data pointer argument and has no return value. It is
|
|
12359
|
-
* not currently used in GLib or GTK
|
|
12449
|
+
* not currently used in GLib or GTK.
|
|
12360
12450
|
* @callback
|
|
12361
12451
|
* @param data a data pointer
|
|
12362
12452
|
*/
|
|
@@ -12534,7 +12624,7 @@ export interface IOFunc {
|
|
|
12534
12624
|
* @param message the message to process
|
|
12535
12625
|
*/
|
|
12536
12626
|
export interface LogFunc {
|
|
12537
|
-
(log_domain: string
|
|
12627
|
+
(log_domain: string, log_level: LogLevelFlags, message: string): void
|
|
12538
12628
|
}
|
|
12539
12629
|
/**
|
|
12540
12630
|
* Writer function for log entries. A log entry is a collection of one or more
|
|
@@ -12597,7 +12687,7 @@ export interface NodeTraverseFunc {
|
|
|
12597
12687
|
* @returns %TRUE if the option was successfully parsed, %FALSE if an error occurred, in which case @error should be set with g_set_error()
|
|
12598
12688
|
*/
|
|
12599
12689
|
export interface OptionArgFunc {
|
|
12600
|
-
(option_name: string
|
|
12690
|
+
(option_name: string, value: string, data: any | null): boolean
|
|
12601
12691
|
}
|
|
12602
12692
|
/**
|
|
12603
12693
|
* The type of function to be used as callback when a parse error occurs.
|
|
@@ -12639,7 +12729,7 @@ export interface PollFunc {
|
|
|
12639
12729
|
* @param string the message to output
|
|
12640
12730
|
*/
|
|
12641
12731
|
export interface PrintFunc {
|
|
12642
|
-
(string: string
|
|
12732
|
+
(string: string): void
|
|
12643
12733
|
}
|
|
12644
12734
|
/**
|
|
12645
12735
|
* Specifies the type of the function passed to g_regex_replace_eval().
|
|
@@ -12795,7 +12885,7 @@ export interface TestFunc {
|
|
|
12795
12885
|
* @returns %TRUE if the program should abort, %FALSE otherwise
|
|
12796
12886
|
*/
|
|
12797
12887
|
export interface TestLogFatalFunc {
|
|
12798
|
-
(log_domain: string
|
|
12888
|
+
(log_domain: string, log_level: LogLevelFlags, message: string): boolean
|
|
12799
12889
|
}
|
|
12800
12890
|
/**
|
|
12801
12891
|
* Specifies the type of the `func` functions passed to g_thread_new()
|
|
@@ -12816,7 +12906,7 @@ export interface ThreadFunc {
|
|
|
12816
12906
|
* @returns a translation of the string for the current locale. The returned string is owned by GLib and must not be freed.
|
|
12817
12907
|
*/
|
|
12818
12908
|
export interface TranslateFunc {
|
|
12819
|
-
(str: string
|
|
12909
|
+
(str: string, data: any | null): string
|
|
12820
12910
|
}
|
|
12821
12911
|
/**
|
|
12822
12912
|
* Specifies the type of function passed to g_tree_traverse(). It is
|
|
@@ -13132,7 +13222,7 @@ export interface BookmarkFile {
|
|
|
13132
13222
|
* @param name the name of the application registering the bookmark or %NULL
|
|
13133
13223
|
* @param exec command line to be used to launch the bookmark or %NULL
|
|
13134
13224
|
*/
|
|
13135
|
-
add_application(uri: string
|
|
13225
|
+
add_application(uri: string, name: string | null, exec: string | null): void
|
|
13136
13226
|
/**
|
|
13137
13227
|
* Adds `group` to the list of groups to which the bookmark for `uri`
|
|
13138
13228
|
* belongs to.
|
|
@@ -13141,7 +13231,7 @@ export interface BookmarkFile {
|
|
|
13141
13231
|
* @param uri a valid URI
|
|
13142
13232
|
* @param group the group name to be added
|
|
13143
13233
|
*/
|
|
13144
|
-
add_group(uri: string
|
|
13234
|
+
add_group(uri: string, group: string): void
|
|
13145
13235
|
/**
|
|
13146
13236
|
* Deeply copies a `bookmark` #GBookmarkFile object to a new one.
|
|
13147
13237
|
* @returns the copy of @bookmark. Use g_bookmark_free() when finished using it.
|
|
@@ -13159,7 +13249,7 @@ export interface BookmarkFile {
|
|
|
13159
13249
|
* @param uri a valid URI
|
|
13160
13250
|
* @returns a timestamp
|
|
13161
13251
|
*/
|
|
13162
|
-
get_added(uri: string
|
|
13252
|
+
get_added(uri: string): number
|
|
13163
13253
|
/**
|
|
13164
13254
|
* Gets the time the bookmark for `uri` was added to `bookmark`
|
|
13165
13255
|
*
|
|
@@ -13168,7 +13258,7 @@ export interface BookmarkFile {
|
|
|
13168
13258
|
* @param uri a valid URI
|
|
13169
13259
|
* @returns a #GDateTime
|
|
13170
13260
|
*/
|
|
13171
|
-
get_added_date_time(uri: string
|
|
13261
|
+
get_added_date_time(uri: string): DateTime
|
|
13172
13262
|
/**
|
|
13173
13263
|
* Gets the registration information of `app_name` for the bookmark for
|
|
13174
13264
|
* `uri`. See g_bookmark_file_set_application_info() for more information about
|
|
@@ -13187,7 +13277,7 @@ export interface BookmarkFile {
|
|
|
13187
13277
|
* @param name an application's name
|
|
13188
13278
|
* @returns %TRUE on success.
|
|
13189
13279
|
*/
|
|
13190
|
-
get_app_info(uri: string
|
|
13280
|
+
get_app_info(uri: string, name: string): [ /* returnType */ boolean, /* exec */ string, /* count */ number, /* stamp */ number ]
|
|
13191
13281
|
/**
|
|
13192
13282
|
* Gets the registration information of `app_name` for the bookmark for
|
|
13193
13283
|
* `uri`. See g_bookmark_file_set_application_info() for more information about
|
|
@@ -13206,7 +13296,7 @@ export interface BookmarkFile {
|
|
|
13206
13296
|
* @param name an application's name
|
|
13207
13297
|
* @returns %TRUE on success.
|
|
13208
13298
|
*/
|
|
13209
|
-
get_application_info(uri: string
|
|
13299
|
+
get_application_info(uri: string, name: string): [ /* returnType */ boolean, /* exec */ string, /* count */ number, /* stamp */ DateTime ]
|
|
13210
13300
|
/**
|
|
13211
13301
|
* Retrieves the names of the applications that have registered the
|
|
13212
13302
|
* bookmark for `uri`.
|
|
@@ -13216,7 +13306,7 @@ export interface BookmarkFile {
|
|
|
13216
13306
|
* @param uri a valid URI
|
|
13217
13307
|
* @returns a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
13218
13308
|
*/
|
|
13219
|
-
get_applications(uri: string
|
|
13309
|
+
get_applications(uri: string): string[]
|
|
13220
13310
|
/**
|
|
13221
13311
|
* Retrieves the description of the bookmark for `uri`.
|
|
13222
13312
|
*
|
|
@@ -13225,7 +13315,7 @@ export interface BookmarkFile {
|
|
|
13225
13315
|
* @param uri a valid URI
|
|
13226
13316
|
* @returns a newly allocated string or %NULL if the specified URI cannot be found.
|
|
13227
13317
|
*/
|
|
13228
|
-
get_description(uri: string
|
|
13318
|
+
get_description(uri: string): string | null
|
|
13229
13319
|
/**
|
|
13230
13320
|
* Retrieves the list of group names of the bookmark for `uri`.
|
|
13231
13321
|
*
|
|
@@ -13237,7 +13327,7 @@ export interface BookmarkFile {
|
|
|
13237
13327
|
* @param uri a valid URI
|
|
13238
13328
|
* @returns a newly allocated %NULL-terminated array of group names. Use g_strfreev() to free it.
|
|
13239
13329
|
*/
|
|
13240
|
-
get_groups(uri: string
|
|
13330
|
+
get_groups(uri: string): string[]
|
|
13241
13331
|
/**
|
|
13242
13332
|
* Gets the icon of the bookmark for `uri`.
|
|
13243
13333
|
*
|
|
@@ -13246,7 +13336,7 @@ export interface BookmarkFile {
|
|
|
13246
13336
|
* @param uri a valid URI
|
|
13247
13337
|
* @returns %TRUE if the icon for the bookmark for the URI was found. You should free the returned strings.
|
|
13248
13338
|
*/
|
|
13249
|
-
get_icon(uri: string
|
|
13339
|
+
get_icon(uri: string): [ /* returnType */ boolean, /* href */ string, /* mime_type */ string ]
|
|
13250
13340
|
/**
|
|
13251
13341
|
* Gets whether the private flag of the bookmark for `uri` is set.
|
|
13252
13342
|
*
|
|
@@ -13257,7 +13347,7 @@ export interface BookmarkFile {
|
|
|
13257
13347
|
* @param uri a valid URI
|
|
13258
13348
|
* @returns %TRUE if the private flag is set, %FALSE otherwise.
|
|
13259
13349
|
*/
|
|
13260
|
-
get_is_private(uri: string
|
|
13350
|
+
get_is_private(uri: string): boolean
|
|
13261
13351
|
/**
|
|
13262
13352
|
* Retrieves the MIME type of the resource pointed by `uri`.
|
|
13263
13353
|
*
|
|
@@ -13268,7 +13358,7 @@ export interface BookmarkFile {
|
|
|
13268
13358
|
* @param uri a valid URI
|
|
13269
13359
|
* @returns a newly allocated string or %NULL if the specified URI cannot be found.
|
|
13270
13360
|
*/
|
|
13271
|
-
get_mime_type(uri: string
|
|
13361
|
+
get_mime_type(uri: string): string | null
|
|
13272
13362
|
/**
|
|
13273
13363
|
* Gets the time when the bookmark for `uri` was last modified.
|
|
13274
13364
|
*
|
|
@@ -13277,7 +13367,7 @@ export interface BookmarkFile {
|
|
|
13277
13367
|
* @param uri a valid URI
|
|
13278
13368
|
* @returns a timestamp
|
|
13279
13369
|
*/
|
|
13280
|
-
get_modified(uri: string
|
|
13370
|
+
get_modified(uri: string): number
|
|
13281
13371
|
/**
|
|
13282
13372
|
* Gets the time when the bookmark for `uri` was last modified.
|
|
13283
13373
|
*
|
|
@@ -13286,7 +13376,7 @@ export interface BookmarkFile {
|
|
|
13286
13376
|
* @param uri a valid URI
|
|
13287
13377
|
* @returns a #GDateTime
|
|
13288
13378
|
*/
|
|
13289
|
-
get_modified_date_time(uri: string
|
|
13379
|
+
get_modified_date_time(uri: string): DateTime
|
|
13290
13380
|
/**
|
|
13291
13381
|
* Gets the number of bookmarks inside `bookmark`.
|
|
13292
13382
|
* @returns the number of bookmarks
|
|
@@ -13318,7 +13408,7 @@ export interface BookmarkFile {
|
|
|
13318
13408
|
* @param uri a valid URI
|
|
13319
13409
|
* @returns a timestamp.
|
|
13320
13410
|
*/
|
|
13321
|
-
get_visited(uri: string
|
|
13411
|
+
get_visited(uri: string): number
|
|
13322
13412
|
/**
|
|
13323
13413
|
* Gets the time the bookmark for `uri` was last visited.
|
|
13324
13414
|
*
|
|
@@ -13327,7 +13417,7 @@ export interface BookmarkFile {
|
|
|
13327
13417
|
* @param uri a valid URI
|
|
13328
13418
|
* @returns a #GDateTime
|
|
13329
13419
|
*/
|
|
13330
|
-
get_visited_date_time(uri: string
|
|
13420
|
+
get_visited_date_time(uri: string): DateTime
|
|
13331
13421
|
/**
|
|
13332
13422
|
* Checks whether the bookmark for `uri` inside `bookmark` has been
|
|
13333
13423
|
* registered by application `name`.
|
|
@@ -13338,7 +13428,7 @@ export interface BookmarkFile {
|
|
|
13338
13428
|
* @param name the name of the application
|
|
13339
13429
|
* @returns %TRUE if the application @name was found
|
|
13340
13430
|
*/
|
|
13341
|
-
has_application(uri: string
|
|
13431
|
+
has_application(uri: string, name: string): boolean
|
|
13342
13432
|
/**
|
|
13343
13433
|
* Checks whether `group` appears in the list of groups to which
|
|
13344
13434
|
* the bookmark for `uri` belongs to.
|
|
@@ -13349,13 +13439,13 @@ export interface BookmarkFile {
|
|
|
13349
13439
|
* @param group the group name to be searched
|
|
13350
13440
|
* @returns %TRUE if @group was found.
|
|
13351
13441
|
*/
|
|
13352
|
-
has_group(uri: string
|
|
13442
|
+
has_group(uri: string, group: string): boolean
|
|
13353
13443
|
/**
|
|
13354
13444
|
* Looks whether the desktop bookmark has an item with its URI set to `uri`.
|
|
13355
13445
|
* @param uri a valid URI
|
|
13356
13446
|
* @returns %TRUE if @uri is inside @bookmark, %FALSE otherwise
|
|
13357
13447
|
*/
|
|
13358
|
-
has_item(uri: string
|
|
13448
|
+
has_item(uri: string): boolean
|
|
13359
13449
|
/**
|
|
13360
13450
|
* Loads a bookmark file from memory into an empty #GBookmarkFile
|
|
13361
13451
|
* structure. If the object cannot be created then `error` is set to a
|
|
@@ -13393,7 +13483,7 @@ export interface BookmarkFile {
|
|
|
13393
13483
|
* @param new_uri a valid URI, or %NULL
|
|
13394
13484
|
* @returns %TRUE if the URI was successfully changed
|
|
13395
13485
|
*/
|
|
13396
|
-
move_item(old_uri: string
|
|
13486
|
+
move_item(old_uri: string, new_uri: string | null): boolean
|
|
13397
13487
|
/**
|
|
13398
13488
|
* Removes application registered with `name` from the list of applications
|
|
13399
13489
|
* that have registered a bookmark for `uri` inside `bookmark`.
|
|
@@ -13407,7 +13497,7 @@ export interface BookmarkFile {
|
|
|
13407
13497
|
* @param name the name of the application
|
|
13408
13498
|
* @returns %TRUE if the application was successfully removed.
|
|
13409
13499
|
*/
|
|
13410
|
-
remove_application(uri: string
|
|
13500
|
+
remove_application(uri: string, name: string): boolean
|
|
13411
13501
|
/**
|
|
13412
13502
|
* Removes `group` from the list of groups to which the bookmark
|
|
13413
13503
|
* for `uri` belongs to.
|
|
@@ -13420,13 +13510,13 @@ export interface BookmarkFile {
|
|
|
13420
13510
|
* @param group the group name to be removed
|
|
13421
13511
|
* @returns %TRUE if @group was successfully removed.
|
|
13422
13512
|
*/
|
|
13423
|
-
remove_group(uri: string
|
|
13513
|
+
remove_group(uri: string, group: string): boolean
|
|
13424
13514
|
/**
|
|
13425
13515
|
* Removes the bookmark for `uri` from the bookmark file `bookmark`.
|
|
13426
13516
|
* @param uri a valid URI
|
|
13427
13517
|
* @returns %TRUE if the bookmark was removed successfully.
|
|
13428
13518
|
*/
|
|
13429
|
-
remove_item(uri: string
|
|
13519
|
+
remove_item(uri: string): boolean
|
|
13430
13520
|
/**
|
|
13431
13521
|
* Sets the time the bookmark for `uri` was added into `bookmark`.
|
|
13432
13522
|
*
|
|
@@ -13434,7 +13524,7 @@ export interface BookmarkFile {
|
|
|
13434
13524
|
* @param uri a valid URI
|
|
13435
13525
|
* @param added a timestamp or -1 to use the current time
|
|
13436
13526
|
*/
|
|
13437
|
-
set_added(uri: string
|
|
13527
|
+
set_added(uri: string, added: number): void
|
|
13438
13528
|
/**
|
|
13439
13529
|
* Sets the time the bookmark for `uri` was added into `bookmark`.
|
|
13440
13530
|
*
|
|
@@ -13442,7 +13532,7 @@ export interface BookmarkFile {
|
|
|
13442
13532
|
* @param uri a valid URI
|
|
13443
13533
|
* @param added a #GDateTime
|
|
13444
13534
|
*/
|
|
13445
|
-
set_added_date_time(uri: string
|
|
13535
|
+
set_added_date_time(uri: string, added: DateTime): void
|
|
13446
13536
|
/**
|
|
13447
13537
|
* Sets the meta-data of application `name` inside the list of
|
|
13448
13538
|
* applications that have registered a bookmark for `uri` inside
|
|
@@ -13479,7 +13569,7 @@ export interface BookmarkFile {
|
|
|
13479
13569
|
* @param stamp the time of the last registration for this application
|
|
13480
13570
|
* @returns %TRUE if the application's meta-data was successfully changed.
|
|
13481
13571
|
*/
|
|
13482
|
-
set_app_info(uri: string
|
|
13572
|
+
set_app_info(uri: string, name: string, exec: string, count: number, stamp: number): boolean
|
|
13483
13573
|
/**
|
|
13484
13574
|
* Sets the meta-data of application `name` inside the list of
|
|
13485
13575
|
* applications that have registered a bookmark for `uri` inside
|
|
@@ -13515,7 +13605,7 @@ export interface BookmarkFile {
|
|
|
13515
13605
|
* @param stamp the time of the last registration for this application, which may be %NULL if `count` is 0
|
|
13516
13606
|
* @returns %TRUE if the application's meta-data was successfully changed.
|
|
13517
13607
|
*/
|
|
13518
|
-
set_application_info(uri: string
|
|
13608
|
+
set_application_info(uri: string, name: string, exec: string, count: number, stamp: DateTime | null): boolean
|
|
13519
13609
|
/**
|
|
13520
13610
|
* Sets `description` as the description of the bookmark for `uri`.
|
|
13521
13611
|
*
|
|
@@ -13525,7 +13615,7 @@ export interface BookmarkFile {
|
|
|
13525
13615
|
* @param uri a valid URI or %NULL
|
|
13526
13616
|
* @param description a string
|
|
13527
13617
|
*/
|
|
13528
|
-
set_description(uri: string | null, description: string
|
|
13618
|
+
set_description(uri: string | null, description: string): void
|
|
13529
13619
|
/**
|
|
13530
13620
|
* Sets a list of group names for the item with URI `uri`. Each previously
|
|
13531
13621
|
* set group name list is removed.
|
|
@@ -13534,7 +13624,7 @@ export interface BookmarkFile {
|
|
|
13534
13624
|
* @param uri an item's URI
|
|
13535
13625
|
* @param groups an array of group names, or %NULL to remove all groups
|
|
13536
13626
|
*/
|
|
13537
|
-
set_groups(uri: string
|
|
13627
|
+
set_groups(uri: string, groups: string[] | null): void
|
|
13538
13628
|
/**
|
|
13539
13629
|
* Sets the icon for the bookmark for `uri`. If `href` is %NULL, unsets
|
|
13540
13630
|
* the currently set icon. `href` can either be a full URL for the icon
|
|
@@ -13545,7 +13635,7 @@ export interface BookmarkFile {
|
|
|
13545
13635
|
* @param href the URI of the icon for the bookmark, or %NULL
|
|
13546
13636
|
* @param mime_type the MIME type of the icon for the bookmark
|
|
13547
13637
|
*/
|
|
13548
|
-
set_icon(uri: string
|
|
13638
|
+
set_icon(uri: string, href: string | null, mime_type: string): void
|
|
13549
13639
|
/**
|
|
13550
13640
|
* Sets the private flag of the bookmark for `uri`.
|
|
13551
13641
|
*
|
|
@@ -13553,7 +13643,7 @@ export interface BookmarkFile {
|
|
|
13553
13643
|
* @param uri a valid URI
|
|
13554
13644
|
* @param is_private %TRUE if the bookmark should be marked as private
|
|
13555
13645
|
*/
|
|
13556
|
-
set_is_private(uri: string
|
|
13646
|
+
set_is_private(uri: string, is_private: boolean): void
|
|
13557
13647
|
/**
|
|
13558
13648
|
* Sets `mime_type` as the MIME type of the bookmark for `uri`.
|
|
13559
13649
|
*
|
|
@@ -13561,7 +13651,7 @@ export interface BookmarkFile {
|
|
|
13561
13651
|
* @param uri a valid URI
|
|
13562
13652
|
* @param mime_type a MIME type
|
|
13563
13653
|
*/
|
|
13564
|
-
set_mime_type(uri: string
|
|
13654
|
+
set_mime_type(uri: string, mime_type: string): void
|
|
13565
13655
|
/**
|
|
13566
13656
|
* Sets the last time the bookmark for `uri` was last modified.
|
|
13567
13657
|
*
|
|
@@ -13574,7 +13664,7 @@ export interface BookmarkFile {
|
|
|
13574
13664
|
* @param uri a valid URI
|
|
13575
13665
|
* @param modified a timestamp or -1 to use the current time
|
|
13576
13666
|
*/
|
|
13577
|
-
set_modified(uri: string
|
|
13667
|
+
set_modified(uri: string, modified: number): void
|
|
13578
13668
|
/**
|
|
13579
13669
|
* Sets the last time the bookmark for `uri` was last modified.
|
|
13580
13670
|
*
|
|
@@ -13587,7 +13677,7 @@ export interface BookmarkFile {
|
|
|
13587
13677
|
* @param uri a valid URI
|
|
13588
13678
|
* @param modified a #GDateTime
|
|
13589
13679
|
*/
|
|
13590
|
-
set_modified_date_time(uri: string
|
|
13680
|
+
set_modified_date_time(uri: string, modified: DateTime): void
|
|
13591
13681
|
/**
|
|
13592
13682
|
* Sets `title` as the title of the bookmark for `uri` inside the
|
|
13593
13683
|
* bookmark file `bookmark`.
|
|
@@ -13598,7 +13688,7 @@ export interface BookmarkFile {
|
|
|
13598
13688
|
* @param uri a valid URI or %NULL
|
|
13599
13689
|
* @param title a UTF-8 encoded string
|
|
13600
13690
|
*/
|
|
13601
|
-
set_title(uri: string | null, title: string
|
|
13691
|
+
set_title(uri: string | null, title: string): void
|
|
13602
13692
|
/**
|
|
13603
13693
|
* Sets the time the bookmark for `uri` was last visited.
|
|
13604
13694
|
*
|
|
@@ -13612,7 +13702,7 @@ export interface BookmarkFile {
|
|
|
13612
13702
|
* @param uri a valid URI
|
|
13613
13703
|
* @param visited a timestamp or -1 to use the current time
|
|
13614
13704
|
*/
|
|
13615
|
-
set_visited(uri: string
|
|
13705
|
+
set_visited(uri: string, visited: number): void
|
|
13616
13706
|
/**
|
|
13617
13707
|
* Sets the time the bookmark for `uri` was last visited.
|
|
13618
13708
|
*
|
|
@@ -13626,7 +13716,7 @@ export interface BookmarkFile {
|
|
|
13626
13716
|
* @param uri a valid URI
|
|
13627
13717
|
* @param visited a #GDateTime
|
|
13628
13718
|
*/
|
|
13629
|
-
set_visited_date_time(uri: string
|
|
13719
|
+
set_visited_date_time(uri: string, visited: DateTime): void
|
|
13630
13720
|
/**
|
|
13631
13721
|
* This function outputs `bookmark` as a string.
|
|
13632
13722
|
* @returns a newly allocated string holding the contents of the #GBookmarkFile
|
|
@@ -13642,7 +13732,44 @@ export interface BookmarkFile {
|
|
|
13642
13732
|
}
|
|
13643
13733
|
|
|
13644
13734
|
/**
|
|
13645
|
-
*
|
|
13735
|
+
* GBookmarkFile lets you parse, edit or create files containing bookmarks
|
|
13736
|
+
* to URI, along with some meta-data about the resource pointed by the URI
|
|
13737
|
+
* like its MIME type, the application that is registering the bookmark and
|
|
13738
|
+
* the icon that should be used to represent the bookmark. The data is stored
|
|
13739
|
+
* using the
|
|
13740
|
+
* [Desktop Bookmark Specification](http://www.gnome.org/~ebassi/bookmark-spec).
|
|
13741
|
+
*
|
|
13742
|
+
* The syntax of the bookmark files is described in detail inside the
|
|
13743
|
+
* Desktop Bookmark Specification, here is a quick summary: bookmark
|
|
13744
|
+
* files use a sub-class of the XML Bookmark Exchange Language
|
|
13745
|
+
* specification, consisting of valid UTF-8 encoded XML, under the
|
|
13746
|
+
* <xbel> root element; each bookmark is stored inside a
|
|
13747
|
+
* <bookmark> element, using its URI: no relative paths can
|
|
13748
|
+
* be used inside a bookmark file. The bookmark may have a user defined
|
|
13749
|
+
* title and description, to be used instead of the URI. Under the
|
|
13750
|
+
* <metadata> element, with its owner attribute set to
|
|
13751
|
+
* `http://freedesktop.org`, is stored the meta-data about a resource
|
|
13752
|
+
* pointed by its URI. The meta-data consists of the resource's MIME
|
|
13753
|
+
* type; the applications that have registered a bookmark; the groups
|
|
13754
|
+
* to which a bookmark belongs to; a visibility flag, used to set the
|
|
13755
|
+
* bookmark as "private" to the applications and groups that has it
|
|
13756
|
+
* registered; the URI and MIME type of an icon, to be used when
|
|
13757
|
+
* displaying the bookmark inside a GUI.
|
|
13758
|
+
*
|
|
13759
|
+
* Here is an example of a bookmark file:
|
|
13760
|
+
* [bookmarks.xbel](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/glib/tests/bookmarks.xbel)
|
|
13761
|
+
*
|
|
13762
|
+
* A bookmark file might contain more than one bookmark; each bookmark
|
|
13763
|
+
* is accessed through its URI.
|
|
13764
|
+
*
|
|
13765
|
+
* The important caveat of bookmark files is that when you add a new
|
|
13766
|
+
* bookmark you must also add the application that is registering it, using
|
|
13767
|
+
* g_bookmark_file_add_application() or g_bookmark_file_set_application_info().
|
|
13768
|
+
* If a bookmark has no applications then it won't be dumped when creating
|
|
13769
|
+
* the on disk representation, using g_bookmark_file_to_data() or
|
|
13770
|
+
* g_bookmark_file_to_file().
|
|
13771
|
+
*
|
|
13772
|
+
* The #GBookmarkFile parser was added in GLib 2.12.
|
|
13646
13773
|
* @record
|
|
13647
13774
|
*/
|
|
13648
13775
|
export class BookmarkFile {
|
|
@@ -13711,8 +13838,10 @@ export class ByteArray {
|
|
|
13711
13838
|
*/
|
|
13712
13839
|
static new(): Uint8Array
|
|
13713
13840
|
/**
|
|
13714
|
-
*
|
|
13715
|
-
*
|
|
13841
|
+
* Creates a byte array containing the `data`.
|
|
13842
|
+
* After this call, `data` belongs to the #GByteArray and may no longer be
|
|
13843
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
13844
|
+
* allocated and will eventually be freed with g_free().
|
|
13716
13845
|
*
|
|
13717
13846
|
* Do not use it if `len` is greater than %G_MAXUINT. #GByteArray
|
|
13718
13847
|
* stores the length of its data in #guint, which may be shorter than
|
|
@@ -13959,11 +14088,9 @@ export class Bytes {
|
|
|
13959
14088
|
/**
|
|
13960
14089
|
* Creates a new #GBytes from `data`.
|
|
13961
14090
|
*
|
|
13962
|
-
* After this call, `data` belongs to the
|
|
13963
|
-
* modified by the caller.
|
|
13964
|
-
*
|
|
13965
|
-
* a call to g_malloc(), g_malloc0() or g_realloc() or by one of the many
|
|
13966
|
-
* functions that wrap these calls (such as g_new(), g_strdup(), etc).
|
|
14091
|
+
* After this call, `data` belongs to the #GBytes and may no longer be
|
|
14092
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
14093
|
+
* allocated and will eventually be freed with g_free().
|
|
13967
14094
|
*
|
|
13968
14095
|
* For creating #GBytes with memory from other allocators, see
|
|
13969
14096
|
* g_bytes_new_with_free_func().
|
|
@@ -14000,7 +14127,7 @@ export interface Checksum {
|
|
|
14000
14127
|
* The hexadecimal characters will be lower case.
|
|
14001
14128
|
* @returns the hexadecimal representation of the checksum. The returned string is owned by the checksum and should not be modified or freed.
|
|
14002
14129
|
*/
|
|
14003
|
-
get_string(): string
|
|
14130
|
+
get_string(): string
|
|
14004
14131
|
/**
|
|
14005
14132
|
* Resets the state of the `checksum` back to its initial state.
|
|
14006
14133
|
*/
|
|
@@ -14506,7 +14633,7 @@ export interface Date {
|
|
|
14506
14633
|
* capacity).
|
|
14507
14634
|
* @param str string to parse
|
|
14508
14635
|
*/
|
|
14509
|
-
set_parse(str: string
|
|
14636
|
+
set_parse(str: string): void
|
|
14510
14637
|
/**
|
|
14511
14638
|
* Sets the value of a date from a #GTime value.
|
|
14512
14639
|
* The time to date conversion is done using the user's current timezone.
|
|
@@ -14711,7 +14838,7 @@ export class Date {
|
|
|
14711
14838
|
* @param date valid #GDate
|
|
14712
14839
|
* @returns number of characters written to the buffer, or 0 the buffer was too small
|
|
14713
14840
|
*/
|
|
14714
|
-
static strftime(s: string | null, slen: number, format: string
|
|
14841
|
+
static strftime(s: string | null, slen: number, format: string, date: Date): number
|
|
14715
14842
|
/**
|
|
14716
14843
|
* Returns %TRUE if the day of the month is valid (a day is valid if it's
|
|
14717
14844
|
* between 1 and 31 inclusive).
|
|
@@ -14866,107 +14993,107 @@ export interface DateTime {
|
|
|
14866
14993
|
* Creates a newly allocated string representing the requested `format`.
|
|
14867
14994
|
*
|
|
14868
14995
|
* The format strings understood by this function are a subset of the
|
|
14869
|
-
* strftime() format language as specified by C99. The
|
|
14870
|
-
* conversions are not supported, nor is the
|
|
14871
|
-
* extensions
|
|
14872
|
-
*
|
|
14996
|
+
* `strftime()` format language as specified by C99. The `%D`, `%U` and `%W`
|
|
14997
|
+
* conversions are not supported, nor is the `E` modifier. The GNU
|
|
14998
|
+
* extensions `%k`, `%l`, `%s` and `%P` are supported, however, as are the
|
|
14999
|
+
* `0`, `_` and `-` modifiers. The Python extension `%f` is also supported.
|
|
14873
15000
|
*
|
|
14874
|
-
* In contrast to strftime()
|
|
15001
|
+
* In contrast to `strftime()`, this function always produces a UTF-8
|
|
14875
15002
|
* string, regardless of the current locale. Note that the rendering of
|
|
14876
|
-
* many formats is locale-dependent and may not match the strftime()
|
|
15003
|
+
* many formats is locale-dependent and may not match the `strftime()`
|
|
14877
15004
|
* output exactly.
|
|
14878
15005
|
*
|
|
14879
15006
|
* The following format specifiers are supported:
|
|
14880
15007
|
*
|
|
14881
|
-
* -
|
|
14882
|
-
* -
|
|
14883
|
-
* -
|
|
14884
|
-
* -
|
|
14885
|
-
* -
|
|
14886
|
-
* -
|
|
14887
|
-
* -
|
|
14888
|
-
* -
|
|
14889
|
-
* single digits are preceded by a figure space
|
|
14890
|
-
* -
|
|
14891
|
-
* -
|
|
14892
|
-
* decimal number (00-99). This works well with
|
|
14893
|
-
* -
|
|
14894
|
-
* well with
|
|
14895
|
-
* -
|
|
14896
|
-
* -
|
|
14897
|
-
* -
|
|
14898
|
-
* -
|
|
14899
|
-
* -
|
|
14900
|
-
* single digits are preceded by a figure space
|
|
14901
|
-
* -
|
|
14902
|
-
* single digits are preceded by a figure space
|
|
14903
|
-
* -
|
|
14904
|
-
* -
|
|
14905
|
-
* -
|
|
14906
|
-
* -
|
|
15008
|
+
* - `%a`: the abbreviated weekday name according to the current locale
|
|
15009
|
+
* - `%A`: the full weekday name according to the current locale
|
|
15010
|
+
* - `%b`: the abbreviated month name according to the current locale
|
|
15011
|
+
* - `%B`: the full month name according to the current locale
|
|
15012
|
+
* - `%c`: the preferred date and time representation for the current locale
|
|
15013
|
+
* - `%C`: the century number (year/100) as a 2-digit integer (00-99)
|
|
15014
|
+
* - `%d`: the day of the month as a decimal number (range 01 to 31)
|
|
15015
|
+
* - `%e`: the day of the month as a decimal number (range 1 to 31);
|
|
15016
|
+
* single digits are preceded by a figure space (U+2007)
|
|
15017
|
+
* - `%F`: equivalent to `%Y-%m-%d` (the ISO 8601 date format)
|
|
15018
|
+
* - `%g`: the last two digits of the ISO 8601 week-based year as a
|
|
15019
|
+
* decimal number (00-99). This works well with `%V` and `%u`.
|
|
15020
|
+
* - `%G`: the ISO 8601 week-based year as a decimal number. This works
|
|
15021
|
+
* well with `%V` and `%u`.
|
|
15022
|
+
* - `%h`: equivalent to `%b`
|
|
15023
|
+
* - `%H`: the hour as a decimal number using a 24-hour clock (range 00 to 23)
|
|
15024
|
+
* - `%I`: the hour as a decimal number using a 12-hour clock (range 01 to 12)
|
|
15025
|
+
* - `%j`: the day of the year as a decimal number (range 001 to 366)
|
|
15026
|
+
* - `%k`: the hour (24-hour clock) as a decimal number (range 0 to 23);
|
|
15027
|
+
* single digits are preceded by a figure space (U+2007)
|
|
15028
|
+
* - `%l`: the hour (12-hour clock) as a decimal number (range 1 to 12);
|
|
15029
|
+
* single digits are preceded by a figure space (U+2007)
|
|
15030
|
+
* - `%m`: the month as a decimal number (range 01 to 12)
|
|
15031
|
+
* - `%M`: the minute as a decimal number (range 00 to 59)
|
|
15032
|
+
* - `%f`: the microsecond as a decimal number (range 000000 to 999999)
|
|
15033
|
+
* - `%p`: either ‘AM’ or ‘PM’ according to the given time value, or the
|
|
14907
15034
|
* corresponding strings for the current locale. Noon is treated as
|
|
14908
|
-
*
|
|
14909
|
-
* many locales have no concept of AM/PM formatting. Use
|
|
14910
|
-
* -
|
|
15035
|
+
* ‘PM’ and midnight as ‘AM’. Use of this format specifier is discouraged, as
|
|
15036
|
+
* many locales have no concept of AM/PM formatting. Use `%c` or `%X` instead.
|
|
15037
|
+
* - `%P`: like `%p` but lowercase: ‘am’ or ‘pm’ or a corresponding string for
|
|
14911
15038
|
* the current locale. Use of this format specifier is discouraged, as
|
|
14912
|
-
* many locales have no concept of AM/PM formatting. Use
|
|
14913
|
-
* -
|
|
14914
|
-
* discouraged, as many locales have no concept of AM/PM formatting. Use
|
|
14915
|
-
* or
|
|
14916
|
-
* -
|
|
14917
|
-
* -
|
|
15039
|
+
* many locales have no concept of AM/PM formatting. Use `%c` or `%X` instead.
|
|
15040
|
+
* - `%r`: the time in a.m. or p.m. notation. Use of this format specifier is
|
|
15041
|
+
* discouraged, as many locales have no concept of AM/PM formatting. Use `%c`
|
|
15042
|
+
* or `%X` instead.
|
|
15043
|
+
* - `%R`: the time in 24-hour notation (`%H:%M`)
|
|
15044
|
+
* - `%s`: the number of seconds since the Epoch, that is, since 1970-01-01
|
|
14918
15045
|
* 00:00:00 UTC
|
|
14919
|
-
* -
|
|
14920
|
-
* -
|
|
14921
|
-
* -
|
|
14922
|
-
* -
|
|
14923
|
-
* Monday being 1. This works well with
|
|
14924
|
-
* -
|
|
15046
|
+
* - `%S`: the second as a decimal number (range 00 to 60)
|
|
15047
|
+
* - `%t`: a tab character
|
|
15048
|
+
* - `%T`: the time in 24-hour notation with seconds (`%H:%M:%S`)
|
|
15049
|
+
* - `%u`: the ISO 8601 standard day of the week as a decimal, range 1 to 7,
|
|
15050
|
+
* Monday being 1. This works well with `%G` and `%V`.
|
|
15051
|
+
* - `%V`: the ISO 8601 standard week number of the current year as a decimal
|
|
14925
15052
|
* number, range 01 to 53, where week 1 is the first week that has at
|
|
14926
15053
|
* least 4 days in the new year. See g_date_time_get_week_of_year().
|
|
14927
|
-
* This works well with
|
|
14928
|
-
* -
|
|
14929
|
-
* This is not the ISO 8601 standard format
|
|
14930
|
-
* -
|
|
15054
|
+
* This works well with `%G` and `%u`.
|
|
15055
|
+
* - `%w`: the day of the week as a decimal, range 0 to 6, Sunday being 0.
|
|
15056
|
+
* This is not the ISO 8601 standard format — use `%u` instead.
|
|
15057
|
+
* - `%x`: the preferred date representation for the current locale without
|
|
14931
15058
|
* the time
|
|
14932
|
-
* -
|
|
15059
|
+
* - `%X`: the preferred time representation for the current locale without
|
|
14933
15060
|
* the date
|
|
14934
|
-
* -
|
|
14935
|
-
* -
|
|
14936
|
-
* -
|
|
14937
|
-
* -
|
|
14938
|
-
* This is a gnulib strftime() extension. Since: 2.38
|
|
14939
|
-
* -
|
|
14940
|
-
* gnulib strftime() extension. Since: 2.38
|
|
14941
|
-
* -
|
|
14942
|
-
* precision (e.g.,
|
|
14943
|
-
* -
|
|
14944
|
-
* -
|
|
15061
|
+
* - `%y`: the year as a decimal number without the century
|
|
15062
|
+
* - `%Y`: the year as a decimal number including the century
|
|
15063
|
+
* - `%z`: the time zone as an offset from UTC (`+hhmm`)
|
|
15064
|
+
* - `%:z`: the time zone as an offset from UTC (`+hh:mm`).
|
|
15065
|
+
* This is a gnulib `strftime()` extension. Since: 2.38
|
|
15066
|
+
* - `%::z`: the time zone as an offset from UTC (`+hh:mm:ss`). This is a
|
|
15067
|
+
* gnulib `strftime()` extension. Since: 2.38
|
|
15068
|
+
* - `%:::z`: the time zone as an offset from UTC, with `:` to necessary
|
|
15069
|
+
* precision (e.g., `-04`, `+05:30`). This is a gnulib `strftime()` extension. Since: 2.38
|
|
15070
|
+
* - `%Z`: the time zone or name or abbreviation
|
|
15071
|
+
* - `%%`: a literal `%` character
|
|
14945
15072
|
*
|
|
14946
15073
|
* Some conversion specifications can be modified by preceding the
|
|
14947
15074
|
* conversion specifier by one or more modifier characters. The
|
|
14948
15075
|
* following modifiers are supported for many of the numeric
|
|
14949
15076
|
* conversions:
|
|
14950
15077
|
*
|
|
14951
|
-
* - O
|
|
14952
|
-
* - _
|
|
15078
|
+
* - `O`: Use alternative numeric symbols, if the current locale supports those.
|
|
15079
|
+
* - `_`: Pad a numeric result with spaces. This overrides the default padding
|
|
14953
15080
|
* for the specifier.
|
|
14954
|
-
* -
|
|
15081
|
+
* - `-`: Do not pad a numeric result. This overrides the default padding
|
|
14955
15082
|
* for the specifier.
|
|
14956
|
-
* - 0
|
|
15083
|
+
* - `0`: Pad a numeric result with zeros. This overrides the default padding
|
|
14957
15084
|
* for the specifier.
|
|
14958
15085
|
*
|
|
14959
|
-
* Additionally, when O is used with B
|
|
15086
|
+
* Additionally, when `O` is used with `B`, `b`, or `h`, it produces the alternative
|
|
14960
15087
|
* form of a month name. The alternative form should be used when the month
|
|
14961
15088
|
* name is used without a day number (e.g., standalone). It is required in
|
|
14962
15089
|
* some languages (Baltic, Slavic, Greek, and more) due to their grammatical
|
|
14963
|
-
* rules. For other languages there is no difference.
|
|
14964
|
-
* strftime() extension expected to be added to the future POSIX specification,
|
|
14965
|
-
*
|
|
15090
|
+
* rules. For other languages there is no difference. `%OB` is a GNU and BSD
|
|
15091
|
+
* `strftime()` extension expected to be added to the future POSIX specification,
|
|
15092
|
+
* `%Ob` and `%Oh` are GNU `strftime()` extensions. Since: 2.56
|
|
14966
15093
|
* @param format a valid UTF-8 string, containing the format for the #GDateTime
|
|
14967
15094
|
* @returns a newly allocated string formatted to the requested format or %NULL in the case that there was an error (such as a format specifier not being supported in the current locale). The string should be freed with g_free().
|
|
14968
15095
|
*/
|
|
14969
|
-
format(format: string
|
|
15096
|
+
format(format: string): string | null
|
|
14970
15097
|
/**
|
|
14971
15098
|
* Format `datetime` in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601),
|
|
14972
15099
|
* including the date, time and time zone, and return that as a UTF-8 encoded
|
|
@@ -15040,7 +15167,7 @@ export interface DateTime {
|
|
|
15040
15167
|
* time is in effect.
|
|
15041
15168
|
* @returns the time zone abbreviation. The returned string is owned by the #GDateTime and it should not be modified or freed
|
|
15042
15169
|
*/
|
|
15043
|
-
get_timezone_abbreviation(): string
|
|
15170
|
+
get_timezone_abbreviation(): string
|
|
15044
15171
|
/**
|
|
15045
15172
|
* Determines the offset to UTC in effect at the time and in the time
|
|
15046
15173
|
* zone of `datetime`.
|
|
@@ -15338,7 +15465,7 @@ export class DateTime {
|
|
|
15338
15465
|
* @param default_tz a #GTimeZone to use if the text doesn't contain a timezone, or %NULL.
|
|
15339
15466
|
* @returns a new #GDateTime, or %NULL
|
|
15340
15467
|
*/
|
|
15341
|
-
static new_from_iso8601(text: string
|
|
15468
|
+
static new_from_iso8601(text: string, default_tz: TimeZone | null): DateTime
|
|
15342
15469
|
/**
|
|
15343
15470
|
* Creates a #GDateTime corresponding to the given #GTimeVal `tv` in the
|
|
15344
15471
|
* local time zone.
|
|
@@ -15482,7 +15609,7 @@ export interface DebugKey {
|
|
|
15482
15609
|
* the string
|
|
15483
15610
|
* @field
|
|
15484
15611
|
*/
|
|
15485
|
-
key: string
|
|
15612
|
+
key: string
|
|
15486
15613
|
/**
|
|
15487
15614
|
* the flag
|
|
15488
15615
|
* @field
|
|
@@ -15661,7 +15788,7 @@ export class Error {
|
|
|
15661
15788
|
* @param message error message
|
|
15662
15789
|
* @returns a new #GError
|
|
15663
15790
|
*/
|
|
15664
|
-
static new_literal(domain: Quark, code: number, message: string
|
|
15791
|
+
static new_literal(domain: Quark, code: number, message: string): Error
|
|
15665
15792
|
|
|
15666
15793
|
// Owm static methods of GLib-2.0.GLib.Error
|
|
15667
15794
|
|
|
@@ -15987,7 +16114,7 @@ export interface Hmac {
|
|
|
15987
16114
|
* The hexadecimal characters will be lower case.
|
|
15988
16115
|
* @returns the hexadecimal representation of the HMAC. The returned string is owned by the HMAC and should not be modified or freed.
|
|
15989
16116
|
*/
|
|
15990
|
-
get_string(): string
|
|
16117
|
+
get_string(): string
|
|
15991
16118
|
/**
|
|
15992
16119
|
* Atomically decrements the reference count of `hmac` by one.
|
|
15993
16120
|
*
|
|
@@ -16273,7 +16400,7 @@ export interface IOChannel {
|
|
|
16273
16400
|
* makes the channel safe for binary data.
|
|
16274
16401
|
* @returns A string containing the encoding, this string is owned by GLib and must not be freed.
|
|
16275
16402
|
*/
|
|
16276
|
-
get_encoding(): string
|
|
16403
|
+
get_encoding(): string
|
|
16277
16404
|
/**
|
|
16278
16405
|
* Gets the current flags for a #GIOChannel, including read-only
|
|
16279
16406
|
* flags such as %G_IO_FLAG_IS_READABLE.
|
|
@@ -16293,7 +16420,7 @@ export interface IOChannel {
|
|
|
16293
16420
|
* indicates autodetection.
|
|
16294
16421
|
* @returns The line termination string. This value is owned by GLib and must not be freed.
|
|
16295
16422
|
*/
|
|
16296
|
-
get_line_term(): [ /* returnType */ string
|
|
16423
|
+
get_line_term(): [ /* returnType */ string, /* length */ number ]
|
|
16297
16424
|
/**
|
|
16298
16425
|
* Initializes a #GIOChannel struct.
|
|
16299
16426
|
*
|
|
@@ -16478,7 +16605,7 @@ export interface IOChannel {
|
|
|
16478
16605
|
* @param bytes_written the number of bytes actually written
|
|
16479
16606
|
* @returns %G_IO_ERROR_NONE if the operation was successful.
|
|
16480
16607
|
*/
|
|
16481
|
-
write(buf: string
|
|
16608
|
+
write(buf: string, count: number, bytes_written: number): IOError
|
|
16482
16609
|
/**
|
|
16483
16610
|
* Replacement for g_io_channel_write() with the new API.
|
|
16484
16611
|
*
|
|
@@ -16525,7 +16652,7 @@ export class IOChannel {
|
|
|
16525
16652
|
* @param mode One of "r", "w", "a", "r+", "w+", "a+". These have the same meaning as in fopen()
|
|
16526
16653
|
* @returns A #GIOChannel on success, %NULL on failure.
|
|
16527
16654
|
*/
|
|
16528
|
-
static new_file(filename: string, mode: string
|
|
16655
|
+
static new_file(filename: string, mode: string): IOChannel
|
|
16529
16656
|
/**
|
|
16530
16657
|
* Creates a new #GIOChannel given a file descriptor. On UNIX systems
|
|
16531
16658
|
* this works for plain files, pipes, and sockets.
|
|
@@ -16568,7 +16695,7 @@ export interface IOFuncs {
|
|
|
16568
16695
|
// Own fields of GLib-2.0.GLib.IOFuncs
|
|
16569
16696
|
|
|
16570
16697
|
io_read: (channel: IOChannel, buf: string | null, count: number, bytes_read: number) => IOStatus
|
|
16571
|
-
io_write: (channel: IOChannel, buf: string
|
|
16698
|
+
io_write: (channel: IOChannel, buf: string, count: number, bytes_written: number) => IOStatus
|
|
16572
16699
|
io_seek: (channel: IOChannel, offset: number, type: SeekType) => IOStatus
|
|
16573
16700
|
io_close: (channel: IOChannel) => IOStatus
|
|
16574
16701
|
io_create_watch: (channel: IOChannel, condition: IOCondition) => Source
|
|
@@ -16605,7 +16732,7 @@ export interface KeyFile {
|
|
|
16605
16732
|
* @param key a key
|
|
16606
16733
|
* @returns the value associated with the key as a boolean, or %FALSE if the key was not found or could not be parsed.
|
|
16607
16734
|
*/
|
|
16608
|
-
get_boolean(group_name: string
|
|
16735
|
+
get_boolean(group_name: string, key: string): boolean
|
|
16609
16736
|
/**
|
|
16610
16737
|
* Returns the values associated with `key` under `group_name` as
|
|
16611
16738
|
* booleans.
|
|
@@ -16618,7 +16745,7 @@ export interface KeyFile {
|
|
|
16618
16745
|
* @param key a key
|
|
16619
16746
|
* @returns the values associated with the key as a list of booleans, or %NULL if the key was not found or could not be parsed. The returned list of booleans should be freed with g_free() when no longer needed.
|
|
16620
16747
|
*/
|
|
16621
|
-
get_boolean_list(group_name: string
|
|
16748
|
+
get_boolean_list(group_name: string, key: string): boolean[]
|
|
16622
16749
|
/**
|
|
16623
16750
|
* Retrieves a comment above `key` from `group_name`.
|
|
16624
16751
|
* If `key` is %NULL then `comment` will be read from above
|
|
@@ -16645,7 +16772,7 @@ export interface KeyFile {
|
|
|
16645
16772
|
* @param key a key
|
|
16646
16773
|
* @returns the value associated with the key as a double, or 0.0 if the key was not found or could not be parsed.
|
|
16647
16774
|
*/
|
|
16648
|
-
get_double(group_name: string
|
|
16775
|
+
get_double(group_name: string, key: string): number
|
|
16649
16776
|
/**
|
|
16650
16777
|
* Returns the values associated with `key` under `group_name` as
|
|
16651
16778
|
* doubles.
|
|
@@ -16658,7 +16785,7 @@ export interface KeyFile {
|
|
|
16658
16785
|
* @param key a key
|
|
16659
16786
|
* @returns the values associated with the key as a list of doubles, or %NULL if the key was not found or could not be parsed. The returned list of doubles should be freed with g_free() when no longer needed.
|
|
16660
16787
|
*/
|
|
16661
|
-
get_double_list(group_name: string
|
|
16788
|
+
get_double_list(group_name: string, key: string): number[]
|
|
16662
16789
|
/**
|
|
16663
16790
|
* Returns all groups in the key file loaded with `key_file`.
|
|
16664
16791
|
* The array of returned groups will be %NULL-terminated, so
|
|
@@ -16674,7 +16801,7 @@ export interface KeyFile {
|
|
|
16674
16801
|
* @param key a non-%NULL key
|
|
16675
16802
|
* @returns the value associated with the key as a signed 64-bit integer, or 0 if the key was not found or could not be parsed.
|
|
16676
16803
|
*/
|
|
16677
|
-
get_int64(group_name: string
|
|
16804
|
+
get_int64(group_name: string, key: string): number
|
|
16678
16805
|
/**
|
|
16679
16806
|
* Returns the value associated with `key` under `group_name` as an
|
|
16680
16807
|
* integer.
|
|
@@ -16688,7 +16815,7 @@ export interface KeyFile {
|
|
|
16688
16815
|
* @param key a key
|
|
16689
16816
|
* @returns the value associated with the key as an integer, or 0 if the key was not found or could not be parsed.
|
|
16690
16817
|
*/
|
|
16691
|
-
get_integer(group_name: string
|
|
16818
|
+
get_integer(group_name: string, key: string): number
|
|
16692
16819
|
/**
|
|
16693
16820
|
* Returns the values associated with `key` under `group_name` as
|
|
16694
16821
|
* integers.
|
|
@@ -16702,7 +16829,7 @@ export interface KeyFile {
|
|
|
16702
16829
|
* @param key a key
|
|
16703
16830
|
* @returns the values associated with the key as a list of integers, or %NULL if the key was not found or could not be parsed. The returned list of integers should be freed with g_free() when no longer needed.
|
|
16704
16831
|
*/
|
|
16705
|
-
get_integer_list(group_name: string
|
|
16832
|
+
get_integer_list(group_name: string, key: string): number[]
|
|
16706
16833
|
/**
|
|
16707
16834
|
* Returns all keys for the group name `group_name`. The array of
|
|
16708
16835
|
* returned keys will be %NULL-terminated, so `length` may
|
|
@@ -16712,7 +16839,7 @@ export interface KeyFile {
|
|
|
16712
16839
|
* @param group_name a group name
|
|
16713
16840
|
* @returns a newly-allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
|
|
16714
16841
|
*/
|
|
16715
|
-
get_keys(group_name: string
|
|
16842
|
+
get_keys(group_name: string): [ /* returnType */ string[], /* length */ number ]
|
|
16716
16843
|
/**
|
|
16717
16844
|
* Returns the actual locale which the result of
|
|
16718
16845
|
* g_key_file_get_locale_string() or g_key_file_get_locale_string_list()
|
|
@@ -16728,7 +16855,7 @@ export interface KeyFile {
|
|
|
16728
16855
|
* @param locale a locale identifier or %NULL
|
|
16729
16856
|
* @returns the locale from the file, or %NULL if the key was not found or the entry in the file was was untranslated
|
|
16730
16857
|
*/
|
|
16731
|
-
get_locale_for_key(group_name: string
|
|
16858
|
+
get_locale_for_key(group_name: string, key: string, locale: string | null): string | null
|
|
16732
16859
|
/**
|
|
16733
16860
|
* Returns the value associated with `key` under `group_name`
|
|
16734
16861
|
* translated in the given `locale` if available. If `locale` is
|
|
@@ -16747,7 +16874,7 @@ export interface KeyFile {
|
|
|
16747
16874
|
* @param locale a locale identifier or %NULL
|
|
16748
16875
|
* @returns a newly allocated string or %NULL if the specified key cannot be found.
|
|
16749
16876
|
*/
|
|
16750
|
-
get_locale_string(group_name: string
|
|
16877
|
+
get_locale_string(group_name: string, key: string, locale: string | null): string | null
|
|
16751
16878
|
/**
|
|
16752
16879
|
* Returns the values associated with `key` under `group_name`
|
|
16753
16880
|
* translated in the given `locale` if available. If `locale` is
|
|
@@ -16768,7 +16895,7 @@ export interface KeyFile {
|
|
|
16768
16895
|
* @param locale a locale identifier or %NULL
|
|
16769
16896
|
* @returns a newly allocated %NULL-terminated string array or %NULL if the key isn't found. The string array should be freed with g_strfreev().
|
|
16770
16897
|
*/
|
|
16771
|
-
get_locale_string_list(group_name: string
|
|
16898
|
+
get_locale_string_list(group_name: string, key: string, locale: string | null): string[]
|
|
16772
16899
|
/**
|
|
16773
16900
|
* Returns the name of the start group of the file.
|
|
16774
16901
|
* @returns The start group of the key file.
|
|
@@ -16787,7 +16914,7 @@ export interface KeyFile {
|
|
|
16787
16914
|
* @param key a key
|
|
16788
16915
|
* @returns a newly allocated string or %NULL if the specified key cannot be found.
|
|
16789
16916
|
*/
|
|
16790
|
-
get_string(group_name: string
|
|
16917
|
+
get_string(group_name: string, key: string): string | null
|
|
16791
16918
|
/**
|
|
16792
16919
|
* Returns the values associated with `key` under `group_name`.
|
|
16793
16920
|
*
|
|
@@ -16799,7 +16926,7 @@ export interface KeyFile {
|
|
|
16799
16926
|
* @param key a key
|
|
16800
16927
|
* @returns a %NULL-terminated string array or %NULL if the specified key cannot be found. The array should be freed with g_strfreev().
|
|
16801
16928
|
*/
|
|
16802
|
-
get_string_list(group_name: string
|
|
16929
|
+
get_string_list(group_name: string, key: string): string[]
|
|
16803
16930
|
/**
|
|
16804
16931
|
* Returns the value associated with `key` under `group_name` as an unsigned
|
|
16805
16932
|
* 64-bit integer. This is similar to g_key_file_get_integer() but can return
|
|
@@ -16808,7 +16935,7 @@ export interface KeyFile {
|
|
|
16808
16935
|
* @param key a non-%NULL key
|
|
16809
16936
|
* @returns the value associated with the key as an unsigned 64-bit integer, or 0 if the key was not found or could not be parsed.
|
|
16810
16937
|
*/
|
|
16811
|
-
get_uint64(group_name: string
|
|
16938
|
+
get_uint64(group_name: string, key: string): number
|
|
16812
16939
|
/**
|
|
16813
16940
|
* Returns the raw value associated with `key` under `group_name`.
|
|
16814
16941
|
* Use g_key_file_get_string() to retrieve an unescaped UTF-8 string.
|
|
@@ -16821,13 +16948,13 @@ export interface KeyFile {
|
|
|
16821
16948
|
* @param key a key
|
|
16822
16949
|
* @returns a newly allocated string or %NULL if the specified key cannot be found.
|
|
16823
16950
|
*/
|
|
16824
|
-
get_value(group_name: string
|
|
16951
|
+
get_value(group_name: string, key: string): string | null
|
|
16825
16952
|
/**
|
|
16826
16953
|
* Looks whether the key file has the group `group_name`.
|
|
16827
16954
|
* @param group_name a group name
|
|
16828
16955
|
* @returns %TRUE if @group_name is a part of @key_file, %FALSE otherwise.
|
|
16829
16956
|
*/
|
|
16830
|
-
has_group(group_name: string
|
|
16957
|
+
has_group(group_name: string): boolean
|
|
16831
16958
|
/**
|
|
16832
16959
|
* Loads a key file from the data in `bytes` into an empty #GKeyFile structure.
|
|
16833
16960
|
* If the object cannot be created then %error is set to a #GKeyFileError.
|
|
@@ -16844,7 +16971,7 @@ export interface KeyFile {
|
|
|
16844
16971
|
* @param flags flags from #GKeyFileFlags
|
|
16845
16972
|
* @returns %TRUE if a key file could be loaded, %FALSE otherwise
|
|
16846
16973
|
*/
|
|
16847
|
-
load_from_data(data: string
|
|
16974
|
+
load_from_data(data: string, length: number, flags: KeyFileFlags): boolean
|
|
16848
16975
|
/**
|
|
16849
16976
|
* This function looks for a key file named `file` in the paths
|
|
16850
16977
|
* returned from g_get_user_data_dir() and g_get_system_data_dirs(),
|
|
@@ -16902,14 +17029,14 @@ export interface KeyFile {
|
|
|
16902
17029
|
* @param group_name a group name
|
|
16903
17030
|
* @returns %TRUE if the group was removed, %FALSE otherwise
|
|
16904
17031
|
*/
|
|
16905
|
-
remove_group(group_name: string
|
|
17032
|
+
remove_group(group_name: string): boolean
|
|
16906
17033
|
/**
|
|
16907
17034
|
* Removes `key` in `group_name` from the key file.
|
|
16908
17035
|
* @param group_name a group name
|
|
16909
17036
|
* @param key a key name to remove
|
|
16910
17037
|
* @returns %TRUE if the key was removed, %FALSE otherwise
|
|
16911
17038
|
*/
|
|
16912
|
-
remove_key(group_name: string
|
|
17039
|
+
remove_key(group_name: string, key: string): boolean
|
|
16913
17040
|
/**
|
|
16914
17041
|
* Writes the contents of `key_file` to `filename` using
|
|
16915
17042
|
* g_file_set_contents(). If you need stricter guarantees about durability of
|
|
@@ -16921,7 +17048,7 @@ export interface KeyFile {
|
|
|
16921
17048
|
* @param filename the name of the file to write to
|
|
16922
17049
|
* @returns %TRUE if successful, else %FALSE with @error set
|
|
16923
17050
|
*/
|
|
16924
|
-
save_to_file(filename: string
|
|
17051
|
+
save_to_file(filename: string): boolean
|
|
16925
17052
|
/**
|
|
16926
17053
|
* Associates a new boolean value with `key` under `group_name`.
|
|
16927
17054
|
* If `key` cannot be found then it is created.
|
|
@@ -16929,7 +17056,7 @@ export interface KeyFile {
|
|
|
16929
17056
|
* @param key a key
|
|
16930
17057
|
* @param value %TRUE or %FALSE
|
|
16931
17058
|
*/
|
|
16932
|
-
set_boolean(group_name: string
|
|
17059
|
+
set_boolean(group_name: string, key: string, value: boolean): void
|
|
16933
17060
|
/**
|
|
16934
17061
|
* Associates a list of boolean values with `key` under `group_name`.
|
|
16935
17062
|
* If `key` cannot be found then it is created.
|
|
@@ -16938,7 +17065,7 @@ export interface KeyFile {
|
|
|
16938
17065
|
* @param key a key
|
|
16939
17066
|
* @param list an array of boolean values
|
|
16940
17067
|
*/
|
|
16941
|
-
set_boolean_list(group_name: string
|
|
17068
|
+
set_boolean_list(group_name: string, key: string, list: boolean[]): void
|
|
16942
17069
|
/**
|
|
16943
17070
|
* Places a comment above `key` from `group_name`.
|
|
16944
17071
|
*
|
|
@@ -16953,7 +17080,7 @@ export interface KeyFile {
|
|
|
16953
17080
|
* @param comment a comment
|
|
16954
17081
|
* @returns %TRUE if the comment was written, %FALSE otherwise
|
|
16955
17082
|
*/
|
|
16956
|
-
set_comment(group_name: string | null, key: string | null, comment: string
|
|
17083
|
+
set_comment(group_name: string | null, key: string | null, comment: string): boolean
|
|
16957
17084
|
/**
|
|
16958
17085
|
* Associates a new double value with `key` under `group_name`.
|
|
16959
17086
|
* If `key` cannot be found then it is created.
|
|
@@ -16961,7 +17088,7 @@ export interface KeyFile {
|
|
|
16961
17088
|
* @param key a key
|
|
16962
17089
|
* @param value a double value
|
|
16963
17090
|
*/
|
|
16964
|
-
set_double(group_name: string
|
|
17091
|
+
set_double(group_name: string, key: string, value: number): void
|
|
16965
17092
|
/**
|
|
16966
17093
|
* Associates a list of double values with `key` under
|
|
16967
17094
|
* `group_name`. If `key` cannot be found then it is created.
|
|
@@ -16969,7 +17096,7 @@ export interface KeyFile {
|
|
|
16969
17096
|
* @param key a key
|
|
16970
17097
|
* @param list an array of double values
|
|
16971
17098
|
*/
|
|
16972
|
-
set_double_list(group_name: string
|
|
17099
|
+
set_double_list(group_name: string, key: string, list: number[]): void
|
|
16973
17100
|
/**
|
|
16974
17101
|
* Associates a new integer value with `key` under `group_name`.
|
|
16975
17102
|
* If `key` cannot be found then it is created.
|
|
@@ -16977,7 +17104,7 @@ export interface KeyFile {
|
|
|
16977
17104
|
* @param key a key
|
|
16978
17105
|
* @param value an integer value
|
|
16979
17106
|
*/
|
|
16980
|
-
set_int64(group_name: string
|
|
17107
|
+
set_int64(group_name: string, key: string, value: number): void
|
|
16981
17108
|
/**
|
|
16982
17109
|
* Associates a new integer value with `key` under `group_name`.
|
|
16983
17110
|
* If `key` cannot be found then it is created.
|
|
@@ -16985,7 +17112,7 @@ export interface KeyFile {
|
|
|
16985
17112
|
* @param key a key
|
|
16986
17113
|
* @param value an integer value
|
|
16987
17114
|
*/
|
|
16988
|
-
set_integer(group_name: string
|
|
17115
|
+
set_integer(group_name: string, key: string, value: number): void
|
|
16989
17116
|
/**
|
|
16990
17117
|
* Associates a list of integer values with `key` under `group_name`.
|
|
16991
17118
|
* If `key` cannot be found then it is created.
|
|
@@ -16993,7 +17120,7 @@ export interface KeyFile {
|
|
|
16993
17120
|
* @param key a key
|
|
16994
17121
|
* @param list an array of integer values
|
|
16995
17122
|
*/
|
|
16996
|
-
set_integer_list(group_name: string
|
|
17123
|
+
set_integer_list(group_name: string, key: string, list: number[]): void
|
|
16997
17124
|
/**
|
|
16998
17125
|
* Sets the character which is used to separate
|
|
16999
17126
|
* values in lists. Typically ';' or ',' are used
|
|
@@ -17009,7 +17136,7 @@ export interface KeyFile {
|
|
|
17009
17136
|
* @param locale a locale identifier
|
|
17010
17137
|
* @param string a string
|
|
17011
17138
|
*/
|
|
17012
|
-
set_locale_string(group_name: string
|
|
17139
|
+
set_locale_string(group_name: string, key: string, locale: string, string: string): void
|
|
17013
17140
|
/**
|
|
17014
17141
|
* Associates a list of string values for `key` and `locale` under
|
|
17015
17142
|
* `group_name`. If the translation for `key` cannot be found then
|
|
@@ -17019,7 +17146,7 @@ export interface KeyFile {
|
|
|
17019
17146
|
* @param locale a locale identifier
|
|
17020
17147
|
* @param list a %NULL-terminated array of locale string values
|
|
17021
17148
|
*/
|
|
17022
|
-
set_locale_string_list(group_name: string
|
|
17149
|
+
set_locale_string_list(group_name: string, key: string, locale: string, list: string[]): void
|
|
17023
17150
|
/**
|
|
17024
17151
|
* Associates a new string value with `key` under `group_name`.
|
|
17025
17152
|
* If `key` cannot be found then it is created.
|
|
@@ -17030,7 +17157,7 @@ export interface KeyFile {
|
|
|
17030
17157
|
* @param key a key
|
|
17031
17158
|
* @param string a string
|
|
17032
17159
|
*/
|
|
17033
|
-
set_string(group_name: string
|
|
17160
|
+
set_string(group_name: string, key: string, string: string): void
|
|
17034
17161
|
/**
|
|
17035
17162
|
* Associates a list of string values for `key` under `group_name`.
|
|
17036
17163
|
* If `key` cannot be found then it is created.
|
|
@@ -17039,7 +17166,7 @@ export interface KeyFile {
|
|
|
17039
17166
|
* @param key a key
|
|
17040
17167
|
* @param list an array of string values
|
|
17041
17168
|
*/
|
|
17042
|
-
set_string_list(group_name: string
|
|
17169
|
+
set_string_list(group_name: string, key: string, list: string[]): void
|
|
17043
17170
|
/**
|
|
17044
17171
|
* Associates a new integer value with `key` under `group_name`.
|
|
17045
17172
|
* If `key` cannot be found then it is created.
|
|
@@ -17047,7 +17174,7 @@ export interface KeyFile {
|
|
|
17047
17174
|
* @param key a key
|
|
17048
17175
|
* @param value an integer value
|
|
17049
17176
|
*/
|
|
17050
|
-
set_uint64(group_name: string
|
|
17177
|
+
set_uint64(group_name: string, key: string, value: number): void
|
|
17051
17178
|
/**
|
|
17052
17179
|
* Associates a new value with `key` under `group_name`.
|
|
17053
17180
|
*
|
|
@@ -17059,7 +17186,7 @@ export interface KeyFile {
|
|
|
17059
17186
|
* @param key a key
|
|
17060
17187
|
* @param value a string
|
|
17061
17188
|
*/
|
|
17062
|
-
set_value(group_name: string
|
|
17189
|
+
set_value(group_name: string, key: string, value: string): void
|
|
17063
17190
|
/**
|
|
17064
17191
|
* This function outputs `key_file` as a string.
|
|
17065
17192
|
*
|
|
@@ -17076,8 +17203,146 @@ export interface KeyFile {
|
|
|
17076
17203
|
}
|
|
17077
17204
|
|
|
17078
17205
|
/**
|
|
17079
|
-
*
|
|
17080
|
-
*
|
|
17206
|
+
* #GKeyFile lets you parse, edit or create files containing groups of
|
|
17207
|
+
* key-value pairs, which we call "key files" for lack of a better name.
|
|
17208
|
+
* Several freedesktop.org specifications use key files now, e.g the
|
|
17209
|
+
* [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec)
|
|
17210
|
+
* and the
|
|
17211
|
+
* [Icon Theme Specification](http://freedesktop.org/Standards/icon-theme-spec).
|
|
17212
|
+
*
|
|
17213
|
+
* The syntax of key files is described in detail in the
|
|
17214
|
+
* [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec),
|
|
17215
|
+
* here is a quick summary: Key files
|
|
17216
|
+
* consists of groups of key-value pairs, interspersed with comments.
|
|
17217
|
+
*
|
|
17218
|
+
*
|
|
17219
|
+
* ```
|
|
17220
|
+
* # this is just an example
|
|
17221
|
+
* # there can be comments before the first group
|
|
17222
|
+
*
|
|
17223
|
+
* [First Group]
|
|
17224
|
+
*
|
|
17225
|
+
* Name=Key File Example\tthis value shows\nescaping
|
|
17226
|
+
*
|
|
17227
|
+
* # localized strings are stored in multiple key-value pairs
|
|
17228
|
+
* Welcome=Hello
|
|
17229
|
+
* Welcome[de]=Hallo
|
|
17230
|
+
* Welcome[fr_FR]=Bonjour
|
|
17231
|
+
* Welcome[it]=Ciao
|
|
17232
|
+
* Welcome[be`latin]`=Hello
|
|
17233
|
+
*
|
|
17234
|
+
* [Another Group]
|
|
17235
|
+
*
|
|
17236
|
+
* Numbers=2;20;-200;0
|
|
17237
|
+
*
|
|
17238
|
+
* Booleans=true;false;true;true
|
|
17239
|
+
* ```
|
|
17240
|
+
*
|
|
17241
|
+
*
|
|
17242
|
+
* Lines beginning with a '#' and blank lines are considered comments.
|
|
17243
|
+
*
|
|
17244
|
+
* Groups are started by a header line containing the group name enclosed
|
|
17245
|
+
* in '[' and ']', and ended implicitly by the start of the next group or
|
|
17246
|
+
* the end of the file. Each key-value pair must be contained in a group.
|
|
17247
|
+
*
|
|
17248
|
+
* Key-value pairs generally have the form `key=value`, with the
|
|
17249
|
+
* exception of localized strings, which have the form
|
|
17250
|
+
* `key[locale]=value`, with a locale identifier of the
|
|
17251
|
+
* form `lang_COUNTRY`MODIFIER`` where `COUNTRY` and `MODIFIER`
|
|
17252
|
+
* are optional.
|
|
17253
|
+
* Space before and after the '=' character are ignored. Newline, tab,
|
|
17254
|
+
* carriage return and backslash characters in value are escaped as \n,
|
|
17255
|
+
* \t, \r, and \\\\, respectively. To preserve leading spaces in values,
|
|
17256
|
+
* these can also be escaped as \s.
|
|
17257
|
+
*
|
|
17258
|
+
* Key files can store strings (possibly with localized variants), integers,
|
|
17259
|
+
* booleans and lists of these. Lists are separated by a separator character,
|
|
17260
|
+
* typically ';' or ','. To use the list separator character in a value in
|
|
17261
|
+
* a list, it has to be escaped by prefixing it with a backslash.
|
|
17262
|
+
*
|
|
17263
|
+
* This syntax is obviously inspired by the .ini files commonly met
|
|
17264
|
+
* on Windows, but there are some important differences:
|
|
17265
|
+
*
|
|
17266
|
+
* - .ini files use the ';' character to begin comments,
|
|
17267
|
+
* key files use the '#' character.
|
|
17268
|
+
*
|
|
17269
|
+
* - Key files do not allow for ungrouped keys meaning only
|
|
17270
|
+
* comments can precede the first group.
|
|
17271
|
+
*
|
|
17272
|
+
* - Key files are always encoded in UTF-8.
|
|
17273
|
+
*
|
|
17274
|
+
* - Key and Group names are case-sensitive. For example, a group called
|
|
17275
|
+
* [GROUP] is a different from [group].
|
|
17276
|
+
*
|
|
17277
|
+
* - .ini files don't have a strongly typed boolean entry type,
|
|
17278
|
+
* they only have GetProfileInt(). In key files, only
|
|
17279
|
+
* true and false (in lower case) are allowed.
|
|
17280
|
+
*
|
|
17281
|
+
* Note that in contrast to the
|
|
17282
|
+
* [Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec),
|
|
17283
|
+
* groups in key files may contain the same
|
|
17284
|
+
* key multiple times; the last entry wins. Key files may also contain
|
|
17285
|
+
* multiple groups with the same name; they are merged together.
|
|
17286
|
+
* Another difference is that keys and group names in key files are not
|
|
17287
|
+
* restricted to ASCII characters.
|
|
17288
|
+
*
|
|
17289
|
+
* Here is an example of loading a key file and reading a value:
|
|
17290
|
+
*
|
|
17291
|
+
*
|
|
17292
|
+
* ```c
|
|
17293
|
+
* g_autoptr(GError) error = NULL;
|
|
17294
|
+
* g_autoptr(GKeyFile) key_file = g_key_file_new ();
|
|
17295
|
+
*
|
|
17296
|
+
* if (!g_key_file_load_from_file (key_file, "key-file.ini", flags, &error))
|
|
17297
|
+
* {
|
|
17298
|
+
* if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
|
|
17299
|
+
* g_warning ("Error loading key file: %s", error->message);
|
|
17300
|
+
* return;
|
|
17301
|
+
* }
|
|
17302
|
+
*
|
|
17303
|
+
* g_autofree gchar *val = g_key_file_get_string (key_file, "Group Name", "SomeKey", &error);
|
|
17304
|
+
* if (val == NULL &&
|
|
17305
|
+
* !g_error_matches (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_KEY_NOT_FOUND))
|
|
17306
|
+
* {
|
|
17307
|
+
* g_warning ("Error finding key in key file: %s", error->message);
|
|
17308
|
+
* return;
|
|
17309
|
+
* }
|
|
17310
|
+
* else if (val == NULL)
|
|
17311
|
+
* {
|
|
17312
|
+
* // Fall back to a default value.
|
|
17313
|
+
* val = g_strdup ("default-value");
|
|
17314
|
+
* }
|
|
17315
|
+
* ```
|
|
17316
|
+
*
|
|
17317
|
+
*
|
|
17318
|
+
* Here is an example of creating and saving a key file:
|
|
17319
|
+
*
|
|
17320
|
+
*
|
|
17321
|
+
* ```c
|
|
17322
|
+
* g_autoptr(GKeyFile) key_file = g_key_file_new ();
|
|
17323
|
+
* const gchar *val = …;
|
|
17324
|
+
* g_autoptr(GError) error = NULL;
|
|
17325
|
+
*
|
|
17326
|
+
* g_key_file_set_string (key_file, "Group Name", "SomeKey", val);
|
|
17327
|
+
*
|
|
17328
|
+
* // Save as a file.
|
|
17329
|
+
* if (!g_key_file_save_to_file (key_file, "key-file.ini", &error))
|
|
17330
|
+
* {
|
|
17331
|
+
* g_warning ("Error saving key file: %s", error->message);
|
|
17332
|
+
* return;
|
|
17333
|
+
* }
|
|
17334
|
+
*
|
|
17335
|
+
* // Or store to a GBytes for use elsewhere.
|
|
17336
|
+
* gsize data_len;
|
|
17337
|
+
* g_autofree guint8 *data = (guint8 *) g_key_file_to_data (key_file, &data_len, &error);
|
|
17338
|
+
* if (data == NULL)
|
|
17339
|
+
* {
|
|
17340
|
+
* g_warning ("Error saving key file: %s", error->message);
|
|
17341
|
+
* return;
|
|
17342
|
+
* }
|
|
17343
|
+
* g_autoptr(GBytes) bytes = g_bytes_new_take (g_steal_pointer (&data), data_len);
|
|
17344
|
+
* ```
|
|
17345
|
+
*
|
|
17081
17346
|
* @record
|
|
17082
17347
|
*/
|
|
17083
17348
|
export class KeyFile {
|
|
@@ -17151,7 +17416,7 @@ export interface LogField {
|
|
|
17151
17416
|
* field name (UTF-8 string)
|
|
17152
17417
|
* @field
|
|
17153
17418
|
*/
|
|
17154
|
-
key: string
|
|
17419
|
+
key: string
|
|
17155
17420
|
/**
|
|
17156
17421
|
* field value (arbitrary bytes)
|
|
17157
17422
|
* @field
|
|
@@ -17195,7 +17460,7 @@ export interface MainContext {
|
|
|
17195
17460
|
*
|
|
17196
17461
|
* You must be the owner of a context before you
|
|
17197
17462
|
* can call g_main_context_prepare(), g_main_context_query(),
|
|
17198
|
-
* g_main_context_check(), g_main_context_dispatch().
|
|
17463
|
+
* g_main_context_check(), g_main_context_dispatch(), g_main_context_release().
|
|
17199
17464
|
*
|
|
17200
17465
|
* Since 2.76 `context` can be %NULL to use the global-default
|
|
17201
17466
|
* main context.
|
|
@@ -17391,6 +17656,9 @@ export interface MainContext {
|
|
|
17391
17656
|
* with g_main_context_acquire(). If the context was acquired multiple
|
|
17392
17657
|
* times, the ownership will be released only when g_main_context_release()
|
|
17393
17658
|
* is called as many times as it was acquired.
|
|
17659
|
+
*
|
|
17660
|
+
* You must have successfully acquired the context with
|
|
17661
|
+
* g_main_context_acquire() before you may call this function.
|
|
17394
17662
|
*/
|
|
17395
17663
|
release(): void
|
|
17396
17664
|
/**
|
|
@@ -17558,11 +17826,16 @@ export interface MainLoop {
|
|
|
17558
17826
|
* the result is zero, free the loop and free all associated memory.
|
|
17559
17827
|
*/
|
|
17560
17828
|
unref(): void
|
|
17829
|
+
/**
|
|
17830
|
+
* Similar to `GLib.MainLoop.run` but return a Promise which resolves when the main loop ends, instead of blocking while the main loop runs.
|
|
17831
|
+
* This helps avoid the situation where Promises never resolved if you didn't run the main loop inside a callback.
|
|
17832
|
+
*/
|
|
17833
|
+
runAsync(): Promise<void>
|
|
17561
17834
|
}
|
|
17562
17835
|
|
|
17563
17836
|
/**
|
|
17564
17837
|
* The `GMainLoop` struct is an opaque data type
|
|
17565
|
-
* representing the main event loop of a GLib or GTK
|
|
17838
|
+
* representing the main event loop of a GLib or GTK application.
|
|
17566
17839
|
* @record
|
|
17567
17840
|
*/
|
|
17568
17841
|
export class MainLoop {
|
|
@@ -17747,7 +18020,7 @@ export interface MarkupParseContext {
|
|
|
17747
18020
|
* elements, see g_markup_parse_context_get_element_stack().
|
|
17748
18021
|
* @returns the name of the currently open element, or %NULL
|
|
17749
18022
|
*/
|
|
17750
|
-
get_element(): string
|
|
18023
|
+
get_element(): string
|
|
17751
18024
|
/**
|
|
17752
18025
|
* Retrieves the current line number and the number of the character on
|
|
17753
18026
|
* that line. Intended for use in error messages; there are no strict
|
|
@@ -17779,7 +18052,7 @@ export interface MarkupParseContext {
|
|
|
17779
18052
|
* @param text_len length of `text` in bytes
|
|
17780
18053
|
* @returns %FALSE if an error occurred, %TRUE on success
|
|
17781
18054
|
*/
|
|
17782
|
-
parse(text: string
|
|
18055
|
+
parse(text: string, text_len: number): boolean
|
|
17783
18056
|
/**
|
|
17784
18057
|
* Completes the process of a temporary sub-parser redirection.
|
|
17785
18058
|
*
|
|
@@ -17984,10 +18257,10 @@ export interface MarkupParser {
|
|
|
17984
18257
|
|
|
17985
18258
|
// Own fields of GLib-2.0.GLib.MarkupParser
|
|
17986
18259
|
|
|
17987
|
-
start_element: (context: MarkupParseContext, element_name: string
|
|
17988
|
-
end_element: (context: MarkupParseContext, element_name: string
|
|
17989
|
-
text: (context: MarkupParseContext, text: string
|
|
17990
|
-
passthrough: (context: MarkupParseContext, passthrough_text: string
|
|
18260
|
+
start_element: (context: MarkupParseContext, element_name: string, attribute_names: string, attribute_values: string) => void
|
|
18261
|
+
end_element: (context: MarkupParseContext, element_name: string) => void
|
|
18262
|
+
text: (context: MarkupParseContext, text: string, text_len: number) => void
|
|
18263
|
+
passthrough: (context: MarkupParseContext, passthrough_text: string, text_len: number) => void
|
|
17991
18264
|
error: (context: MarkupParseContext, error: Error) => void
|
|
17992
18265
|
}
|
|
17993
18266
|
|
|
@@ -18033,7 +18306,7 @@ export interface MatchInfo {
|
|
|
18033
18306
|
* @param string_to_expand the string to expand
|
|
18034
18307
|
* @returns the expanded string, or %NULL if an error occurred
|
|
18035
18308
|
*/
|
|
18036
|
-
expand_references(string_to_expand: string
|
|
18309
|
+
expand_references(string_to_expand: string): string | null
|
|
18037
18310
|
/**
|
|
18038
18311
|
* Retrieves the text matching the `match_num'`th capturing
|
|
18039
18312
|
* parentheses. 0 is the full text of the match, 1 is the first paren
|
|
@@ -18087,7 +18360,7 @@ export interface MatchInfo {
|
|
|
18087
18360
|
* @param name name of the subexpression
|
|
18088
18361
|
* @returns The matched substring, or %NULL if an error occurred. You have to free the string yourself
|
|
18089
18362
|
*/
|
|
18090
|
-
fetch_named(name: string
|
|
18363
|
+
fetch_named(name: string): string | null
|
|
18091
18364
|
/**
|
|
18092
18365
|
* Retrieves the position in bytes of the capturing parentheses named `name`.
|
|
18093
18366
|
*
|
|
@@ -18097,7 +18370,7 @@ export interface MatchInfo {
|
|
|
18097
18370
|
* @param name name of the subexpression
|
|
18098
18371
|
* @returns %TRUE if the position was fetched, %FALSE otherwise. If the position cannot be fetched, @start_pos and @end_pos are left unchanged.
|
|
18099
18372
|
*/
|
|
18100
|
-
fetch_named_pos(name: string
|
|
18373
|
+
fetch_named_pos(name: string): [ /* returnType */ boolean, /* start_pos */ number, /* end_pos */ number ]
|
|
18101
18374
|
/**
|
|
18102
18375
|
* Retrieves the position in bytes of the `match_num'`th capturing
|
|
18103
18376
|
* parentheses. 0 is the full text of the match, 1 is the first
|
|
@@ -18146,7 +18419,7 @@ export interface MatchInfo {
|
|
|
18146
18419
|
* you may not free it before calling this function.
|
|
18147
18420
|
* @returns the string searched with @match_info
|
|
18148
18421
|
*/
|
|
18149
|
-
get_string(): string
|
|
18422
|
+
get_string(): string
|
|
18150
18423
|
/**
|
|
18151
18424
|
* Usually if the string passed to g_regex_match*() matches as far as
|
|
18152
18425
|
* it goes, but is too short to match the entire pattern, %FALSE is
|
|
@@ -18472,7 +18745,7 @@ export interface OptionContext {
|
|
|
18472
18745
|
* Returns the description. See g_option_context_set_description().
|
|
18473
18746
|
* @returns the description
|
|
18474
18747
|
*/
|
|
18475
|
-
get_description(): string
|
|
18748
|
+
get_description(): string
|
|
18476
18749
|
/**
|
|
18477
18750
|
* Returns a formatted, translated help text for the given context.
|
|
18478
18751
|
* To obtain the text produced by `--help`, call
|
|
@@ -18514,7 +18787,7 @@ export interface OptionContext {
|
|
|
18514
18787
|
* Returns the summary. See g_option_context_set_summary().
|
|
18515
18788
|
* @returns the summary
|
|
18516
18789
|
*/
|
|
18517
|
-
get_summary(): string
|
|
18790
|
+
get_summary(): string
|
|
18518
18791
|
/**
|
|
18519
18792
|
* Parses the command line arguments, recognizing options
|
|
18520
18793
|
* which have been added to `context`. A side-effect of
|
|
@@ -18656,13 +18929,169 @@ export interface OptionContext {
|
|
|
18656
18929
|
* user-visible strings.
|
|
18657
18930
|
* @param domain the domain to use
|
|
18658
18931
|
*/
|
|
18659
|
-
set_translation_domain(domain: string
|
|
18932
|
+
set_translation_domain(domain: string): void
|
|
18660
18933
|
}
|
|
18661
18934
|
|
|
18662
18935
|
/**
|
|
18663
|
-
*
|
|
18664
|
-
*
|
|
18665
|
-
*
|
|
18936
|
+
* The GOption commandline parser is intended to be a simpler replacement
|
|
18937
|
+
* for the popt library. It supports short and long commandline options,
|
|
18938
|
+
* as shown in the following example:
|
|
18939
|
+
*
|
|
18940
|
+
* `testtreemodel -r 1 --max-size 20 --rand --display=:1.0 -vb -- file1 file2`
|
|
18941
|
+
*
|
|
18942
|
+
* The example demonstrates a number of features of the GOption
|
|
18943
|
+
* commandline parser:
|
|
18944
|
+
*
|
|
18945
|
+
* - Options can be single letters, prefixed by a single dash.
|
|
18946
|
+
*
|
|
18947
|
+
* - Multiple short options can be grouped behind a single dash.
|
|
18948
|
+
*
|
|
18949
|
+
* - Long options are prefixed by two consecutive dashes.
|
|
18950
|
+
*
|
|
18951
|
+
* - Options can have an extra argument, which can be a number, a string or
|
|
18952
|
+
* a filename. For long options, the extra argument can be appended with
|
|
18953
|
+
* an equals sign after the option name, which is useful if the extra
|
|
18954
|
+
* argument starts with a dash, which would otherwise cause it to be
|
|
18955
|
+
* interpreted as another option.
|
|
18956
|
+
*
|
|
18957
|
+
* - Non-option arguments are returned to the application as rest arguments.
|
|
18958
|
+
*
|
|
18959
|
+
* - An argument consisting solely of two dashes turns off further parsing,
|
|
18960
|
+
* any remaining arguments (even those starting with a dash) are returned
|
|
18961
|
+
* to the application as rest arguments.
|
|
18962
|
+
*
|
|
18963
|
+
* Another important feature of GOption is that it can automatically
|
|
18964
|
+
* generate nicely formatted help output. Unless it is explicitly turned
|
|
18965
|
+
* off with g_option_context_set_help_enabled(), GOption will recognize
|
|
18966
|
+
* the `--help`, `-?`, `--help-all` and `--help-groupname` options
|
|
18967
|
+
* (where `groupname` is the name of a #GOptionGroup) and write a text
|
|
18968
|
+
* similar to the one shown in the following example to stdout.
|
|
18969
|
+
*
|
|
18970
|
+
*
|
|
18971
|
+
* ```
|
|
18972
|
+
* Usage:
|
|
18973
|
+
* testtreemodel [OPTION...] - test tree model performance
|
|
18974
|
+
*
|
|
18975
|
+
* Help Options:
|
|
18976
|
+
* -h, --help Show help options
|
|
18977
|
+
* --help-all Show all help options
|
|
18978
|
+
* --help-gtk Show GTK Options
|
|
18979
|
+
*
|
|
18980
|
+
* Application Options:
|
|
18981
|
+
* -r, --repeats=N Average over N repetitions
|
|
18982
|
+
* -m, --max-size=M Test up to 2^M items
|
|
18983
|
+
* --display=DISPLAY X display to use
|
|
18984
|
+
* -v, --verbose Be verbose
|
|
18985
|
+
* -b, --beep Beep when done
|
|
18986
|
+
* --rand Randomize the data
|
|
18987
|
+
* ```
|
|
18988
|
+
*
|
|
18989
|
+
*
|
|
18990
|
+
* GOption groups options in #GOptionGroups, which makes it easy to
|
|
18991
|
+
* incorporate options from multiple sources. The intended use for this is
|
|
18992
|
+
* to let applications collect option groups from the libraries it uses,
|
|
18993
|
+
* add them to their #GOptionContext, and parse all options by a single call
|
|
18994
|
+
* to g_option_context_parse(). See gtk_get_option_group() for an example.
|
|
18995
|
+
*
|
|
18996
|
+
* If an option is declared to be of type string or filename, GOption takes
|
|
18997
|
+
* care of converting it to the right encoding; strings are returned in
|
|
18998
|
+
* UTF-8, filenames are returned in the GLib filename encoding. Note that
|
|
18999
|
+
* this only works if setlocale() has been called before
|
|
19000
|
+
* g_option_context_parse().
|
|
19001
|
+
*
|
|
19002
|
+
* Here is a complete example of setting up GOption to parse the example
|
|
19003
|
+
* commandline above and produce the example help output.
|
|
19004
|
+
*
|
|
19005
|
+
* ```c
|
|
19006
|
+
* static gint repeats = 2;
|
|
19007
|
+
* static gint max_size = 8;
|
|
19008
|
+
* static gboolean verbose = FALSE;
|
|
19009
|
+
* static gboolean beep = FALSE;
|
|
19010
|
+
* static gboolean randomize = FALSE;
|
|
19011
|
+
*
|
|
19012
|
+
* static GOptionEntry entries[] =
|
|
19013
|
+
* {
|
|
19014
|
+
* { "repeats", 'r', 0, G_OPTION_ARG_INT, &repeats, "Average over N repetitions", "N" },
|
|
19015
|
+
* { "max-size", 'm', 0, G_OPTION_ARG_INT, &max_size, "Test up to 2^M items", "M" },
|
|
19016
|
+
* { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
|
|
19017
|
+
* { "beep", 'b', 0, G_OPTION_ARG_NONE, &beep, "Beep when done", NULL },
|
|
19018
|
+
* { "rand", 0, 0, G_OPTION_ARG_NONE, &randomize, "Randomize the data", NULL },
|
|
19019
|
+
* G_OPTION_ENTRY_NULL
|
|
19020
|
+
* };
|
|
19021
|
+
*
|
|
19022
|
+
* int
|
|
19023
|
+
* main (int argc, char *argv[])
|
|
19024
|
+
* {
|
|
19025
|
+
* GError *error = NULL;
|
|
19026
|
+
* GOptionContext *context;
|
|
19027
|
+
*
|
|
19028
|
+
* context = g_option_context_new ("- test tree model performance");
|
|
19029
|
+
* g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
|
19030
|
+
* g_option_context_add_group (context, gtk_get_option_group (TRUE));
|
|
19031
|
+
* if (!g_option_context_parse (context, &argc, &argv, &error))
|
|
19032
|
+
* {
|
|
19033
|
+
* g_print ("option parsing failed: %s\n", error->message);
|
|
19034
|
+
* exit (1);
|
|
19035
|
+
* }
|
|
19036
|
+
*
|
|
19037
|
+
* ...
|
|
19038
|
+
*
|
|
19039
|
+
* }
|
|
19040
|
+
* ```
|
|
19041
|
+
*
|
|
19042
|
+
*
|
|
19043
|
+
* On UNIX systems, the argv that is passed to main() has no particular
|
|
19044
|
+
* encoding, even to the extent that different parts of it may have
|
|
19045
|
+
* different encodings. In general, normal arguments and flags will be
|
|
19046
|
+
* in the current locale and filenames should be considered to be opaque
|
|
19047
|
+
* byte strings. Proper use of %G_OPTION_ARG_FILENAME vs
|
|
19048
|
+
* %G_OPTION_ARG_STRING is therefore important.
|
|
19049
|
+
*
|
|
19050
|
+
* Note that on Windows, filenames do have an encoding, but using
|
|
19051
|
+
* #GOptionContext with the argv as passed to main() will result in a
|
|
19052
|
+
* program that can only accept commandline arguments with characters
|
|
19053
|
+
* from the system codepage. This can cause problems when attempting to
|
|
19054
|
+
* deal with filenames containing Unicode characters that fall outside
|
|
19055
|
+
* of the codepage.
|
|
19056
|
+
*
|
|
19057
|
+
* A solution to this is to use g_win32_get_command_line() and
|
|
19058
|
+
* g_option_context_parse_strv() which will properly handle full Unicode
|
|
19059
|
+
* filenames. If you are using #GApplication, this is done
|
|
19060
|
+
* automatically for you.
|
|
19061
|
+
*
|
|
19062
|
+
* The following example shows how you can use #GOptionContext directly
|
|
19063
|
+
* in order to correctly deal with Unicode filenames on Windows:
|
|
19064
|
+
*
|
|
19065
|
+
*
|
|
19066
|
+
* ```c
|
|
19067
|
+
* int
|
|
19068
|
+
* main (int argc, char **argv)
|
|
19069
|
+
* {
|
|
19070
|
+
* GError *error = NULL;
|
|
19071
|
+
* GOptionContext *context;
|
|
19072
|
+
* gchar **args;
|
|
19073
|
+
*
|
|
19074
|
+
* #ifdef G_OS_WIN32
|
|
19075
|
+
* args = g_win32_get_command_line ();
|
|
19076
|
+
* #else
|
|
19077
|
+
* args = g_strdupv (argv);
|
|
19078
|
+
* #endif
|
|
19079
|
+
*
|
|
19080
|
+
* // set up context
|
|
19081
|
+
*
|
|
19082
|
+
* if (!g_option_context_parse_strv (context, &args, &error))
|
|
19083
|
+
* {
|
|
19084
|
+
* // error happened
|
|
19085
|
+
* }
|
|
19086
|
+
*
|
|
19087
|
+
* ...
|
|
19088
|
+
*
|
|
19089
|
+
* g_strfreev (args);
|
|
19090
|
+
*
|
|
19091
|
+
* ...
|
|
19092
|
+
* }
|
|
19093
|
+
* ```
|
|
19094
|
+
*
|
|
18666
19095
|
* @record
|
|
18667
19096
|
*/
|
|
18668
19097
|
export class OptionContext {
|
|
@@ -18684,7 +19113,7 @@ export interface OptionEntry {
|
|
|
18684
19113
|
* `--groupname-long_name`.
|
|
18685
19114
|
* @field
|
|
18686
19115
|
*/
|
|
18687
|
-
long_name: string
|
|
19116
|
+
long_name: string
|
|
18688
19117
|
/**
|
|
18689
19118
|
* If an option has a short name, it can be specified
|
|
18690
19119
|
* `-short_name` in a commandline. `short_name` must be a printable
|
|
@@ -18730,7 +19159,7 @@ export interface OptionEntry {
|
|
|
18730
19159
|
* of the group, see g_option_group_set_translation_domain().
|
|
18731
19160
|
* @field
|
|
18732
19161
|
*/
|
|
18733
|
-
description: string
|
|
19162
|
+
description: string
|
|
18734
19163
|
/**
|
|
18735
19164
|
* The placeholder to use for the extra argument parsed
|
|
18736
19165
|
* by the option in `--help` output. The `arg_description` is translated
|
|
@@ -18738,7 +19167,7 @@ export interface OptionEntry {
|
|
|
18738
19167
|
* g_option_group_set_translation_domain().
|
|
18739
19168
|
* @field
|
|
18740
19169
|
*/
|
|
18741
|
-
arg_description: string
|
|
19170
|
+
arg_description: string
|
|
18742
19171
|
}
|
|
18743
19172
|
|
|
18744
19173
|
/**
|
|
@@ -18788,7 +19217,7 @@ export interface OptionGroup {
|
|
|
18788
19217
|
* user-visible strings.
|
|
18789
19218
|
* @param domain the domain to use
|
|
18790
19219
|
*/
|
|
18791
|
-
set_translation_domain(domain: string
|
|
19220
|
+
set_translation_domain(domain: string): void
|
|
18792
19221
|
/**
|
|
18793
19222
|
* Decrements the reference count of `group` by one.
|
|
18794
19223
|
* If the reference count drops to 0, the `group` will be freed.
|
|
@@ -18825,7 +19254,7 @@ export class OptionGroup {
|
|
|
18825
19254
|
* @param destroy a function that will be called to free `user_data,` or %NULL
|
|
18826
19255
|
* @returns a newly created option group. It should be added to a #GOptionContext or freed with g_option_group_unref().
|
|
18827
19256
|
*/
|
|
18828
|
-
constructor(name: string
|
|
19257
|
+
constructor(name: string, description: string, help_description: string, user_data: any | null, destroy: DestroyNotify | null)
|
|
18829
19258
|
/**
|
|
18830
19259
|
* Creates a new #GOptionGroup.
|
|
18831
19260
|
* @constructor
|
|
@@ -18836,7 +19265,7 @@ export class OptionGroup {
|
|
|
18836
19265
|
* @param destroy a function that will be called to free `user_data,` or %NULL
|
|
18837
19266
|
* @returns a newly created option group. It should be added to a #GOptionContext or freed with g_option_group_unref().
|
|
18838
19267
|
*/
|
|
18839
|
-
static new(name: string
|
|
19268
|
+
static new(name: string, description: string, help_description: string, user_data: any | null, destroy: DestroyNotify | null): OptionGroup
|
|
18840
19269
|
}
|
|
18841
19270
|
|
|
18842
19271
|
export interface PathBuf {
|
|
@@ -19115,7 +19544,7 @@ export interface PatternSpec {
|
|
|
19115
19544
|
* @param string_reversed the reverse of `string` or %NULL
|
|
19116
19545
|
* @returns %TRUE if @string matches @pspec
|
|
19117
19546
|
*/
|
|
19118
|
-
match(string_length: number, string: string
|
|
19547
|
+
match(string_length: number, string: string, string_reversed: string | null): boolean
|
|
19119
19548
|
/**
|
|
19120
19549
|
* Matches a string against a compiled pattern. If the string is to be
|
|
19121
19550
|
* matched against more than one pattern, consider using
|
|
@@ -19123,7 +19552,7 @@ export interface PatternSpec {
|
|
|
19123
19552
|
* @param string the UTF-8 encoded string to match
|
|
19124
19553
|
* @returns %TRUE if @string matches @pspec
|
|
19125
19554
|
*/
|
|
19126
|
-
match_string(string: string
|
|
19555
|
+
match_string(string: string): boolean
|
|
19127
19556
|
}
|
|
19128
19557
|
|
|
19129
19558
|
/**
|
|
@@ -19145,14 +19574,14 @@ export class PatternSpec {
|
|
|
19145
19574
|
* @param pattern a zero-terminated UTF-8 encoded string
|
|
19146
19575
|
* @returns a newly-allocated #GPatternSpec
|
|
19147
19576
|
*/
|
|
19148
|
-
constructor(pattern: string
|
|
19577
|
+
constructor(pattern: string)
|
|
19149
19578
|
/**
|
|
19150
19579
|
* Compiles a pattern to a #GPatternSpec.
|
|
19151
19580
|
* @constructor
|
|
19152
19581
|
* @param pattern a zero-terminated UTF-8 encoded string
|
|
19153
19582
|
* @returns a newly-allocated #GPatternSpec
|
|
19154
19583
|
*/
|
|
19155
|
-
static new(pattern: string
|
|
19584
|
+
static new(pattern: string): PatternSpec
|
|
19156
19585
|
}
|
|
19157
19586
|
|
|
19158
19587
|
export interface PollFD {
|
|
@@ -19816,13 +20245,13 @@ export interface Regex {
|
|
|
19816
20245
|
* the string passed to g_regex_new().
|
|
19817
20246
|
* @returns the pattern of @regex
|
|
19818
20247
|
*/
|
|
19819
|
-
get_pattern(): string
|
|
20248
|
+
get_pattern(): string
|
|
19820
20249
|
/**
|
|
19821
20250
|
* Retrieves the number of the subexpression named `name`.
|
|
19822
20251
|
* @param name name of the subexpression
|
|
19823
20252
|
* @returns The number of the subexpression or -1 if @name does not exists
|
|
19824
20253
|
*/
|
|
19825
|
-
get_string_number(name: string
|
|
20254
|
+
get_string_number(name: string): number
|
|
19826
20255
|
/**
|
|
19827
20256
|
* Scans for a match in `string` for the pattern in `regex`.
|
|
19828
20257
|
* The `match_options` are combined with the match options specified
|
|
@@ -19870,7 +20299,7 @@ export interface Regex {
|
|
|
19870
20299
|
* @param match_options match options
|
|
19871
20300
|
* @returns %TRUE is the string matched, %FALSE otherwise
|
|
19872
20301
|
*/
|
|
19873
|
-
match(string: string
|
|
20302
|
+
match(string: string, match_options: RegexMatchFlags): [ /* returnType */ boolean, /* match_info */ MatchInfo ]
|
|
19874
20303
|
/**
|
|
19875
20304
|
* Using the standard algorithm for regular expression matching only
|
|
19876
20305
|
* the longest match in the string is retrieved. This function uses
|
|
@@ -19890,7 +20319,7 @@ export interface Regex {
|
|
|
19890
20319
|
* @param match_options match options
|
|
19891
20320
|
* @returns %TRUE is the string matched, %FALSE otherwise
|
|
19892
20321
|
*/
|
|
19893
|
-
match_all(string: string
|
|
20322
|
+
match_all(string: string, match_options: RegexMatchFlags): [ /* returnType */ boolean, /* match_info */ MatchInfo ]
|
|
19894
20323
|
/**
|
|
19895
20324
|
* Using the standard algorithm for regular expression matching only
|
|
19896
20325
|
* the longest match in the `string` is retrieved, it is not possible
|
|
@@ -20034,7 +20463,7 @@ export interface Regex {
|
|
|
20034
20463
|
* @param match_options options for the match
|
|
20035
20464
|
* @returns a newly allocated string containing the replacements
|
|
20036
20465
|
*/
|
|
20037
|
-
replace(string: string[], start_position: number, replacement: string
|
|
20466
|
+
replace(string: string[], start_position: number, replacement: string, match_options: RegexMatchFlags): string | null
|
|
20038
20467
|
/**
|
|
20039
20468
|
* Replaces all occurrences of the pattern in `regex` with the
|
|
20040
20469
|
* replacement text. `replacement` is replaced literally, to
|
|
@@ -20050,7 +20479,7 @@ export interface Regex {
|
|
|
20050
20479
|
* @param match_options options for the match
|
|
20051
20480
|
* @returns a newly allocated string containing the replacements
|
|
20052
20481
|
*/
|
|
20053
|
-
replace_literal(string: string[], start_position: number, replacement: string
|
|
20482
|
+
replace_literal(string: string[], start_position: number, replacement: string, match_options: RegexMatchFlags): string | null
|
|
20054
20483
|
/**
|
|
20055
20484
|
* Breaks the string on the pattern, and returns an array of the tokens.
|
|
20056
20485
|
* If the pattern contains capturing parentheses, then the text for each
|
|
@@ -20073,7 +20502,7 @@ export interface Regex {
|
|
|
20073
20502
|
* @param match_options match time option flags
|
|
20074
20503
|
* @returns a %NULL-terminated gchar ** array. Free it using g_strfreev()
|
|
20075
20504
|
*/
|
|
20076
|
-
split(string: string
|
|
20505
|
+
split(string: string, match_options: RegexMatchFlags): string[]
|
|
20077
20506
|
/**
|
|
20078
20507
|
* Breaks the string on the pattern, and returns an array of the tokens.
|
|
20079
20508
|
* If the pattern contains capturing parentheses, then the text for each
|
|
@@ -20183,7 +20612,7 @@ export class Regex {
|
|
|
20183
20612
|
* @param match_options match options for the regular expression, or 0
|
|
20184
20613
|
* @returns a #GRegex structure or %NULL if an error occurred. Call g_regex_unref() when you are done with it
|
|
20185
20614
|
*/
|
|
20186
|
-
constructor(pattern: string
|
|
20615
|
+
constructor(pattern: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags)
|
|
20187
20616
|
/**
|
|
20188
20617
|
* Compiles the regular expression to an internal form, and does
|
|
20189
20618
|
* the initial setup of the #GRegex structure.
|
|
@@ -20193,7 +20622,7 @@ export class Regex {
|
|
|
20193
20622
|
* @param match_options match options for the regular expression, or 0
|
|
20194
20623
|
* @returns a #GRegex structure or %NULL if an error occurred. Call g_regex_unref() when you are done with it
|
|
20195
20624
|
*/
|
|
20196
|
-
static new(pattern: string
|
|
20625
|
+
static new(pattern: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): Regex
|
|
20197
20626
|
/**
|
|
20198
20627
|
* Checks whether `replacement` is a valid replacement string
|
|
20199
20628
|
* (see g_regex_replace()), i.e. that all escape sequences in
|
|
@@ -20207,7 +20636,7 @@ export class Regex {
|
|
|
20207
20636
|
* @param replacement the replacement string
|
|
20208
20637
|
* @returns whether @replacement is a valid replacement string
|
|
20209
20638
|
*/
|
|
20210
|
-
static check_replacement(replacement: string
|
|
20639
|
+
static check_replacement(replacement: string): [ /* returnType */ boolean, /* has_references */ boolean ]
|
|
20211
20640
|
static error_quark(): Quark
|
|
20212
20641
|
/**
|
|
20213
20642
|
* Escapes the nul characters in `string` to "\x00". It can be used
|
|
@@ -20219,7 +20648,7 @@ export class Regex {
|
|
|
20219
20648
|
* @param length the length of `string`
|
|
20220
20649
|
* @returns a newly-allocated escaped string
|
|
20221
20650
|
*/
|
|
20222
|
-
static escape_nul(string: string
|
|
20651
|
+
static escape_nul(string: string, length: number): string | null
|
|
20223
20652
|
/**
|
|
20224
20653
|
* Escapes the special characters used for regular expressions
|
|
20225
20654
|
* in `string,` for instance "a.b*c" becomes "a\.b\*c". This
|
|
@@ -20232,7 +20661,7 @@ export class Regex {
|
|
|
20232
20661
|
* @param length the length of `string,` in bytes, or -1 if `string` is nul-terminated
|
|
20233
20662
|
* @returns a newly-allocated escaped string
|
|
20234
20663
|
*/
|
|
20235
|
-
static escape_string(string: string
|
|
20664
|
+
static escape_string(string: string, length: number): string | null
|
|
20236
20665
|
/**
|
|
20237
20666
|
* Scans for a match in `string` for `pattern`.
|
|
20238
20667
|
*
|
|
@@ -20250,7 +20679,7 @@ export class Regex {
|
|
|
20250
20679
|
* @param match_options match options, or 0
|
|
20251
20680
|
* @returns %TRUE if the string matched, %FALSE otherwise
|
|
20252
20681
|
*/
|
|
20253
|
-
static match_simple(pattern: string
|
|
20682
|
+
static match_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): boolean
|
|
20254
20683
|
/**
|
|
20255
20684
|
* Breaks the string on the pattern, and returns an array of
|
|
20256
20685
|
* the tokens. If the pattern contains capturing parentheses,
|
|
@@ -20285,7 +20714,7 @@ export class Regex {
|
|
|
20285
20714
|
* @param match_options match options, or 0
|
|
20286
20715
|
* @returns a %NULL-terminated array of strings. Free it using g_strfreev()
|
|
20287
20716
|
*/
|
|
20288
|
-
static split_simple(pattern: string
|
|
20717
|
+
static split_simple(pattern: string, string: string, compile_options: RegexCompileFlags, match_options: RegexMatchFlags): string[]
|
|
20289
20718
|
}
|
|
20290
20719
|
|
|
20291
20720
|
export interface SList {
|
|
@@ -20341,7 +20770,7 @@ export interface Scanner {
|
|
|
20341
20770
|
* name of input stream, featured by the default message handler
|
|
20342
20771
|
* @field
|
|
20343
20772
|
*/
|
|
20344
|
-
input_name: string
|
|
20773
|
+
input_name: string
|
|
20345
20774
|
/**
|
|
20346
20775
|
* quarked data
|
|
20347
20776
|
* @field
|
|
@@ -20448,7 +20877,7 @@ export interface Scanner {
|
|
|
20448
20877
|
* @param text the text buffer to scan
|
|
20449
20878
|
* @param text_len the length of the text buffer
|
|
20450
20879
|
*/
|
|
20451
|
-
input_text(text: string
|
|
20880
|
+
input_text(text: string, text_len: number): void
|
|
20452
20881
|
/**
|
|
20453
20882
|
* Looks up a symbol in the current scope and return its value.
|
|
20454
20883
|
* If the symbol is not bound in the current scope, %NULL is
|
|
@@ -20456,7 +20885,7 @@ export interface Scanner {
|
|
|
20456
20885
|
* @param symbol the symbol to look up
|
|
20457
20886
|
* @returns the value of @symbol in the current scope, or %NULL if @symbol is not bound in the current scope
|
|
20458
20887
|
*/
|
|
20459
|
-
lookup_symbol(symbol: string
|
|
20888
|
+
lookup_symbol(symbol: string): any | null
|
|
20460
20889
|
/**
|
|
20461
20890
|
* Parses the next token, without removing it from the input stream.
|
|
20462
20891
|
* The token data is placed in the `next_token,` `next_value,` `next_line,`
|
|
@@ -20478,7 +20907,7 @@ export interface Scanner {
|
|
|
20478
20907
|
* @param symbol the symbol to add
|
|
20479
20908
|
* @param value the value of the symbol
|
|
20480
20909
|
*/
|
|
20481
|
-
scope_add_symbol(scope_id: number, symbol: string
|
|
20910
|
+
scope_add_symbol(scope_id: number, symbol: string, value: any | null): void
|
|
20482
20911
|
/**
|
|
20483
20912
|
* Looks up a symbol in a scope and return its value. If the
|
|
20484
20913
|
* symbol is not bound in the scope, %NULL is returned.
|
|
@@ -20486,13 +20915,13 @@ export interface Scanner {
|
|
|
20486
20915
|
* @param symbol the symbol to look up
|
|
20487
20916
|
* @returns the value of @symbol in the given scope, or %NULL if @symbol is not bound in the given scope.
|
|
20488
20917
|
*/
|
|
20489
|
-
scope_lookup_symbol(scope_id: number, symbol: string
|
|
20918
|
+
scope_lookup_symbol(scope_id: number, symbol: string): any | null
|
|
20490
20919
|
/**
|
|
20491
20920
|
* Removes a symbol from a scope.
|
|
20492
20921
|
* @param scope_id the scope id
|
|
20493
20922
|
* @param symbol the symbol to remove
|
|
20494
20923
|
*/
|
|
20495
|
-
scope_remove_symbol(scope_id: number, symbol: string
|
|
20924
|
+
scope_remove_symbol(scope_id: number, symbol: string): void
|
|
20496
20925
|
/**
|
|
20497
20926
|
* Sets the current scope.
|
|
20498
20927
|
* @param scope_id the new scope id
|
|
@@ -20521,7 +20950,7 @@ export interface Scanner {
|
|
|
20521
20950
|
* @param message a message string to output at the end of the warning/error, or %NULL.
|
|
20522
20951
|
* @param is_error if %TRUE it is output as an error. If %FALSE it is output as a warning.
|
|
20523
20952
|
*/
|
|
20524
|
-
unexp_token(expected_token: TokenType, identifier_spec: string
|
|
20953
|
+
unexp_token(expected_token: TokenType, identifier_spec: string, symbol_spec: string, symbol_name: string, message: string, is_error: number): void
|
|
20525
20954
|
}
|
|
20526
20955
|
|
|
20527
20956
|
/**
|
|
@@ -21315,7 +21744,7 @@ export interface Source {
|
|
|
21315
21744
|
*
|
|
21316
21745
|
* The source name should describe in a human-readable way
|
|
21317
21746
|
* what the source does. For example, "X11 event queue"
|
|
21318
|
-
* or "GTK
|
|
21747
|
+
* or "GTK repaint idle handler" or whatever it is.
|
|
21319
21748
|
*
|
|
21320
21749
|
* It is permitted to call this function multiple times, but is not
|
|
21321
21750
|
* recommended due to the potential performance impact. For example,
|
|
@@ -21330,7 +21759,7 @@ export interface Source {
|
|
|
21330
21759
|
* Also see g_source_set_static_name().
|
|
21331
21760
|
* @param name debug name for the source
|
|
21332
21761
|
*/
|
|
21333
|
-
set_name(name: string
|
|
21762
|
+
set_name(name: string): void
|
|
21334
21763
|
/**
|
|
21335
21764
|
* Sets the priority of a source. While the main loop is being run, a
|
|
21336
21765
|
* source will be dispatched if it is ready to be dispatched and no
|
|
@@ -21375,7 +21804,7 @@ export interface Source {
|
|
|
21375
21804
|
* string literals.
|
|
21376
21805
|
* @param name debug name for the source
|
|
21377
21806
|
*/
|
|
21378
|
-
set_static_name(name: string
|
|
21807
|
+
set_static_name(name: string): void
|
|
21379
21808
|
/**
|
|
21380
21809
|
* Decreases the reference count of a source by one. If the
|
|
21381
21810
|
* resulting reference count is zero the source and associated
|
|
@@ -21488,7 +21917,7 @@ export class Source {
|
|
|
21488
21917
|
* @param tag a #GSource ID
|
|
21489
21918
|
* @param name debug name for the source
|
|
21490
21919
|
*/
|
|
21491
|
-
static set_name_by_id(tag: number, name: string
|
|
21920
|
+
static set_name_by_id(tag: number, name: string): void
|
|
21492
21921
|
}
|
|
21493
21922
|
|
|
21494
21923
|
export interface SourceCallbackFuncs {
|
|
@@ -21609,7 +22038,7 @@ export interface String {
|
|
|
21609
22038
|
* @param val the string to append onto the end of `string`
|
|
21610
22039
|
* @returns @string
|
|
21611
22040
|
*/
|
|
21612
|
-
append(val: string
|
|
22041
|
+
append(val: string): String
|
|
21613
22042
|
/**
|
|
21614
22043
|
* Adds a byte onto the end of a #GString, expanding
|
|
21615
22044
|
* it if necessary.
|
|
@@ -21631,7 +22060,7 @@ export interface String {
|
|
|
21631
22060
|
* @param len number of bytes of `val` to use, or -1 for all of `val`
|
|
21632
22061
|
* @returns @string
|
|
21633
22062
|
*/
|
|
21634
|
-
append_len(val: string
|
|
22063
|
+
append_len(val: string, len: number): String
|
|
21635
22064
|
/**
|
|
21636
22065
|
* Converts a Unicode character into UTF-8, and appends it
|
|
21637
22066
|
* to the string.
|
|
@@ -21647,7 +22076,7 @@ export interface String {
|
|
|
21647
22076
|
* @param allow_utf8 set %TRUE if the escaped string may include UTF8 characters
|
|
21648
22077
|
* @returns @string
|
|
21649
22078
|
*/
|
|
21650
|
-
append_uri_escaped(unescaped: string
|
|
22079
|
+
append_uri_escaped(unescaped: string, reserved_chars_allowed: string, allow_utf8: boolean): String
|
|
21651
22080
|
/**
|
|
21652
22081
|
* Converts all uppercase ASCII letters to lowercase ASCII letters.
|
|
21653
22082
|
* @returns passed-in @string pointer, with all the uppercase characters converted to lowercase in place, with semantics that exactly match g_ascii_tolower().
|
|
@@ -21666,7 +22095,7 @@ export interface String {
|
|
|
21666
22095
|
* @param rval the string to copy into `string`
|
|
21667
22096
|
* @returns @string
|
|
21668
22097
|
*/
|
|
21669
|
-
assign(rval: string
|
|
22098
|
+
assign(rval: string): String
|
|
21670
22099
|
/**
|
|
21671
22100
|
* Converts a #GString to lowercase.
|
|
21672
22101
|
* @returns the #GString
|
|
@@ -21731,7 +22160,7 @@ export interface String {
|
|
|
21731
22160
|
* @param val the string to insert
|
|
21732
22161
|
* @returns @string
|
|
21733
22162
|
*/
|
|
21734
|
-
insert(pos: number, val: string
|
|
22163
|
+
insert(pos: number, val: string): String
|
|
21735
22164
|
/**
|
|
21736
22165
|
* Inserts a byte into a #GString, expanding it if necessary.
|
|
21737
22166
|
* @param pos the position to insert the byte
|
|
@@ -21755,7 +22184,7 @@ export interface String {
|
|
|
21755
22184
|
* @param len number of bytes of `val` to insert, or -1 for all of `val`
|
|
21756
22185
|
* @returns @string
|
|
21757
22186
|
*/
|
|
21758
|
-
insert_len(pos: number, val: string
|
|
22187
|
+
insert_len(pos: number, val: string, len: number): String
|
|
21759
22188
|
/**
|
|
21760
22189
|
* Converts a Unicode character into UTF-8, and insert it
|
|
21761
22190
|
* into the string at the given position.
|
|
@@ -21770,7 +22199,7 @@ export interface String {
|
|
|
21770
22199
|
* @param val the string that will overwrite the `string` starting at `pos`
|
|
21771
22200
|
* @returns @string
|
|
21772
22201
|
*/
|
|
21773
|
-
overwrite(pos: number, val: string
|
|
22202
|
+
overwrite(pos: number, val: string): String
|
|
21774
22203
|
/**
|
|
21775
22204
|
* Overwrites part of a string, lengthening it if necessary.
|
|
21776
22205
|
* This function will work with embedded nuls.
|
|
@@ -21779,14 +22208,14 @@ export interface String {
|
|
|
21779
22208
|
* @param len the number of bytes to write from `val`
|
|
21780
22209
|
* @returns @string
|
|
21781
22210
|
*/
|
|
21782
|
-
overwrite_len(pos: number, val: string
|
|
22211
|
+
overwrite_len(pos: number, val: string, len: number): String
|
|
21783
22212
|
/**
|
|
21784
22213
|
* Adds a string on to the start of a #GString,
|
|
21785
22214
|
* expanding it if necessary.
|
|
21786
22215
|
* @param val the string to prepend on the start of `string`
|
|
21787
22216
|
* @returns @string
|
|
21788
22217
|
*/
|
|
21789
|
-
prepend(val: string
|
|
22218
|
+
prepend(val: string): String
|
|
21790
22219
|
/**
|
|
21791
22220
|
* Adds a byte onto the start of a #GString,
|
|
21792
22221
|
* expanding it if necessary.
|
|
@@ -21808,7 +22237,7 @@ export interface String {
|
|
|
21808
22237
|
* @param len number of bytes in `val` to prepend, or -1 for all of `val`
|
|
21809
22238
|
* @returns @string
|
|
21810
22239
|
*/
|
|
21811
|
-
prepend_len(val: string
|
|
22240
|
+
prepend_len(val: string, len: number): String
|
|
21812
22241
|
/**
|
|
21813
22242
|
* Converts a Unicode character into UTF-8, and prepends it
|
|
21814
22243
|
* to the string.
|
|
@@ -21831,7 +22260,7 @@ export interface String {
|
|
|
21831
22260
|
* @param limit the maximum instances of `find` to replace with `replace,` or `0` for no limit
|
|
21832
22261
|
* @returns the number of find and replace operations performed.
|
|
21833
22262
|
*/
|
|
21834
|
-
replace(find: string
|
|
22263
|
+
replace(find: string, replace: string, limit: number): number
|
|
21835
22264
|
/**
|
|
21836
22265
|
* Sets the length of a #GString. If the length is less than
|
|
21837
22266
|
* the current length, the string will be truncated. If the
|
|
@@ -21894,7 +22323,18 @@ export class String {
|
|
|
21894
22323
|
* @param len length of `init` to use
|
|
21895
22324
|
* @returns a new #GString
|
|
21896
22325
|
*/
|
|
21897
|
-
static new_len(init: string
|
|
22326
|
+
static new_len(init: string, len: number): String
|
|
22327
|
+
/**
|
|
22328
|
+
* Creates a new #GString, initialized with the given string.
|
|
22329
|
+
*
|
|
22330
|
+
* After this call, `init` belongs to the #GString and may no longer be
|
|
22331
|
+
* modified by the caller. The memory of `data` has to be dynamically
|
|
22332
|
+
* allocated and will eventually be freed with g_free().
|
|
22333
|
+
* @constructor
|
|
22334
|
+
* @param init initial text used as the string. Ownership of the string is transferred to the #GString. Passing %NULL creates an empty string.
|
|
22335
|
+
* @returns the new #GString
|
|
22336
|
+
*/
|
|
22337
|
+
static new_take(init: string | null): String
|
|
21898
22338
|
/**
|
|
21899
22339
|
* Creates a new #GString, with enough space for `dfl_size`
|
|
21900
22340
|
* bytes. This is useful if you are going to add a lot of
|
|
@@ -21938,7 +22378,7 @@ export interface StringChunk {
|
|
|
21938
22378
|
* @param string the string to add
|
|
21939
22379
|
* @returns a pointer to the copy of @string within the #GStringChunk
|
|
21940
22380
|
*/
|
|
21941
|
-
insert(string: string
|
|
22381
|
+
insert(string: string): string | null
|
|
21942
22382
|
/**
|
|
21943
22383
|
* Adds a copy of `string` to the #GStringChunk, unless the same
|
|
21944
22384
|
* string has already been added to the #GStringChunk with
|
|
@@ -21956,7 +22396,7 @@ export interface StringChunk {
|
|
|
21956
22396
|
* @param string the string to add
|
|
21957
22397
|
* @returns a pointer to the new or existing copy of @string within the #GStringChunk
|
|
21958
22398
|
*/
|
|
21959
|
-
insert_const(string: string
|
|
22399
|
+
insert_const(string: string): string | null
|
|
21960
22400
|
/**
|
|
21961
22401
|
* Adds a copy of the first `len` bytes of `string` to the #GStringChunk.
|
|
21962
22402
|
* The copy is nul-terminated.
|
|
@@ -21971,7 +22411,7 @@ export interface StringChunk {
|
|
|
21971
22411
|
* @param len number of bytes of `string` to insert, or -1 to insert a nul-terminated string
|
|
21972
22412
|
* @returns a pointer to the copy of @string within the #GStringChunk
|
|
21973
22413
|
*/
|
|
21974
|
-
insert_len(string: string
|
|
22414
|
+
insert_len(string: string, len: number): string | null
|
|
21975
22415
|
}
|
|
21976
22416
|
|
|
21977
22417
|
/**
|
|
@@ -21996,7 +22436,7 @@ export interface StrvBuilder {
|
|
|
21996
22436
|
* Since 2.68
|
|
21997
22437
|
* @param value a string.
|
|
21998
22438
|
*/
|
|
21999
|
-
add(value: string
|
|
22439
|
+
add(value: string): void
|
|
22000
22440
|
/**
|
|
22001
22441
|
* Appends all the strings in the given vector to the builder.
|
|
22002
22442
|
*
|
|
@@ -22627,7 +23067,7 @@ export class TimeVal {
|
|
|
22627
23067
|
* @param iso_date an ISO 8601 encoded date string
|
|
22628
23068
|
* @returns %TRUE if the conversion was successful.
|
|
22629
23069
|
*/
|
|
22630
|
-
static from_iso8601(iso_date: string
|
|
23070
|
+
static from_iso8601(iso_date: string): [ /* returnType */ boolean, /* time_ */ TimeVal ]
|
|
22631
23071
|
}
|
|
22632
23072
|
|
|
22633
23073
|
export interface TimeZone {
|
|
@@ -22690,7 +23130,7 @@ export interface TimeZone {
|
|
|
22690
23130
|
* @param interval an interval within the timezone
|
|
22691
23131
|
* @returns the time zone abbreviation, which belongs to @tz
|
|
22692
23132
|
*/
|
|
22693
|
-
get_abbreviation(interval: number): string
|
|
23133
|
+
get_abbreviation(interval: number): string
|
|
22694
23134
|
/**
|
|
22695
23135
|
* Get the identifier of this #GTimeZone, as passed to g_time_zone_new().
|
|
22696
23136
|
* If the identifier passed at construction time was not recognised, `UTC` will
|
|
@@ -22702,7 +23142,7 @@ export interface TimeZone {
|
|
|
22702
23142
|
* this function.
|
|
22703
23143
|
* @returns identifier for this timezone
|
|
22704
23144
|
*/
|
|
22705
|
-
get_identifier(): string
|
|
23145
|
+
get_identifier(): string
|
|
22706
23146
|
/**
|
|
22707
23147
|
* Determines the offset to UTC in effect during a particular `interval`
|
|
22708
23148
|
* of time in the time zone `tz`.
|
|
@@ -23298,7 +23738,7 @@ export interface Uri {
|
|
|
23298
23738
|
* flags with which `uri` was created.
|
|
23299
23739
|
* @returns @uri's path.
|
|
23300
23740
|
*/
|
|
23301
|
-
get_path(): string
|
|
23741
|
+
get_path(): string
|
|
23302
23742
|
/**
|
|
23303
23743
|
* Gets `uri'`s port.
|
|
23304
23744
|
* @returns @uri's port, or `-1` if no port was specified.
|
|
@@ -23318,7 +23758,7 @@ export interface Uri {
|
|
|
23318
23758
|
* regardless of the string or strings that `uri` was created from.
|
|
23319
23759
|
* @returns @uri's scheme.
|
|
23320
23760
|
*/
|
|
23321
|
-
get_scheme(): string
|
|
23761
|
+
get_scheme(): string
|
|
23322
23762
|
/**
|
|
23323
23763
|
* Gets the ‘username’ component of `uri'`s userinfo, which may contain
|
|
23324
23764
|
* `%`-encoding, depending on the flags with which `uri` was created.
|
|
@@ -23342,7 +23782,7 @@ export interface Uri {
|
|
|
23342
23782
|
* @param flags flags describing how to parse `uri_ref`
|
|
23343
23783
|
* @returns a new #GUri, or NULL on error.
|
|
23344
23784
|
*/
|
|
23345
|
-
parse_relative(uri_ref: string
|
|
23785
|
+
parse_relative(uri_ref: string, flags: UriFlags): Uri
|
|
23346
23786
|
/**
|
|
23347
23787
|
* Returns a string representing `uri`.
|
|
23348
23788
|
*
|
|
@@ -23502,7 +23942,7 @@ export class Uri {
|
|
|
23502
23942
|
* @param fragment the fragment, or %NULL
|
|
23503
23943
|
* @returns a new #GUri
|
|
23504
23944
|
*/
|
|
23505
|
-
static build(flags: UriFlags, scheme: string
|
|
23945
|
+
static build(flags: UriFlags, scheme: string, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
23506
23946
|
/**
|
|
23507
23947
|
* Creates a new #GUri from the given components according to `flags`
|
|
23508
23948
|
* (%G_URI_FLAGS_HAS_PASSWORD is added unconditionally). The `flags` must be
|
|
@@ -23524,7 +23964,7 @@ export class Uri {
|
|
|
23524
23964
|
* @param fragment the fragment, or %NULL
|
|
23525
23965
|
* @returns a new #GUri
|
|
23526
23966
|
*/
|
|
23527
|
-
static build_with_user(flags: UriFlags, scheme: string
|
|
23967
|
+
static build_with_user(flags: UriFlags, scheme: string, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): Uri
|
|
23528
23968
|
static error_quark(): Quark
|
|
23529
23969
|
/**
|
|
23530
23970
|
* Escapes arbitrary data for use in a URI.
|
|
@@ -23557,7 +23997,7 @@ export class Uri {
|
|
|
23557
23997
|
* @param allow_utf8 %TRUE if the result can include UTF-8 characters.
|
|
23558
23998
|
* @returns an escaped version of @unescaped. The returned string should be freed when no longer needed.
|
|
23559
23999
|
*/
|
|
23560
|
-
static escape_string(unescaped: string
|
|
24000
|
+
static escape_string(unescaped: string, reserved_chars_allowed: string | null, allow_utf8: boolean): string | null
|
|
23561
24001
|
/**
|
|
23562
24002
|
* Parses `uri_string` according to `flags,` to determine whether it is a valid
|
|
23563
24003
|
* [absolute URI][relative-absolute-uris], i.e. it does not need to be resolved
|
|
@@ -23571,7 +24011,7 @@ export class Uri {
|
|
|
23571
24011
|
* @param flags flags for parsing `uri_string`
|
|
23572
24012
|
* @returns %TRUE if @uri_string is a valid absolute URI, %FALSE on error.
|
|
23573
24013
|
*/
|
|
23574
|
-
static is_valid(uri_string: string
|
|
24014
|
+
static is_valid(uri_string: string, flags: UriFlags): boolean
|
|
23575
24015
|
/**
|
|
23576
24016
|
* Joins the given components together according to `flags` to create
|
|
23577
24017
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -23579,7 +24019,7 @@ export class Uri {
|
|
|
23579
24019
|
*
|
|
23580
24020
|
* When `host` is present, `path` must either be empty or begin with a slash (`/`)
|
|
23581
24021
|
* character. When `host` is not present, `path` cannot begin with two slash
|
|
23582
|
-
*
|
|
24022
|
+
* characters (`//`). See
|
|
23583
24023
|
* [RFC 3986, section 3](https://tools.ietf.org/html/rfc3986#section-3).
|
|
23584
24024
|
*
|
|
23585
24025
|
* See also g_uri_join_with_user(), which allows specifying the
|
|
@@ -23597,7 +24037,7 @@ export class Uri {
|
|
|
23597
24037
|
* @param fragment the fragment, or %NULL
|
|
23598
24038
|
* @returns an absolute URI string
|
|
23599
24039
|
*/
|
|
23600
|
-
static join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string
|
|
24040
|
+
static join(flags: UriFlags, scheme: string | null, userinfo: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
23601
24041
|
/**
|
|
23602
24042
|
* Joins the given components together according to `flags` to create
|
|
23603
24043
|
* an absolute URI string. `path` may not be %NULL (though it may be the empty
|
|
@@ -23620,7 +24060,7 @@ export class Uri {
|
|
|
23620
24060
|
* @param fragment the fragment, or %NULL
|
|
23621
24061
|
* @returns an absolute URI string
|
|
23622
24062
|
*/
|
|
23623
|
-
static join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string
|
|
24063
|
+
static join_with_user(flags: UriFlags, scheme: string | null, user: string | null, password: string | null, auth_params: string | null, host: string | null, port: number, path: string, query: string | null, fragment: string | null): string | null
|
|
23624
24064
|
/**
|
|
23625
24065
|
* Splits an URI list conforming to the text/uri-list
|
|
23626
24066
|
* mime type defined in RFC 2483 into individual URIs,
|
|
@@ -23628,7 +24068,7 @@ export class Uri {
|
|
|
23628
24068
|
* @param uri_list an URI list
|
|
23629
24069
|
* @returns a newly allocated %NULL-terminated list of strings holding the individual URIs. The array should be freed with g_strfreev().
|
|
23630
24070
|
*/
|
|
23631
|
-
static list_extract_uris(uri_list: string
|
|
24071
|
+
static list_extract_uris(uri_list: string): string[]
|
|
23632
24072
|
/**
|
|
23633
24073
|
* Parses `uri_string` according to `flags`. If the result is not a
|
|
23634
24074
|
* valid [absolute URI][relative-absolute-uris], it will be discarded, and an
|
|
@@ -23637,7 +24077,7 @@ export class Uri {
|
|
|
23637
24077
|
* @param flags flags describing how to parse `uri_string`
|
|
23638
24078
|
* @returns a new #GUri, or NULL on error.
|
|
23639
24079
|
*/
|
|
23640
|
-
static parse(uri_string: string
|
|
24080
|
+
static parse(uri_string: string, flags: UriFlags): Uri
|
|
23641
24081
|
/**
|
|
23642
24082
|
* Many URI schemes include one or more attribute/value pairs as part of the URI
|
|
23643
24083
|
* value. This method can be used to parse them into a hash table. When an
|
|
@@ -23669,7 +24109,7 @@ export class Uri {
|
|
|
23669
24109
|
* @param flags flags to modify the way the parameters are handled.
|
|
23670
24110
|
* @returns A hash table of attribute/value pairs, with both names and values fully-decoded; or %NULL on error.
|
|
23671
24111
|
*/
|
|
23672
|
-
static parse_params(params: string
|
|
24112
|
+
static parse_params(params: string, length: number, separators: string, flags: UriParamsFlags): HashTable
|
|
23673
24113
|
/**
|
|
23674
24114
|
* Gets the scheme portion of a URI string.
|
|
23675
24115
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -23683,7 +24123,7 @@ export class Uri {
|
|
|
23683
24123
|
* @param uri a valid URI.
|
|
23684
24124
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string should be freed when no longer needed.
|
|
23685
24125
|
*/
|
|
23686
|
-
static parse_scheme(uri: string
|
|
24126
|
+
static parse_scheme(uri: string): string | null
|
|
23687
24127
|
/**
|
|
23688
24128
|
* Gets the scheme portion of a URI string.
|
|
23689
24129
|
* [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) decodes the scheme
|
|
@@ -23700,7 +24140,7 @@ export class Uri {
|
|
|
23700
24140
|
* @param uri a valid URI.
|
|
23701
24141
|
* @returns The ‘scheme’ component of the URI, or %NULL on error. The returned string is normalized to all-lowercase, and interned via g_intern_string(), so it does not need to be freed.
|
|
23702
24142
|
*/
|
|
23703
|
-
static peek_scheme(uri: string
|
|
24143
|
+
static peek_scheme(uri: string): string | null
|
|
23704
24144
|
/**
|
|
23705
24145
|
* Parses `uri_ref` according to `flags` and, if it is a
|
|
23706
24146
|
* [relative URI][relative-absolute-uris], resolves it relative to
|
|
@@ -23714,7 +24154,7 @@ export class Uri {
|
|
|
23714
24154
|
* @param flags flags describing how to parse `uri_ref`
|
|
23715
24155
|
* @returns the resolved URI string, or NULL on error.
|
|
23716
24156
|
*/
|
|
23717
|
-
static resolve_relative(base_uri_string: string | null, uri_ref: string
|
|
24157
|
+
static resolve_relative(base_uri_string: string | null, uri_ref: string, flags: UriFlags): string | null
|
|
23718
24158
|
/**
|
|
23719
24159
|
* Parses `uri_ref` (which can be an
|
|
23720
24160
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -23736,7 +24176,7 @@ export class Uri {
|
|
|
23736
24176
|
* @param flags flags for parsing `uri_ref`
|
|
23737
24177
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
23738
24178
|
*/
|
|
23739
|
-
static split(uri_ref: string
|
|
24179
|
+
static split(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* userinfo */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
23740
24180
|
/**
|
|
23741
24181
|
* Parses `uri_string` (which must be an [absolute URI][relative-absolute-uris])
|
|
23742
24182
|
* according to `flags,` and returns the pieces relevant to connecting to a host.
|
|
@@ -23748,7 +24188,7 @@ export class Uri {
|
|
|
23748
24188
|
* @param flags flags for parsing `uri_string`
|
|
23749
24189
|
* @returns %TRUE if @uri_string parsed successfully, %FALSE on error.
|
|
23750
24190
|
*/
|
|
23751
|
-
static split_network(uri_string: string
|
|
24191
|
+
static split_network(uri_string: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* host */ string | null, /* port */ number ]
|
|
23752
24192
|
/**
|
|
23753
24193
|
* Parses `uri_ref` (which can be an
|
|
23754
24194
|
* [absolute or relative URI][relative-absolute-uris]) according to `flags,` and
|
|
@@ -23765,7 +24205,7 @@ export class Uri {
|
|
|
23765
24205
|
* @param flags flags for parsing `uri_ref`
|
|
23766
24206
|
* @returns %TRUE if @uri_ref parsed successfully, %FALSE on error.
|
|
23767
24207
|
*/
|
|
23768
|
-
static split_with_user(uri_ref: string
|
|
24208
|
+
static split_with_user(uri_ref: string, flags: UriFlags): [ /* returnType */ boolean, /* scheme */ string | null, /* user */ string | null, /* password */ string | null, /* auth_params */ string | null, /* host */ string | null, /* port */ number, /* path */ string, /* query */ string | null, /* fragment */ string | null ]
|
|
23769
24209
|
/**
|
|
23770
24210
|
* Unescapes a segment of an escaped string as binary data.
|
|
23771
24211
|
*
|
|
@@ -23782,7 +24222,7 @@ export class Uri {
|
|
|
23782
24222
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
23783
24223
|
* @returns an unescaped version of @escaped_string or %NULL on error (if decoding failed, using %G_URI_ERROR_FAILED error code). The returned #GBytes should be unreffed when no longer needed.
|
|
23784
24224
|
*/
|
|
23785
|
-
static unescape_bytes(escaped_string: string
|
|
24225
|
+
static unescape_bytes(escaped_string: string, length: number, illegal_characters: string | null): Bytes
|
|
23786
24226
|
/**
|
|
23787
24227
|
* Unescapes a segment of an escaped string.
|
|
23788
24228
|
*
|
|
@@ -23812,7 +24252,7 @@ export class Uri {
|
|
|
23812
24252
|
* @param illegal_characters a string of illegal characters not to be allowed, or %NULL.
|
|
23813
24253
|
* @returns an unescaped version of @escaped_string. The returned string should be freed when no longer needed.
|
|
23814
24254
|
*/
|
|
23815
|
-
static unescape_string(escaped_string: string
|
|
24255
|
+
static unescape_string(escaped_string: string, illegal_characters: string | null): string | null
|
|
23816
24256
|
}
|
|
23817
24257
|
|
|
23818
24258
|
export interface UriParamsIter {
|
|
@@ -23860,7 +24300,7 @@ export interface UriParamsIter {
|
|
|
23860
24300
|
* @param separators the separator byte character set between parameters. (usually `&`, but sometimes `;` or both `&;`). Note that this function works on bytes not characters, so it can't be used to delimit UTF-8 strings for anything but ASCII characters. You may pass an empty set, in which case no splitting will occur.
|
|
23861
24301
|
* @param flags flags to modify the way the parameters are handled.
|
|
23862
24302
|
*/
|
|
23863
|
-
init(params: string
|
|
24303
|
+
init(params: string, length: number, separators: string, flags: UriParamsFlags): void
|
|
23864
24304
|
/**
|
|
23865
24305
|
* Advances `iter` and retrieves the next attribute/value. %FALSE is returned if
|
|
23866
24306
|
* an error has occurred (in which case `error` is set), or if the end of the
|
|
@@ -23939,7 +24379,7 @@ export interface Variant {
|
|
|
23939
24379
|
* @param copy_only %TRUE to ensure the format string makes deep copies
|
|
23940
24380
|
* @returns %TRUE if @format_string is safe to use
|
|
23941
24381
|
*/
|
|
23942
|
-
check_format_string(format_string: string
|
|
24382
|
+
check_format_string(format_string: string, copy_only: boolean): boolean
|
|
23943
24383
|
/**
|
|
23944
24384
|
* Classifies `value` according to its top-level type.
|
|
23945
24385
|
* @returns the #GVariantClass of @value
|
|
@@ -24284,7 +24724,7 @@ export interface Variant {
|
|
|
24284
24724
|
* The return value remains valid as long as `value` exists.
|
|
24285
24725
|
* @returns the constant string, UTF-8 encoded
|
|
24286
24726
|
*/
|
|
24287
|
-
get_string(): [ /* returnType */ string
|
|
24727
|
+
get_string(): [ /* returnType */ string, /* length */ number ]
|
|
24288
24728
|
/**
|
|
24289
24729
|
* Gets the contents of an array of strings #GVariant. This call
|
|
24290
24730
|
* makes a shallow copy; the return result should be released with
|
|
@@ -24313,7 +24753,7 @@ export interface Variant {
|
|
|
24313
24753
|
* string belongs to #GVariant and must not be freed.
|
|
24314
24754
|
* @returns the type string for the type of @value
|
|
24315
24755
|
*/
|
|
24316
|
-
get_type_string(): string
|
|
24756
|
+
get_type_string(): string
|
|
24317
24757
|
/**
|
|
24318
24758
|
* Returns the 16-bit unsigned integer value of `value`.
|
|
24319
24759
|
*
|
|
@@ -24424,7 +24864,7 @@ export interface Variant {
|
|
|
24424
24864
|
* @param expected_type a #GVariantType, or %NULL
|
|
24425
24865
|
* @returns the value of the dictionary key, or %NULL
|
|
24426
24866
|
*/
|
|
24427
|
-
lookup_value(key: string
|
|
24867
|
+
lookup_value(key: string, expected_type: VariantType | null): Variant
|
|
24428
24868
|
/**
|
|
24429
24869
|
* Determines the number of children in a container #GVariant instance.
|
|
24430
24870
|
* This includes variants, maybes, arrays, tuples and dictionary
|
|
@@ -25005,14 +25445,14 @@ export class Variant {
|
|
|
25005
25445
|
*/
|
|
25006
25446
|
static new_maybe(child_type: VariantType | null, child: Variant | null): Variant
|
|
25007
25447
|
/**
|
|
25008
|
-
* Creates a D-Bus object path #GVariant with the contents of `
|
|
25009
|
-
* `
|
|
25448
|
+
* Creates a D-Bus object path #GVariant with the contents of `object_path`.
|
|
25449
|
+
* `object_path` must be a valid D-Bus object path. Use
|
|
25010
25450
|
* g_variant_is_object_path() if you're not sure.
|
|
25011
25451
|
* @constructor
|
|
25012
25452
|
* @param object_path a normal C nul-terminated string
|
|
25013
25453
|
* @returns a floating reference to a new object path #GVariant instance
|
|
25014
25454
|
*/
|
|
25015
|
-
static new_object_path(object_path: string
|
|
25455
|
+
static new_object_path(object_path: string): Variant
|
|
25016
25456
|
/**
|
|
25017
25457
|
* Constructs an array of object paths #GVariant from the given array of
|
|
25018
25458
|
* strings.
|
|
@@ -25034,7 +25474,7 @@ export class Variant {
|
|
|
25034
25474
|
* @param signature a normal C nul-terminated string
|
|
25035
25475
|
* @returns a floating reference to a new signature #GVariant instance
|
|
25036
25476
|
*/
|
|
25037
|
-
static new_signature(signature: string
|
|
25477
|
+
static new_signature(signature: string): Variant
|
|
25038
25478
|
/**
|
|
25039
25479
|
* Creates a string #GVariant with the contents of `string`.
|
|
25040
25480
|
*
|
|
@@ -25045,7 +25485,7 @@ export class Variant {
|
|
|
25045
25485
|
* @param string a normal UTF-8 nul-terminated string
|
|
25046
25486
|
* @returns a floating reference to a new string #GVariant instance
|
|
25047
25487
|
*/
|
|
25048
|
-
static new_string(string: string
|
|
25488
|
+
static new_string(string: string): Variant
|
|
25049
25489
|
/**
|
|
25050
25490
|
* Constructs an array of strings #GVariant from the given array of
|
|
25051
25491
|
* strings.
|
|
@@ -25114,7 +25554,7 @@ export class Variant {
|
|
|
25114
25554
|
* @param string a normal C nul-terminated string
|
|
25115
25555
|
* @returns %TRUE if @string is a D-Bus object path
|
|
25116
25556
|
*/
|
|
25117
|
-
static is_object_path(string: string
|
|
25557
|
+
static is_object_path(string: string): boolean
|
|
25118
25558
|
/**
|
|
25119
25559
|
* Determines if a given string is a valid D-Bus type signature. You
|
|
25120
25560
|
* should ensure that a string is a valid D-Bus type signature before
|
|
@@ -25125,7 +25565,7 @@ export class Variant {
|
|
|
25125
25565
|
* @param string a normal C nul-terminated string
|
|
25126
25566
|
* @returns %TRUE if @string is a D-Bus type signature
|
|
25127
25567
|
*/
|
|
25128
|
-
static is_signature(string: string
|
|
25568
|
+
static is_signature(string: string): boolean
|
|
25129
25569
|
/**
|
|
25130
25570
|
* Parses a #GVariant from a text representation.
|
|
25131
25571
|
*
|
|
@@ -25168,7 +25608,7 @@ export class Variant {
|
|
|
25168
25608
|
* @param endptr a location to store the end pointer, or %NULL
|
|
25169
25609
|
* @returns a non-floating reference to a #GVariant, or %NULL
|
|
25170
25610
|
*/
|
|
25171
|
-
static parse(type: VariantType | null, text: string
|
|
25611
|
+
static parse(type: VariantType | null, text: string, limit: string | null, endptr: string | null): Variant
|
|
25172
25612
|
/**
|
|
25173
25613
|
* Pretty-prints a message showing the context of a #GVariant parse
|
|
25174
25614
|
* error within the string for which parsing was attempted.
|
|
@@ -25207,7 +25647,7 @@ export class Variant {
|
|
|
25207
25647
|
* @param source_str the string that was given to the parser
|
|
25208
25648
|
* @returns the printed message
|
|
25209
25649
|
*/
|
|
25210
|
-
static parse_error_print_context(error: Error, source_str: string
|
|
25650
|
+
static parse_error_print_context(error: Error, source_str: string): string | null
|
|
25211
25651
|
static parse_error_quark(): Quark
|
|
25212
25652
|
/**
|
|
25213
25653
|
* Same as g_variant_error_quark().
|
|
@@ -25405,7 +25845,7 @@ export interface VariantDict {
|
|
|
25405
25845
|
* @param key the key to look up in the dictionary
|
|
25406
25846
|
* @returns %TRUE if @key is in @dict
|
|
25407
25847
|
*/
|
|
25408
|
-
contains(key: string
|
|
25848
|
+
contains(key: string): boolean
|
|
25409
25849
|
/**
|
|
25410
25850
|
* Returns the current value of `dict` as a #GVariant of type
|
|
25411
25851
|
* %G_VARIANT_TYPE_VARDICT, clearing it in the process.
|
|
@@ -25424,7 +25864,7 @@ export interface VariantDict {
|
|
|
25424
25864
|
* @param key the key to insert a value for
|
|
25425
25865
|
* @param value the value to insert
|
|
25426
25866
|
*/
|
|
25427
|
-
insert_value(key: string
|
|
25867
|
+
insert_value(key: string, value: Variant): void
|
|
25428
25868
|
/**
|
|
25429
25869
|
* Looks up a value in a #GVariantDict.
|
|
25430
25870
|
*
|
|
@@ -25441,7 +25881,7 @@ export interface VariantDict {
|
|
|
25441
25881
|
* @param expected_type a #GVariantType, or %NULL
|
|
25442
25882
|
* @returns the value of the dictionary key, or %NULL
|
|
25443
25883
|
*/
|
|
25444
|
-
lookup_value(key: string
|
|
25884
|
+
lookup_value(key: string, expected_type: VariantType | null): Variant | null
|
|
25445
25885
|
/**
|
|
25446
25886
|
* Increases the reference count on `dict`.
|
|
25447
25887
|
*
|
|
@@ -25455,7 +25895,7 @@ export interface VariantDict {
|
|
|
25455
25895
|
* @param key the key to remove
|
|
25456
25896
|
* @returns %TRUE if the key was found and removed
|
|
25457
25897
|
*/
|
|
25458
|
-
remove(key: string
|
|
25898
|
+
remove(key: string): boolean
|
|
25459
25899
|
/**
|
|
25460
25900
|
* Decreases the reference count on `dict`.
|
|
25461
25901
|
*
|
|
@@ -26065,7 +26505,7 @@ export class VariantType {
|
|
|
26065
26505
|
* @param type_string a valid GVariant type string
|
|
26066
26506
|
* @returns a new #GVariantType
|
|
26067
26507
|
*/
|
|
26068
|
-
constructor(type_string: string
|
|
26508
|
+
constructor(type_string: string)
|
|
26069
26509
|
/**
|
|
26070
26510
|
* Creates a new #GVariantType corresponding to the type string given
|
|
26071
26511
|
* by `type_string`. It is appropriate to call g_variant_type_free() on
|
|
@@ -26077,7 +26517,7 @@ export class VariantType {
|
|
|
26077
26517
|
* @param type_string a valid GVariant type string
|
|
26078
26518
|
* @returns a new #GVariantType
|
|
26079
26519
|
*/
|
|
26080
|
-
static new(type_string: string
|
|
26520
|
+
static new(type_string: string): VariantType
|
|
26081
26521
|
/**
|
|
26082
26522
|
* Constructs the type corresponding to an array of elements of the
|
|
26083
26523
|
* type `type`.
|
|
@@ -26121,8 +26561,8 @@ export class VariantType {
|
|
|
26121
26561
|
* @returns a new tuple #GVariantType Since 2.24
|
|
26122
26562
|
*/
|
|
26123
26563
|
static new_tuple(items: VariantType[]): VariantType
|
|
26124
|
-
static checked_(arg0: string
|
|
26125
|
-
static string_get_depth_(type_string: string
|
|
26564
|
+
static checked_(arg0: string): VariantType
|
|
26565
|
+
static string_get_depth_(type_string: string): number
|
|
26126
26566
|
/**
|
|
26127
26567
|
* Checks if `type_string` is a valid GVariant type string. This call is
|
|
26128
26568
|
* equivalent to calling g_variant_type_string_scan() and confirming
|
|
@@ -26130,7 +26570,7 @@ export class VariantType {
|
|
|
26130
26570
|
* @param type_string a pointer to any string
|
|
26131
26571
|
* @returns %TRUE if @type_string is exactly one valid type string Since 2.24
|
|
26132
26572
|
*/
|
|
26133
|
-
static string_is_valid(type_string: string
|
|
26573
|
+
static string_is_valid(type_string: string): boolean
|
|
26134
26574
|
/**
|
|
26135
26575
|
* Scan for a single complete and valid GVariant type string in `string`.
|
|
26136
26576
|
* The memory pointed to by `limit` (or bytes beyond it) is never
|
|
@@ -26149,7 +26589,7 @@ export class VariantType {
|
|
|
26149
26589
|
* @param limit the end of `string,` or %NULL
|
|
26150
26590
|
* @returns %TRUE if a valid type string was found
|
|
26151
26591
|
*/
|
|
26152
|
-
static string_scan(string: string
|
|
26592
|
+
static string_scan(string: string, limit: string | null): [ /* returnType */ boolean, /* endptr */ string ]
|
|
26153
26593
|
}
|
|
26154
26594
|
|
|
26155
26595
|
export interface DoubleIEEE754 {
|