-
Notifications
You must be signed in to change notification settings - Fork 0
/
GConf-2.0.d.ts
572 lines (484 loc) · 18.3 KB
/
GConf-2.0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
// @ts-nocheck
/*
* Type Definitions for node-gtk (https://github.com/romgrk/node-gtk)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* GConf-2.0
*/
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
export namespace GConf {
enum ClientErrorHandlingMode {
HANDLE_NONE,
HANDLE_UNRETURNED,
HANDLE_ALL,
}
enum ClientPreloadType {
PRELOAD_NONE,
PRELOAD_ONELEVEL,
PRELOAD_RECURSIVE,
}
enum Error {
SUCCESS,
FAILED,
NO_SERVER,
NO_PERMISSION,
BAD_ADDRESS,
BAD_KEY,
PARSE_ERROR,
CORRUPT,
TYPE_MISMATCH,
IS_DIR,
IS_KEY,
OVERRIDDEN,
OAF_ERROR,
LOCAL_ENGINE,
LOCK_FAILED,
NO_WRITABLE_DATABASE,
IN_SHUTDOWN,
}
enum ValueType {
INVALID,
STRING,
INT,
FLOAT,
BOOL,
SCHEMA,
LIST,
PAIR,
}
enum UnsetFlags {
NAMES,
}
function concatDirAndKey(dir: string, key: string): string
/**
* Detach from the config server and release
* all related resources
*/
function debugShutdown(): number
function enumToString(lookupTable: EnumStringPair, enumValue: number): string
function errorQuark(): GLib.Quark
/**
* Escape `arbitrary_text` such that it's a valid key element (i.e. one
* part of the key path). The escaped key won't pass gconf_valid_key()
* because it isn't a whole key (i.e. it doesn't have a preceding
* slash), but prepending a slash to the escaped text should always
* result in a valid key.
* @param arbitraryText some text in any encoding or format
* @param len length of `arbitrary_text` in bytes, or -1 if `arbitrary_text` is nul-terminated
*/
function escapeKey(arbitraryText: string, len: number): string
function init(argc: number, argv: string): boolean
function isInitialized(): boolean
function keyIsBelow(above: string, below: string): boolean
function postinit(app: object | null, modInfo: object | null): void
function preinit(app: object | null, modInfo: object | null): void
function stringToEnum(lookupTable: EnumStringPair, str: string, enumValueRetloc: number): boolean
/**
* Converts a string escaped with gconf_escape_key() back into its original
* form.
* @param escapedKey a key created with gconf_escape_key()
* @param len length of `escaped_key` in bytes, or -1 if `escaped_key` is nul-terminated
*/
function unescapeKey(escapedKey: string, len: number): string
function uniqueKey(): string
function validKey(key: string, whyInvalid: string): boolean
function valueDecode(encoded: string): Value
interface ChangeSetForeachFunc {
(cs: ChangeSet, key: string, value: Value): void
}
interface ClientErrorHandlerFunc {
(client: Client, error: GLib.Error): void
}
interface ClientNotifyFunc {
(client: Client, cnxnId: number, entry: Entry): void
}
interface ListenersForeach {
(location: string, cnxnId: number, listenerData: object | null): void
}
interface ListenersPredicate {
(location: string, cnxnId: number, listenerData: object | null): boolean
}
interface Client_ConstructProps extends GObject.Object_ConstructProps {
}
/**
* Signal callback interface for `error`
*/
interface Client_ErrorSignalCallback {
(object: object | null): void
}
/**
* Signal callback interface for `unreturned-error`
*/
interface Client_UnreturnedErrorSignalCallback {
(object: object | null): void
}
/**
* Signal callback interface for `value-changed`
*/
interface Client_ValueChangedSignalCallback {
(object: string, p0: object | null): void
}
interface Client {
// Own fields of GConf-2.0.GConf.Client
object: GObject.Object
// Owm methods of GConf-2.0.GConf.Client
addDir(dir: string, preload: ClientPreloadType): void
/**
* Lists the subdirectories in `dir`. The returned list contains
* allocated strings. Each string is the absolute path of a
* subdirectory. You should g_free() each string in the list, then
* g_slist_free() the list itself. Just like gconf_engine_all_dirs(),
* but uses #GConfClient caching and error-handling features.
* @param dir directory to get subdirectories from.
*/
allDirs(dir: string): string[]
/**
* Lists the key-value pairs in `dir`. Does not list subdirectories; for
* that use gconf_client_all_dirs(). The returned list contains #GConfEntry
* objects. A #GConfEntry contains an <emphasis>absolute</emphasis> key
* and a value. The list is not recursive, it contains only the immediate
* children of `dir`. To free the returned list, gconf_entry_free()
* each list element, then g_slist_free() the list itself.
* Just like gconf_engine_all_entries (), but uses #GConfClient caching and error-handling features.
* @param dir directory to list.
*/
allEntries(dir: string): Entry[]
changeSetFromCurrentv(keys: string): ChangeSet
clearCache(): void
commitChangeSet(cs: ChangeSet, removeCommitted: boolean): boolean
dirExists(dir: string): boolean
error(error: GLib.Error): void
get(key: string): Value
getBool(key: string): boolean
getDefaultFromSchema(key: string): Value
getEntry(key: string, locale: string, useSchemaDefault: boolean): Entry
getFloat(key: string): number
getInt(key: string): number
getPair(key: string, carType: ValueType, cdrType: ValueType, carRetloc: object | null, cdrRetloc: object | null): boolean
getString(key: string): string
getWithoutDefault(key: string): Value
keyIsWritable(key: string): boolean
notify(key: string): void
notifyAdd(namespaceSection: string, func: ClientNotifyFunc): number
notifyRemove(cnxn: number): void
preload(dirname: string, type: ClientPreloadType): void
recursiveUnset(key: string, flags: UnsetFlags): boolean
removeDir(dir: string): void
reverseChangeSet(cs: ChangeSet): ChangeSet
set(key: string, val: Value): void
setBool(key: string, val: boolean): boolean
setErrorHandling(mode: ClientErrorHandlingMode): void
setFloat(key: string, val: number): boolean
setInt(key: string, val: number): boolean
setPair(key: string, carType: ValueType, cdrType: ValueType, addressOfCar: object | null, addressOfCdr: object | null): boolean
setString(key: string, val: string): boolean
suggestSync(): void
unreturnedError(error: GLib.Error): void
unset(key: string): boolean
valueChanged(key: string, value: Value): void
// Own signals of GConf-2.0.GConf.Client
connect(sigName: "error", callback: Client_ErrorSignalCallback): number
on(sigName: "error", callback: Client_ErrorSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "error", callback: Client_ErrorSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "error", callback: Client_ErrorSignalCallback): NodeJS.EventEmitter
emit(sigName: "error", ...args: any[]): void
connect(sigName: "unreturned-error", callback: Client_UnreturnedErrorSignalCallback): number
on(sigName: "unreturned-error", callback: Client_UnreturnedErrorSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "unreturned-error", callback: Client_UnreturnedErrorSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "unreturned-error", callback: Client_UnreturnedErrorSignalCallback): NodeJS.EventEmitter
emit(sigName: "unreturned-error", ...args: any[]): void
connect(sigName: "value-changed", callback: Client_ValueChangedSignalCallback): number
on(sigName: "value-changed", callback: Client_ValueChangedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "value-changed", callback: Client_ValueChangedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "value-changed", callback: Client_ValueChangedSignalCallback): NodeJS.EventEmitter
emit(sigName: "value-changed", p0: object | null, ...args: any[]): void
// Class property signals of GConf-2.0.GConf.Client
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class Client extends GObject.Object {
// Own properties of GConf-2.0.GConf.Client
static name: string
static $gtype: GObject.GType<Client>
// Constructors of GConf-2.0.GConf.Client
constructor(config?: Client_ConstructProps)
_init(config?: Client_ConstructProps): void
/**
* Creates a new #GConfClient using the default #GConfEngine. Normally this is the
* engine you want. If someone else is already using the default
* #GConfClient, this function returns the same one they're using, but
* with the reference count incremented. So you have to unref either way.
*/
static getDefault(): Client
}
interface ChangeSet {
// Owm methods of GConf-2.0.GConf.ChangeSet
checkValue(key: string, valueRetloc: Value): boolean
clear(): void
/**
* Iterates over a #GConfChangeSet by calling a
* #GConfChangeSetForeachFunc for each change in the set. See the
* description of #GConfChangeSetForeachFunc for details. You may not
* call gconf_change_set_remove() during the iteration, because you'll
* confuse the internal data structures and cause memory corruption.
* @param func function to call for each change in the change set.
*/
foreach(func: ChangeSetForeachFunc): void
ref(): ChangeSet
remove(key: string): void
set(key: string, value: Value): void
setBool(key: string, val: boolean): void
setFloat(key: string, val: number): void
setInt(key: string, val: number): void
setNocopy(key: string, value: Value): void
setPair(key: string, carType: ValueType, cdrType: ValueType, addressOfCar: object | null, addressOfCdr: object | null): void
setString(key: string, val: string): void
size(): number
unref(): void
unset(key: string): void
}
class ChangeSet {
// Own properties of GConf-2.0.GConf.ChangeSet
static name: string
// Constructors of GConf-2.0.GConf.ChangeSet
constructor()
static new(): ChangeSet
}
interface ClientClass {
// Own fields of GConf-2.0.GConf.ClientClass
parentClass: GObject.ObjectClass
valueChanged: (client: Client, key: string, value: Value) => void
unreturnedError: (client: Client, error: GLib.Error) => void
error: (client: Client, error: GLib.Error) => void
pad1: GLib.Func
pad2: GLib.Func
pad3: GLib.Func
}
abstract class ClientClass {
// Own properties of GConf-2.0.GConf.ClientClass
static name: string
}
interface Engine {
// Owm methods of GConf-2.0.GConf.Engine
/**
* Lists the subdirectories in `dir`. The returned list contains
* allocated strings. Each string is the absolute path of a
* subdirectory. You should g_free() each string in the list, then
* g_slist_free() the list itself.
* @param dir Directory to get subdirectories from.
*/
allDirs(dir: string): string[]
/**
* Lists the key-value pairs in `dir`. Does not list subdirectories; for
* that use gconf_engine_all_dirs(). The returned list contains #GConfEntry
* objects. A #GConfEntry contains an <emphasis>absolute</emphasis> key
* and a value. The list is not recursive, it contains only the immediate
* children of `dir`. To free the returned list, gconf_entry_free()
* each list element, then g_slist_free() the list itself.
* @param dir Directory to list.
*/
allEntries(dir: string): Entry[]
associateSchema(key: string, schemaKey: string): boolean
changeSetFromCurrent(err: GLib.Error, firstKey: string, ...args: any): ChangeSet
changeSetFromCurrentv(keys: string): ChangeSet
commitChangeSet(cs: ChangeSet, removeCommitted: boolean): boolean
dirExists(dir: string): boolean
get(key: string): Value
getBool(key: string): boolean
getDefaultFromSchema(key: string): Value
getEntry(key: string, locale: string, useSchemaDefault: boolean): Entry
getFloat(key: string): number
getFull(key: string, locale: string, useSchemaDefault: boolean, isDefaultP: boolean, isWritableP: boolean): Value
getInt(key: string): number
getPair(key: string, carType: ValueType, cdrType: ValueType, carRetloc: object | null, cdrRetloc: object | null): boolean
getString(key: string): string
getUserData(): object | null
getWithLocale(key: string, locale: string): Value
getWithoutDefault(key: string): Value
keyIsWritable(key: string): boolean
notifyRemove(cnxn: number): void
ref(): void
removeDir(dir: string): void
reverseChangeSet(cs: ChangeSet): ChangeSet
set(key: string, value: Value): boolean
setBool(key: string, val: boolean): boolean
setFloat(key: string, val: number): boolean
setInt(key: string, val: number): boolean
setList(key: string, listType: ValueType, list: object[]): boolean
setPair(key: string, carType: ValueType, cdrType: ValueType, addressOfCar: object | null, addressOfCdr: object | null): boolean
setString(key: string, val: string): boolean
setUserData(data: object | null, dnotify: GLib.DestroyNotify): void
suggestSync(): void
unref(): void
unset(key: string): boolean
}
/**
* An opaque data type representing one or more configuration sources.
* @record
*/
class Engine {
// Own properties of GConf-2.0.GConf.Engine
static name: string
}
interface Entry {
// Own fields of GConf-2.0.GConf.Entry
key: string
value: Value
// Owm methods of GConf-2.0.GConf.Entry
copy(): Entry
equal(b: Entry): boolean
free(): void
getIsDefault(): boolean
getIsWritable(): boolean
getKey(): string
getSchemaName(): string
getValue(): Value
ref(): Entry
setIsDefault(isDefault: boolean): void
setIsWritable(isWritable: boolean): void
setSchemaName(name: string): void
setValue(val: Value): void
setValueNocopy(val: Value): void
stealValue(): Value
unref(): void
}
class Entry {
// Own properties of GConf-2.0.GConf.Entry
static name: string
// Constructors of GConf-2.0.GConf.Entry
constructor(key: string, val: Value)
static new(key: string, val: Value): Entry
static newNocopy(key: string, val: Value): Entry
}
interface EnumStringPair {
// Own fields of GConf-2.0.GConf.EnumStringPair
enumValue: number
str: string
}
class EnumStringPair {
// Own properties of GConf-2.0.GConf.EnumStringPair
static name: string
}
interface Listeners {
// Owm methods of GConf-2.0.GConf.Listeners
add(listenPoint: string, listenerData: object | null, destroyNotify: GLib.FreeFunc): number
count(): number
foreach(callback: ListenersForeach): void
free(): void
getData(cnxnId: number, listenerDataP: object | null, locationP: string): boolean
notify(allAbove: string, callback: any): void
remove(cnxnId: number): void
removeIf(predicate: ListenersPredicate): void
}
/**
* The #GConfListeners structure contains nothing other than a dummy pointer. Internally
* the data about listeners is maintained through a listener table structure,
* LTable which contains data like the namespace, an array to hold the listeners, count of
* active listeners,value to be given to the next connection and the list of connection indices
* to be recycled. There is also a Listener structure maintaining data pertaining to listeners.
* @record
*/
class Listeners {
// Own properties of GConf-2.0.GConf.Listeners
static name: string
}
interface MetaInfo {
// Own fields of GConf-2.0.GConf.MetaInfo
schema: string
modUser: string
modTime: GLib.Time
// Owm methods of GConf-2.0.GConf.MetaInfo
free(): void
getModUser(): string
getSchema(): string
setModTime(modTime: GLib.Time): void
setModUser(modUser: string): void
setSchema(schemaName: string): void
}
class MetaInfo {
// Own properties of GConf-2.0.GConf.MetaInfo
static name: string
}
interface Schema {
// Owm methods of GConf-2.0.GConf.Schema
free(): void
getCarType(): ValueType
getCdrType(): ValueType
getDefaultValue(): Value
getListType(): ValueType
getLocale(): string
getLongDesc(): string
getOwner(): string
getShortDesc(): string
getType(): ValueType
setCarType(type: ValueType): void
setCdrType(type: ValueType): void
setDefaultValue(val: Value): void
setDefaultValueNocopy(val: Value): void
setListType(type: ValueType): void
setLocale(locale: string): void
setLongDesc(desc: string): void
setOwner(owner: string): void
setShortDesc(desc: string): void
setType(type: ValueType): void
}
/**
* An opaque data type representing a description of a key-value pair.
* @record
*/
class Schema {
// Own properties of GConf-2.0.GConf.Schema
static name: string
}
interface Value {
// Own fields of GConf-2.0.GConf.Value
type: ValueType
// Owm methods of GConf-2.0.GConf.Value
compare(valueB: Value): number
copy(): Value
encode(): string
free(): void
getBool(): boolean
getCar(): Value
getCdr(): Value
getFloat(): number
getInt(): number
/**
* Returns a #GSList containing #GConfValue objects. Each #GConfValue in
* the returned list will have the type returned by
* gconf_value_get_list_type(). Remember that the empty #GSList is equal to
* <symbol>NULL</symbol>. The list is not a copy; it is "owned" by the
* #GConfValue and will be destroyed when the #GConfValue is destroyed.
*/
getList(): Value[]
getListType(): ValueType
getString(): string
setBool(theBool: boolean): void
setCar(car: Value): void
setCarNocopy(car: Value): void
setCdr(cdr: Value): void
setCdrNocopy(cdr: Value): void
setFloat(theFloat: number): void
setInt(theInt: number): void
setListType(type: ValueType): void
setString(theStr: string): void
toString(): string
}
class Value {
// Own properties of GConf-2.0.GConf.Value
static name: string
// Constructors of GConf-2.0.GConf.Value
constructor(type: ValueType)
static new(type: ValueType): Value
static newFromString(type: ValueType, str: string): Value
static decode(encoded: string): Value
}
}
export default GConf;