@gjsify/adwaita-nativescript 0.63.0 → 0.63.1-next.235

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.
Files changed (89) hide show
  1. package/lib/esm/builder/index.js +1 -1
  2. package/lib/esm/namespace/gtk.js +1 -1
  3. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  4. package/lib/esm/widgets/adw-data-grid.js +1 -1
  5. package/lib/esm/widgets/adw-split-button.js +1 -1
  6. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  7. package/lib/esm/widgets/adw-toggle.js +1 -1
  8. package/lib/esm/widgets/construct-props.js +1 -1
  9. package/lib/esm/widgets/gtk-box.js +1 -1
  10. package/lib/esm/widgets/gtk-enums.js +1 -1
  11. package/lib/esm/widgets/gtk-grid.js +1 -1
  12. package/lib/esm/widgets/gtk-list-box.js +1 -1
  13. package/lib/esm/widgets/gtk-window.js +1 -1
  14. package/lib/esm/widgets/index.js +1 -1
  15. package/lib/esm/widgets/shadowed-properties.js +1 -0
  16. package/lib/esm/widgets/signals.js +1 -1
  17. package/lib/esm/widgets/window-base.js +1 -1
  18. package/lib/esm/window-host.js +1 -1
  19. package/lib/esm/window-source.android.js +1 -1
  20. package/lib/esm/window-source.ios.js +1 -1
  21. package/lib/esm/window-source.js +1 -1
  22. package/lib/types/canvas2d/canvas2d-bridge.d.ts +4 -42
  23. package/lib/types/index.d.ts +1 -1
  24. package/lib/types/namespace/gtk.d.ts +1 -1
  25. package/lib/types/shadowed-properties.spec.d.ts +1 -0
  26. package/lib/types/testing/ns-core.d.mts +1 -1
  27. package/lib/types/widgets/adw-about-dialog.d.ts +8 -6
  28. package/lib/types/widgets/adw-action-row.d.ts +8 -6
  29. package/lib/types/widgets/adw-alert-dialog.d.ts +8 -6
  30. package/lib/types/widgets/adw-avatar.d.ts +8 -6
  31. package/lib/types/widgets/adw-banner.d.ts +8 -6
  32. package/lib/types/widgets/adw-bottom-sheet.d.ts +30 -16
  33. package/lib/types/widgets/adw-button-content.d.ts +8 -6
  34. package/lib/types/widgets/adw-carousel.d.ts +8 -6
  35. package/lib/types/widgets/adw-clamp.d.ts +8 -6
  36. package/lib/types/widgets/adw-data-grid.d.ts +26 -12
  37. package/lib/types/widgets/adw-header-bar.d.ts +8 -6
  38. package/lib/types/widgets/adw-image-button.d.ts +8 -6
  39. package/lib/types/widgets/adw-navigation-page.d.ts +8 -6
  40. package/lib/types/widgets/adw-navigation-view.d.ts +8 -6
  41. package/lib/types/widgets/adw-preferences-dialog.d.ts +8 -6
  42. package/lib/types/widgets/adw-preferences-group.d.ts +8 -6
  43. package/lib/types/widgets/adw-preferences-page.d.ts +8 -6
  44. package/lib/types/widgets/adw-shortcut-label.d.ts +8 -6
  45. package/lib/types/widgets/adw-sidebar.d.ts +8 -6
  46. package/lib/types/widgets/adw-slider-row.d.ts +8 -6
  47. package/lib/types/widgets/adw-spinner.d.ts +8 -6
  48. package/lib/types/widgets/adw-split-button.d.ts +30 -10
  49. package/lib/types/widgets/adw-status-page.d.ts +8 -6
  50. package/lib/types/widgets/adw-tab-view.d.ts +8 -6
  51. package/lib/types/widgets/adw-toast-overlay.d.ts +8 -6
  52. package/lib/types/widgets/adw-toggle-group.d.ts +8 -6
  53. package/lib/types/widgets/adw-toggle.d.ts +16 -8
  54. package/lib/types/widgets/adw-toolbar-view.d.ts +8 -6
  55. package/lib/types/widgets/adw-view-stack.d.ts +8 -6
  56. package/lib/types/widgets/adw-view-switcher-bar.d.ts +8 -6
  57. package/lib/types/widgets/adw-window-title.d.ts +8 -6
  58. package/lib/types/widgets/adw-wrap-box.d.ts +8 -6
  59. package/lib/types/widgets/carousel-indicator-base.d.ts +8 -6
  60. package/lib/types/widgets/construct-props.d.ts +9 -3
  61. package/lib/types/widgets/gtk-action-bar.d.ts +8 -6
  62. package/lib/types/widgets/gtk-box.d.ts +1 -1
  63. package/lib/types/widgets/gtk-button.d.ts +8 -6
  64. package/lib/types/widgets/gtk-drop-down.d.ts +8 -6
  65. package/lib/types/widgets/gtk-entry.d.ts +8 -6
  66. package/lib/types/widgets/gtk-enums.d.ts +8 -0
  67. package/lib/types/widgets/gtk-grid.d.ts +1 -1
  68. package/lib/types/widgets/gtk-image.d.ts +8 -6
  69. package/lib/types/widgets/gtk-label.d.ts +8 -6
  70. package/lib/types/widgets/gtk-list-box.d.ts +1 -1
  71. package/lib/types/widgets/gtk-popover-menu.d.ts +8 -6
  72. package/lib/types/widgets/gtk-stack.d.ts +8 -6
  73. package/lib/types/widgets/gtk-text-view.d.ts +8 -6
  74. package/lib/types/widgets/gtk-window.d.ts +12 -0
  75. package/lib/types/widgets/shadowed-properties.d.ts +99 -0
  76. package/lib/types/widgets/signals.d.ts +15 -6
  77. package/lib/types/widgets/split-view-base.d.ts +8 -6
  78. package/lib/types/widgets/stack-page.d.ts +8 -6
  79. package/lib/types/widgets/styled-layout-base.d.ts +8 -6
  80. package/lib/types/widgets/view-stack-page.d.ts +8 -6
  81. package/lib/types/widgets/view-switcher-base.d.ts +8 -6
  82. package/lib/types/widgets/widget-layout.d.ts +22 -19
  83. package/lib/types/widgets/window-base.d.ts +2 -0
  84. package/lib/types/window-host.d.ts +6 -0
  85. package/lib/types/window-source.android.d.ts +2 -0
  86. package/lib/types/window-source.d.ts +6 -0
  87. package/lib/types/window-source.ios.d.ts +2 -0
  88. package/package.json +14 -13
  89. package/src/testing/ns-core.mts +5 -3
@@ -5,6 +5,8 @@ declare const AdwCarouselIndicatorBase_base: (abstract new (...args: any[]) => {
5
5
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
6
6
  disconnect(handlerId: number): void;
7
7
  emit(eventName: string, ...args: unknown[]): void;
8
+ get_property(name: string): unknown;
9
+ set_property(name: string, value: unknown): void;
8
10
  get halign(): string;
9
11
  set halign(value: string | number);
10
12
  get valign(): string;
@@ -23,6 +25,12 @@ declare const AdwCarouselIndicatorBase_base: (abstract new (...args: any[]) => {
23
25
  set sensitive(value: boolean | string);
24
26
  get name(): string;
25
27
  set name(value: string | null);
28
+ get tooltipText(): string;
29
+ set tooltipText(value: string);
30
+ get widthRequest(): number;
31
+ set widthRequest(value: number | string);
32
+ get heightRequest(): number;
33
+ set heightRequest(value: number | string);
26
34
  set_direction(direction: number): void;
27
35
  get_direction(): number;
28
36
  get_first_child(): object | null;
@@ -31,12 +39,6 @@ declare const AdwCarouselIndicatorBase_base: (abstract new (...args: any[]) => {
31
39
  get_prev_sibling(): object | null;
32
40
  get_parent(): object | null;
33
41
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
34
- get tooltipText(): string;
35
- set tooltipText(value: string);
36
- get widthRequest(): number;
37
- set widthRequest(value: number | string);
38
- get heightRequest(): number;
39
- set heightRequest(value: number | string);
40
42
  _emit(eventName: string): void;
41
43
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
42
44
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -1,4 +1,5 @@
1
1
  import type { AdwAdjustmentInput, AdwListModelInput } from '@gjsify/adwaita-core';
2
+ import { type ShadowedName } from './shadowed-properties.js';
2
3
  /**
3
4
  * The keys a widget's construct-props bag accepts, derived from the widget itself.
4
5
  *
@@ -13,10 +14,15 @@ import type { AdwAdjustmentInput, AdwListModelInput } from '@gjsify/adwaita-core
13
14
  * measured to drop `size` as well — a getter/setter pair with different types does not
14
15
  * compare equal under it — and a type that silently loses real properties is worse than
15
16
  * one that admits two impossible ones and says so when they arrive.
17
+ *
18
+ * A name a NativeScript base owns (`shadowed-properties.ts`) is dropped whatever `T` inherits
19
+ * under it — read off `T`, `direction` would be NativeScript's layout direction — and comes
20
+ * back only through `Shadowed`, typed as the class's own `set_<p>` takes it:
21
+ * `ConstructProps<AdwSplitButton, { direction: number }>`. The applier routes it to that verb.
16
22
  */
17
- export type ConstructProps<T> = Partial<{
18
- [K in keyof T as T[K] extends (...args: never[]) => unknown ? never : K]: K extends EnumProp ? T[K] | number : K extends ValueProp ? T[K] | ValueProps[K & ValueProp] : T[K];
19
- }>;
23
+ export type ConstructProps<T, Shadowed extends object = object> = Partial<{
24
+ [K in keyof T as T[K] extends (...args: never[]) => unknown ? never : K extends ShadowedName | keyof Shadowed ? never : K]: K extends EnumProp ? T[K] | number : K extends ValueProp ? T[K] | ValueProps[K & ValueProp] : T[K];
25
+ } & Shadowed>;
20
26
  /**
21
27
  * The two properties whose SETTER takes a portable VALUE the getter does not hand back, and
22
28
  * what each one accepts.
@@ -5,6 +5,8 @@ declare const GtkActionBar_base: (abstract new (...args: any[]) => {
5
5
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
6
6
  disconnect(handlerId: number): void;
7
7
  emit(eventName: string, ...args: unknown[]): void;
8
+ get_property(name: string): unknown;
9
+ set_property(name: string, value: unknown): void;
8
10
  get halign(): string;
9
11
  set halign(value: string | number);
10
12
  get valign(): string;
@@ -23,6 +25,12 @@ declare const GtkActionBar_base: (abstract new (...args: any[]) => {
23
25
  set sensitive(value: boolean | string);
24
26
  get name(): string;
25
27
  set name(value: string | null);
28
+ get tooltipText(): string;
29
+ set tooltipText(value: string);
30
+ get widthRequest(): number;
31
+ set widthRequest(value: number | string);
32
+ get heightRequest(): number;
33
+ set heightRequest(value: number | string);
26
34
  set_direction(direction: number): void;
27
35
  get_direction(): number;
28
36
  get_first_child(): object | null;
@@ -31,12 +39,6 @@ declare const GtkActionBar_base: (abstract new (...args: any[]) => {
31
39
  get_prev_sibling(): object | null;
32
40
  get_parent(): object | null;
33
41
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
34
- get tooltipText(): string;
35
- set tooltipText(value: string);
36
- get widthRequest(): number;
37
- set widthRequest(value: number | string);
38
- get heightRequest(): number;
39
- set heightRequest(value: number | string);
40
42
  _emit(eventName: string): void;
41
43
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
42
44
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -25,7 +25,7 @@ export declare class GtkBox extends AdwStyledLayoutBase {
25
25
  * spacing at all.
26
26
  */
27
27
  addChild(view: View): void;
28
- insertChild(child: View, atIndex: number): void;
28
+ insertChild(child: View, atIndex: number): boolean;
29
29
  removeChild(view: View): void;
30
30
  /**
31
31
  * `gtk_box_insert_child_after`.
@@ -10,6 +10,8 @@ declare const GtkButton_base: (abstract new (...args: any[]) => {
10
10
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
11
11
  disconnect(handlerId: number): void;
12
12
  emit(eventName: string, ...args: unknown[]): void;
13
+ get_property(name: string): unknown;
14
+ set_property(name: string, value: unknown): void;
13
15
  get halign(): string;
14
16
  set halign(value: string | number);
15
17
  get valign(): string;
@@ -28,6 +30,12 @@ declare const GtkButton_base: (abstract new (...args: any[]) => {
28
30
  set sensitive(value: boolean | string);
29
31
  get name(): string;
30
32
  set name(value: string | null);
33
+ get tooltipText(): string;
34
+ set tooltipText(value: string);
35
+ get widthRequest(): number;
36
+ set widthRequest(value: number | string);
37
+ get heightRequest(): number;
38
+ set heightRequest(value: number | string);
31
39
  set_direction(direction: number): void;
32
40
  get_direction(): number;
33
41
  get_first_child(): object | null;
@@ -36,12 +44,6 @@ declare const GtkButton_base: (abstract new (...args: any[]) => {
36
44
  get_prev_sibling(): object | null;
37
45
  get_parent(): object | null;
38
46
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
39
- get tooltipText(): string;
40
- set tooltipText(value: string);
41
- get widthRequest(): number;
42
- set widthRequest(value: number | string);
43
- get heightRequest(): number;
44
- set heightRequest(value: number | string);
45
47
  _emit(eventName: string): void;
46
48
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
47
49
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -19,6 +19,8 @@ declare const GtkDropDown_base: (abstract new (...args: any[]) => {
19
19
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
20
20
  disconnect(handlerId: number): void;
21
21
  emit(eventName: string, ...args: unknown[]): void;
22
+ get_property(name: string): unknown;
23
+ set_property(name: string, value: unknown): void;
22
24
  get halign(): string;
23
25
  set halign(value: string | number);
24
26
  get valign(): string;
@@ -37,6 +39,12 @@ declare const GtkDropDown_base: (abstract new (...args: any[]) => {
37
39
  set sensitive(value: boolean | string);
38
40
  get name(): string;
39
41
  set name(value: string | null);
42
+ get tooltipText(): string;
43
+ set tooltipText(value: string);
44
+ get widthRequest(): number;
45
+ set widthRequest(value: number | string);
46
+ get heightRequest(): number;
47
+ set heightRequest(value: number | string);
40
48
  set_direction(direction: number): void;
41
49
  get_direction(): number;
42
50
  get_first_child(): object | null;
@@ -45,12 +53,6 @@ declare const GtkDropDown_base: (abstract new (...args: any[]) => {
45
53
  get_prev_sibling(): object | null;
46
54
  get_parent(): object | null;
47
55
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
48
- get tooltipText(): string;
49
- set tooltipText(value: string);
50
- get widthRequest(): number;
51
- set widthRequest(value: number | string);
52
- get heightRequest(): number;
53
- set heightRequest(value: number | string);
54
56
  _emit(eventName: string): void;
55
57
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
56
58
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -17,6 +17,8 @@ declare const GtkEntry_base: (abstract new (...args: any[]) => {
17
17
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
18
18
  disconnect(handlerId: number): void;
19
19
  emit(eventName: string, ...args: unknown[]): void;
20
+ get_property(name: string): unknown;
21
+ set_property(name: string, value: unknown): void;
20
22
  get halign(): string;
21
23
  set halign(value: string | number);
22
24
  get valign(): string;
@@ -35,6 +37,12 @@ declare const GtkEntry_base: (abstract new (...args: any[]) => {
35
37
  set sensitive(value: boolean | string);
36
38
  get name(): string;
37
39
  set name(value: string | null);
40
+ get tooltipText(): string;
41
+ set tooltipText(value: string);
42
+ get widthRequest(): number;
43
+ set widthRequest(value: number | string);
44
+ get heightRequest(): number;
45
+ set heightRequest(value: number | string);
38
46
  set_direction(direction: number): void;
39
47
  get_direction(): number;
40
48
  get_first_child(): object | null;
@@ -43,12 +51,6 @@ declare const GtkEntry_base: (abstract new (...args: any[]) => {
43
51
  get_prev_sibling(): object | null;
44
52
  get_parent(): object | null;
45
53
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
46
- get tooltipText(): string;
47
- set tooltipText(value: string);
48
- get widthRequest(): number;
49
- set widthRequest(value: number | string);
50
- get heightRequest(): number;
51
- set heightRequest(value: number | string);
52
54
  _emit(eventName: string): void;
53
55
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
54
56
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -5,6 +5,14 @@ export declare const PolicyType: Readonly<{
5
5
  readonly NEVER: 2;
6
6
  readonly EXTERNAL: 3;
7
7
  }>;
8
+ /** `Gtk.ArrowType`: `UP` 0, `DOWN` 1, `LEFT` 2, `RIGHT` 3, `NONE` 4 — `Adw.SplitButton:direction`. */
9
+ export declare const ArrowType: Readonly<{
10
+ readonly UP: 0;
11
+ readonly DOWN: 1;
12
+ readonly LEFT: 2;
13
+ readonly RIGHT: 3;
14
+ readonly NONE: 4;
15
+ }>;
8
16
  /** `Gtk.TextDirection`: `NONE` 0, `LTR` 1, `RTL` 2. */
9
17
  export declare const TextDirection: Readonly<{
10
18
  readonly NONE: 0;
@@ -27,7 +27,7 @@ export declare class GtkGrid extends AdwStyledLayoutBase {
27
27
  * are derived here.
28
28
  */
29
29
  addChild(view: View): void;
30
- insertChild(child: View, atIndex: number): void;
30
+ insertChild(child: View, atIndex: number): boolean;
31
31
  removeChild(view: View): void;
32
32
  /** `Gtk.Grid:row-spacing` — the gap between rows, in DIPs. */
33
33
  get rowSpacing(): number;
@@ -15,6 +15,8 @@ declare const GtkImage_base: (abstract new (...args: any[]) => {
15
15
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
16
16
  disconnect(handlerId: number): void;
17
17
  emit(eventName: string, ...args: unknown[]): void;
18
+ get_property(name: string): unknown;
19
+ set_property(name: string, value: unknown): void;
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;
@@ -33,6 +35,12 @@ declare const GtkImage_base: (abstract new (...args: any[]) => {
33
35
  set sensitive(value: boolean | string);
34
36
  get name(): string;
35
37
  set name(value: string | null);
38
+ get tooltipText(): string;
39
+ set tooltipText(value: string);
40
+ get widthRequest(): number;
41
+ set widthRequest(value: number | string);
42
+ get heightRequest(): number;
43
+ set heightRequest(value: number | string);
36
44
  set_direction(direction: number): void;
37
45
  get_direction(): number;
38
46
  get_first_child(): object | null;
@@ -41,12 +49,6 @@ declare const GtkImage_base: (abstract new (...args: any[]) => {
41
49
  get_prev_sibling(): object | null;
42
50
  get_parent(): object | null;
43
51
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
44
- get tooltipText(): string;
45
- set tooltipText(value: string);
46
- get widthRequest(): number;
47
- set widthRequest(value: number | string);
48
- get heightRequest(): number;
49
- set heightRequest(value: number | string);
50
52
  _emit(eventName: string): void;
51
53
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
52
54
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -5,6 +5,8 @@ declare const GtkLabel_base: (abstract new (...args: any[]) => {
5
5
  connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
6
6
  disconnect(handlerId: number): void;
7
7
  emit(eventName: string, ...args: unknown[]): void;
8
+ get_property(name: string): unknown;
9
+ set_property(name: string, value: unknown): void;
8
10
  get halign(): string;
9
11
  set halign(value: string | number);
10
12
  get valign(): string;
@@ -23,6 +25,12 @@ declare const GtkLabel_base: (abstract new (...args: any[]) => {
23
25
  set sensitive(value: boolean | string);
24
26
  get name(): string;
25
27
  set name(value: string | null);
28
+ get tooltipText(): string;
29
+ set tooltipText(value: string);
30
+ get widthRequest(): number;
31
+ set widthRequest(value: number | string);
32
+ get heightRequest(): number;
33
+ set heightRequest(value: number | string);
26
34
  set_direction(direction: number): void;
27
35
  get_direction(): number;
28
36
  get_first_child(): object | null;
@@ -31,12 +39,6 @@ declare const GtkLabel_base: (abstract new (...args: any[]) => {
31
39
  get_prev_sibling(): object | null;
32
40
  get_parent(): object | null;
33
41
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
34
- get tooltipText(): string;
35
- set tooltipText(value: string);
36
- get widthRequest(): number;
37
- set widthRequest(value: number | string);
38
- get heightRequest(): number;
39
- set heightRequest(value: number | string);
40
42
  _emit(eventName: string): void;
41
43
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
42
44
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -35,7 +35,7 @@ export declare class GtkListBox extends AdwStyledLayoutBase {
35
35
  get_row_at_index(index: number): View | null;
36
36
  /** Every path a row can enter by ends here, so the rows are numbered here. */
37
37
  addChild(view: View): void;
38
- insertChild(child: View, atIndex: number): void;
38
+ insertChild(child: View, atIndex: number): boolean;
39
39
  removeChild(view: View): void;
40
40
  /** XML inflation — every child is a row, whatever slot it names. */
41
41
  _addChildFromBuilder(_name: string, view: View): void;
@@ -8,6 +8,8 @@ declare const GtkPopoverMenu_base: (abstract new (...args: any[]) => {
8
8
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
9
9
  disconnect(handlerId: number): void;
10
10
  emit(eventName: string, ...args: unknown[]): void;
11
+ get_property(name: string): unknown;
12
+ set_property(name: string, value: unknown): void;
11
13
  get halign(): string;
12
14
  set halign(value: string | number);
13
15
  get valign(): string;
@@ -26,6 +28,12 @@ declare const GtkPopoverMenu_base: (abstract new (...args: any[]) => {
26
28
  set sensitive(value: boolean | string);
27
29
  get name(): string;
28
30
  set name(value: string | null);
31
+ get tooltipText(): string;
32
+ set tooltipText(value: string);
33
+ get widthRequest(): number;
34
+ set widthRequest(value: number | string);
35
+ get heightRequest(): number;
36
+ set heightRequest(value: number | string);
29
37
  set_direction(direction: number): void;
30
38
  get_direction(): number;
31
39
  get_first_child(): object | null;
@@ -34,12 +42,6 @@ declare const GtkPopoverMenu_base: (abstract new (...args: any[]) => {
34
42
  get_prev_sibling(): object | null;
35
43
  get_parent(): object | null;
36
44
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
37
- get tooltipText(): string;
38
- set tooltipText(value: string);
39
- get widthRequest(): number;
40
- set widthRequest(value: number | string);
41
- get heightRequest(): number;
42
- set heightRequest(value: number | string);
43
45
  _emit(eventName: string): void;
44
46
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
45
47
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -15,6 +15,8 @@ declare const GtkStack_base: (abstract new (...args: any[]) => {
15
15
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
16
16
  disconnect(handlerId: number): void;
17
17
  emit(eventName: string, ...args: unknown[]): void;
18
+ get_property(name: string): unknown;
19
+ set_property(name: string, value: unknown): void;
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;
@@ -33,6 +35,12 @@ declare const GtkStack_base: (abstract new (...args: any[]) => {
33
35
  set sensitive(value: boolean | string);
34
36
  get name(): string;
35
37
  set name(value: string | null);
38
+ get tooltipText(): string;
39
+ set tooltipText(value: string);
40
+ get widthRequest(): number;
41
+ set widthRequest(value: number | string);
42
+ get heightRequest(): number;
43
+ set heightRequest(value: number | string);
36
44
  set_direction(direction: number): void;
37
45
  get_direction(): number;
38
46
  get_first_child(): object | null;
@@ -41,12 +49,6 @@ declare const GtkStack_base: (abstract new (...args: any[]) => {
41
49
  get_prev_sibling(): object | null;
42
50
  get_parent(): object | null;
43
51
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
44
- get tooltipText(): string;
45
- set tooltipText(value: string);
46
- get widthRequest(): number;
47
- set widthRequest(value: number | string);
48
- get heightRequest(): number;
49
- set heightRequest(value: number | string);
50
52
  _emit(eventName: string): void;
51
53
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
52
54
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -17,6 +17,8 @@ declare const GtkTextView_base: (abstract new (...args: any[]) => {
17
17
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
18
18
  disconnect(handlerId: number): void;
19
19
  emit(eventName: string, ...args: unknown[]): void;
20
+ get_property(name: string): unknown;
21
+ set_property(name: string, value: unknown): void;
20
22
  get halign(): string;
21
23
  set halign(value: string | number);
22
24
  get valign(): string;
@@ -35,6 +37,12 @@ declare const GtkTextView_base: (abstract new (...args: any[]) => {
35
37
  set sensitive(value: boolean | string);
36
38
  get name(): string;
37
39
  set name(value: string | null);
40
+ get tooltipText(): string;
41
+ set tooltipText(value: string);
42
+ get widthRequest(): number;
43
+ set widthRequest(value: number | string);
44
+ get heightRequest(): number;
45
+ set heightRequest(value: number | string);
38
46
  set_direction(direction: number): void;
39
47
  get_direction(): number;
40
48
  get_first_child(): object | null;
@@ -43,12 +51,6 @@ declare const GtkTextView_base: (abstract new (...args: any[]) => {
43
51
  get_prev_sibling(): object | null;
44
52
  get_parent(): object | null;
45
53
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
46
- get tooltipText(): string;
47
- set tooltipText(value: string);
48
- get widthRequest(): number;
49
- set widthRequest(value: number | string);
50
- get heightRequest(): number;
51
- set heightRequest(value: number | string);
52
54
  _emit(eventName: string): void;
53
55
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
54
56
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -13,6 +13,7 @@ export declare class GtkWindow extends AdwSingleChildBase {
13
13
  private readonly _members;
14
14
  private readonly _closeRequest;
15
15
  private _unwatchForeground;
16
+ private _unwatchBack;
16
17
  constructor(props?: ConstructProps<GtkWindow>);
17
18
  onLoaded(): void;
18
19
  onUnloaded(): void;
@@ -38,6 +39,17 @@ export declare class GtkWindow extends AdwSingleChildBase {
38
39
  * it ends. Throws on iOS (no public API to end the root) before any handler runs.
39
40
  */
40
41
  close(): void;
42
+ private _requestClose;
43
+ /**
44
+ * What the back button does, in order: the topmost dialog, the innermost navigation view, then
45
+ * `close-request`. Always consumes the press — the system's own back would `finish()` too, but
46
+ * without asking the handlers.
47
+ */
48
+ private _handleBack;
49
+ /** A subclass that shows things over the window (dialogs) takes the press first; true = taken. */
50
+ protected _consumeBack(): boolean;
51
+ /** Only a window with no window above it owns the back button. */
52
+ private _isToplevel;
41
53
  connect(eventName: string, callback: (self: this, data: EventData) => unknown): number;
42
54
  /** `GtkWindow:title`. Held: a `Page` has no title bar of this window's to put it in. */
43
55
  get title(): string;
@@ -0,0 +1,99 @@
1
+ /** One GTK property name that a NativeScript base owns as something else. */
2
+ export interface ShadowedProperty {
3
+ /** The platform member the name lands on, and what it is there. */
4
+ readonly nativeScript: string;
5
+ /** GType names whose GTK property of this name the port implements through `get_<p>` / `set_<p>`. */
6
+ readonly routed: readonly string[];
7
+ /** GIR types declaring a property of this name the port does not implement. */
8
+ readonly refused: readonly string[];
9
+ }
10
+ export declare const SHADOWED_PROPERTIES: {
11
+ readonly columns: {
12
+ readonly nativeScript: "GridLayoutBase.columns — the column track spec ('auto,*'), setter-only";
13
+ readonly routed: readonly ["AdwDataGrid"];
14
+ readonly refused: readonly [];
15
+ };
16
+ readonly cssClasses: {
17
+ readonly nativeScript: "ViewBase.cssClasses — the Set the view's own class list lives in";
18
+ readonly routed: readonly [];
19
+ readonly refused: readonly ["GtkWidget"];
20
+ };
21
+ readonly direction: {
22
+ readonly nativeScript: "ViewCommon.direction — the CSS layout direction ('ltr' | 'rtl') margins resolve by";
23
+ readonly routed: readonly ["AdwSplitButton"];
24
+ readonly refused: readonly ["GtkMenuButton"];
25
+ };
26
+ readonly modal: {
27
+ readonly nativeScript: "ViewCommon.modal — the view this one was shown modally from, getter-only";
28
+ readonly routed: readonly ["AdwBottomSheet"];
29
+ readonly refused: readonly ["GtkWindow"];
30
+ };
31
+ readonly rows: {
32
+ readonly nativeScript: "GridLayoutBase.rows — the row track spec ('auto,*'), setter-only";
33
+ readonly routed: readonly ["AdwDataGrid"];
34
+ readonly refused: readonly [];
35
+ };
36
+ readonly visibility: {
37
+ readonly nativeScript: "View.visibility — 'visible' | 'hidden' | 'collapse'";
38
+ readonly routed: readonly [];
39
+ readonly refused: readonly ["GtkEntry"];
40
+ };
41
+ };
42
+ /** Every name {@link SHADOWED_PROPERTIES} decides. */
43
+ export type ShadowedName = keyof typeof SHADOWED_PROPERTIES;
44
+ /** A GTK property the NativeScript member of the same name already carries, and why that is enough. */
45
+ export interface SharedProperty {
46
+ /** The GIR type that declares it. */
47
+ readonly declarer: string;
48
+ readonly why: string;
49
+ }
50
+ export declare const SHARED_PROPERTIES: {
51
+ readonly marginBottom: {
52
+ readonly declarer: "GtkWidget";
53
+ readonly why: "View.marginBottom is the same outer spacing; a GTK pixel count is a valid NativeScript length.";
54
+ };
55
+ readonly marginTop: {
56
+ readonly declarer: "GtkWidget";
57
+ readonly why: "View.marginTop is the same outer spacing; a GTK pixel count is a valid NativeScript length.";
58
+ };
59
+ readonly opacity: {
60
+ readonly declarer: "GtkWidget";
61
+ readonly why: "View.opacity is the same 0..1 alpha.";
62
+ };
63
+ readonly orientation: {
64
+ readonly declarer: "GtkOrientable";
65
+ readonly why: "StackLayout.orientation takes the same two nicks, 'horizontal' and 'vertical'.";
66
+ };
67
+ };
68
+ /** How a GTK property name reaches a given object. */
69
+ export type GtkPropertyDoor = {
70
+ readonly kind: 'accessor';
71
+ } | {
72
+ readonly kind: 'verbs';
73
+ readonly get: string;
74
+ readonly set: string;
75
+ } | {
76
+ readonly kind: 'refused';
77
+ readonly why: string;
78
+ } | {
79
+ readonly kind: 'absent';
80
+ };
81
+ /**
82
+ * A GObject property name (`'can-close'`, `'can_close'`, `'canClose'`) in the camel case the
83
+ * port's members use — `propertyOf` from `@gjsify/adwaita-core/tags`, restated here so every
84
+ * widget importing `signals.js` does not reach adwaita-core through it.
85
+ */
86
+ export declare const camelProperty: (name: string) => string;
87
+ /**
88
+ * Where an assignment or read of the camel-case GTK property `prop` lands on `target`: the
89
+ * class's own accessor, its `get_<p>` / `set_<p>` pair, a refusal, or nowhere.
90
+ */
91
+ export declare function gtkPropertyDoor(target: object, prop: string): GtkPropertyDoor;
92
+ /** Whether {@link writeGtkProperty} has somewhere to put `prop`. */
93
+ export declare function hasGtkProperty(target: object, prop: string): boolean;
94
+ /** Why `prop` is refused on `target`, or `null` when it is not one of the shadowed names. */
95
+ export declare function gtkPropertyRefusal(target: object, prop: string): string | null;
96
+ /** Read the GTK property `prop`, through `get_<p>()` where the name is NativeScript's. */
97
+ export declare function readGtkProperty(target: object, prop: string): unknown;
98
+ /** Write the GTK property `prop`, through `set_<p>()` where the name is NativeScript's. */
99
+ export declare function writeGtkProperty(target: object, prop: string, value: unknown): void;
@@ -13,6 +13,13 @@ export interface GObjectSignals {
13
13
  disconnect(handlerId: number): void;
14
14
  /** `g_signal_emit_by_name`: run every handler `connect` added for `eventName`, with `args` in the payload. */
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
+ /**
17
+ * `g_object_get_property`: the GTK property `name` (`'can-close'` or camel case). A
18
+ * name NativeScript owns as something else is read through the class's `get_<p>()`.
19
+ */
20
+ get_property(name: string): unknown;
21
+ /** `g_object_set_property`, routed the same way as {@link get_property}. */
22
+ set_property(name: string, value: unknown): void;
16
23
  }
17
24
  /**
18
25
  * A constructor the mixin can wrap: anything that is an `Observable`, abstract or not.
@@ -34,6 +41,8 @@ export declare function withSignals<TBase extends ObservableConstructor>(Base: T
34
41
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
35
42
  disconnect(handlerId: number): void;
36
43
  emit(eventName: string, ...args: unknown[]): void;
44
+ get_property(name: string): unknown;
45
+ set_property(name: string, value: unknown): void;
37
46
  get halign(): string;
38
47
  set halign(value: string | number);
39
48
  get valign(): string;
@@ -52,6 +61,12 @@ export declare function withSignals<TBase extends ObservableConstructor>(Base: T
52
61
  set sensitive(value: boolean | string);
53
62
  get name(): string;
54
63
  set name(value: string | null);
64
+ get tooltipText(): string;
65
+ set tooltipText(value: string);
66
+ get widthRequest(): number;
67
+ set widthRequest(value: number | string);
68
+ get heightRequest(): number;
69
+ set heightRequest(value: number | string);
55
70
  set_direction(direction: number): void;
56
71
  get_direction(): number;
57
72
  get_first_child(): object | null;
@@ -60,12 +75,6 @@ export declare function withSignals<TBase extends ObservableConstructor>(Base: T
60
75
  get_prev_sibling(): object | null;
61
76
  get_parent(): object | null;
62
77
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
63
- get tooltipText(): string;
64
- set tooltipText(value: string);
65
- get widthRequest(): number;
66
- set widthRequest(value: number | string);
67
- get heightRequest(): number;
68
- set heightRequest(value: number | string);
69
78
  _emit(eventName: string): void;
70
79
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
71
80
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -14,6 +14,8 @@ declare const AdwSplitViewBase_base: (abstract new (...args: any[]) => {
14
14
  connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
15
15
  disconnect(handlerId: number): void;
16
16
  emit(eventName: string, ...args: unknown[]): void;
17
+ get_property(name: string): unknown;
18
+ set_property(name: string, value: unknown): void;
17
19
  get halign(): string;
18
20
  set halign(value: string | number);
19
21
  get valign(): string;
@@ -32,6 +34,12 @@ declare const AdwSplitViewBase_base: (abstract new (...args: any[]) => {
32
34
  set sensitive(value: boolean | string);
33
35
  get name(): string;
34
36
  set name(value: string | null);
37
+ get tooltipText(): string;
38
+ set tooltipText(value: string);
39
+ get widthRequest(): number;
40
+ set widthRequest(value: number | string);
41
+ get heightRequest(): number;
42
+ set heightRequest(value: number | string);
35
43
  set_direction(direction: number): void;
36
44
  get_direction(): number;
37
45
  get_first_child(): object | null;
@@ -40,12 +48,6 @@ declare const AdwSplitViewBase_base: (abstract new (...args: any[]) => {
40
48
  get_prev_sibling(): object | null;
41
49
  get_parent(): object | null;
42
50
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
43
- get tooltipText(): string;
44
- set tooltipText(value: string);
45
- get widthRequest(): number;
46
- set widthRequest(value: number | string);
47
- get heightRequest(): number;
48
- set heightRequest(value: number | string);
49
51
  _emit(eventName: string): void;
50
52
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
51
53
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;