@gjsify/adwaita-nativescript 0.62.0 → 0.63.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.
Files changed (64) hide show
  1. package/lib/esm/widgets/application.js +1 -1
  2. package/lib/esm/widgets/gtk-window.js +1 -1
  3. package/lib/esm/widgets/signals.js +1 -1
  4. package/lib/esm/window-host.js +1 -0
  5. package/lib/esm/window-source.android.js +1 -0
  6. package/lib/esm/window-source.ios.js +1 -0
  7. package/lib/esm/window-source.js +1 -0
  8. package/lib/types/testing/ns-core.d.mts +5 -0
  9. package/lib/types/widgets/adw-about-dialog.d.ts +1 -1
  10. package/lib/types/widgets/adw-action-row.d.ts +1 -1
  11. package/lib/types/widgets/adw-alert-dialog.d.ts +1 -1
  12. package/lib/types/widgets/adw-avatar.d.ts +1 -1
  13. package/lib/types/widgets/adw-banner.d.ts +1 -1
  14. package/lib/types/widgets/adw-bottom-sheet.d.ts +1 -1
  15. package/lib/types/widgets/adw-button-content.d.ts +1 -1
  16. package/lib/types/widgets/adw-carousel.d.ts +1 -1
  17. package/lib/types/widgets/adw-clamp.d.ts +1 -1
  18. package/lib/types/widgets/adw-data-grid.d.ts +1 -1
  19. package/lib/types/widgets/adw-header-bar.d.ts +1 -1
  20. package/lib/types/widgets/adw-image-button.d.ts +1 -1
  21. package/lib/types/widgets/adw-navigation-page.d.ts +1 -1
  22. package/lib/types/widgets/adw-navigation-view.d.ts +1 -1
  23. package/lib/types/widgets/adw-preferences-dialog.d.ts +1 -1
  24. package/lib/types/widgets/adw-preferences-group.d.ts +1 -1
  25. package/lib/types/widgets/adw-preferences-page.d.ts +1 -1
  26. package/lib/types/widgets/adw-shortcut-label.d.ts +1 -1
  27. package/lib/types/widgets/adw-sidebar.d.ts +1 -1
  28. package/lib/types/widgets/adw-slider-row.d.ts +1 -1
  29. package/lib/types/widgets/adw-spinner.d.ts +1 -1
  30. package/lib/types/widgets/adw-split-button.d.ts +1 -1
  31. package/lib/types/widgets/adw-status-page.d.ts +1 -1
  32. package/lib/types/widgets/adw-tab-view.d.ts +1 -1
  33. package/lib/types/widgets/adw-toast-overlay.d.ts +1 -1
  34. package/lib/types/widgets/adw-toggle-group.d.ts +1 -1
  35. package/lib/types/widgets/adw-toggle.d.ts +1 -1
  36. package/lib/types/widgets/adw-toolbar-view.d.ts +1 -1
  37. package/lib/types/widgets/adw-view-stack.d.ts +1 -1
  38. package/lib/types/widgets/adw-view-switcher-bar.d.ts +1 -1
  39. package/lib/types/widgets/adw-window-title.d.ts +1 -1
  40. package/lib/types/widgets/adw-wrap-box.d.ts +1 -1
  41. package/lib/types/widgets/carousel-indicator-base.d.ts +1 -1
  42. package/lib/types/widgets/gtk-action-bar.d.ts +1 -1
  43. package/lib/types/widgets/gtk-button.d.ts +1 -1
  44. package/lib/types/widgets/gtk-drop-down.d.ts +1 -1
  45. package/lib/types/widgets/gtk-entry.d.ts +1 -1
  46. package/lib/types/widgets/gtk-image.d.ts +1 -1
  47. package/lib/types/widgets/gtk-label.d.ts +1 -1
  48. package/lib/types/widgets/gtk-popover-menu.d.ts +1 -1
  49. package/lib/types/widgets/gtk-stack.d.ts +1 -1
  50. package/lib/types/widgets/gtk-text-view.d.ts +1 -1
  51. package/lib/types/widgets/gtk-window.d.ts +33 -0
  52. package/lib/types/widgets/signals.d.ts +2 -2
  53. package/lib/types/widgets/split-view-base.d.ts +1 -1
  54. package/lib/types/widgets/stack-page.d.ts +1 -1
  55. package/lib/types/widgets/styled-layout-base.d.ts +1 -1
  56. package/lib/types/widgets/view-stack-page.d.ts +1 -1
  57. package/lib/types/widgets/view-switcher-base.d.ts +1 -1
  58. package/lib/types/window-host.d.ts +18 -0
  59. package/lib/types/window-members.spec.d.ts +1 -0
  60. package/lib/types/window-source.android.d.ts +6 -0
  61. package/lib/types/window-source.d.ts +7 -0
  62. package/lib/types/window-source.ios.d.ts +6 -0
  63. package/package.json +12 -12
  64. package/src/testing/ns-core.mts +8 -0
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{GioApplicationBase as e,applicationOfWindow as t,installActionMap as n,withGtkApplication as r}from"@gjsify/adwaita-core";import{Application as i,GridLayout as a}from"@nativescript/core";const o={name:`adwaita-nativescript`,requiresWindow:!0,start(e){return new Promise(t=>{i.run({create(){let n=e();return t(),n??new a}})})},detach(){},exit(){i.android?.foregroundActivity?.finish?.()}};var GioApplication=class extends e{static host=o},GtkApplication=class extends r(GioApplication){static GTypeName=`GtkApplication`},AdwApplication=class extends GtkApplication{static GTypeName=`AdwApplication`};function defineWindowApplication(e){n(e),Object.defineProperty(e,"application",{configurable:!0,enumerable:!0,get(){return t(this)},set(e){let n=t(this);n!==e&&(n?.remove_window(this),e?.add_window(this))}})}export{AdwApplication,GioApplication,GtkApplication,defineWindowApplication,o as nativeScriptHost};
1
+ import"../_virtual/_rolldown/runtime.js";import{nativePlatformHost as e}from"../platform-host.js";import{GioApplicationBase as t,applicationOfWindow as n,dispatchAccelerator as r,installActionMap as i,withGtkApplication as a}from"@gjsify/adwaita-core";import{Application as o,GridLayout as s}from"@nativescript/core";const c={name:`adwaita-nativescript`,requiresWindow:!0,start(e){return new Promise(t=>{o.run({create(){let n=e();return t(),n??new s}})})},detach(){},exit(){o.android?.foregroundActivity?.finish?.()}};var GioApplication=class extends t{static host=c},GtkApplication=class extends a(GioApplication){static GTypeName=`GtkApplication`},AdwApplication=class extends GtkApplication{static GTypeName=`AdwApplication`};const l=new WeakMap,parentOf=e=>e.parent;function followAccelerators(t,n){l.get(t)?.(),l.delete(t),n!==null&&l.set(t,e.listenKeys(t,e=>r(t,e,parentOf)))}function defineWindowApplication(e){i(e),Object.defineProperty(e,"application",{configurable:!0,enumerable:!0,get(){return n(this)},set(e){let t=n(this);t!==e&&(t?.remove_window(this),e?.add_window(this),followAccelerators(this,e))}})}export{AdwApplication,GioApplication,GtkApplication,defineWindowApplication,c as nativeScriptHost};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{AdwSingleChildBase as n}from"./single-child-base.js";import{surfaceSize as r}from"./window-state.js";var GtkWindow=class extends n{static GTypeName=`GtkWindow`;_title=``;_defaultWidth=0;_defaultHeight=0;constructor(e){super(),t(this,e)}get title(){return this._title}set title(e){this._title=e??``}get defaultWidth(){return this._defaultWidth}set defaultWidth(t){this._defaultWidth=r(e(t,NaN),t,this._defaultWidth,`defaultWidth`)}get defaultHeight(){return this._defaultHeight}set defaultHeight(t){this._defaultHeight=r(e(t,NaN),t,this._defaultHeight,`defaultHeight`)}};export{GtkWindow};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{windowHost as r}from"../window-host.js";import{AdwSingleChildBase as i}from"./single-child-base.js";import{surfaceSize as a}from"./window-state.js";import{CloseRequestState as o,HandledAccumulator as s,WindowMemberState as c}from"@gjsify/adwaita-core";const l=`notify::is-active`,u=`notify::maximized`,d=`notify::focus-widget`,f=`close-request`;var GtkWindow=class extends i{static GTypeName=`GtkWindow`;_title=``;_defaultWidth=0;_defaultHeight=0;_members=new c(e=>{let t=e===`is-active`?l:u;this.notify({eventName:t,object:this,value:e===`is-active`?this.isActive:this.maximized})},{maximized:!0});_closeRequest=new o;_unwatchForeground=null;constructor(e){super(),n(this,e)}onLoaded(){super.onLoaded();let e=r();this._unwatchForeground?.(),this._unwatchForeground=e.watchForeground(e=>this._members.reportActive(e)),this._members.reportActive(e.isForeground())}onUnloaded(){this._unwatchForeground?.(),this._unwatchForeground=null,this._members.reportActive(!1),super.onUnloaded()}get isActive(){return this._members.active}is_active(){return this.isActive}get maximized(){return this._members.maximized}set maximized(t){e(t,!0)?this.maximize():this.unmaximize()}is_maximized(){return this.maximized}maximize(){}unmaximize(){throw Error(`GtkWindow.unmaximize is not supported on NativeScript: the window is the whole screen and the platform has no un-maximized state to go back to.`)}present(){}get focusWidget(){return this.get_focus()}get_focus(){let e=r();return findView(this,t=>e.isFocused(t))}set_focus(e){let t=r();if(e===null){let e=this.get_focus();e!==null&&t.clearFocus(e);return}if(findView(this,t=>t===e)===null)throw Error(`GtkWindow.set_focus: the widget is not a descendant of this window.`);t.requestFocus(e)}close(){let e=r();if(this.isLoaded&&!e.canFinish)throw Error(`GtkWindow.close is not supported on this platform: iOS has no public API to close the root window. Android finishes the foreground activity.`);this._closeRequest.close({realized:this.isLoaded,hideOnClose:!1,emit:()=>{let e=new s;return this.notify({eventName:f,object:this,accumulator:e}),e.stopped},hide:()=>{},destroy:()=>e.finish()})}connect(e,t){if(e===`notify::focus-widget`)throw Error(`GtkWindow notify::focus-widget is not supported on NativeScript: focus the user moves is not observable here. Read get_focus() when you need it.`);return super.connect(e,t)}get title(){return this._title}set title(e){this._title=e??``}get defaultWidth(){return this._defaultWidth}set defaultWidth(e){this._defaultWidth=a(t(e,NaN),e,this._defaultWidth,`defaultWidth`)}get defaultHeight(){return this._defaultHeight}set defaultHeight(e){this._defaultHeight=a(t(e,NaN),e,this._defaultHeight,`defaultHeight`)}};function findView(e,t){let n=null;return e.eachChildView(e=>t(e)?(n=e,!1):(n=findView(e,t),n===null)),n}export{f as CLOSE_REQUEST,GtkWindow,d as NOTIFY_FOCUS_WIDGET,l as NOTIFY_IS_ACTIVE,u as NOTIFY_MAXIMIZED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{withGtkWidgetLayout as e}from"./widget-layout.js";const t=new WeakMap;let n=1;function withSignals(r){class WithSignals extends e(r){connect(e,r){let listener=e=>r(this,e),i=n++,a=t.get(this);return a===void 0&&(a=new Map,t.set(this,a)),a.set(i,{eventName:e,listener}),this.addEventListener(e,listener),i}disconnect(e){let n=t.get(this)?.get(e);if(n===void 0)throw TypeError(`${this.constructor.name} has no handler with id ${e}. connect() hands out each id once and disconnect() takes it once; a second disconnect, or an id another widget returned, is refused here rather than left as a silent no-op.`);this.removeEventListener(n.eventName,n.listener),t.get(this)?.delete(e)}emit(e,...t){this.notify({eventName:e,object:this,args:t})}}return WithSignals}export{withSignals};
1
+ import"../_virtual/_rolldown/runtime.js";import{withGtkWidgetLayout as e}from"./widget-layout.js";const t=new WeakMap;let n=1;function withSignals(r){class WithSignals extends e(r){connect(e,r){let listener=e=>{let t=e.accumulator;if(t===void 0){r(this,e);return}t.stopped||t.collect(r(this,e))},i=n++,a=t.get(this);return a===void 0&&(a=new Map,t.set(this,a)),a.set(i,{eventName:e,listener}),this.addEventListener(e,listener),i}disconnect(e){let n=t.get(this)?.get(e);if(n===void 0)throw TypeError(`${this.constructor.name} has no handler with id ${e}. connect() hands out each id once and disconnect() takes it once; a second disconnect, or an id another widget returned, is refused here rather than left as a silent no-op.`);this.removeEventListener(n.eventName,n.listener),t.get(this)?.delete(e)}emit(e,...t){this.notify({eventName:e,object:this,args:t})}}return WithSignals}export{withSignals};
@@ -0,0 +1 @@
1
+ import"./_virtual/_rolldown/runtime.js";import{blurView as e,finishWindow as t,focusView as n,isViewFocused as r}from"./window-source.js";import{Application as i}from"@nativescript/core";let a=null;function useWindowHost(e){a=e}const o={canFinish:!1,isForeground:()=>!0,watchForeground(e){let resume=()=>e(!0),suspend=()=>e(!1);return i.on(`resume`,resume),i.on(`suspend`,suspend),()=>{i.off(`resume`,resume),i.off(`suspend`,suspend)}},finish:t,isFocused:r,requestFocus:n,clearFocus:e};function windowHost(){return a??o}export{o as nativeWindowHost,useWindowHost,windowHost};
@@ -0,0 +1 @@
1
+ import"./_virtual/_rolldown/runtime.js";import{Application as e}from"@nativescript/core";const t=!0;function finishWindow(){let t=e.android?.foregroundActivity??e.android?.startActivity;if(!t?.finish)throw Error(`Android has no activity to finish for this window`);t.finish()}const peer=e=>e.nativeViewProtected;function isViewFocused(e){return peer(e)?.isFocused?.()===!0}function focusView(e){peer(e)?.requestFocus?.()}function blurView(e){peer(e)?.clearFocus?.()}export{blurView,t as canFinishWindow,finishWindow,focusView,isViewFocused};
@@ -0,0 +1 @@
1
+ import"./_virtual/_rolldown/runtime.js";const e=!1;function finishWindow(){throw Error(`iOS has no public API for an app to close its own window`)}const peer=e=>e.nativeViewProtected;function isViewFocused(e){return peer(e)?.isFirstResponder===!0}function focusView(e){peer(e)?.becomeFirstResponder?.()}function blurView(e){peer(e)?.resignFirstResponder?.()}export{blurView,e as canFinishWindow,finishWindow,focusView,isViewFocused};
@@ -0,0 +1 @@
1
+ import"./_virtual/_rolldown/runtime.js";const e=!1;function finishWindow(){throw Error(`there is no platform window to close on this host`)}function isViewFocused(e){throw Error(`there is no platform focus to read on this host`)}function focusView(e){throw Error(`there is no platform focus to move on this host`)}function blurView(e){throw Error(`there is no platform focus to clear on this host`)}export{blurView,e as canFinishWindow,finishWindow,focusView,isViewFocused};
@@ -150,6 +150,9 @@ export declare class View extends Observable {
150
150
  translateY: number;
151
151
  /** Never loaded here: nothing mounts a view into a page without a platform. */
152
152
  readonly isLoaded: boolean;
153
+ /** Nothing loads a view here; a spec calls these to stand in for the platform's. */
154
+ onLoaded(): void;
155
+ onUnloaded(): void;
153
156
  androidOverflowEdge: string;
154
157
  accessibilityRole: string | undefined;
155
158
  accessibilityState: string | undefined;
@@ -396,6 +399,8 @@ export declare const Application: {
396
399
  }): void;
397
400
  on(event: string, callback: (args: unknown) => void): void;
398
401
  off(event: string, callback: (args: unknown) => void): void;
402
+ /** Deliver a lifecycle event (`resume`, `suspend`) to its subscribers, as the platform does. */
403
+ emitLifecycle(event: string): void;
399
404
  /** Absent, as on every platform that is not Android — and this is not Android. */
400
405
  android: undefined;
401
406
  /** Absent, as on every platform that is not iOS — and this is not iOS. */
@@ -3,7 +3,7 @@ import { type ConstructProps } from './construct-props.js';
3
3
  /** Event name emitted when the dialog is closed. */
4
4
  export declare const CLOSED = "closed";
5
5
  declare const AdwAboutDialog_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -5,7 +5,7 @@ import { type ConstructProps } from './construct-props.js';
5
5
  /** Event name emitted when the row is activated. Mirrors `Adw.ActionRow::activated`. */
6
6
  export declare const ACTIVATED = "activated";
7
7
  declare const AdwActionRow_base: (abstract new (...args: any[]) => {
8
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
11
  get halign(): string;
@@ -12,7 +12,7 @@ export interface NotifyResponseEventData extends EventData {
12
12
  response: string;
13
13
  }
14
14
  declare const AdwAlertDialog_base: (abstract new (...args: any[]) => {
15
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
18
  get halign(): string;
@@ -8,7 +8,7 @@ export declare const DEFAULT_AVATAR_SIZE = 48;
8
8
  export { avatarColor, avatarInitials };
9
9
  export { AVATAR_DEFAULT_ICON };
10
10
  declare const AdwAvatar_base: (abstract new (...args: any[]) => {
11
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
11
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
12
12
  disconnect(handlerId: number): void;
13
13
  emit(eventName: string, ...args: unknown[]): void;
14
14
  get halign(): string;
@@ -4,7 +4,7 @@ import { type ConstructProps } from './construct-props.js';
4
4
  /** Event name emitted when the banner's action button is tapped. */
5
5
  export declare const BUTTON_CLICKED = "buttonClicked";
6
6
  declare const AdwBanner_base: (abstract new (...args: any[]) => {
7
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
7
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
8
8
  disconnect(handlerId: number): void;
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get halign(): string;
@@ -12,7 +12,7 @@ export { CLOSE_ATTEMPT, NOTIFY_OPEN, SHEET_CLOSE };
12
12
  export declare function bottomSheetPanel(sheet: AdwBottomSheet): View;
13
13
  export type { NotifyOpenEventData };
14
14
  declare const AdwBottomSheet_base: (abstract new (...args: any[]) => {
15
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
18
  get halign(): string;
@@ -3,7 +3,7 @@ import type { ButtonContentEllipsize } from '@gjsify/adwaita-core';
3
3
  import { GtkImage } from './gtk-image.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwButtonContent_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -18,7 +18,7 @@ export interface PageChangedEventData extends EventData {
18
18
  index: number;
19
19
  }
20
20
  declare const AdwCarousel_base: (abstract new (...args: any[]) => {
21
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
21
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
22
22
  disconnect(handlerId: number): void;
23
23
  emit(eventName: string, ...args: unknown[]): void;
24
24
  get halign(): string;
@@ -4,7 +4,7 @@ import { DEFAULT_CLAMP_MAX_SIZE, DEFAULT_CLAMP_TIGHTENING_THRESHOLD } from './ch
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  export { DEFAULT_CLAMP_MAX_SIZE, DEFAULT_CLAMP_TIGHTENING_THRESHOLD };
6
6
  declare const AdwClamp_base: (abstract new (...args: any[]) => {
7
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
7
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
8
8
  disconnect(handlerId: number): void;
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get halign(): string;
@@ -10,7 +10,7 @@ export interface RowActivatedEventData extends EventData {
10
10
  row: AdwDataGridRow;
11
11
  }
12
12
  declare const AdwDataGrid_base: (abstract new (...args: any[]) => {
13
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
13
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
14
14
  disconnect(handlerId: number): void;
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get halign(): string;
@@ -2,7 +2,7 @@ import type { View } from '@nativescript/core';
2
2
  import { GridLayout, StackLayout } from '@nativescript/core';
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  declare const AdwHeaderBar_base: (abstract new (...args: any[]) => {
5
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
8
  get halign(): string;
@@ -12,7 +12,7 @@ import { type ConstructProps } from './construct-props.js';
12
12
  */
13
13
  export declare const DEFAULT_ICON_BUTTON_ICON_SIZE: number;
14
14
  declare const AdwImageButton_base: (abstract new (...args: any[]) => {
15
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
18
  get halign(): string;
@@ -8,7 +8,7 @@ export interface NavigationPageOwner {
8
8
  setPageCanPop(view: View, canPop: boolean): boolean;
9
9
  }
10
10
  declare const AdwNavigationPage_base: (abstract new (...args: any[]) => {
11
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
11
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
12
12
  disconnect(handlerId: number): void;
13
13
  emit(eventName: string, ...args: unknown[]): void;
14
14
  get halign(): string;
@@ -15,7 +15,7 @@ export interface AdwNavigationEventData extends EventData {
15
15
  /** Payload of the `notify::visible-page` event. */
16
16
  export type NotifyVisiblePageEventData = AdwNavigationEventData;
17
17
  declare const AdwNavigationView_base: (abstract new (...args: any[]) => {
18
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
18
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
19
19
  disconnect(handlerId: number): void;
20
20
  emit(eventName: string, ...args: unknown[]): void;
21
21
  get halign(): string;
@@ -6,7 +6,7 @@ import { type ConstructProps } from './construct-props.js';
6
6
  /** Event name emitted when the dialog is closed. */
7
7
  export declare const CLOSED = "closed";
8
8
  declare const AdwPreferencesDialog_base: (abstract new (...args: any[]) => {
9
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
9
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
10
10
  disconnect(handlerId: number): void;
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get halign(): string;
@@ -3,7 +3,7 @@ import { GridLayout, Label, StackLayout } from '@nativescript/core';
3
3
  import type { NsSearchableGroup, NsSearchableRow } from './preferences-search.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwPreferencesGroup_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -3,7 +3,7 @@ import { ScrollView, StackLayout } from '@nativescript/core';
3
3
  import type { NsSearchableGroup, NsSearchablePage } from './preferences-search.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwPreferencesPage_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -1,7 +1,7 @@
1
1
  import { StackLayout } from '@nativescript/core';
2
2
  import { type ConstructProps } from './construct-props.js';
3
3
  declare const AdwShortcutLabel_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
7
  get halign(): string;
@@ -27,7 +27,7 @@ export interface SidebarActivatedEventData extends EventData {
27
27
  title: string;
28
28
  }
29
29
  declare const AdwSidebar_base: (abstract new (...args: any[]) => {
30
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
30
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
31
31
  disconnect(handlerId: number): void;
32
32
  emit(eventName: string, ...args: unknown[]): void;
33
33
  get halign(): string;
@@ -9,7 +9,7 @@ export interface NotifySliderValueEventData extends EventData {
9
9
  value: number;
10
10
  }
11
11
  declare const AdwSliderRow_base: (abstract new (...args: any[]) => {
12
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
12
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
13
13
  disconnect(handlerId: number): void;
14
14
  emit(eventName: string, ...args: unknown[]): void;
15
15
  get halign(): string;
@@ -3,7 +3,7 @@ import { DEFAULT_SPINNER_SIZE } from './chrome.js';
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  export { DEFAULT_SPINNER_SIZE };
5
5
  declare const AdwSpinner_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -22,7 +22,7 @@ export interface MenuTappedEventData extends EventData {
22
22
  action?: string;
23
23
  }
24
24
  declare const AdwSplitButton_base: (abstract new (...args: any[]) => {
25
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
25
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
26
26
  disconnect(handlerId: number): void;
27
27
  emit(eventName: string, ...args: unknown[]): void;
28
28
  get halign(): string;
@@ -3,7 +3,7 @@ import { GridLayout, Label, StackLayout } from '@nativescript/core';
3
3
  import { GtkImage } from './gtk-image.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwStatusPage_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -24,7 +24,7 @@ export interface ClosePageEventData extends EventData {
24
24
  index: number;
25
25
  }
26
26
  declare const AdwTabView_base: (abstract new (...args: any[]) => {
27
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
27
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
28
28
  disconnect(handlerId: number): void;
29
29
  emit(eventName: string, ...args: unknown[]): void;
30
30
  get halign(): string;
@@ -8,7 +8,7 @@ export type { AdwToastOptions, AdwToastQueueHandlers, AdwToastQueueOptions, Toas
8
8
  /** Event name emitted when a toast's action button is tapped. */
9
9
  export declare const TOAST_BUTTON_CLICKED = "toastButtonClicked";
10
10
  declare const AdwToastOverlay_base: (abstract new (...args: any[]) => {
11
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
11
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
12
12
  disconnect(handlerId: number): void;
13
13
  emit(eventName: string, ...args: unknown[]): void;
14
14
  get halign(): string;
@@ -22,7 +22,7 @@ export interface AdwToggleSpec {
22
22
  name?: string | null;
23
23
  }
24
24
  declare const AdwToggleGroup_base: (abstract new (...args: any[]) => {
25
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
25
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
26
26
  disconnect(handlerId: number): void;
27
27
  emit(eventName: string, ...args: unknown[]): void;
28
28
  get halign(): string;
@@ -1,7 +1,7 @@
1
1
  import { Observable } from '@nativescript/core';
2
2
  import { type ConstructProps } from './construct-props.js';
3
3
  declare const AdwToggle_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
7
  get halign(): string;
@@ -4,7 +4,7 @@ import { type AdwToolbarStyle } from './chrome.js';
4
4
  import { type SystemBarEdges } from './system-bars.js';
5
5
  import { type ConstructProps } from './construct-props.js';
6
6
  declare const AdwToolbarView_base: (abstract new (...args: any[]) => {
7
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
7
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
8
8
  disconnect(handlerId: number): void;
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get halign(): string;
@@ -16,7 +16,7 @@ export declare const NOTIFY_VISIBLE_CHILD_NAME = "notify::visible-child-name";
16
16
  export interface NotifyVisibleChildEventData extends EventData, ViewStackNotifyPayload {
17
17
  }
18
18
  declare const AdwViewStack_base: (abstract new (...args: any[]) => {
19
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
22
  get halign(): string;
@@ -3,7 +3,7 @@ import { AdwViewStack } from './adw-view-stack.js';
3
3
  import { type ViewId } from './id-reference.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
5
  declare const AdwViewSwitcherBar_base: (abstract new (...args: any[]) => {
6
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
6
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
7
  disconnect(handlerId: number): void;
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get halign(): string;
@@ -5,7 +5,7 @@ export declare const NOTIFY_TITLE = "notify::title";
5
5
  /** Event name emitted when {@link AdwWindowTitle.subtitle} changes. */
6
6
  export declare const NOTIFY_SUBTITLE = "notify::subtitle";
7
7
  declare const AdwWindowTitle_base: (abstract new (...args: any[]) => {
8
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
11
  get halign(): string;
@@ -4,7 +4,7 @@ import { type ConstructProps } from './construct-props.js';
4
4
  /** Every `notify::` an `Adw.WrapBox` emits (adw-wrap-box.c:284-497). */
5
5
  export type AdwWrapBoxProperty = 'child-spacing' | 'child-spacing-unit' | 'pack-direction' | 'align' | 'justify' | 'justify-last-line' | 'line-spacing' | 'line-spacing-unit' | 'line-homogeneous' | 'natural-line-length' | 'natural-line-length-unit' | 'wrap-reverse' | 'wrap-policy' | 'orientation';
6
6
  declare const AdwWrapBox_base: (abstract new (...args: any[]) => {
7
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
7
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
8
8
  disconnect(handlerId: number): void;
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get halign(): string;
@@ -2,7 +2,7 @@ import { GridLayout, StackLayout } from '@nativescript/core';
2
2
  import { AdwCarousel } from './adw-carousel.js';
3
3
  import { type ViewId } from './id-reference.js';
4
4
  declare const AdwCarouselIndicatorBase_base: (abstract new (...args: any[]) => {
5
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
8
  get halign(): string;
@@ -2,7 +2,7 @@ import type { View } from '@nativescript/core';
2
2
  import { GridLayout, StackLayout } from '@nativescript/core';
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  declare const GtkActionBar_base: (abstract new (...args: any[]) => {
5
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
8
  get halign(): string;
@@ -7,7 +7,7 @@ export declare const GTK_BUTTON_IMAGE_CLASS = "image-button";
7
7
  /** The class the button's own label carries, so the theme can give it Adwaita's type. */
8
8
  export declare const GTK_BUTTON_LABEL_CLASS = "adw-button-label";
9
9
  declare const GtkButton_base: (abstract new (...args: any[]) => {
10
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
13
  get halign(): string;
@@ -16,7 +16,7 @@ export interface NotifyDropDownSelectedEventData extends EventData {
16
16
  label: string;
17
17
  }
18
18
  declare const GtkDropDown_base: (abstract new (...args: any[]) => {
19
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
22
  get halign(): string;
@@ -14,7 +14,7 @@ export interface NotifyEntryTextEventData extends EventData {
14
14
  textLength: number;
15
15
  }
16
16
  declare const GtkEntry_base: (abstract new (...args: any[]) => {
17
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
20
  get halign(): string;
@@ -12,7 +12,7 @@ import { type ConstructProps } from './construct-props.js';
12
12
  */
13
13
  export declare const DEFAULT_GTK_IMAGE_SIZE: number;
14
14
  declare const GtkImage_base: (abstract new (...args: any[]) => {
15
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
18
  get halign(): string;
@@ -2,7 +2,7 @@ import { Label } from '@nativescript/core';
2
2
  import { type LabelEllipsizeMode } from '@gjsify/adwaita-core';
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  declare const GtkLabel_base: (abstract new (...args: any[]) => {
5
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => void): number;
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
8
  get halign(): string;
@@ -5,7 +5,7 @@ import { type ConstructProps } from './construct-props.js';
5
5
  /** `GtkPopover::closed`, emitted when the menu goes away. */
6
6
  export declare const CLOSED = "closed";
7
7
  declare const GtkPopoverMenu_base: (abstract new (...args: any[]) => {
8
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
11
  get halign(): string;
@@ -12,7 +12,7 @@ export declare const NOTIFY_STACK_VISIBLE_CHILD_NAME = "notify::visible-child-na
12
12
  export interface NotifyStackVisibleChildEventData extends EventData, ViewStackNotifyPayload {
13
13
  }
14
14
  declare const GtkStack_base: (abstract new (...args: any[]) => {
15
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
18
  get halign(): string;
@@ -14,7 +14,7 @@ export interface GtkTextBufferSubset {
14
14
  insert_at_cursor(text: string, len?: number): void;
15
15
  }
16
16
  declare const GtkTextView_base: (abstract new (...args: any[]) => {
17
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => void): number;
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
20
  get halign(): string;
@@ -1,11 +1,44 @@
1
+ import type { EventData, View } from '@nativescript/core';
1
2
  import { type ConstructProps } from './construct-props.js';
2
3
  import { AdwSingleChildBase } from './single-child-base.js';
4
+ export declare const NOTIFY_IS_ACTIVE = "notify::is-active";
5
+ export declare const NOTIFY_MAXIMIZED = "notify::maximized";
6
+ export declare const NOTIFY_FOCUS_WIDGET = "notify::focus-widget";
7
+ export declare const CLOSE_REQUEST = "close-request";
3
8
  export declare class GtkWindow extends AdwSingleChildBase {
4
9
  static readonly GTypeName: string;
5
10
  private _title;
6
11
  private _defaultWidth;
7
12
  private _defaultHeight;
13
+ private readonly _members;
14
+ private readonly _closeRequest;
15
+ private _unwatchForeground;
8
16
  constructor(props?: ConstructProps<GtkWindow>);
17
+ onLoaded(): void;
18
+ onUnloaded(): void;
19
+ /** `GtkWindow:is-active` (read-only): the application is in the foreground. */
20
+ get isActive(): boolean;
21
+ is_active(): boolean;
22
+ /** `GtkWindow:maximized`: always true here. Writing false throws; writing true is a no-op. */
23
+ get maximized(): boolean;
24
+ set maximized(value: boolean | string);
25
+ is_maximized(): boolean;
26
+ /** The window is the screen already: nothing to do, nothing to notify. */
27
+ maximize(): void;
28
+ unmaximize(): void;
29
+ /** The application's `activate` returns the root window, so it is presented already. */
30
+ present(): void;
31
+ /** `GtkWindow:focus-widget` (read-only): the view holding native focus, found live. */
32
+ get focusWidget(): View | null;
33
+ get_focus(): View | null;
34
+ /** Move native focus to a descendant, or clear it with `null`. */
35
+ set_focus(widget: View | null): void;
36
+ /**
37
+ * `gtk_window_close`: emit `close-request`; a handler returning true keeps the window, else
38
+ * it ends. Throws on iOS (no public API to end the root) before any handler runs.
39
+ */
40
+ close(): void;
41
+ connect(eventName: string, callback: (self: this, data: EventData) => unknown): number;
9
42
  /** `GtkWindow:title`. Held: a `Page` has no title bar of this window's to put it in. */
10
43
  get title(): string;
11
44
  set title(value: string | null);
@@ -8,7 +8,7 @@ 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. */
@@ -31,7 +31,7 @@ export type ObservableConstructor = abstract new (...args: any[]) => Observable;
31
31
  * the two methods and would otherwise carry a second, identical copy one prototype up.
32
32
  */
33
33
  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;
34
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
35
35
  disconnect(handlerId: number): void;
36
36
  emit(eventName: string, ...args: unknown[]): void;
37
37
  get halign(): string;
@@ -11,7 +11,7 @@ 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
17
  get halign(): string;
@@ -9,7 +9,7 @@ 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
15
  get halign(): string;
@@ -1,7 +1,7 @@
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
7
  get halign(): string;
@@ -9,7 +9,7 @@ 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
15
  get halign(): string;
@@ -13,7 +13,7 @@ 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
19
  get halign(): string;
@@ -0,0 +1,18 @@
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
+ /** End the window. Throws where the platform has no way to. */
10
+ finish(): void;
11
+ isFocused(view: View): boolean;
12
+ requestFocus(view: View): void;
13
+ clearFocus(view: View): void;
14
+ }
15
+ /** @internal A seam for the specs: `null` restores the platform's own. */
16
+ export declare function useWindowHost(host: WindowHost | null): void;
17
+ export declare const nativeWindowHost: WindowHost;
18
+ export declare function windowHost(): WindowHost;
@@ -0,0 +1 @@
1
+ export declare const GtkWindowMembersNsTest: () => Promise<void>;
@@ -0,0 +1,6 @@
1
+ import { type View } from '@nativescript/core';
2
+ export declare const canFinishWindow = true;
3
+ export declare function finishWindow(): void;
4
+ export declare function isViewFocused(view: View): boolean;
5
+ export declare function focusView(view: View): void;
6
+ export declare function blurView(view: View): void;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,6 @@
1
+ import type { View } from '@nativescript/core';
2
+ export declare const canFinishWindow = false;
3
+ export declare function finishWindow(): void;
4
+ export declare function isViewFocused(view: View): boolean;
5
+ export declare function focusView(view: View): void;
6
+ export declare function blurView(view: View): 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.0",
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.0",
77
+ "@gjsify/adwaita-fonts": "^0.63.0",
78
+ "@gjsify/adwaita-icons": "^0.63.0",
79
+ "@gjsify/canvas2d-core": "^0.63.0",
80
+ "@gjsify/native-platform": "^0.63.0"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@nativescript/core": "*",
84
- "@gjsify/app-settings": "^0.62.0"
84
+ "@gjsify/app-settings": "^0.63.0"
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.0",
96
+ "@gjsify/blueprint": "^0.63.0",
97
+ "@gjsify/cli": "^0.63.0",
98
+ "@gjsify/unit": "^0.63.0",
99
+ "@gjsify/vite-plugin-blueprint": "^0.63.0",
100
100
  "@types/node": "^25.9.2",
101
101
  "typescript": "^6.0.3"
102
102
  },
@@ -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;
@@ -836,6 +839,11 @@ export const Application = {
836
839
  if (at !== -1) existing.splice(at, 1);
837
840
  },
838
841
 
842
+ /** Deliver a lifecycle event (`resume`, `suspend`) to its subscribers, as the platform does. */
843
+ emitLifecycle(event: string): void {
844
+ for (const callback of (LIFECYCLE.get(event) ?? []).slice()) callback({ eventName: event });
845
+ },
846
+
839
847
  /** Absent, as on every platform that is not Android — and this is not Android. */
840
848
  android: undefined as undefined,
841
849
  /** Absent, as on every platform that is not iOS — and this is not iOS. */