@girs/amtk-5 4.3.0 → 4.4.0

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/amtk-5)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Amtk-5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.3.0.
8
+ GJS TypeScript type definitions for Amtk-5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
9
 
10
10
  ## Install
11
11
 
@@ -87,6 +87,23 @@ export interface Widgets {
87
87
  /** Every GType this namespace can create. A consumer derives its own tag map. */
88
88
  export type WidgetGType = keyof Widgets;
89
89
 
90
+ // ---------------------------------------------------------------------------
91
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
92
+ //
93
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
94
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
95
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
96
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
97
+ // more rows in `Widgets`: concatenate them when you mean both.
98
+ // ---------------------------------------------------------------------------
99
+
100
+ export interface ChildHolders {
101
+
102
+ }
103
+
104
+ /** Every GType this namespace holds a child in without it being a widget. */
105
+ export type ChildHolderGType = keyof ChildHolders;
106
+
90
107
  /** The writable, optional, GObject-keyed property surface of one GType. */
91
108
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
92
109
 
@@ -122,6 +139,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
122
139
  /** Widget GType -> every declaration its members come from, self first. */
123
140
  export const DECLS: Readonly<Record<string, readonly string[]>>;
124
141
 
142
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
143
+ export const CHILD_HOLDERS: readonly string[];
144
+
125
145
  /** Enum GType -> the nicks this surface offers. */
126
146
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
127
147
 
package/amtk-5-surface.js CHANGED
@@ -18,6 +18,12 @@ export const DECLS = {
18
18
  AmtkTreeViewScrolledWindowSizing: ['AmtkTreeViewScrolledWindowSizing', 'GtkScrolledWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
19
19
  };
20
20
 
21
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
22
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
23
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
24
+ // from a list — the count is in the provenance line above.
25
+ export const CHILD_HOLDERS = [];
26
+
21
27
  export const ENUM_NICKS = {};
22
28
 
23
29
  export const SLOT_CANDIDATES = {};
package/amtk-5.d.ts CHANGED
@@ -345,12 +345,16 @@ export namespace Amtk {
345
345
  emit(signal: string, ...args: any[]): void;
346
346
 
347
347
  // Static methods
348
+ /**
349
+ * @since 3.0
350
+ */
348
351
  static get_singleton(): ActionInfoCentralStore;
349
352
 
350
353
  // Methods
351
354
  /**
352
355
  * @param action_name an action name.
353
356
  * @returns the found {@link Amtk.ActionInfo}, or `null`.
357
+ * @since 2.0
354
358
  */
355
359
  lookup(action_name: string): ActionInfo;
356
360
  }
@@ -406,6 +410,7 @@ export namespace Amtk {
406
410
  * {@link Amtk.ActionInfo} with the same action name. The stores take their own
407
411
  * reference on `info`.
408
412
  * @param info an {@link Amtk.ActionInfo}.
413
+ * @since 2.0
409
414
  */
410
415
  add(info: ActionInfo): void;
411
416
 
@@ -418,6 +423,7 @@ export namespace Amtk {
418
423
  * An API similar to `g_action_map_add_action_entries()`.
419
424
  * @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
420
425
  * @param translation_domain a gettext domain, or `null`.
426
+ * @since 2.0
421
427
  */
422
428
  add_entries(entries: ActionInfoEntry[], translation_domain: string | null): void;
423
429
 
@@ -429,12 +435,14 @@ export namespace Amtk {
429
435
  * You probably want to call this function on the application store after
430
436
  * creating the menu and toolbar. But it can also be useful for a store provided
431
437
  * by a library, to easily see which actions are not used by the application.
438
+ * @since 2.0
432
439
  */
433
440
  check_all_used(): void;
434
441
 
435
442
  /**
436
443
  * @param action_name an action name.
437
444
  * @returns the found {@link Amtk.ActionInfo}, or `null`.
445
+ * @since 2.0
438
446
  */
439
447
  lookup(action_name: string): ActionInfo;
440
448
 
@@ -462,6 +470,7 @@ export namespace Amtk {
462
470
  * {@link Amtk.Factory}, containing information about actions that are not added to any
463
471
  * menu or toolbar.
464
472
  * @param application a {@link Gtk.Application}.
473
+ * @since 5.0
465
474
  */
466
475
  set_all_accels_to_app(application: Gtk.Application): void;
467
476
  }
@@ -546,6 +555,7 @@ export namespace Amtk {
546
555
  * are added to the default {@link Gtk.RecentManager} with
547
556
  * `gtk_recent_manager_add_item()`, the files will normally show up in the
548
557
  * {@link Gtk.RecentChooserMenu}.
558
+ * @since 5.6
549
559
  */
550
560
  static create_open_recent_menu_base(): Gtk.RecentChooserMenu;
551
561
 
@@ -553,6 +563,7 @@ export namespace Amtk {
553
563
  * Returns the {@link Amtk.ApplicationWindow} of `gtk_window`. The returned object is
554
564
  * guaranteed to be the same for the lifetime of `gtk_window`.
555
565
  * @param gtk_window a {@link Gtk.ApplicationWindow}.
566
+ * @since 2.0
556
567
  */
557
568
  static get_from_gtk_application_window(gtk_window: Gtk.ApplicationWindow): ApplicationWindow;
558
569
 
@@ -566,6 +577,7 @@ export namespace Amtk {
566
577
  * So `amtk_menu_item_set_long_description()` must have been called, which is the
567
578
  * case if the {@link Gtk.MenuItem} has been created with {@link Amtk.Factory}.
568
579
  * @param menu_shell a {@link Gtk.MenuShell}.
580
+ * @since 2.0
569
581
  */
570
582
  connect_menu_to_statusbar(menu_shell: Gtk.MenuShell): void;
571
583
 
@@ -577,6 +589,7 @@ export namespace Amtk {
577
589
  * The full path is retrieved with
578
590
  * `amtk_utils_recent_chooser_menu_get_item_uri()`.
579
591
  * @param menu a {@link Gtk.RecentChooserMenu}.
592
+ * @since 2.0
580
593
  */
581
594
  connect_recent_chooser_menu_to_statusbar(menu: Gtk.RecentChooserMenu): void;
582
595
 
@@ -592,6 +605,7 @@ export namespace Amtk {
592
605
  * `g_application_open()` is called (with an empty hint), so the {@link Gio.Application}
593
606
  * must have the {@link Gio.ApplicationFlags.HANDLES_OPEN} flag set.
594
607
  * @returns a new {@link Gtk.RecentChooserMenu}.
608
+ * @since 3.0
595
609
  */
596
610
  create_open_recent_menu(): Gtk.Widget;
597
611
 
@@ -600,22 +614,26 @@ export namespace Amtk {
600
614
  * submenu. The {@link Gtk.RecentChooserMenu} is created with
601
615
  * `amtk_application_window_create_open_recent_menu()`.
602
616
  * @returns a new {@link Gtk.MenuItem}.
617
+ * @since 2.0
603
618
  */
604
619
  create_open_recent_menu_item(): Gtk.Widget;
605
620
 
606
621
  /**
607
622
  * @returns the {@link Gtk.ApplicationWindow} of `amtk_window`.
623
+ * @since 2.0
608
624
  */
609
625
  get_application_window(): Gtk.ApplicationWindow;
610
626
 
611
627
  /**
612
628
  * @returns the {@link Amtk.ApplicationWindow.statusbar}.
629
+ * @since 2.0
613
630
  */
614
631
  get_statusbar(): Gtk.Statusbar | null;
615
632
 
616
633
  /**
617
634
  * Sets the {@link Amtk.ApplicationWindow.statusbar} property.
618
635
  * @param statusbar a {@link Gtk.Statusbar}, or `null`.
636
+ * @since 2.0
619
637
  */
620
638
  set_statusbar(statusbar: Gtk.Statusbar | null): void;
621
639
  }
@@ -707,6 +725,7 @@ export namespace Amtk {
707
725
  * information.
708
726
  * @param action_name an action name.
709
727
  * @returns a new {@link Gtk.CheckMenuItem} for `action_name`.
728
+ * @since 3.0
710
729
  */
711
730
  create_check_menu_item(action_name: string): Gtk.Widget;
712
731
 
@@ -722,6 +741,7 @@ export namespace Amtk {
722
741
  * @param action_name an action name.
723
742
  * @param flags {@link Amtk.FactoryFlags}.
724
743
  * @returns a new {@link Gtk.CheckMenuItem} for `action_name`.
744
+ * @since 3.0
725
745
  */
726
746
  create_check_menu_item_full(action_name: string, flags: FactoryFlags): Gtk.Widget;
727
747
 
@@ -730,6 +750,7 @@ export namespace Amtk {
730
750
  * {@link Amtk.Factory.default_flags}.
731
751
  * @param action_name an action name.
732
752
  * @returns a new {@link Gio.MenuItem} for `action_name`.
753
+ * @since 5.0
733
754
  */
734
755
  create_gmenu_item(action_name: string): Gio.MenuItem;
735
756
 
@@ -742,6 +763,7 @@ export namespace Amtk {
742
763
  * @param action_name an action name.
743
764
  * @param flags {@link Amtk.FactoryFlags}.
744
765
  * @returns a new {@link Gio.MenuItem} for `action_name`.
766
+ * @since 5.0
745
767
  */
746
768
  create_gmenu_item_full(action_name: string, flags: FactoryFlags): Gio.MenuItem;
747
769
 
@@ -750,6 +772,7 @@ export namespace Amtk {
750
772
  * {@link Amtk.Factory.default_flags}.
751
773
  * @param action_name an action name.
752
774
  * @returns a new {@link Gtk.MenuItem} for `action_name`.
775
+ * @since 3.0
753
776
  */
754
777
  create_menu_item(action_name: string): Gtk.Widget;
755
778
 
@@ -759,6 +782,7 @@ export namespace Amtk {
759
782
  * @param action_name an action name.
760
783
  * @param flags {@link Amtk.FactoryFlags}.
761
784
  * @returns a new {@link Gtk.MenuItem} for `action_name`.
785
+ * @since 3.0
762
786
  */
763
787
  create_menu_item_full(action_name: string, flags: FactoryFlags): Gtk.Widget;
764
788
 
@@ -770,6 +794,7 @@ export namespace Amtk {
770
794
  * information.
771
795
  * @param action_name an action name.
772
796
  * @returns a new {@link Gtk.MenuToolButton} for `action_name`.
797
+ * @since 3.0
773
798
  */
774
799
  create_menu_tool_button(action_name: string): Gtk.MenuToolButton;
775
800
 
@@ -782,6 +807,7 @@ export namespace Amtk {
782
807
  * @param action_name an action name.
783
808
  * @param flags {@link Amtk.FactoryFlags}.
784
809
  * @returns a new {@link Gtk.MenuToolButton} for `action_name`.
810
+ * @since 3.0
785
811
  */
786
812
  create_menu_tool_button_full(action_name: string, flags: FactoryFlags): Gtk.MenuToolButton;
787
813
 
@@ -790,6 +816,7 @@ export namespace Amtk {
790
816
  * {@link Amtk.Factory.default_flags}.
791
817
  * @param action_name an action name.
792
818
  * @returns a new {@link Gtk.ShortcutsShortcut} for `action_name`.
819
+ * @since 5.0
793
820
  */
794
821
  create_shortcut(action_name: string): Gtk.Widget;
795
822
 
@@ -818,6 +845,7 @@ export namespace Amtk {
818
845
  * @param action_name an action name.
819
846
  * @param flags {@link Amtk.FactoryFlags}.
820
847
  * @returns a new {@link Gtk.ShortcutsShortcut} for `action_name`.
848
+ * @since 5.0
821
849
  */
822
850
  create_shortcut_full(action_name: string, flags: FactoryFlags): Gtk.Widget;
823
851
 
@@ -826,6 +854,7 @@ export namespace Amtk {
826
854
  * {@link Amtk.Factory.default_flags}.
827
855
  * @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
828
856
  * @returns a new simple {@link Gtk.Menu} for `entries`.
857
+ * @since 5.0
829
858
  */
830
859
  create_simple_menu(entries: ActionInfoEntry[]): Gtk.Widget;
831
860
 
@@ -845,6 +874,7 @@ export namespace Amtk {
845
874
  * @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
846
875
  * @param flags {@link Amtk.FactoryFlags}.
847
876
  * @returns a new simple {@link Gtk.Menu} for `entries`.
877
+ * @since 5.0
848
878
  */
849
879
  create_simple_menu_full(entries: ActionInfoEntry[], flags: FactoryFlags): Gtk.Widget;
850
880
 
@@ -853,6 +883,7 @@ export namespace Amtk {
853
883
  * {@link Amtk.Factory.default_flags}.
854
884
  * @param action_name an action name.
855
885
  * @returns a new {@link Gtk.ToolButton} for `action_name`.
886
+ * @since 3.0
856
887
  */
857
888
  create_tool_button(action_name: string): Gtk.ToolItem;
858
889
 
@@ -862,22 +893,26 @@ export namespace Amtk {
862
893
  * @param action_name an action name.
863
894
  * @param flags {@link Amtk.FactoryFlags}.
864
895
  * @returns a new {@link Gtk.ToolButton} for `action_name`.
896
+ * @since 3.0
865
897
  */
866
898
  create_tool_button_full(action_name: string, flags: FactoryFlags): Gtk.ToolItem;
867
899
 
868
900
  /**
869
901
  * @returns the {@link Amtk.Factory.application}.
902
+ * @since 3.0
870
903
  */
871
904
  get_application(): Gtk.Application | null;
872
905
 
873
906
  /**
874
907
  * @returns the {@link Amtk.Factory.default_flags}.
908
+ * @since 3.0
875
909
  */
876
910
  get_default_flags(): FactoryFlags;
877
911
 
878
912
  /**
879
913
  * Sets the {@link Amtk.Factory.default_flags} property.
880
914
  * @param default_flags the new value.
915
+ * @since 3.0
881
916
  */
882
917
  set_default_flags(default_flags: FactoryFlags): void;
883
918
  }
@@ -967,6 +1002,7 @@ export namespace Amtk {
967
1002
  * Returns the {@link Amtk.MenuShell} of `gtk_menu_shell`. The returned object is
968
1003
  * guaranteed to be the same for the lifetime of `gtk_menu_shell`.
969
1004
  * @param gtk_menu_shell a {@link Gtk.MenuShell}.
1005
+ * @since 2.0
970
1006
  */
971
1007
  static get_from_gtk_menu_shell(gtk_menu_shell: Gtk.MenuShell): MenuShell;
972
1008
 
@@ -986,6 +1022,7 @@ export namespace Amtk {
986
1022
  // Methods
987
1023
  /**
988
1024
  * @returns the {@link Gtk.MenuShell} of `amtk_menu_shell`.
1025
+ * @since 2.0
989
1026
  */
990
1027
  get_menu_shell(): Gtk.MenuShell;
991
1028
  }
@@ -1118,17 +1155,20 @@ export namespace Amtk {
1118
1155
  // Methods
1119
1156
  /**
1120
1157
  * @returns the current value of the {@link Amtk.TreeViewScrolledWindowSizing.monitor_limit_enabled} property.
1158
+ * @since 5.10
1121
1159
  */
1122
1160
  get_monitor_limit(): boolean;
1123
1161
 
1124
1162
  /**
1125
1163
  * @returns the {@link Gtk.TreeView}, if the child widget is a {@link Gtk.TreeView}. Otherwise `null` is returned.
1164
+ * @since 5.10
1126
1165
  */
1127
1166
  get_tree_view(): Gtk.TreeView | null;
1128
1167
 
1129
1168
  /**
1130
1169
  * Sets the {@link Amtk.TreeViewScrolledWindowSizing.monitor_limit_enabled} property.
1131
1170
  * @param monitor_limit the new value.
1171
+ * @since 5.10
1132
1172
  */
1133
1173
  set_monitor_limit(monitor_limit: boolean): void;
1134
1174
  }
@@ -1150,6 +1190,7 @@ export namespace Amtk {
1150
1190
  // Methods
1151
1191
  /**
1152
1192
  * @returns a copy of `info`. The copy will have a reference count of one.
1193
+ * @since 2.0
1153
1194
  */
1154
1195
  copy(): ActionInfo;
1155
1196
 
@@ -1158,16 +1199,19 @@ export namespace Amtk {
1158
1199
  * returns a `null`-terminated array, to be suitable for
1159
1200
  * `gtk_application_set_accels_for_action()`.
1160
1201
  * @returns a `null`-terminated array of accelerators in the format understood by `gtk_accelerator_parse()`.
1202
+ * @since 2.0
1161
1203
  */
1162
1204
  get_accels(): string[];
1163
1205
 
1164
1206
  /**
1165
1207
  * @returns the action name, or `null`. Example: `"win.save"`. Can be a detailed action name, see `g_action_parse_detailed_name()`.
1208
+ * @since 2.0
1166
1209
  */
1167
1210
  get_action_name(): string | null;
1168
1211
 
1169
1212
  /**
1170
1213
  * @returns the icon name, or `null`.
1214
+ * @since 2.0
1171
1215
  */
1172
1216
  get_icon_name(): string | null;
1173
1217
 
@@ -1175,11 +1219,13 @@ export namespace Amtk {
1175
1219
  * Gets the label. The label has normally a mnemonic. To remove the mnemonic,
1176
1220
  * there is the `amtk_utils_remove_mnemonic()` function.
1177
1221
  * @returns the label (i.e. a short description), or `null`.
1222
+ * @since 2.0
1178
1223
  */
1179
1224
  get_label(): string | null;
1180
1225
 
1181
1226
  /**
1182
1227
  * @returns the tooltip (i.e. a long description), or `null`.
1228
+ * @since 2.0
1183
1229
  */
1184
1230
  get_tooltip(): string | null;
1185
1231
 
@@ -1187,18 +1233,21 @@ export namespace Amtk {
1187
1233
  * Returns whether `info` has been used (for example by an {@link Amtk.Factory}
1188
1234
  * function). See also `amtk_action_info_store_check_all_used()`.
1189
1235
  * @returns whether `info` has been used.
1236
+ * @since 3.0
1190
1237
  */
1191
1238
  has_been_used(): boolean;
1192
1239
 
1193
1240
  /**
1194
1241
  * Mark `info` as used. An {@link Amtk.Factory} function that uses an {@link Amtk.ActionInfo}
1195
1242
  * should call this function. See `amtk_action_info_store_check_all_used()`.
1243
+ * @since 3.0
1196
1244
  */
1197
1245
  mark_as_used(): void;
1198
1246
 
1199
1247
  /**
1200
1248
  * Increments the reference count of `info` by one.
1201
1249
  * @returns the passed in `info`.
1250
+ * @since 2.0
1202
1251
  */
1203
1252
  ref(): ActionInfo;
1204
1253
 
@@ -1208,6 +1257,7 @@ export namespace Amtk {
1208
1257
  * `accels` must not be `null`, it must be a `null`-terminated array, to be
1209
1258
  * consistent with `gtk_application_set_accels_for_action()`.
1210
1259
  * @param accels a `null`-terminated array of accelerators in the format understood by `gtk_accelerator_parse()`.
1260
+ * @since 2.0
1211
1261
  */
1212
1262
  set_accels(accels: string[]): void;
1213
1263
 
@@ -1215,11 +1265,13 @@ export namespace Amtk {
1215
1265
  * Sets the action name, for example `"win.save"`. Can be a detailed action
1216
1266
  * name, see `g_action_parse_detailed_name()`.
1217
1267
  * @param action_name the action name.
1268
+ * @since 2.0
1218
1269
  */
1219
1270
  set_action_name(action_name: string): void;
1220
1271
 
1221
1272
  /**
1222
1273
  * @param icon_name the icon name, or `null`.
1274
+ * @since 2.0
1223
1275
  */
1224
1276
  set_icon_name(icon_name: string | null): void;
1225
1277
 
@@ -1227,17 +1279,20 @@ export namespace Amtk {
1227
1279
  * Sets the label with a mnemonic. To know how to encode the mnemonic, see the
1228
1280
  * documentation of `gtk_label_new_with_mnemonic()`.
1229
1281
  * @param label the label (i.e. a short description), or `null`.
1282
+ * @since 2.0
1230
1283
  */
1231
1284
  set_label(label: string | null): void;
1232
1285
 
1233
1286
  /**
1234
1287
  * @param tooltip the tooltip (i.e. a long description), or `null`.
1288
+ * @since 2.0
1235
1289
  */
1236
1290
  set_tooltip(tooltip: string | null): void;
1237
1291
 
1238
1292
  /**
1239
1293
  * Decrements the reference count of `info` by one. If the reference count drops
1240
1294
  * to 0, `info` is freed.
1295
+ * @since 2.0
1241
1296
  */
1242
1297
  unref(): void;
1243
1298
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/amtk-5",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for Amtk-5",
5
5
  "type": "module",
6
6
  "module": "amtk-5.js",
@@ -36,20 +36,20 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.3.0",
40
- "@girs/gtk-3.0": "^4.3.0",
41
- "@girs/xlib-2.0": "^4.3.0",
42
- "@girs/gdk-3.0": "^4.3.0",
43
- "@girs/cairo-1.0": "^4.3.0",
44
- "@girs/gobject-2.0": "^4.3.0",
45
- "@girs/glib-2.0": "^4.3.0",
46
- "@girs/pango-1.0": "^4.3.0",
47
- "@girs/harfbuzz-0.0": "^4.3.0",
48
- "@girs/freetype2-2.0": "^4.3.0",
49
- "@girs/gio-2.0": "^4.3.0",
50
- "@girs/gmodule-2.0": "^4.3.0",
51
- "@girs/gdkpixbuf-2.0": "^4.3.0",
52
- "@girs/atk-1.0": "^4.3.0" },
39
+ "@girs/gjs": "^4.4.0",
40
+ "@girs/gtk-3.0": "^4.4.0",
41
+ "@girs/xlib-2.0": "^4.4.0",
42
+ "@girs/gdk-3.0": "^4.4.0",
43
+ "@girs/cairo-1.0": "^4.4.0",
44
+ "@girs/gobject-2.0": "^4.4.0",
45
+ "@girs/glib-2.0": "^4.4.0",
46
+ "@girs/pango-1.0": "^4.4.0",
47
+ "@girs/harfbuzz-0.0": "^4.4.0",
48
+ "@girs/freetype2-2.0": "^4.4.0",
49
+ "@girs/gio-2.0": "^4.4.0",
50
+ "@girs/gmodule-2.0": "^4.4.0",
51
+ "@girs/gdkpixbuf-2.0": "^4.4.0",
52
+ "@girs/atk-1.0": "^4.4.0" },
53
53
  "devDependencies": {
54
54
  "typescript": "*"
55
55
  },