@gjsify/adwaita-nativescript 0.62.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 (91) 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/application.js +1 -1
  9. package/lib/esm/widgets/construct-props.js +1 -1
  10. package/lib/esm/widgets/gtk-box.js +1 -1
  11. package/lib/esm/widgets/gtk-enums.js +1 -1
  12. package/lib/esm/widgets/gtk-grid.js +1 -1
  13. package/lib/esm/widgets/gtk-list-box.js +1 -1
  14. package/lib/esm/widgets/gtk-window.js +1 -1
  15. package/lib/esm/widgets/index.js +1 -1
  16. package/lib/esm/widgets/shadowed-properties.js +1 -0
  17. package/lib/esm/widgets/signals.js +1 -1
  18. package/lib/esm/widgets/window-base.js +1 -1
  19. package/lib/esm/window-host.js +1 -0
  20. package/lib/esm/window-source.android.js +1 -0
  21. package/lib/esm/window-source.ios.js +1 -0
  22. package/lib/esm/window-source.js +1 -0
  23. package/lib/types/canvas2d/canvas2d-bridge.d.ts +4 -42
  24. package/lib/types/index.d.ts +1 -1
  25. package/lib/types/namespace/gtk.d.ts +1 -1
  26. package/lib/types/shadowed-properties.spec.d.ts +1 -0
  27. package/lib/types/testing/ns-core.d.mts +6 -1
  28. package/lib/types/widgets/adw-about-dialog.d.ts +9 -7
  29. package/lib/types/widgets/adw-action-row.d.ts +9 -7
  30. package/lib/types/widgets/adw-alert-dialog.d.ts +9 -7
  31. package/lib/types/widgets/adw-avatar.d.ts +9 -7
  32. package/lib/types/widgets/adw-banner.d.ts +9 -7
  33. package/lib/types/widgets/adw-bottom-sheet.d.ts +30 -16
  34. package/lib/types/widgets/adw-button-content.d.ts +9 -7
  35. package/lib/types/widgets/adw-carousel.d.ts +9 -7
  36. package/lib/types/widgets/adw-clamp.d.ts +9 -7
  37. package/lib/types/widgets/adw-data-grid.d.ts +27 -13
  38. package/lib/types/widgets/adw-header-bar.d.ts +9 -7
  39. package/lib/types/widgets/adw-image-button.d.ts +9 -7
  40. package/lib/types/widgets/adw-navigation-page.d.ts +9 -7
  41. package/lib/types/widgets/adw-navigation-view.d.ts +9 -7
  42. package/lib/types/widgets/adw-preferences-dialog.d.ts +9 -7
  43. package/lib/types/widgets/adw-preferences-group.d.ts +9 -7
  44. package/lib/types/widgets/adw-preferences-page.d.ts +9 -7
  45. package/lib/types/widgets/adw-shortcut-label.d.ts +9 -7
  46. package/lib/types/widgets/adw-sidebar.d.ts +9 -7
  47. package/lib/types/widgets/adw-slider-row.d.ts +9 -7
  48. package/lib/types/widgets/adw-spinner.d.ts +9 -7
  49. package/lib/types/widgets/adw-split-button.d.ts +31 -11
  50. package/lib/types/widgets/adw-status-page.d.ts +9 -7
  51. package/lib/types/widgets/adw-tab-view.d.ts +9 -7
  52. package/lib/types/widgets/adw-toast-overlay.d.ts +9 -7
  53. package/lib/types/widgets/adw-toggle-group.d.ts +9 -7
  54. package/lib/types/widgets/adw-toggle.d.ts +17 -9
  55. package/lib/types/widgets/adw-toolbar-view.d.ts +9 -7
  56. package/lib/types/widgets/adw-view-stack.d.ts +9 -7
  57. package/lib/types/widgets/adw-view-switcher-bar.d.ts +9 -7
  58. package/lib/types/widgets/adw-window-title.d.ts +9 -7
  59. package/lib/types/widgets/adw-wrap-box.d.ts +9 -7
  60. package/lib/types/widgets/carousel-indicator-base.d.ts +9 -7
  61. package/lib/types/widgets/construct-props.d.ts +9 -3
  62. package/lib/types/widgets/gtk-action-bar.d.ts +9 -7
  63. package/lib/types/widgets/gtk-box.d.ts +1 -1
  64. package/lib/types/widgets/gtk-button.d.ts +9 -7
  65. package/lib/types/widgets/gtk-drop-down.d.ts +9 -7
  66. package/lib/types/widgets/gtk-entry.d.ts +9 -7
  67. package/lib/types/widgets/gtk-enums.d.ts +8 -0
  68. package/lib/types/widgets/gtk-grid.d.ts +1 -1
  69. package/lib/types/widgets/gtk-image.d.ts +9 -7
  70. package/lib/types/widgets/gtk-label.d.ts +9 -7
  71. package/lib/types/widgets/gtk-list-box.d.ts +1 -1
  72. package/lib/types/widgets/gtk-popover-menu.d.ts +9 -7
  73. package/lib/types/widgets/gtk-stack.d.ts +9 -7
  74. package/lib/types/widgets/gtk-text-view.d.ts +9 -7
  75. package/lib/types/widgets/gtk-window.d.ts +45 -0
  76. package/lib/types/widgets/shadowed-properties.d.ts +99 -0
  77. package/lib/types/widgets/signals.d.ts +17 -8
  78. package/lib/types/widgets/split-view-base.d.ts +9 -7
  79. package/lib/types/widgets/stack-page.d.ts +9 -7
  80. package/lib/types/widgets/styled-layout-base.d.ts +9 -7
  81. package/lib/types/widgets/view-stack-page.d.ts +9 -7
  82. package/lib/types/widgets/view-switcher-base.d.ts +9 -7
  83. package/lib/types/widgets/widget-layout.d.ts +22 -19
  84. package/lib/types/widgets/window-base.d.ts +2 -0
  85. package/lib/types/window-host.d.ts +24 -0
  86. package/lib/types/window-members.spec.d.ts +1 -0
  87. package/lib/types/window-source.android.d.ts +8 -0
  88. package/lib/types/window-source.d.ts +13 -0
  89. package/lib/types/window-source.ios.d.ts +8 -0
  90. package/package.json +14 -13
  91. package/src/testing/ns-core.mts +13 -3
@@ -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;
@@ -8,11 +8,18 @@ export interface GObjectSignals {
8
8
  * The callback receives the emitting widget FIRST, as a GJS signal handler does,
9
9
  * then the NativeScript payload.
10
10
  */
11
- connect(eventName: string, callback: (self: this, data: EventData) => void): number;
11
+ connect(eventName: string, callback: (self: this, data: EventData) => unknown): number;
12
12
  /** Remove exactly the handler `connect` returned this id for. Throws on an id nothing holds. */
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.
@@ -31,9 +38,11 @@ export type ObservableConstructor = abstract new (...args: any[]) => Observable;
31
38
  * the two methods and would otherwise carry a second, identical copy one prototype up.
32
39
  */
33
40
  export declare function withSignals<TBase extends ObservableConstructor>(Base: TBase): (abstract new (...args: any[]) => {
34
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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;
@@ -11,9 +11,11 @@ export interface NotifyShowSidebarEventData extends EventData {
11
11
  collapsed: boolean;
12
12
  }
13
13
  declare const AdwSplitViewBase_base: (abstract new (...args: any[]) => {
14
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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;
@@ -9,9 +9,11 @@ interface AwaitingStack {
9
9
  _addChildFromBuilder(name: string, view: GtkStackPage): void;
10
10
  }
11
11
  declare const GtkStackPage_base: (abstract new (...args: any[]) => {
12
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
12
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
13
13
  disconnect(handlerId: number): void;
14
14
  emit(eventName: string, ...args: unknown[]): void;
15
+ get_property(name: string): unknown;
16
+ set_property(name: string, value: unknown): void;
15
17
  get halign(): string;
16
18
  set halign(value: string | number);
17
19
  get valign(): string;
@@ -30,6 +32,12 @@ declare const GtkStackPage_base: (abstract new (...args: any[]) => {
30
32
  set sensitive(value: boolean | string);
31
33
  get name(): string;
32
34
  set name(value: string | null);
35
+ get tooltipText(): string;
36
+ set tooltipText(value: string);
37
+ get widthRequest(): number;
38
+ set widthRequest(value: number | string);
39
+ get heightRequest(): number;
40
+ set heightRequest(value: number | string);
33
41
  set_direction(direction: number): void;
34
42
  get_direction(): number;
35
43
  get_first_child(): object | null;
@@ -38,12 +46,6 @@ declare const GtkStackPage_base: (abstract new (...args: any[]) => {
38
46
  get_prev_sibling(): object | null;
39
47
  get_parent(): object | null;
40
48
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
41
- get tooltipText(): string;
42
- set tooltipText(value: string);
43
- get widthRequest(): number;
44
- set widthRequest(value: number | string);
45
- get heightRequest(): number;
46
- set heightRequest(value: number | string);
47
49
  _emit(eventName: string): void;
48
50
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
49
51
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -1,9 +1,11 @@
1
1
  import { GridLayout } from '@nativescript/core';
2
2
  import { type AdwStyleClassesInput } from './style-classes.js';
3
3
  declare const AdwStyledLayoutBase_base: (abstract new (...args: any[]) => {
4
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
4
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
5
5
  disconnect(handlerId: number): void;
6
6
  emit(eventName: string, ...args: unknown[]): void;
7
+ get_property(name: string): unknown;
8
+ set_property(name: string, value: unknown): void;
7
9
  get halign(): string;
8
10
  set halign(value: string | number);
9
11
  get valign(): string;
@@ -22,6 +24,12 @@ declare const AdwStyledLayoutBase_base: (abstract new (...args: any[]) => {
22
24
  set sensitive(value: boolean | string);
23
25
  get name(): string;
24
26
  set name(value: string | null);
27
+ get tooltipText(): string;
28
+ set tooltipText(value: string);
29
+ get widthRequest(): number;
30
+ set widthRequest(value: number | string);
31
+ get heightRequest(): number;
32
+ set heightRequest(value: number | string);
25
33
  set_direction(direction: number): void;
26
34
  get_direction(): number;
27
35
  get_first_child(): object | null;
@@ -30,12 +38,6 @@ declare const AdwStyledLayoutBase_base: (abstract new (...args: any[]) => {
30
38
  get_prev_sibling(): object | null;
31
39
  get_parent(): object | null;
32
40
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
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);
39
41
  _emit(eventName: string): void;
40
42
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
41
43
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -9,9 +9,11 @@ interface AwaitingStack {
9
9
  _addChildFromBuilder(name: string, view: AdwViewStackPage): void;
10
10
  }
11
11
  declare const AdwViewStackPage_base: (abstract new (...args: any[]) => {
12
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
12
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
13
13
  disconnect(handlerId: number): void;
14
14
  emit(eventName: string, ...args: unknown[]): void;
15
+ get_property(name: string): unknown;
16
+ set_property(name: string, value: unknown): void;
15
17
  get halign(): string;
16
18
  set halign(value: string | number);
17
19
  get valign(): string;
@@ -30,6 +32,12 @@ declare const AdwViewStackPage_base: (abstract new (...args: any[]) => {
30
32
  set sensitive(value: boolean | string);
31
33
  get name(): string;
32
34
  set name(value: string | null);
35
+ get tooltipText(): string;
36
+ set tooltipText(value: string);
37
+ get widthRequest(): number;
38
+ set widthRequest(value: number | string);
39
+ get heightRequest(): number;
40
+ set heightRequest(value: number | string);
33
41
  set_direction(direction: number): void;
34
42
  get_direction(): number;
35
43
  get_first_child(): object | null;
@@ -38,12 +46,6 @@ declare const AdwViewStackPage_base: (abstract new (...args: any[]) => {
38
46
  get_prev_sibling(): object | null;
39
47
  get_parent(): object | null;
40
48
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
41
- get tooltipText(): string;
42
- set tooltipText(value: string);
43
- get widthRequest(): number;
44
- set widthRequest(value: number | string);
45
- get heightRequest(): number;
46
- set heightRequest(value: number | string);
47
49
  _emit(eventName: string): void;
48
50
  addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
49
51
  removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
@@ -13,9 +13,11 @@ export declare const NOTIFY_SELECTED = "notify::selected";
13
13
  export interface NotifyViewSelectedEventData extends EventData, ViewSwitcherNotifyPayload {
14
14
  }
15
15
  declare const AdwViewSwitcherBase_base: (abstract new (...args: any[]) => {
16
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
16
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
17
17
  disconnect(handlerId: number): void;
18
18
  emit(eventName: string, ...args: unknown[]): void;
19
+ get_property(name: string): unknown;
20
+ set_property(name: string, value: unknown): void;
19
21
  get halign(): string;
20
22
  set halign(value: string | number);
21
23
  get valign(): string;
@@ -34,6 +36,12 @@ declare const AdwViewSwitcherBase_base: (abstract new (...args: any[]) => {
34
36
  set sensitive(value: boolean | string);
35
37
  get name(): string;
36
38
  set name(value: string | null);
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);
37
45
  set_direction(direction: number): void;
38
46
  get_direction(): number;
39
47
  get_first_child(): object | null;
@@ -42,12 +50,6 @@ declare const AdwViewSwitcherBase_base: (abstract new (...args: any[]) => {
42
50
  get_prev_sibling(): object | null;
43
51
  get_parent(): object | null;
44
52
  insert_action_group(prefix: string, group: import("@gjsify/adwaita-core").ActionGroupLike | null): void;
45
- get tooltipText(): string;
46
- set tooltipText(value: string);
47
- get widthRequest(): number;
48
- set widthRequest(value: number | string);
49
- get heightRequest(): number;
50
- set heightRequest(value: number | string);
51
53
  _emit(eventName: string): void;
52
54
  addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
53
55
  removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
@@ -36,13 +36,15 @@ export interface GtkWidgetLayout {
36
36
  heightRequest: number;
37
37
  }
38
38
  /**
39
- * Give a `@nativescript/core` base GTK's widget layout properties.
39
+ * Everything the mixin adds to an instance, spelled out so the emitted declaration names it.
40
40
  *
41
- * Applied by `withSignals` and nowhere else, so it reaches exactly the classes that meet the
42
- * platform — the rule arm 6 of `check-nativescript-xml-doors.mjs` already holds for that
43
- * mixin — and a subclass of a port class inherits it like any other accessor.
41
+ * Left to inference, `tsc` re-inlines the anonymous mixin class into every subclass's `.d.ts`
42
+ * and writes each setter as `set x(v): any`, which TS1095 rejects in a consumer that checks
43
+ * library files. A `declare class`, not an interface: interface accessors count as properties,
44
+ * and a subclass overriding one with an accessor is then TS2611.
45
+ * The accessors keep their wider setter types (TS 5.1 unrelated accessor types).
44
46
  */
45
- export declare function withGtkWidgetLayout<TBase extends ObservableConstructor>(Base: TBase): (abstract new (...args: any[]) => {
47
+ export declare abstract class GtkWidgetLayoutMembers {
46
48
  get halign(): string;
47
49
  set halign(value: string | number);
48
50
  get valign(): string;
@@ -61,6 +63,12 @@ export declare function withGtkWidgetLayout<TBase extends ObservableConstructor>
61
63
  set sensitive(value: boolean | string);
62
64
  get name(): string;
63
65
  set name(value: string | null);
66
+ get tooltipText(): string;
67
+ set tooltipText(value: string);
68
+ get widthRequest(): number;
69
+ set widthRequest(value: number | string);
70
+ get heightRequest(): number;
71
+ set heightRequest(value: number | string);
64
72
  /** `gtk_widget_set_direction`: written to the CSS `direction` a view resolves its margins by; NONE clears it. */
65
73
  set_direction(direction: number): void;
66
74
  /** `gtk_widget_get_direction`: LTR until set. */
@@ -72,18 +80,13 @@ export declare function withGtkWidgetLayout<TBase extends ObservableConstructor>
72
80
  get_parent(): object | null;
73
81
  /** `gtk_widget_insert_action_group`: `null` removes the group of `prefix`. */
74
82
  insert_action_group(prefix: string, group: ActionGroupLike | null): void;
75
- get tooltipText(): string;
76
- set tooltipText(value: string);
77
- get widthRequest(): number;
78
- set widthRequest(value: number | string);
79
- get heightRequest(): number;
80
- set heightRequest(value: number | string);
81
- _emit(eventName: string): void;
82
- addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
83
- removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
84
- notify<T extends import("@nativescript/core").EventData>(data: T): void;
85
- notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
86
- set(name: string, value: unknown): void;
87
- get(name: string): unknown;
88
- }) & TBase;
83
+ }
84
+ /**
85
+ * Give a `@nativescript/core` base GTK's widget layout properties.
86
+ *
87
+ * Applied by `withSignals` and nowhere else, so it reaches exactly the classes that meet the
88
+ * platform — the rule arm 6 of `check-nativescript-xml-doors.mjs` already holds for that
89
+ * mixin — and a subclass of a port class inherits it like any other accessor.
90
+ */
91
+ export declare function withGtkWidgetLayout<TBase extends ObservableConstructor>(Base: TBase): (abstract new (...args: any[]) => GtkWidgetLayoutMembers) & TBase;
89
92
  export {};
@@ -24,6 +24,8 @@ export declare abstract class AdwWindowBase extends GtkWindow implements DialogH
24
24
  get dialogs(): readonly View[];
25
25
  /** `DialogHost` — `AdwDialog.present (parent)` calls this on the window it finds. */
26
26
  _hostDialog(dialog: unknown): void;
27
+ /** Back closes the topmost open dialog; a dialog that cannot close (`can-close`) still takes the press. */
28
+ protected _consumeBack(): boolean;
27
29
  /** `DialogHost` — the dialog closed. A view this window did not host is left alone. */
28
30
  _unhostDialog(dialog: unknown): void;
29
31
  }
@@ -0,0 +1,24 @@
1
+ import { type View } from '@nativescript/core';
2
+ export interface WindowHost {
3
+ /** Whether {@link finish} can end the window; asked BEFORE a `close-request` is emitted. */
4
+ readonly canFinish: boolean;
5
+ /** Whether the application is in the foreground right now. */
6
+ isForeground(): boolean;
7
+ /** Call `onChange` whenever the application enters or leaves the foreground; returns the unsubscribe. */
8
+ watchForeground(onChange: (foreground: boolean) => void): () => void;
9
+ /**
10
+ * Call `onBack` when the system's back button or gesture is used; it answers whether it took
11
+ * the press (true stops the system's own back). Returns the unsubscribe. Never fires where
12
+ * the platform has no back button.
13
+ */
14
+ watchBack(onBack: () => boolean): () => void;
15
+ /** End the window. Throws where the platform has no way to. */
16
+ finish(): void;
17
+ isFocused(view: View): boolean;
18
+ requestFocus(view: View): void;
19
+ clearFocus(view: View): void;
20
+ }
21
+ /** @internal A seam for the specs: `null` restores the platform's own. */
22
+ export declare function useWindowHost(host: WindowHost | null): void;
23
+ export declare const nativeWindowHost: WindowHost;
24
+ export declare function windowHost(): WindowHost;
@@ -0,0 +1 @@
1
+ export declare const GtkWindowMembersNsTest: () => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import { type View } from '@nativescript/core';
2
+ import type { BackPressedEvent } from './window-source.js';
3
+ export declare const canFinishWindow = true;
4
+ export declare function watchBackButton(onBack: (event: BackPressedEvent) => void): () => void;
5
+ export declare function finishWindow(): void;
6
+ export declare function isViewFocused(view: View): boolean;
7
+ export declare function focusView(view: View): void;
8
+ export declare function blurView(view: View): void;
@@ -0,0 +1,13 @@
1
+ import type { View } from '@nativescript/core';
2
+ /** Whether {@link finishWindow} can end the window on this platform. */
3
+ export declare const canFinishWindow = false;
4
+ export declare function finishWindow(): void;
5
+ export declare function isViewFocused(_view: View): boolean;
6
+ export declare function focusView(_view: View): void;
7
+ export declare function blurView(_view: View): void;
8
+ /** Back-button event data NativeScript hands its listeners: `cancel` stops the system's own back. */
9
+ export interface BackPressedEvent {
10
+ cancel: boolean;
11
+ }
12
+ /** This host has no back button to hear; nothing to unsubscribe. */
13
+ export declare function watchBackButton(_onBack: (event: BackPressedEvent) => void): () => void;
@@ -0,0 +1,8 @@
1
+ import type { View } from '@nativescript/core';
2
+ import type { BackPressedEvent } from './window-source.js';
3
+ export declare const canFinishWindow = false;
4
+ export declare function finishWindow(): void;
5
+ export declare function isViewFocused(view: View): boolean;
6
+ export declare function focusView(view: View): void;
7
+ export declare function blurView(view: View): void;
8
+ export declare function watchBackButton(_onBack: (event: BackPressedEvent) => void): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-nativescript",
3
- "version": "0.62.0",
3
+ "version": "0.63.1-next.235",
4
4
  "description": "Native Adwaita widgets for the NativeScript runtime — real NativeScript components (StackLayout/GridLayout/Switch/Label) styled like Libadwaita, not a webview",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -73,15 +73,15 @@
73
73
  "design-system"
74
74
  ],
75
75
  "dependencies": {
76
- "@gjsify/adwaita-core": "^0.62.0",
77
- "@gjsify/adwaita-fonts": "^0.62.0",
78
- "@gjsify/adwaita-icons": "^0.62.0",
79
- "@gjsify/canvas2d-core": "^0.62.0",
80
- "@gjsify/native-platform": "^0.62.0"
76
+ "@gjsify/adwaita-core": "0.63.1-next.235",
77
+ "@gjsify/adwaita-fonts": "0.63.1-next.235",
78
+ "@gjsify/adwaita-icons": "0.63.1-next.235",
79
+ "@gjsify/canvas2d-core": "0.63.1-next.235",
80
+ "@gjsify/native-platform": "0.63.1-next.235"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@nativescript/core": "*",
84
- "@gjsify/app-settings": "^0.62.0"
84
+ "@gjsify/app-settings": "0.63.1-next.235"
85
85
  },
86
86
  "peerDependenciesMeta": {
87
87
  "@nativescript/core": {
@@ -92,11 +92,11 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@gjsify/app-settings": "^0.62.0",
96
- "@gjsify/blueprint": "^0.62.0",
97
- "@gjsify/cli": "^0.62.0",
98
- "@gjsify/unit": "^0.62.0",
99
- "@gjsify/vite-plugin-blueprint": "^0.62.0",
95
+ "@gjsify/app-settings": "0.63.1-next.235",
96
+ "@gjsify/blueprint": "0.63.1-next.235",
97
+ "@gjsify/cli": "0.63.1-next.235",
98
+ "@gjsify/unit": "0.63.1-next.235",
99
+ "@gjsify/vite-plugin-blueprint": "0.63.1-next.235",
100
100
  "@types/node": "^25.9.2",
101
101
  "typescript": "^6.0.3"
102
102
  },
@@ -125,5 +125,6 @@
125
125
  "bugs": {
126
126
  "url": "https://github.com/gjsify/gjsify/issues"
127
127
  },
128
- "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/adwaita#readme"
128
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/adwaita#readme",
129
+ "gitHead": "9d2cca56170a0215b3e0792e98421ed1f83e7f72"
129
130
  }
@@ -294,6 +294,9 @@ export class View extends Observable {
294
294
  translateY = 0;
295
295
  /** Never loaded here: nothing mounts a view into a page without a platform. */
296
296
  readonly isLoaded: boolean = false;
297
+ /** Nothing loads a view here; a spec calls these to stand in for the platform's. */
298
+ onLoaded(): void {}
299
+ onUnloaded(): void {}
297
300
  androidOverflowEdge = 'none';
298
301
  accessibilityRole: string | undefined;
299
302
  accessibilityState: string | undefined;
@@ -500,10 +503,12 @@ const placementOf = (view: View) => {
500
503
 
501
504
  export class GridLayout extends LayoutBase {
502
505
  protected _rows: ItemSpec[] = [];
503
- protected _columns: ItemSpec[] = [];
506
+ // `_cols`, as `GridLayoutBase` names it. The double said `_columns`, and `AdwDataGrid`'s own
507
+ // `_columns` (its data) received every track spec here and nowhere on a device.
508
+ protected _cols: ItemSpec[] = [];
504
509
 
505
510
  addColumn(itemSpec: ItemSpec): void {
506
- this._columns.push(itemSpec);
511
+ this._cols.push(itemSpec);
507
512
  }
508
513
 
509
514
  addRow(itemSpec: ItemSpec): void {
@@ -516,7 +521,7 @@ export class GridLayout extends LayoutBase {
516
521
  }
517
522
 
518
523
  removeColumns(): void {
519
- this._columns.length = 0;
524
+ this._cols.length = 0;
520
525
  }
521
526
 
522
527
  removeRows(): void {
@@ -836,6 +841,11 @@ export const Application = {
836
841
  if (at !== -1) existing.splice(at, 1);
837
842
  },
838
843
 
844
+ /** Deliver a lifecycle event (`resume`, `suspend`) to its subscribers, as the platform does. */
845
+ emitLifecycle(event: string): void {
846
+ for (const callback of (LIFECYCLE.get(event) ?? []).slice()) callback({ eventName: event });
847
+ },
848
+
839
849
  /** Absent, as on every platform that is not Android — and this is not Android. */
840
850
  android: undefined as undefined,
841
851
  /** Absent, as on every platform that is not iOS — and this is not iOS. */