/
Dee-1.0.d.ts
3330 lines (2842 loc) · 128 KB
/
Dee-1.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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// @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
*/
/**
* Dee-1.0
*/
import type Gio from './Gio-2.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
export namespace Dee {
/**
* Error codes for the ICU extension to Dee. These codes will be set when the
* error domain is #DEE_ICU_ERROR.
*/
enum ICUError {
/**
* Error parsing a transliteration rule
*/
BAD_RULE,
/**
* Error parsing a transliterator system id
*/
BAD_ID,
/**
* The ICU subsystem returned an error that is not
* handled in Dee
*/
UNKNOWN,
}
/**
* Enumeration defining behavior of the model with regards to writes from
* other peers in the swarm.
*/
enum SharedModelAccessMode {
WORLD_WRITABLE,
LEADER_WRITABLE,
}
enum SharedModelError {
SHARED_MODEL_ERROR_LEADER_INVALIDATED,
}
/**
* Enumeration defining flushing behavior of a shared model.
*/
enum SharedModelFlushMode {
AUTOMATIC,
MANUAL,
}
/**
* Error codes for the #DeeTransaction class. These codes will be set when the
* error domain is #DEE_TRANSACTION_ERROR.
*/
enum TransactionError {
/**
* The target model has been
* modified while the transaction was open.
*/
CONCURRENT_MODIFICATION,
/**
* Raised when someone tries to commit a
* transaction that has already been committed
*/
COMMITTED,
}
/**
* Flags passed to dee_index_lookup() to control how matching is done.
* Note that it is not required that index backends support more than just
* #DEE_TERM_MATCH_EXACT.
*
* You can query for the supported flags with
* dee_index_get_supported_term_match_flags().
* @bitfield
*/
enum TermMatchFlag {
/**
* Match terms byte for byte as specified in the
* query string
*/
EXACT,
/**
* Match if the indexed term begins with the byte string
* being queried by. This is also sometimes known as
* truncated- or wildcard queries
*/
PREFIX,
}
const PEER_DBUS_IFACE: string
/**
* String constant defining the name of the DBus Model interface.
*/
const SEQUENCE_MODEL_DBUS_IFACE: string
/**
* String constant defining the name of the DBus Model interface.
*/
const SHARED_MODEL_DBUS_IFACE: string
/**
* Create a new #DeeFilter with the given parameters. This call will zero
* the `out_filter` struct.
* @param mapFunc The #DeeFilterMapFunc to use for the filter
* @param mapNotify The #DeeFilterMapNotify to use for the filter
*/
function filterNew(mapFunc: FilterMapFunc, mapNotify: FilterMapNotify): /* outFilter */ Filter
/**
* Create a #DeeFilter that takes string values from a column in the model
* and builds a #DeeFilterModel with the rows sorted according to the
* collation rules of the current locale.
* @param column The index of a column containing the strings to sort after
*/
function filterNewCollator(column: number): /* outFilter */ Filter
/**
* Create a #DeeFilter that takes string values from a column in the model
* and builds a #DeeFilterModel with the rows sorted descending according to the
* collation rules of the current locale.
* @param column The index of a column containing the strings to sort after
*/
function filterNewCollatorDesc(column: number): /* outFilter */ Filter
/**
* Create a #DeeFilter that only includes rows from the original model
* which match a variant value in a given column. A #DeeFilterModel
* created with this filter will be ordered in accordance with its parent model.
*
* This method will work on any column, disregarding its schema, since the
* value comparison is done using g_variant_equal(). This means you can use
* this filter as a convenient fallback when there is no predefined filter
* for your column type if raw performance is not paramount.
* @param column The index of a column containing the string to match
* @param value A #GVariant value columns must match exactly. The matching semantics are those of g_variant_equal(). If `value` is floating the ownership will be transfered to the filter
*/
function filterNewForAnyColumn(column: number, value: GLib.Variant): /* outFilter */ Filter
/**
* Create a #DeeFilter that only includes rows from the original model
* which has an exact match on some string column. A #DeeFilterModel created
* with this filter will be ordered in accordance with its parent model.
* @param column The index of a column containing the string key to match
* @param key
*/
function filterNewForKeyColumn(column: number, key: string): /* outFilter */ Filter
/**
* Create a #DeeFilter that only includes rows from the original model
* which match a regular expression on some string column. A #DeeFilterModel
* created with this filter will be ordered in accordance with its parent model.
* @param column The index of a column containing the string to match
* @param regex The regular expression `column` must match
*/
function filterNewRegex(column: number, regex: GLib.Regex): /* outFilter */ Filter
/**
* Create a new #DeeFilter sorting a model according to a #DeeCompareRowFunc.
* @param cmpRow A #DeeCompareRowFunc to use for sorting
*/
function filterNewSort(cmpRow: CompareRowFunc): /* outFilter */ Filter
function icuErrorQuark(): GLib.Quark
/**
* Create a new #DeeModelReader with the given parameters. This call will zero
* the `out_reader` struct.
* @param readerFunc The #DeeModelReaderFunc to use for the reader
*/
function modelReaderNew(readerFunc: ModelReaderFunc): /* outReader */ ModelReader
/**
* A #DeeModelReader reading a %gint32 from a #DeeModel at a given column
* @param column The column index to read a %gint32 from
*/
function modelReaderNewForInt32Column(column: number): /* outReader */ ModelReader
/**
* A #DeeModelReader reading a string from a #DeeModel at a given column
* @param column The column index to read a string from
*/
function modelReaderNewForStringColumn(column: number): /* outReader */ ModelReader
/**
* A #DeeModelReader reading a %guint32 from a #DeeModel at a given column
* @param column The column index to read a %guint32 from
*/
function modelReaderNewForUint32Column(column: number): /* outReader */ ModelReader
/**
* Get a pointer to the platform default #DeeResourceManager.
*/
function resourceManagerGetDefault(): ResourceManager
/**
* Reconstruct a #DeeSerializable from #GVariant data. For this function
* to work you need to register a parser with
* dee_serializable_register_parser(). Any native Dee class will do so
* automatically.
*
* This method only works on data created with dee_serializable_serialize()
* and <emphasis>not</emphasis> with data from dee_serializable_externalize().
*
* Since a #DeeSerializableParseFunc is not allowed to fail - by contract -
* it can be guaranteed that this function only returns %NULL in case there
* is no known parser for `type` and #GVariant signature of `data`.
* @param data The #GVariant data to parse. If this is a floating reference it will be consumed
* @param type The #GType of the class to instantiate from `data`
*/
function serializableParse(data: GLib.Variant, type: GObject.GType): GObject.Object
/**
* Reconstruct a #DeeSerializable from #GVariant data. For this function
* to work you need to register a parser with
* dee_serializable_register_parser(). Any native Dee class will do so
* automatically.
*
* This method only works on data created with dee_serializable_externalize()
* and <emphasis>not</emphasis> with data from dee_serializable_serialize().
*
* Since a #DeeSerializableParseFunc is not allowed to fail - by contract -
* it can be guaranteed that this function only returns %NULL in case there
* is no known parser for the #GType or #GVariant signature of `data`.
* @param data The #GVariant data to parse
*/
function serializableParseExternal(data: GLib.Variant): GObject.Object
/**
* A collator takes an input string, most often a term produced from a
* #DeeAnalyzer, and outputs a collation key.
* @callback
* @param input The string to produce a collation key for
*/
interface CollatorFunc {
(input: string): string
}
/**
* Compares `row1` and `row2`. Mainly used with dee_model_insert_sorted() and
* dee_model_find_sorted().
* @callback
* @param row1 The model being indexed
* @param row2 The row to extract terms for
*/
interface CompareRowFunc {
(row1: GLib.Variant[], row2: GLib.Variant[]): number
}
/**
* Compares `row1` and `row2`. Mainly used with
* dee_model_insert_row_sorted_with_sizes() and
* dee_model_find_row_sorted_with_sizes().
* @callback
* @param row1 Row data
* @param row2 Row data to compare with
*/
interface CompareRowSizedFunc {
(row1: GLib.Variant[], row2: GLib.Variant[]): number
}
/**
* Function used to collect the rows from a model that should be included in
* a #DeeFilterModel. To add rows to `filter_model` use the methods
* dee_filter_model_append_iter(), dee_filter_model_prepend_iter(),
* dee_filter_model_insert_iter(), and dee_filter_model_insert_iter_before().
*
* The iteration over the original model is purposely left to the map func
* in order to allow optimized iterations if the the caller has a priori
* knowledge of the sorting and grouping of the data in the original model.
* @callback
* @param origModel The model containing the original data to filter
* @param filterModel The model that will contain the filtered results. The filter func must iterate over `orig_model` and add all relevant rows to `filter_model`. This model is guaranteed to be empty when the filter func is invoked
*/
interface FilterMapFunc {
(origModel: Model, filterModel: FilterModel): void
}
/**
* Callback invoked when a row is added to `orig_model`. To add rows to
* `filter_model` use the methods dee_filter_model_append_iter(),
* dee_filter_model_prepend_iter(), dee_filter_model_insert_iter(),
* and dee_filter_model_insert_iter_before().
* @callback
* @param origModel The model containing the added row
* @param origIter A #DeeModelIter pointing to the new row in `orig_model`
* @param filterModel The model that was also passed to the #DeeModelMapFunc of the #DeeFilter this functions is a part of
*/
interface FilterMapNotify {
(origModel: Model, origIter: ModelIter, filterModel: FilterModel): boolean
}
/**
* The signature of the function passed to dee_index_foreach().
*
* Be cautious if you plan on modifying the rows in the model via the
* DeeModelIter<!-- -->s you find. Your code may have to be reentrant since
* the index may change in reaction to the changes in the model. It's not
* impossible to do this in a non-broken manner, but it may likely require
* you calling dee_model_freeze_signals() and dee_model_thaw_signals() at
* strategic points.
* @callback
* @param key A key in the index being traversed
* @param rows A #DeeResultSet. Do not free or modify.
*/
interface IndexIterFunc {
(key: string, rows: ResultSet): boolean
}
/**
* Extracts a string from a row in a model.
* @callback
* @param model The model being indexed
* @param iter The row to extract terms for
*/
interface ModelReaderFunc {
(model: Model, iter: ModelIter): string
}
interface SerializableParseFunc {
(data: GLib.Variant): GObject.Object
}
/**
* A term filter takes a list of terms and runs it through a filtering and/or
* set of transformations and stores the output in a #DeeTermList.
*
* You can register term filters on a #DeeAnalyzer with
* dee_analyzer_add_term_filter().
* @callback
* @param termsIn A #DeeTermList with the terms to filter
* @param termsOut A #DeeTermList to write the filtered terms to
*/
interface TermFilterFunc {
(termsIn: TermList, termsOut: TermList): void
}
interface Model_ConstructProps extends GObject.Object_ConstructProps {
}
/**
* Signal callback interface for `changeset-finished`
*/
interface Model_ChangesetFinishedSignalCallback {
(): void
}
/**
* Signal callback interface for `changeset-started`
*/
interface Model_ChangesetStartedSignalCallback {
(): void
}
/**
* Signal callback interface for `row-added`
*/
interface Model_RowAddedSignalCallback {
(iter: ModelIter): void
}
/**
* Signal callback interface for `row-changed`
*/
interface Model_RowChangedSignalCallback {
(iter: ModelIter): void
}
/**
* Signal callback interface for `row-removed`
*/
interface Model_RowRemovedSignalCallback {
(iter: ModelIter): void
}
interface Model {
// Owm methods of Dee-1.0.Dee.Model
/**
* Like dee_model_append() but intended for language bindings or
* situations where you work with models on a meta level and may not have
* a prior knowledge of the column schemas of the models. See also
* dee_model_build_row().
* @param rowMembers An array of #GVariants with type signature matching those of the column schemas of `self`. If any of the variants have floating references they will be consumed
*/
appendRow(rowMembers: GLib.Variant[]): ModelIter
/**
* Notify listeners that the model is about to be changed, which means that
* multiple row additions / changes / removals will follow.
* The default implementation of this method will emit
* the ::changeset-started signal.
*
* It is not stricly necessary to enclose every change to a model
* in a dee_model_begin_changeset() and dee_model_end_changeset() calls, but
* doing so is highly recommended and allows implementing various optimizations.
*
* The usual way to perform multiple changes to a model is as follows:
*
* <programlisting>
* void update_model (DeeModel *model)
* {
* GVariant **added_row_data1 = ...;
* GVariant **added_row_data2 = ...;
*
* dee_model_begin_changeset (model);
*
* dee_model_remove (model, dee_model_get_first_iter (model));
* dee_model_append_row (model, added_row_data1);
* dee_model_append_row (model, added_row_data2);
*
* dee_model_end_changeset (model);
* }
* </programlisting>
*/
beginChangeset(): void
/**
* Removes all rows in the model. Signals are emitted for each row in the model
*/
clear(): void
/**
* This method is purely syntactic sugar for calling dee_model_set_tag() with
* a `value` of %NULL. It's included in order to help developers write more
* readable code.
* @param iter The row to clear the tag from
* @param tag The tag to clear from `iter`
*/
clearTag(iter: ModelIter, tag: ModelTag): void
/**
* Notify listeners that all changes have been committed to the model.
* The default implementation of this method will emit
* the ::changeset-finished signal.
*
* See also dee_model_begin_changeset().
*/
endChangeset(): void
/**
* Finds a row in `self` according to the sorting specified by `cmp_func`.
* This method will assume that `self` is already sorted by `cmp_func`.
*
* If you use this method for searching you should only use
* dee_model_insert_row_sorted() to insert rows in the model.
* @param rowSpec An array of #GVariants with type signature matching those of the column schemas of `self`. No references will be taken on the variants.
* @param cmpFunc Callback used for comparison or rows
*/
findRowSorted(rowSpec: GLib.Variant[], cmpFunc: CompareRowFunc): [ /* returnType */ ModelIter, /* outWasFound */ boolean ]
/**
* Like dee_model_find_row_sorted(), but uses DeeCompareRowSizedFunc and
* therefore doesn't cause trouble when used from introspected languages.
*
* Finds a row in `self` according to the sorting specified by `cmp_func`.
* This method will assume that `self` is already sorted by `cmp_func`.
*
* If you use this method for searching you should only use
* dee_model_insert_row_sorted() (or dee_model_insert_row_sorted_with_sizes())
* to insert rows in the model.
* @param rowSpec An array of #GVariants with type signature matching those of the column schemas of `self`. No references will be taken on the variants.
* @param cmpFunc Callback used for comparison or rows
*/
findRowSortedWithSizes(rowSpec: GLib.Variant[], cmpFunc: CompareRowSizedFunc): [ /* returnType */ ModelIter, /* outWasFound */ boolean ]
getBool(iter: ModelIter, column: number): boolean
/**
* Get the column index of a column.
* @param columnName the column name to retrieve the index of
*/
getColumnIndex(columnName: string): number
/**
* Get a %NULL-terminated array of column names for the columns of `self`.
* These names can be used in calls to dee_model_build_named_row().
*/
getColumnNames(): string[]
/**
* Get the #GVariant signature of a column
* @param column the column to get retrieve the #GVariant type string of
*/
getColumnSchema(column: number): string
getDouble(iter: ModelIter, column: number): number
/**
* Get the #GVariant signature of field previously registered with
* dee_model_register_vardict_schema().
* @param fieldName name of vardict field to get schema of
*/
getFieldSchema(fieldName: string): [ /* returnType */ string, /* outColumn */ number ]
/**
* Retrieves a #DeeModelIter representing the first row in `self`.
*/
getFirstIter(): ModelIter
getInt32(iter: ModelIter, column: number): number
getInt64(iter: ModelIter, column: number): number
/**
* Retrieves a #DeeModelIter representing the row at the given index.
*
* Note that this method does not have any performance guarantees. In particular
* it is not guaranteed to be <emphasis>O(1)</emphasis>.
* @param row position of the row to retrieve
*/
getIterAtRow(row: number): ModelIter
/**
* Retrieves a #DeeModelIter pointing right <emphasis>after</emphasis> the
* last row in `self`. This is refered to also the the
* <emphasis>end iter</emphasis>.
*
* As with other iters the end iter, in particular, is stable over inserts,
* changes, or removals.
*/
getLastIter(): ModelIter
/**
* Gets the number of columns in `self`
*/
getNColumns(): number
/**
* Gets the number of rows in `self`
*/
getNRows(): number
/**
* Get the numeric offset of `iter` into `self`. Note that this method is
* <emphasis>not</emphasis> guaranteed to be <emphasis>O(1)</emphasis>.
* @param iter The iter to get the position of
*/
getPosition(iter: ModelIter): number
getRow(iter: ModelIter): [ /* returnType */ GLib.Variant[], /* outRowMembers */ GLib.Variant[] ]
/**
* Get a %NULL-terminated array of #GVariant type strings that defines the
* required formats for the columns of `self`.
*/
getSchema(): string[]
getString(iter: ModelIter, column: number): string
/**
* Look up a tag value for a given row in a model. This method is guaranteed
* to be O(1).
* @param iter A #DeeModelIter pointing to the row to get the tag from
* @param tag The tag handle to retrieve the tag value for
*/
getTag(iter: ModelIter, tag: ModelTag): object | null
getUchar(iter: ModelIter, column: number): number
getUint32(iter: ModelIter, column: number): number
getUint64(iter: ModelIter, column: number): number
getValue(iter: ModelIter, column: number): GLib.Variant
getValueByName(iter: ModelIter, columnName: string): GLib.Variant
/**
* Get a schema for variant dictionary column previously registered using
* dee_model_register_vardict_schema().
* @param column the column index to get the schemas for
*/
getVardictSchema(column: number): GLib.HashTable
/**
* As dee_model_insert(), but intended for language bindings or
* situations where you work with models on a meta level and may not have
* a priori knowledge of the column schemas of the models. See also
* dee_model_build_row().
* @param pos The index to insert the row on. The existing row will be pushed down.
* @param rowMembers An array of #GVariants with type signature matching those of the column schemas of `self`. If any of the variants have floating references they will be consumed.
*/
insertRow(pos: number, rowMembers: GLib.Variant[]): ModelIter
/**
* As dee_model_insert_before(), but intended for language bindings or
* situations where you work with models on a meta level and may not have
* a priori knowledge of the column schemas of the models. See also
* dee_model_build_row().
* @param iter An iter pointing to the row before which to insert the new one
* @param rowMembers An array of #GVariants with type signature matching those of the column schemas of `self`. If any of the variants have floating references they will be consumed.
*/
insertRowBefore(iter: ModelIter, rowMembers: GLib.Variant[]): ModelIter
/**
* Inserts a row in `self` according to the sorting specified by `cmp_func`.
* If you use this method for insertion you should not use other methods as this
* method assumes the model to be already sorted by `cmp_func`.
* @param rowMembers An array of #GVariants with type signature matching those of the column schemas of `self`. If any of the variants have floating references they will be consumed.
* @param cmpFunc Callback used for comparison or rows
*/
insertRowSorted(rowMembers: GLib.Variant[], cmpFunc: CompareRowFunc): ModelIter
/**
* Inserts a row in `self` according to the sorting specified by `cmp_func`.
* If you use this method for insertion you should not use other methods as this
* method assumes the model to be already sorted by `cmp_func`.
* @param rowMembers An array of #GVariants with type signature matching those of the column schemas of `self`. If any of the variants have floating references they will be consumed.
* @param cmpFunc Callback used for comparison or rows
*/
insertRowSortedWithSizes(rowMembers: GLib.Variant[], cmpFunc: CompareRowSizedFunc): ModelIter
/**
* Checks if `iter` is the very first iter `self`.
* @param iter a #DeeModelIter
*/
isFirst(iter: ModelIter): boolean
/**
* Whether `iter` is the end iter of `self`. Note that the end iter points
* right <emphasis>after</emphasis> the last valid row in `self`.
* @param iter a #DeeModelIter
*/
isLast(iter: ModelIter): boolean
/**
* Returns a #DeeModelIter that points to the next position in the model.
* @param iter a #DeeModelIter
*/
next(iter: ModelIter): ModelIter
/**
* Like dee_model_prepend() but intended for language bindings or
* situations where you work with models on a meta level and may not have
* a priori knowledge of the column schemas of the models. See also
* dee_model_build_row().
* @param rowMembers An array of #GVariants with type signature matching those of the column schemas of `self`. If any of the variants have floating references they will be consumed.
*/
prependRow(rowMembers: GLib.Variant[]): ModelIter
/**
* Returns a #DeeModelIter that points to the previous position in the model.
* @param iter a #DeeModelIter
*/
prev(iter: ModelIter): ModelIter
/**
* Register a new tag on a #DeeModel. A <emphasis>tag</emphasis> is an extra
* value attached to a given row on a model. The tags are invisible to all
* that doesn't have the tag handle returned by this method. #DeeModel
* implementations must ensure that dee_model_get_tag() is an O(1) operation.
*
* Tags can be very useful in associating some extra data to a row in a model
* and have that automatically synced when the model changes. If you're
* writing a tiled view for a model you might want to tag each row with the
* tile widget for that row. That way you have very convenient access to the
* tile widget given any row in the model.
*
* The private nature of tags and the fact that you can store arbitrary pointers
* and binary data in them also means that they are not serialized if you
* utilize a model implementation that exposes the #DeeSerializable interface.
* @param tagDestroy Function called when a tagged row is removed from the model. This function will also be called on all tagged rows when the model is finalized.
*/
registerTag(tagDestroy: GLib.DestroyNotify): ModelTag
/**
* Register schema for fields in a model containing column with variant
* dictionary schema ('a{sv}').
* The keys registered with this function can be later used
* with dee_model_build_named_row() function, as well as
* dee_model_get_value_by_name(). Note that it is possible to register
* the same field name for multiple columns, in which case you need to use
* fully-qualified "column_name::field" name in the calls to
* dee_model_build_named_row() and dee_model_get_field_schema().
* @param column the column index to register the schemas with
* @param schemas hashtable with keys specifying names of the fields and values defining their schema
*/
registerVardictSchema(column: number, schemas: GLib.HashTable): void
/**
* Removes the row at the given position from the model.
* @param iter a #DeeModelIter pointing to the row to remove
*/
remove(iter: ModelIter): void
/**
* Set column names used by `self`.
* This method must be called exactly once, but only after setting
* a schema of the model. Note that some constructors will do this for you.
* @param columnNames A list of column names terminated by a %NULL
*/
setColumnNamesFull(columnNames: string[]): void
/**
* Sets all columns in the row `iter` points to, to those found in
* `row_members`. The variants in `row_members` must match the types defined in
* the model's schema.
* @param iter a #DeeModelIter
* @param rowMembers And array of #GVariant<!-- -->s with type signature matching those from the model schema. If any of the variants have floating references these will be consumed
*/
setRow(iter: ModelIter, rowMembers: GLib.Variant[]): void
/**
* Set the #GVariant types and the number of columns used by `self`.
* This method must be called exactly once before using `self`. Note that
* some constructors will do this for you.
* @param columnSchemas A list of #GVariant type strings terminated by a %NULL
*/
setSchemaFull(columnSchemas: string[]): void
/**
* Set a tag on a row in a model. This function is guaranteed to be O(1).
* See also dee_model_register_tag().
*
* If `tag` is already set on this row the existing tag value will be destroyed
* with the #GDestroyNotify passed to the dee_model_register_tag().
* @param iter The row to set the tag on
* @param tag The tag handle for the tag as obtained from dee_model_register_tag()
* @param value The value to set for `tag`. Note that %NULL represents an unset tag
*/
setTag(iter: ModelIter, tag: ModelTag, value: object | null): void
/**
* Sets the data in `column` for the row `iter` points to, to `value`. The type
* of `value` must be convertible to the type of the column.
*
* When this method call completes the model will emit ::row-changed. You can
* edit the model in place without triggering the change signals by calling
* dee_model_set_value_silently().
* @param iter a #DeeModelIter
* @param column column number to set the value
* @param value New value for cell. If `value` is a floating reference the model will assume ownership of the variant
*/
setValue(iter: ModelIter, column: number, value: GLib.Variant): void
// Own signals of Dee-1.0.Dee.Model
connect(sigName: "changeset-finished", callback: Model_ChangesetFinishedSignalCallback): number
on(sigName: "changeset-finished", callback: Model_ChangesetFinishedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "changeset-finished", callback: Model_ChangesetFinishedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "changeset-finished", callback: Model_ChangesetFinishedSignalCallback): NodeJS.EventEmitter
emit(sigName: "changeset-finished", ...args: any[]): void
connect(sigName: "changeset-started", callback: Model_ChangesetStartedSignalCallback): number
on(sigName: "changeset-started", callback: Model_ChangesetStartedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "changeset-started", callback: Model_ChangesetStartedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "changeset-started", callback: Model_ChangesetStartedSignalCallback): NodeJS.EventEmitter
emit(sigName: "changeset-started", ...args: any[]): void
connect(sigName: "row-added", callback: Model_RowAddedSignalCallback): number
on(sigName: "row-added", callback: Model_RowAddedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "row-added", callback: Model_RowAddedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "row-added", callback: Model_RowAddedSignalCallback): NodeJS.EventEmitter
emit(sigName: "row-added", ...args: any[]): void
connect(sigName: "row-changed", callback: Model_RowChangedSignalCallback): number
on(sigName: "row-changed", callback: Model_RowChangedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "row-changed", callback: Model_RowChangedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "row-changed", callback: Model_RowChangedSignalCallback): NodeJS.EventEmitter
emit(sigName: "row-changed", ...args: any[]): void
connect(sigName: "row-removed", callback: Model_RowRemovedSignalCallback): number
on(sigName: "row-removed", callback: Model_RowRemovedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "row-removed", callback: Model_RowRemovedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "row-removed", callback: Model_RowRemovedSignalCallback): NodeJS.EventEmitter
emit(sigName: "row-removed", ...args: any[]): void
// Class property signals of Dee-1.0.Dee.Model
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 Model extends GObject.Object {
// Own properties of Dee-1.0.Dee.Model
static name: string
static $gtype: GObject.GType<Model>
// Constructors of Dee-1.0.Dee.Model
constructor(config?: Model_ConstructProps)
_init(config?: Model_ConstructProps): void
}
interface ResourceManager_ConstructProps extends GObject.Object_ConstructProps {
}
interface ResourceManager {
// Owm methods of Dee-1.0.Dee.ResourceManager
/**
* Load a resource from persistent storage. The loaded resource will be of the
* same GType as when it was stored (provided that the same serialization and
* parse functions are registered).
*
* In case of an error the error will be in the #GFileError domain. Specifically
* if there is no resource with the name `resource_name` the error code will
* be #G_FILE_ERROR_NOENT.
*
* Important note: This call may do blocking IO. The resource manager must
* guarantee that this call is reasonably fast, like writing the externalized
* resource to a file, but not blocking IO over a network socket.
* @param resourceName The name of the resource to retrieve
*/
load(resourceName: string): GObject.Object
/**
* Store a resource under a given name. The resource manager must guarantee
* that the stored data survives system reboots and that you can recreate a
* copy of `resource` by calling dee_resource_manager_load() using the
* same `resource_name`.
*
* Important note: This call may do blocking IO. The resource manager must
* guarantee that this call is reasonably fast, like writing the externalized
* resource to a file, but not blocking IO over a network socket.
* @param resource A #DeeSerializable to store under `resource_name`
* @param resourceName The name to store the resource under. Will overwrite any existing resource with the same name
*/
store(resource: Serializable, resourceName: string): boolean
// Class property signals of Dee-1.0.Dee.ResourceManager
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 ResourceManager extends GObject.Object {
// Own properties of Dee-1.0.Dee.ResourceManager
static name: string
static $gtype: GObject.GType<ResourceManager>
// Constructors of Dee-1.0.Dee.ResourceManager
constructor(config?: ResourceManager_ConstructProps)
_init(config?: ResourceManager_ConstructProps): void
/**
* Get a pointer to the platform default #DeeResourceManager.
*/
static getDefault(): ResourceManager
}
interface ResultSet_ConstructProps extends GObject.Object_ConstructProps {
}
interface ResultSet {
// Owm methods of Dee-1.0.Dee.ResultSet
/**
* Get the model associated with a result set
*/
getModel(): Model
/**
* Get the number of #DeeModelIter<!-- -->s held in a #DeeResultSet.
*/
getNRows(): number
/**
* Check if a call to dee_result_set_next() will succeed.
*/
hasNext(): boolean
/**
* Get the current row from the result set and advance the cursor.
* To ensure that calls to this method will succeed you can call
* dee_result_set_has_next().
*
* To retrieve the current row without advancing the cursor call
* dee_result_set_peek() in stead of this method.
*/
next(): ModelIter
/**
* Get the row at the current cursor position.
*
* To retrieve the current row and advance the cursor position call
* dee_result_set_next() in stead of this method.
*/
peek(): ModelIter
/**
* Set the cursor position. Following calls to dee_result_set_peek()
* or dee_result_set_next() will read the row at position `pos`.
* @param pos The position to seek to
*/
seek(pos: number): void
/**
* Get the current position of the cursor.
*/
tell(): number
// Class property signals of Dee-1.0.Dee.ResultSet
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 ResultSet extends GObject.Object {
// Own properties of Dee-1.0.Dee.ResultSet
static name: string
static $gtype: GObject.GType<ResultSet>
// Constructors of Dee-1.0.Dee.ResultSet
constructor(config?: ResultSet_ConstructProps)
_init(config?: ResultSet_ConstructProps): void
}
interface Serializable_ConstructProps extends GObject.Object_ConstructProps {
}
interface Serializable {
// Owm methods of Dee-1.0.Dee.Serializable
/**
* Build an externalized form of `self` which can be used together with
* dee_serializable_parse_external() to rebuild a copy of `self`.
*
* It is important to note that the variant returned from this method does
* not have the same type signature as returned from a call to
* dee_serializable_serialize(). Externalization will wrap the serialized data
* in a container format with versioning information and headers with type
* information.
*/
externalize(): GLib.Variant
/**
* Build a clean serialized representation of `self`. The signature of the
* returned variant is entirely determined by the underlying implementation.
* You can recreate a serialized instance by calling dee_serializable_parse()
* provided that you know the correct #GType for the serialized instance.
*/
serialize(): GLib.Variant
// Class property signals of Dee-1.0.Dee.Serializable
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 Serializable extends GObject.Object {
// Own properties of Dee-1.0.Dee.Serializable
static name: string
static $gtype: GObject.GType<Serializable>
// Constructors of Dee-1.0.Dee.Serializable
constructor(config?: Serializable_ConstructProps)
_init(config?: Serializable_ConstructProps): void
/**
* Reconstruct a #DeeSerializable from #GVariant data. For this function
* to work you need to register a parser with
* dee_serializable_register_parser(). Any native Dee class will do so
* automatically.
*
* This method only works on data created with dee_serializable_serialize()
* and <emphasis>not</emphasis> with data from dee_serializable_externalize().
*
* Since a #DeeSerializableParseFunc is not allowed to fail - by contract -
* it can be guaranteed that this function only returns %NULL in case there
* is no known parser for `type` and #GVariant signature of `data`.
* @param data The #GVariant data to parse. If this is a floating reference it will be consumed
* @param type The #GType of the class to instantiate from `data`
*/
static parse(data: GLib.Variant, type: GObject.GType): GObject.Object
/**
* Reconstruct a #DeeSerializable from #GVariant data. For this function
* to work you need to register a parser with
* dee_serializable_register_parser(). Any native Dee class will do so
* automatically.
*
* This method only works on data created with dee_serializable_externalize()
* and <emphasis>not</emphasis> with data from dee_serializable_serialize().
*
* Since a #DeeSerializableParseFunc is not allowed to fail - by contract -
* it can be guaranteed that this function only returns %NULL in case there
* is no known parser for the #GType or #GVariant signature of `data`.
* @param data The #GVariant data to parse
*/
static parseExternal(data: GLib.Variant): GObject.Object
}
interface Analyzer_ConstructProps extends GObject.Object_ConstructProps {
}
interface Analyzer {
// Owm methods of Dee-1.0.Dee.Analyzer
/**
* Register a #DeeTermFilterFunc to be called whenever dee_analyzer_analyze()
* is called.
*
* Term filters can be used to normalize, add, or remove terms from an input
* data stream.
* @param filterFunc Function to call
*/
addTermFilter(filterFunc: TermFilterFunc): void
/**
* Extract terms and or collation keys from some input data (which is normally,
* but not necessarily, a UTF-8 string).
*
* The terms and corresponding collation keys will be written in order to the
* provided #DeeTermList<!-- -->s.
*
* Implementation notes for subclasses:
* The analysis process must call dee_analyzer_tokenize() and run the tokens
* through all term filters added with dee_analyzer_add_term_filter().
* Collation keys must be generated with dee_analyzer_collate_key().
* @param data The input data to analyze
* @param termsOut A #DeeTermList to place the generated terms in. If %NULL to terms are generated
* @param colkeysOut A #DeeTermList to place generated collation keys in. If %NULL no collation keys are generated
*/
analyze(data: string, termsOut: TermList | null, colkeysOut: TermList | null): void
/**
* Compare collation keys generated by dee_analyzer_collate_key() with similar
* semantics as strcmp(). See also dee_analyzer_collate_cmp_func() if you
* need a version of this function that works as a #GCompareDataFunc.
*
* The default implementation in #DeeAnalyzer just uses strcmp().
* @param key1 The first collation key to compare
* @param key2 The second collation key to compare
*/
collateCmp(key1: string, key2: string): number
/**
* Generate a collation key for a set of input data (usually a UTF-8 string
* passed through tokenization and term filters of the analyzer).
*
* The default implementation just calls g_strdup().
* @param data The input data to generate a collation key for
*/
collateKey(data: string): string
/**
* Tokenize some input data (which is normally, but not necessarily,
* a UTF-8 string).
*
* Tokenization splits the input data into constituents (in most cases words),
* but does not run it through any of the term filters set for the analyzer.
* It is undefined if the tokenization process itself does any normalization.
* @param data The input data to analyze
* @param termsOut A #DeeTermList to place the generated tokens in.
*/
tokenize(data: string, termsOut: TermList): void
// Class property signals of Dee-1.0.Dee.Analyzer
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
}
/**
* All fields in the DeeAnalyzer structure are private and should never be
* accessed directly