@girs/gjsprivate-1.0 1.0.0-4.0.0-beta.37

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 ADDED
@@ -0,0 +1,85 @@
1
+
2
+ # GjsPrivate-1.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/gjsprivate-1.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/gjsprivate-1.0)
6
+
7
+
8
+ GJS TypeScript type definitions for GjsPrivate-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.37.
9
+
10
+ ## Install
11
+
12
+ To use this type definitions, install them with NPM:
13
+ ```bash
14
+ npm install @girs/gjsprivate-1.0
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ You can import this package into your project like this:
20
+ ```ts
21
+ import GjsPrivate from '@girs/gjsprivate-1.0';
22
+ ```
23
+
24
+ ### Ambient Modules
25
+
26
+ You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
27
+ For this you need to include `@girs/gjsprivate-1.0` or `@girs/gjsprivate-1.0/ambient` in your `tsconfig` or entry point Typescript file:
28
+
29
+ `index.ts`:
30
+ ```ts
31
+ import '@girs/gjsprivate-1.0'
32
+ ```
33
+
34
+ `tsconfig.json`:
35
+ ```json
36
+ {
37
+ "compilerOptions": {
38
+ ...
39
+ },
40
+ "include": ["@girs/gjsprivate-1.0"],
41
+ ...
42
+ }
43
+ ```
44
+
45
+ Now you can import the ambient module with TypeScript support:
46
+
47
+ ```ts
48
+ import GjsPrivate from 'gi://GjsPrivate?version=1.0';
49
+ ```
50
+
51
+ ### Global import
52
+
53
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
54
+ For this you need to include `@girs/gjsprivate-1.0` or `@girs/gjsprivate-1.0/import` in your `tsconfig` or entry point Typescript file:
55
+
56
+ `index.ts`:
57
+ ```ts
58
+ import '@girs/gjsprivate-1.0'
59
+ ```
60
+
61
+ `tsconfig.json`:
62
+ ```json
63
+ {
64
+ "compilerOptions": {
65
+ ...
66
+ },
67
+ "include": ["@girs/gjsprivate-1.0"],
68
+ ...
69
+ }
70
+ ```
71
+
72
+ Now you have also type support for this, too:
73
+
74
+ ```ts
75
+ const GjsPrivate = imports.gi.GjsPrivate;
76
+ ```
77
+
78
+ ### Bundle
79
+
80
+ Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
81
+
82
+ ## Other packages
83
+
84
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
85
+
@@ -0,0 +1,9 @@
1
+ declare module 'gi://GjsPrivate?version=1.0' {
2
+ import GjsPrivate10 from '@girs/gjsprivate-1.0';
3
+ export default GjsPrivate10;
4
+ }
5
+
6
+ declare module 'gi://GjsPrivate' {
7
+ import GjsPrivate10 from 'gi://GjsPrivate?version=1.0';
8
+ export default GjsPrivate10;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,9 @@
1
+ import type GjsPrivate10 from '@girs/gjsprivate-1.0';
2
+
3
+ declare global {
4
+ export interface GjsGiImports {
5
+ GjsPrivate: typeof GjsPrivate10;
6
+ }
7
+ }
8
+
9
+ export default GjsGiImports;
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
@@ -0,0 +1,709 @@
1
+ /**
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
7
+ * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import '@girs/gjs';
11
+
12
+ // Module dependencies
13
+ import type GObject from '@girs/gobject-2.0';
14
+ import type GLib from '@girs/glib-2.0';
15
+ import type Gio from '@girs/gio-2.0';
16
+ import type GModule from '@girs/gmodule-2.0';
17
+
18
+ export namespace GjsPrivate {
19
+ /**
20
+ * GjsPrivate-1.0
21
+ */
22
+
23
+ export namespace LocaleCategory {
24
+ export const $gtype: GObject.GType<LocaleCategory>;
25
+ }
26
+
27
+ enum LocaleCategory {
28
+ ALL,
29
+ COLLATE,
30
+ CTYPE,
31
+ MESSAGES,
32
+ MONETARY,
33
+ NUMERIC,
34
+ TIME,
35
+ }
36
+ function bindtextdomain(domain: string, location: string): void;
37
+ function clear_terminal(): void;
38
+ function format_int_alternative_output(n: number): string;
39
+ function g_binding_group_bind_full(
40
+ source: GObject.BindingGroup,
41
+ source_property: string,
42
+ target: GObject.Object,
43
+ target_property: string,
44
+ flags: GObject.BindingFlags | null,
45
+ to_callback: BindingTransformFunc,
46
+ from_callback: BindingTransformFunc,
47
+ ): void;
48
+ function g_object_bind_property_full(
49
+ source: GObject.Object,
50
+ source_property: string,
51
+ target: GObject.Object,
52
+ target_property: string,
53
+ flags: GObject.BindingFlags | null,
54
+ to_callback: BindingTransformFunc,
55
+ from_callback: BindingTransformFunc,
56
+ ): GObject.Binding;
57
+ function gtk_container_child_set_property(
58
+ container: GObject.Object,
59
+ child: GObject.Object,
60
+ property: string,
61
+ value: GObject.Value | any,
62
+ ): void;
63
+ function gtk_custom_sorter_new<T = GObject.Object>(sort_func: CompareDataFunc): T;
64
+ function gtk_custom_sorter_set_sort_func(sorter: GObject.Object, sort_func: CompareDataFunc): void;
65
+ function list_store_insert_sorted(
66
+ store: Gio.ListStore,
67
+ item: GObject.Object,
68
+ compare_func: CompareDataFunc,
69
+ ): number;
70
+ function list_store_sort(store: Gio.ListStore, compare_func: CompareDataFunc): void;
71
+ function log_set_writer_default(): void;
72
+ function log_set_writer_func(func: GLogWriterFunc): void;
73
+ function param_spec_get_flags(pspec: GObject.ParamSpec): GObject.ParamFlags;
74
+ function param_spec_get_owner_type(pspec: GObject.ParamSpec): GObject.GType;
75
+ function param_spec_get_value_type(pspec: GObject.ParamSpec): GObject.GType;
76
+ function regex_match(
77
+ regex: GLib.Regex,
78
+ s: string,
79
+ match_options: GLib.RegexMatchFlags | null,
80
+ ): [boolean, MatchInfo];
81
+ function regex_match_all(
82
+ regex: GLib.Regex,
83
+ s: string,
84
+ match_options: GLib.RegexMatchFlags | null,
85
+ ): [boolean, MatchInfo];
86
+ function regex_match_all_full(
87
+ regex: GLib.Regex,
88
+ bytes: Uint8Array | string,
89
+ start_position: number,
90
+ match_options: GLib.RegexMatchFlags | null,
91
+ ): [boolean, MatchInfo];
92
+ function regex_match_full(
93
+ regex: GLib.Regex,
94
+ bytes: Uint8Array | string,
95
+ start_position: number,
96
+ match_options: GLib.RegexMatchFlags | null,
97
+ ): [boolean, MatchInfo];
98
+ function setlocale(category: LocaleCategory | null, locale: string): string;
99
+ function textdomain(domain: string): void;
100
+ interface BindingTransformFunc {
101
+ (binding: GObject.Binding, from_value: GObject.Value | any): boolean;
102
+ }
103
+ interface CompareDataFunc<A = GObject.Object, B = GObject.Object> {
104
+ (a: A, b: B): number;
105
+ }
106
+ interface GLogWriterFunc {
107
+ (level: GLib.LogLevelFlags, fields: GLib.Variant): GLib.LogWriterOutput;
108
+ }
109
+ namespace DBusImplementation {
110
+ // Signal signatures
111
+ interface SignalSignatures extends Gio.DBusInterfaceSkeleton.SignalSignatures {
112
+ 'handle-method-call': (arg0: string, arg1: GLib.Variant, arg2: Gio.DBusMethodInvocation) => void;
113
+ 'handle-property-get': (arg0: string) => GLib.Variant;
114
+ 'handle-property-set': (arg0: string, arg1: GLib.Variant) => void;
115
+ 'notify::g-interface-info': (pspec: GObject.ParamSpec) => void;
116
+ 'notify::g-flags': (pspec: GObject.ParamSpec) => void;
117
+ }
118
+
119
+ // Constructor properties interface
120
+
121
+ interface ConstructorProps
122
+ extends Gio.DBusInterfaceSkeleton.ConstructorProps,
123
+ Gio.DBusInterface.ConstructorProps {
124
+ g_interface_info: Gio.DBusInterfaceInfo;
125
+ gInterfaceInfo: Gio.DBusInterfaceInfo;
126
+ }
127
+ }
128
+
129
+ class DBusImplementation extends Gio.DBusInterfaceSkeleton implements Gio.DBusInterface {
130
+ static $gtype: GObject.GType<DBusImplementation>;
131
+
132
+ // Properties
133
+
134
+ set g_interface_info(val: Gio.DBusInterfaceInfo);
135
+ set gInterfaceInfo(val: Gio.DBusInterfaceInfo);
136
+
137
+ /**
138
+ * Compile-time signal type information.
139
+ *
140
+ * This instance property is generated only for TypeScript type checking.
141
+ * It is not defined at runtime and should not be accessed in JS code.
142
+ * @internal
143
+ */
144
+ $signals: DBusImplementation.SignalSignatures;
145
+
146
+ // Constructors
147
+
148
+ constructor(properties?: Partial<DBusImplementation.ConstructorProps>, ...args: any[]);
149
+
150
+ _init(...args: any[]): void;
151
+
152
+ // Signals
153
+
154
+ connect<K extends keyof DBusImplementation.SignalSignatures>(
155
+ signal: K,
156
+ callback: GObject.SignalCallback<this, DBusImplementation.SignalSignatures[K]>,
157
+ ): number;
158
+ connect(signal: string, callback: (...args: any[]) => any): number;
159
+ connect_after<K extends keyof DBusImplementation.SignalSignatures>(
160
+ signal: K,
161
+ callback: GObject.SignalCallback<this, DBusImplementation.SignalSignatures[K]>,
162
+ ): number;
163
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
164
+ emit<K extends keyof DBusImplementation.SignalSignatures>(
165
+ signal: K,
166
+ ...args: GObject.GjsParameters<DBusImplementation.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
167
+ ): void;
168
+ emit(signal: string, ...args: any[]): void;
169
+
170
+ // Methods
171
+
172
+ emit_property_changed(property: string, newvalue: GLib.Variant): void;
173
+ emit_signal(signal_name: string, parameters: GLib.Variant): void;
174
+ unexport(): void;
175
+ unexport_from_connection(connection: Gio.DBusConnection): void;
176
+
177
+ // Inherited methods
178
+ /**
179
+ * Gets the #GDBusObject that `interface_` belongs to, if any.
180
+ * @returns A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
181
+ */
182
+ get_object(): Gio.DBusObject | null;
183
+ /**
184
+ * Gets D-Bus introspection information for the D-Bus interface
185
+ * implemented by `interface_`.
186
+ * @returns A #GDBusInterfaceInfo. Do not free.
187
+ */
188
+ get_info(): Gio.DBusInterfaceInfo;
189
+ /**
190
+ * Sets the #GDBusObject for `interface_` to `object`.
191
+ *
192
+ * Note that `interface_` will hold a weak reference to `object`.
193
+ * @param object A #GDBusObject or %NULL.
194
+ */
195
+ set_object(object?: Gio.DBusObject | null): void;
196
+ /**
197
+ * Gets the #GDBusObject that `interface_` belongs to, if any.
198
+ */
199
+ vfunc_dup_object(): Gio.DBusObject | null;
200
+ /**
201
+ * Gets D-Bus introspection information for the D-Bus interface
202
+ * implemented by `interface_`.
203
+ */
204
+ vfunc_get_info(): Gio.DBusInterfaceInfo;
205
+ /**
206
+ * Sets the #GDBusObject for `interface_` to `object`.
207
+ *
208
+ * Note that `interface_` will hold a weak reference to `object`.
209
+ * @param object A #GDBusObject or %NULL.
210
+ */
211
+ vfunc_set_object(object?: Gio.DBusObject | null): void;
212
+ /**
213
+ * Creates a binding between `source_property` on `source` and `target_property`
214
+ * on `target`.
215
+ *
216
+ * Whenever the `source_property` is changed the `target_property` is
217
+ * updated using the same value. For instance:
218
+ *
219
+ *
220
+ * ```c
221
+ * g_object_bind_property (action, "active", widget, "sensitive", 0);
222
+ * ```
223
+ *
224
+ *
225
+ * Will result in the "sensitive" property of the widget #GObject instance to be
226
+ * updated with the same value of the "active" property of the action #GObject
227
+ * instance.
228
+ *
229
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
230
+ * if `target_property` on `target` changes then the `source_property` on `source`
231
+ * will be updated as well.
232
+ *
233
+ * The binding will automatically be removed when either the `source` or the
234
+ * `target` instances are finalized. To remove the binding without affecting the
235
+ * `source` and the `target` you can just call g_object_unref() on the returned
236
+ * #GBinding instance.
237
+ *
238
+ * Removing the binding by calling g_object_unref() on it must only be done if
239
+ * the binding, `source` and `target` are only used from a single thread and it
240
+ * is clear that both `source` and `target` outlive the binding. Especially it
241
+ * is not safe to rely on this if the binding, `source` or `target` can be
242
+ * finalized from different threads. Keep another reference to the binding and
243
+ * use g_binding_unbind() instead to be on the safe side.
244
+ *
245
+ * A #GObject can have multiple bindings.
246
+ * @param source_property the property on @source to bind
247
+ * @param target the target #GObject
248
+ * @param target_property the property on @target to bind
249
+ * @param flags flags to pass to #GBinding
250
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
251
+ */
252
+ bind_property(
253
+ source_property: string,
254
+ target: GObject.Object,
255
+ target_property: string,
256
+ flags: GObject.BindingFlags | null,
257
+ ): GObject.Binding;
258
+ /**
259
+ * Complete version of g_object_bind_property().
260
+ *
261
+ * Creates a binding between `source_property` on `source` and `target_property`
262
+ * on `target,` allowing you to set the transformation functions to be used by
263
+ * the binding.
264
+ *
265
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
266
+ * if `target_property` on `target` changes then the `source_property` on `source`
267
+ * will be updated as well. The `transform_from` function is only used in case
268
+ * of bidirectional bindings, otherwise it will be ignored
269
+ *
270
+ * The binding will automatically be removed when either the `source` or the
271
+ * `target` instances are finalized. This will release the reference that is
272
+ * being held on the #GBinding instance; if you want to hold on to the
273
+ * #GBinding instance, you will need to hold a reference to it.
274
+ *
275
+ * To remove the binding, call g_binding_unbind().
276
+ *
277
+ * A #GObject can have multiple bindings.
278
+ *
279
+ * The same `user_data` parameter will be used for both `transform_to`
280
+ * and `transform_from` transformation functions; the `notify` function will
281
+ * be called once, when the binding is removed. If you need different data
282
+ * for each transformation function, please use
283
+ * g_object_bind_property_with_closures() instead.
284
+ * @param source_property the property on @source to bind
285
+ * @param target the target #GObject
286
+ * @param target_property the property on @target to bind
287
+ * @param flags flags to pass to #GBinding
288
+ * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
289
+ * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
290
+ * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
291
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
292
+ */
293
+ bind_property_full(
294
+ source_property: string,
295
+ target: GObject.Object,
296
+ target_property: string,
297
+ flags: GObject.BindingFlags | null,
298
+ transform_to?: GObject.BindingTransformFunc | null,
299
+ transform_from?: GObject.BindingTransformFunc | null,
300
+ notify?: GLib.DestroyNotify | null,
301
+ ): GObject.Binding;
302
+ // Conflicted with GObject.Object.bind_property_full
303
+ bind_property_full(...args: never[]): any;
304
+ /**
305
+ * This function is intended for #GObject implementations to re-enforce
306
+ * a [floating][floating-ref] object reference. Doing this is seldom
307
+ * required: all #GInitiallyUnowneds are created with a floating reference
308
+ * which usually just needs to be sunken by calling g_object_ref_sink().
309
+ */
310
+ force_floating(): void;
311
+ /**
312
+ * Increases the freeze count on `object`. If the freeze count is
313
+ * non-zero, the emission of "notify" signals on `object` is
314
+ * stopped. The signals are queued until the freeze count is decreased
315
+ * to zero. Duplicate notifications are squashed so that at most one
316
+ * #GObject::notify signal is emitted for each property modified while the
317
+ * object is frozen.
318
+ *
319
+ * This is necessary for accessors that modify multiple properties to prevent
320
+ * premature notification while the object is still being modified.
321
+ */
322
+ freeze_notify(): void;
323
+ /**
324
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
325
+ * @param key name of the key for that association
326
+ * @returns the data if found, or %NULL if no such data exists.
327
+ */
328
+ get_data(key: string): any | null;
329
+ /**
330
+ * Gets a property of an object.
331
+ *
332
+ * The value can be:
333
+ * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
334
+ * - a GObject.Value initialized with the expected type of the property
335
+ * - a GObject.Value initialized with a type to which the expected type of the property can be transformed
336
+ *
337
+ * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
338
+ *
339
+ * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
340
+ * @param property_name The name of the property to get
341
+ * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
342
+ */
343
+ get_property(property_name: string, value: GObject.Value | any): any;
344
+ /**
345
+ * This function gets back user data pointers stored via
346
+ * g_object_set_qdata().
347
+ * @param quark A #GQuark, naming the user data pointer
348
+ * @returns The user data pointer set, or %NULL
349
+ */
350
+ get_qdata(quark: GLib.Quark): any | null;
351
+ /**
352
+ * Gets `n_properties` properties for an `object`.
353
+ * Obtained properties will be set to `values`. All properties must be valid.
354
+ * Warnings will be emitted and undefined behaviour may result if invalid
355
+ * properties are passed in.
356
+ * @param names the names of each property to get
357
+ * @param values the values of each property to get
358
+ */
359
+ getv(names: string[], values: (GObject.Value | any)[]): void;
360
+ /**
361
+ * Checks whether `object` has a [floating][floating-ref] reference.
362
+ * @returns %TRUE if @object has a floating reference
363
+ */
364
+ is_floating(): boolean;
365
+ /**
366
+ * Emits a "notify" signal for the property `property_name` on `object`.
367
+ *
368
+ * When possible, eg. when signaling a property change from within the class
369
+ * that registered the property, you should use g_object_notify_by_pspec()
370
+ * instead.
371
+ *
372
+ * Note that emission of the notify signal may be blocked with
373
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
374
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
375
+ * called.
376
+ * @param property_name the name of a property installed on the class of @object.
377
+ */
378
+ notify(property_name: string): void;
379
+ /**
380
+ * Emits a "notify" signal for the property specified by `pspec` on `object`.
381
+ *
382
+ * This function omits the property name lookup, hence it is faster than
383
+ * g_object_notify().
384
+ *
385
+ * One way to avoid using g_object_notify() from within the
386
+ * class that registered the properties, and using g_object_notify_by_pspec()
387
+ * instead, is to store the GParamSpec used with
388
+ * g_object_class_install_property() inside a static array, e.g.:
389
+ *
390
+ *
391
+ * ```c
392
+ * typedef enum
393
+ * {
394
+ * PROP_FOO = 1,
395
+ * PROP_LAST
396
+ * } MyObjectProperty;
397
+ *
398
+ * static GParamSpec *properties[PROP_LAST];
399
+ *
400
+ * static void
401
+ * my_object_class_init (MyObjectClass *klass)
402
+ * {
403
+ * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
404
+ * 0, 100,
405
+ * 50,
406
+ * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
407
+ * g_object_class_install_property (gobject_class,
408
+ * PROP_FOO,
409
+ * properties[PROP_FOO]);
410
+ * }
411
+ * ```
412
+ *
413
+ *
414
+ * and then notify a change on the "foo" property with:
415
+ *
416
+ *
417
+ * ```c
418
+ * g_object_notify_by_pspec (self, properties[PROP_FOO]);
419
+ * ```
420
+ *
421
+ * @param pspec the #GParamSpec of a property installed on the class of @object.
422
+ */
423
+ notify_by_pspec(pspec: GObject.ParamSpec): void;
424
+ /**
425
+ * Increases the reference count of `object`.
426
+ *
427
+ * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
428
+ * of `object` will be propagated to the return type (using the GCC typeof()
429
+ * extension), so any casting the caller needs to do on the return type must be
430
+ * explicit.
431
+ * @returns the same @object
432
+ */
433
+ ref(): GObject.Object;
434
+ /**
435
+ * Increase the reference count of `object,` and possibly remove the
436
+ * [floating][floating-ref] reference, if `object` has a floating reference.
437
+ *
438
+ * In other words, if the object is floating, then this call "assumes
439
+ * ownership" of the floating reference, converting it to a normal
440
+ * reference by clearing the floating flag while leaving the reference
441
+ * count unchanged. If the object is not floating, then this call
442
+ * adds a new normal reference increasing the reference count by one.
443
+ *
444
+ * Since GLib 2.56, the type of `object` will be propagated to the return type
445
+ * under the same conditions as for g_object_ref().
446
+ * @returns @object
447
+ */
448
+ ref_sink(): GObject.Object;
449
+ /**
450
+ * Releases all references to other objects. This can be used to break
451
+ * reference cycles.
452
+ *
453
+ * This function should only be called from object system implementations.
454
+ */
455
+ run_dispose(): void;
456
+ /**
457
+ * Each object carries around a table of associations from
458
+ * strings to pointers. This function lets you set an association.
459
+ *
460
+ * If the object already had an association with that name,
461
+ * the old association will be destroyed.
462
+ *
463
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
464
+ * This means a copy of `key` is kept permanently (even after `object` has been
465
+ * finalized) — so it is recommended to only use a small, bounded set of values
466
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
467
+ * @param key name of the key
468
+ * @param data data to associate with that key
469
+ */
470
+ set_data(key: string, data?: any | null): void;
471
+ /**
472
+ * Sets a property on an object.
473
+ * @param property_name The name of the property to set
474
+ * @param value The value to set the property to
475
+ */
476
+ set_property(property_name: string, value: GObject.Value | any): void;
477
+ /**
478
+ * Remove a specified datum from the object's data associations,
479
+ * without invoking the association's destroy handler.
480
+ * @param key name of the key
481
+ * @returns the data if found, or %NULL if no such data exists.
482
+ */
483
+ steal_data(key: string): any | null;
484
+ /**
485
+ * This function gets back user data pointers stored via
486
+ * g_object_set_qdata() and removes the `data` from object
487
+ * without invoking its destroy() function (if any was
488
+ * set).
489
+ * Usually, calling this function is only required to update
490
+ * user data pointers with a destroy notifier, for example:
491
+ *
492
+ * ```c
493
+ * void
494
+ * object_add_to_user_list (GObject *object,
495
+ * const gchar *new_string)
496
+ * {
497
+ * // the quark, naming the object data
498
+ * GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
499
+ * // retrieve the old string list
500
+ * GList *list = g_object_steal_qdata (object, quark_string_list);
501
+ *
502
+ * // prepend new string
503
+ * list = g_list_prepend (list, g_strdup (new_string));
504
+ * // this changed 'list', so we need to set it again
505
+ * g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
506
+ * }
507
+ * static void
508
+ * free_string_list (gpointer data)
509
+ * {
510
+ * GList *node, *list = data;
511
+ *
512
+ * for (node = list; node; node = node->next)
513
+ * g_free (node->data);
514
+ * g_list_free (list);
515
+ * }
516
+ * ```
517
+ *
518
+ * Using g_object_get_qdata() in the above example, instead of
519
+ * g_object_steal_qdata() would have left the destroy function set,
520
+ * and thus the partial string list would have been freed upon
521
+ * g_object_set_qdata_full().
522
+ * @param quark A #GQuark, naming the user data pointer
523
+ * @returns The user data pointer set, or %NULL
524
+ */
525
+ steal_qdata(quark: GLib.Quark): any | null;
526
+ /**
527
+ * Reverts the effect of a previous call to
528
+ * g_object_freeze_notify(). The freeze count is decreased on `object`
529
+ * and when it reaches zero, queued "notify" signals are emitted.
530
+ *
531
+ * Duplicate notifications for each property are squashed so that at most one
532
+ * #GObject::notify signal is emitted for each property, in the reverse order
533
+ * in which they have been queued.
534
+ *
535
+ * It is an error to call this function when the freeze count is zero.
536
+ */
537
+ thaw_notify(): void;
538
+ /**
539
+ * Decreases the reference count of `object`. When its reference count
540
+ * drops to 0, the object is finalized (i.e. its memory is freed).
541
+ *
542
+ * If the pointer to the #GObject may be reused in future (for example, if it is
543
+ * an instance variable of another object), it is recommended to clear the
544
+ * pointer to %NULL rather than retain a dangling pointer to a potentially
545
+ * invalid #GObject instance. Use g_clear_object() for this.
546
+ */
547
+ unref(): void;
548
+ /**
549
+ * This function essentially limits the life time of the `closure` to
550
+ * the life time of the object. That is, when the object is finalized,
551
+ * the `closure` is invalidated by calling g_closure_invalidate() on
552
+ * it, in order to prevent invocations of the closure with a finalized
553
+ * (nonexisting) object. Also, g_object_ref() and g_object_unref() are
554
+ * added as marshal guards to the `closure,` to ensure that an extra
555
+ * reference count is held on `object` during invocation of the
556
+ * `closure`. Usually, this function will be called on closures that
557
+ * use this `object` as closure data.
558
+ * @param closure #GClosure to watch
559
+ */
560
+ watch_closure(closure: GObject.Closure): void;
561
+ /**
562
+ * the `constructed` function is called by g_object_new() as the
563
+ * final step of the object creation process. At the point of the call, all
564
+ * construction properties have been set on the object. The purpose of this
565
+ * call is to allow for object initialisation steps that can only be performed
566
+ * after construction properties have been set. `constructed` implementors
567
+ * should chain up to the `constructed` call of their parent class to allow it
568
+ * to complete its initialisation.
569
+ */
570
+ vfunc_constructed(): void;
571
+ /**
572
+ * emits property change notification for a bunch
573
+ * of properties. Overriding `dispatch_properties_changed` should be rarely
574
+ * needed.
575
+ * @param n_pspecs
576
+ * @param pspecs
577
+ */
578
+ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
579
+ /**
580
+ * the `dispose` function is supposed to drop all references to other
581
+ * objects, but keep the instance otherwise intact, so that client method
582
+ * invocations still work. It may be run multiple times (due to reference
583
+ * loops). Before returning, `dispose` should chain up to the `dispose` method
584
+ * of the parent class.
585
+ */
586
+ vfunc_dispose(): void;
587
+ /**
588
+ * instance finalization function, should finish the finalization of
589
+ * the instance begun in `dispose` and chain up to the `finalize` method of the
590
+ * parent class.
591
+ */
592
+ vfunc_finalize(): void;
593
+ /**
594
+ * the generic getter for all properties of this type. Should be
595
+ * overridden for every type with properties.
596
+ * @param property_id
597
+ * @param value
598
+ * @param pspec
599
+ */
600
+ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
601
+ /**
602
+ * Emits a "notify" signal for the property `property_name` on `object`.
603
+ *
604
+ * When possible, eg. when signaling a property change from within the class
605
+ * that registered the property, you should use g_object_notify_by_pspec()
606
+ * instead.
607
+ *
608
+ * Note that emission of the notify signal may be blocked with
609
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
610
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
611
+ * called.
612
+ * @param pspec
613
+ */
614
+ vfunc_notify(pspec: GObject.ParamSpec): void;
615
+ /**
616
+ * the generic setter for all properties of this type. Should be
617
+ * overridden for every type with properties. If implementations of
618
+ * `set_property` don't emit property change notification explicitly, this will
619
+ * be done implicitly by the type system. However, if the notify signal is
620
+ * emitted explicitly, the type system will not emit it a second time.
621
+ * @param property_id
622
+ * @param value
623
+ * @param pspec
624
+ */
625
+ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
626
+ /**
627
+ * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
628
+ * @param id Handler ID of the handler to be disconnected
629
+ */
630
+ disconnect(id: number): void;
631
+ /**
632
+ * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
633
+ * @param properties Object containing the properties to set
634
+ */
635
+ set(properties: { [key: string]: any }): void;
636
+ /**
637
+ * Blocks a handler of an instance so it will not be called during any signal emissions
638
+ * @param id Handler ID of the handler to be blocked
639
+ */
640
+ block_signal_handler(id: number): void;
641
+ /**
642
+ * Unblocks a handler so it will be called again during any signal emissions
643
+ * @param id Handler ID of the handler to be unblocked
644
+ */
645
+ unblock_signal_handler(id: number): void;
646
+ /**
647
+ * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
648
+ * @param detailedName Name of the signal to stop emission of
649
+ */
650
+ stop_emission_by_name(detailedName: string): void;
651
+ }
652
+
653
+ class DBusImplementationClass {
654
+ static $gtype: GObject.GType<DBusImplementationClass>;
655
+
656
+ // Constructors
657
+
658
+ _init(...args: any[]): void;
659
+ }
660
+
661
+ class DBusImplementationPrivate {
662
+ static $gtype: GObject.GType<DBusImplementationPrivate>;
663
+
664
+ // Constructors
665
+
666
+ _init(...args: any[]): void;
667
+ }
668
+
669
+ class MatchInfo {
670
+ static $gtype: GObject.GType<MatchInfo>;
671
+
672
+ // Constructors
673
+
674
+ _init(...args: any[]): void;
675
+
676
+ // Methods
677
+
678
+ expand_references(string_to_expand: string): string;
679
+ fetch(match_num: number): string;
680
+ fetch_all(): string[];
681
+ fetch_named(name: string): string;
682
+ fetch_named_pos(name: string): [boolean, number, number];
683
+ fetch_pos(match_num: number): [boolean, number, number];
684
+ free(): void;
685
+ get_match_count(): number;
686
+ get_regex(): GLib.Regex;
687
+ get_string(): string;
688
+ is_partial_match(): boolean;
689
+ matches(): boolean;
690
+ next(): boolean;
691
+ ref(): MatchInfo;
692
+ unref(): void;
693
+ }
694
+
695
+ /**
696
+ * Name of the imported GIR library
697
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
698
+ */
699
+ const __name__: string;
700
+ /**
701
+ * Version of the imported GIR library
702
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
703
+ */
704
+ const __version__: string;
705
+ }
706
+
707
+ export default GjsPrivate;
708
+
709
+ // END
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GjsPrivate from 'gi://GjsPrivate?version=1.0';
4
+ export default GjsPrivate;
5
+
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
7
+ * This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import './gjsprivate-1.0-ambient.d.ts';
11
+
12
+ import './gjsprivate-1.0-import.d.ts';
13
+
14
+ import GjsPrivate from './gjsprivate-1.0.js';
15
+ export default GjsPrivate;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GjsPrivate from './gjsprivate-1.0.js';
4
+ export default GjsPrivate;
5
+
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@girs/gjsprivate-1.0",
3
+ "version": "1.0.0-4.0.0-beta.37",
4
+ "description": "GJS TypeScript type definitions for GjsPrivate-1.0, generated from library version 1.0.0",
5
+ "type": "module",
6
+ "module": "gjsprivate-1.0.js",
7
+ "main": "gjsprivate-1.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./gjsprivate-1.0-ambient.d.ts",
11
+ "import": "./gjsprivate-1.0-ambient.js",
12
+ "default": "./gjsprivate-1.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./gjsprivate-1.0-import.d.ts",
16
+ "import": "./gjsprivate-1.0-import.js",
17
+ "default": "./gjsprivate-1.0-import.js"
18
+ },
19
+ "./gjsprivate-1.0": {
20
+ "types": "./gjsprivate-1.0.d.ts",
21
+ "import": "./gjsprivate-1.0.js",
22
+ "default": "./gjsprivate-1.0.js"
23
+ },
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "import": "./index.js",
27
+ "default": "./index.js"
28
+ }
29
+ },
30
+ "scripts": {
31
+ "test": "tsc --project tsconfig.json"
32
+ },
33
+ "dependencies": {
34
+ "@girs/gjs": "4.0.0-beta.37",
35
+ "@girs/gobject-2.0": "2.86.0-4.0.0-beta.37",
36
+ "@girs/glib-2.0": "2.86.0-4.0.0-beta.37",
37
+ "@girs/gio-2.0": "2.86.0-4.0.0-beta.37",
38
+ "@girs/gmodule-2.0": "2.0.0-4.0.0-beta.37" },
39
+ "devDependencies": {
40
+ "typescript": "*"
41
+ },
42
+ "keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "GjsPrivate-1.0"],
43
+ "author": "ts-for-gir",
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/gjsify/types.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
51
+ },
52
+ "homepage": "https://github.com/gjsify/types/tree/main/gjsprivate-1.0#readme"
53
+ }
54
+
55
+
package/tsconfig.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ // General settings for code interpretation
4
+ "target": "ESNext",
5
+ "module": "NodeNext",
6
+ "lib": ["ESNext"],
7
+ "types": [],
8
+ "experimentalDecorators": true,
9
+ "moduleResolution": "NodeNext",
10
+ "noEmit": true,
11
+ "noEmitOnError": false,
12
+ "baseUrl": "./",
13
+ "rootDir": ".",
14
+ // General settings for code generation
15
+ "removeComments": false,
16
+ "inlineSourceMap": false,
17
+ "inlineSources": false,
18
+ "newLine": "LF",
19
+ // Show diagnostics
20
+ "diagnostics": true
21
+ },
22
+ "include": ["./gjsprivate-1.0.d.ts"]
23
+ }
24
+
25
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./gjsprivate-1.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "GjsPrivate-1.0",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+