@interopio/desktop 6.15.0 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/desktop.d.ts CHANGED
@@ -98,6 +98,12 @@ export declare namespace IOConnectDesktop {
98
98
  */
99
99
  appManager?: boolean | IOConnectDesktop.AppManager.Mode;
100
100
 
101
+ /**
102
+ * Initializes or disables the Apps API.
103
+ * @default false
104
+ */
105
+ apps?: boolean;
106
+
101
107
  /**
102
108
  * Initializes or disables the Layouts API. You can also specify mode and configuration with which that Layouts API will be initialized.
103
109
  * @default "slim"
@@ -174,6 +180,16 @@ export declare namespace IOConnectDesktop {
174
180
  */
175
181
  appManager: IOConnectDesktop.AppManager.API;
176
182
 
183
+ /**
184
+ * Apps API.
185
+ */
186
+ apps: IOConnectDesktop.Apps.API;
187
+
188
+ /**
189
+ * Platform API.
190
+ */
191
+ platform: IOConnectDesktop.Platform.API;
192
+
177
193
  /**
178
194
  * Layouts API.
179
195
  */
@@ -959,10 +975,13 @@ export declare namespace IOConnectDesktop {
959
975
  * - *Instance* - a running copy of an app. The App Management API provides facilities for starting/stopping app instances and tracking app-related events.
960
976
  *
961
977
  * The App Management API is accessible through the `io.appManager` object.
978
+ *
979
+ * @deprecated The AppManager API is deprecated. Use the new Apps API (`io.apps`) instead.
962
980
  */
963
981
  namespace AppManager {
964
982
  /**
965
983
  * App Management API.
984
+ * @deprecated Use the new Apps API (`io.apps`) instead. This API will be removed in a future version.
966
985
  */
967
986
  export interface API extends AppManager, Entitlements {
968
987
  /**
@@ -1510,7 +1529,7 @@ export declare namespace IOConnectDesktop {
1510
1529
  /**
1511
1530
  * Retrieves the starting context of the instance.
1512
1531
  */
1513
- getContext(): Promise<object>;
1532
+ getContext(): Promise<Record<string, any>>;
1514
1533
 
1515
1534
  /**
1516
1535
  * Retrieves the window object corresponding to the app instance.
@@ -1651,8 +1670,6 @@ export declare namespace IOConnectDesktop {
1651
1670
  activityType?: string;
1652
1671
  /** If `true`, multiple instances of the app can be started. */
1653
1672
  allowMultiple?: boolean;
1654
- /** Whether to register the iodesktop object in the global window context. */
1655
- registerIoDesktop?: boolean;
1656
1673
  }
1657
1674
 
1658
1675
  /** @ignore */
@@ -1694,6 +1711,492 @@ export declare namespace IOConnectDesktop {
1694
1711
  }
1695
1712
  }
1696
1713
 
1714
+ /**
1715
+ * The App Management V2 API provides a modern, fully async way to manage **io.Connect Desktop** apps.
1716
+ * It is accessible through the `io.apps` object.
1717
+ */
1718
+ namespace Apps {
1719
+ /**
1720
+ * App Management API.
1721
+ */
1722
+ export interface API {
1723
+ /**
1724
+ * Provides access to the current app instance and application definition.
1725
+ * This is useful for getting information about the app currently running in the foreground.
1726
+ */
1727
+ readonly my: My;
1728
+
1729
+ /**
1730
+ * App registry for managing app definitions and metadata.
1731
+ */
1732
+ readonly registry: AppRegistry;
1733
+
1734
+ /**
1735
+ * Instance manager for controlling running app instances.
1736
+ */
1737
+ readonly instances: InstanceManager;
1738
+ }
1739
+
1740
+ /**
1741
+ * Provides access to the current app instance and application definition.
1742
+ * This is useful for getting information about the app currently running in the foreground.
1743
+ */
1744
+ export interface My {
1745
+ /**
1746
+ * The current application instance.
1747
+ */
1748
+ readonly instance: ApplicationInstance;
1749
+
1750
+ /**
1751
+ * My application name.
1752
+ */
1753
+ readonly appName: string;
1754
+ }
1755
+
1756
+ /**
1757
+ * App registry for managing app definitions and metadata.
1758
+ */
1759
+ export interface AppRegistry {
1760
+ /**
1761
+ * API for handling app definitions at runtime.
1762
+ * The API methods operate only on in-memory app definitions.
1763
+ */
1764
+ readonly inMemory: InMemoryStore;
1765
+
1766
+ /**
1767
+ * Retrieves an app definition by name.
1768
+ * @param options Options for retrieving the app definition.
1769
+ */
1770
+ get(options: GetAppOptions): Promise<Application | null>;
1771
+
1772
+ /**
1773
+ * Retrieves multiple app definitions with optional filtering and pagination.
1774
+ * @param filter Optional filter criteria for apps.
1775
+ * @param options Options for retrieving app definitions.
1776
+ */
1777
+ getMany(filter?: AppFilter): Promise<Application[]>;
1778
+
1779
+ /**
1780
+ * Checks if an app exists and is available.
1781
+ * @param name The name of the app to check.
1782
+ */
1783
+ has(name: string): Promise<boolean>;
1784
+
1785
+ /**
1786
+ * Subscribes to app addition events.
1787
+ * @param handler Handler for app addition events.
1788
+ * @returns A promise that resolves to an unsubscribe function.
1789
+ */
1790
+ onAdded(handler: AppEventHandler<AppAddedEvent>): Promise<UnsubscribeFunction>;
1791
+
1792
+ /**
1793
+ * Subscribes to app removal events.
1794
+ * @param handler Handler for app removal events.
1795
+ * @returns A promise that resolves to an unsubscribe function.
1796
+ */
1797
+ onRemoved(handler: AppEventHandler<AppRemovedEvent>): Promise<UnsubscribeFunction>;
1798
+
1799
+ /**
1800
+ * Subscribes to app update events.
1801
+ * @param handler Handler for app update events.
1802
+ * @returns A promise that resolves to an unsubscribe function.
1803
+ */
1804
+ onUpdated(handler: AppEventHandler<AppUpdatedEvent>): Promise<UnsubscribeFunction>;
1805
+
1806
+ }
1807
+
1808
+ /**
1809
+ * Instance manager for controlling running app instances.
1810
+ */
1811
+ export interface InstanceManager {
1812
+ /**
1813
+ * Starts a new app instance.
1814
+ * @param options Options for starting the app instance.
1815
+ */
1816
+ start(options: StartAppOptions): Promise<ApplicationInstance>;
1817
+
1818
+ /**
1819
+ * Stops an app instance.
1820
+ * @param options Options for stopping the app instance.
1821
+ */
1822
+ stop(options: StopInstanceOptions): Promise<void>;
1823
+
1824
+ /**
1825
+ * Waits for an app instance to be ready.
1826
+ * This method resolves when the app instance is fully initialized and ready to use.
1827
+ * @param options Options for waiting for an app instance to be ready.
1828
+ */
1829
+ waitForReady(options: InstanceSelect): Promise<void>;
1830
+
1831
+ /**
1832
+ * Retrieves an app instance by ID.
1833
+ * @param options Options for selecting the instance.
1834
+ */
1835
+ get(options: InstanceSelect): Promise<ApplicationInstance | null>;
1836
+
1837
+ /**
1838
+ * Retrieves all running app instances with optional filtering.
1839
+ * @param filter Optional filter criteria for instances.
1840
+ */
1841
+ getMany(filter?: InstanceFilter): Promise<ApplicationInstance[]>;
1842
+
1843
+ /**
1844
+ * Retrieves the state of an app instance.
1845
+ * @param options Options for selecting the instance.
1846
+ */
1847
+ getState(options: InstanceSelect): Promise<InstanceState>;
1848
+
1849
+ /**
1850
+ * Retrieves the context of an app instance.
1851
+ * @param options Options for selecting the instance.
1852
+ */
1853
+ getContext(options: InstanceSelect): Promise<Record<string, any>>;
1854
+
1855
+ /**
1856
+ * Restarts an app instance.
1857
+ * @param options Options for restarting the instance.
1858
+ */
1859
+ restart(options: RestartInstanceOptions): Promise<ApplicationInstance>;
1860
+
1861
+ /**
1862
+ * Subscribes to instance started events.
1863
+ * @param handler Handler for instance started events.
1864
+ * @returns A promise that resolves to an unsubscribe function.
1865
+ */
1866
+ onStarted(handler: InstanceEventHandler<InstanceStartedEvent>): Promise<UnsubscribeFunction>;
1867
+
1868
+ /**
1869
+ * Subscribes to instance stopped events.
1870
+ * @param handler Handler for instance stopped events.
1871
+ * @returns A promise that resolves to an unsubscribe function.
1872
+ */
1873
+ onStopped(handler: InstanceEventHandler<InstanceStoppedEvent>): Promise<UnsubscribeFunction>;
1874
+
1875
+ /**
1876
+ * Subscribes to instance state changed events.
1877
+ * @param handler Handler for instance state changed events.
1878
+ * @returns A promise that resolves to an unsubscribe function.
1879
+ */
1880
+ onStateChanged(handler: InstanceEventHandler<InstanceStateChangedEvent>): Promise<UnsubscribeFunction>;
1881
+ }
1882
+
1883
+ /**
1884
+ * API for handling app definitions at runtime.
1885
+ * The API methods operate only on in-memory app definitions.
1886
+ */
1887
+ export interface InMemoryStore {
1888
+ /**
1889
+ * Imports the provided collection of app definitions.
1890
+ * @param definitions A collection of app definition objects to be imported.
1891
+ * @param mode Mode for importing app definitions. Use `"replace"` (default) to replace all existing in-memory app definitions.
1892
+ * Use `"merge"` to update the existing ones and add new ones.
1893
+ */
1894
+ import(definitions: Definition[], mode?: "replace" | "merge"): Promise<ImportResult>;
1895
+
1896
+ /**
1897
+ *
1898
+ * Checks if an app definition exists in the in-memory store.
1899
+ * @param name The name of the app definition to check.
1900
+ */
1901
+ has(name: string): Promise<boolean>;
1902
+
1903
+ /**
1904
+ * Removes an app definition from the in-memory store.
1905
+ * @param options Remove options.
1906
+ */
1907
+ remove(options: RemoveAppOptions): Promise<void>;
1908
+
1909
+ /**
1910
+ * Removes all app definitions from the in-memory store.
1911
+ * @param options Clear options.
1912
+ */
1913
+ clear(options?: ClearAppsOptions): Promise<void>;
1914
+ }
1915
+
1916
+ // Event Types
1917
+ export type AppAddedEvent = { app: ApplicationCore; };
1918
+ export type AppRemovedEvent = { appName: string; };
1919
+ export type AppUpdatedEvent = { app: ApplicationCore; changes: AppChangeSet };
1920
+
1921
+ export type InstanceStartedEvent = { instance: ApplicationInstance; };
1922
+ export type InstanceStoppedEvent = { instance: ApplicationInstance; reason?: string; };
1923
+ export type InstanceStateChangedEvent = { instance: ApplicationInstance; state: InstanceState }
1924
+
1925
+ // Event Handlers
1926
+ export type AppEventHandler<T> = (event: T) => void;
1927
+ export type InstanceEventHandler<T> = (event: T) => void;
1928
+
1929
+ export interface ApplicationCore {
1930
+ readonly name: string;
1931
+ readonly type: AppType;
1932
+ readonly title?: string;
1933
+ readonly version?: string;
1934
+ readonly description?: string;
1935
+ readonly icon?: string;
1936
+ readonly iconURL?: string;
1937
+ readonly keywords?: string[];
1938
+ readonly autoStart?: boolean;
1939
+ readonly allowMultiple?: boolean;
1940
+ readonly isHidden?: boolean;
1941
+ readonly isShell?: boolean;
1942
+ readonly isInMemory?: boolean;
1943
+ }
1944
+
1945
+ // Core Data Types
1946
+ export interface Application extends ApplicationCore {
1947
+ fdc3?: Record<string, any>;
1948
+ customProperties?: Record<string, any>;
1949
+ definition?: Definition;
1950
+ instances?: ApplicationInstance[];
1951
+ }
1952
+
1953
+ export interface ApplicationInstance {
1954
+ id: string;
1955
+ appName: string;
1956
+ startedAt: Date;
1957
+ startedBy: StartedByInfo;
1958
+ interopInstance?: Promise<IOConnectDesktop.Interop.Instance>;
1959
+ pid?: number;
1960
+ }
1961
+
1962
+ // Filter Types
1963
+ export interface AppFilter extends AppDataOptions {
1964
+ readonly names?: string[];
1965
+ readonly types?: AppType[];
1966
+ readonly isHidden?: boolean;
1967
+ readonly isFdc3Definition?: boolean;
1968
+ readonly isInMemory?: boolean;
1969
+ readonly keywords?: string[];
1970
+ readonly customProperties?: Record<string, any>;
1971
+ }
1972
+
1973
+ export interface InstanceFilter {
1974
+ readonly ids?: string[];
1975
+ readonly appNames?: string[];
1976
+ readonly startedAfter?: Date;
1977
+ readonly startedBefore?: Date;
1978
+ }
1979
+
1980
+ // Options Types
1981
+ export interface GetAppOptions extends AppSelect, AppDataOptions {
1982
+ }
1983
+
1984
+ export interface AppSelect {
1985
+ readonly name: string;
1986
+ }
1987
+
1988
+ export interface AppDataOptions {
1989
+ /**
1990
+ * If true, the app definition will be included in the result.
1991
+ * @default false
1992
+ */
1993
+ readonly includeDefinition?: boolean;
1994
+ /**
1995
+ * If true, the app instances will be included in the result.
1996
+ * @default true
1997
+ */
1998
+ readonly includeInstances?: boolean;
1999
+ }
2000
+
2001
+ export interface StartAppOptions {
2002
+ readonly name: string;
2003
+ /**
2004
+ * Context to pass to the started instance.
2005
+ * If not provided, the context from the app definition will be used.
2006
+ * If the app definition does not have a context, an empty object will be used.
2007
+ */
2008
+ readonly context?: Record<string, any>;
2009
+ /**
2010
+ * If provided, this will override the app definition used to start the instance.
2011
+ * TODO We have to decide how to handle this - we have so called startup args like ignoreSavedLayout, hidden, focus,
2012
+ * TODO It is a mixture of top-level app properties and app-details-specific properties.
2013
+ */
2014
+ readonly definitionOverride?: Record<string, any>;
2015
+ /**
2016
+ * The timeout for the start operation in milliseconds.
2017
+ * @default 120000
2018
+ */
2019
+ readonly timeout?: number;
2020
+ /**
2021
+ * If true, the app will attempt to reuse an existing instance if available.
2022
+ * @default false
2023
+ */
2024
+ readonly reuseInstance?: boolean;
2025
+ }
2026
+
2027
+ export interface StopInstanceOptions {
2028
+ /**
2029
+ * The ID of the instance to stop.
2030
+ */
2031
+ readonly id: string;
2032
+ /**
2033
+ * If true, the instance will be forcefully stopped without waiting for it to gracefully shut down.
2034
+ * @default false
2035
+ */
2036
+ readonly force?: boolean;
2037
+ /**
2038
+ * The timeout for the stop operation in milliseconds.
2039
+ * @default 30000
2040
+ */
2041
+ readonly timeout?: number;
2042
+ /**
2043
+ * Optional reason for stopping the instance.
2044
+ */
2045
+ readonly reason?: string;
2046
+ }
2047
+
2048
+ export interface RestartInstanceOptions {
2049
+ /**
2050
+ * The ID of the instance to restart.
2051
+ */
2052
+ readonly id: string;
2053
+ /**
2054
+ * Context to pass to the restarted instance.
2055
+ * If "preserve", the context from the original instance is reused.
2056
+ * If "clear", the context is reset to an empty object.
2057
+ * If not provided, the context is preserved by default.
2058
+ * @default "preserve"
2059
+ */
2060
+ readonly context?: Record<string, any> | "preserve" | "clear";
2061
+ /**
2062
+ * If true, the original app definition is used for the restarted instance.
2063
+ * @default false
2064
+ */
2065
+ readonly useOriginalDefinition?: boolean;
2066
+ /**
2067
+ * The timeout for the restart operation.
2068
+ * @default 120000
2069
+ */
2070
+ readonly timeout?: number;
2071
+ }
2072
+
2073
+ export interface ImportOptions {
2074
+ readonly mode?: "replace" | "merge";
2075
+ readonly validateOnly?: boolean;
2076
+ readonly skipInvalid?: boolean;
2077
+ }
2078
+
2079
+ export interface ExportOptions {
2080
+ readonly includeConfiguration?: boolean;
2081
+ readonly includeMetadata?: boolean;
2082
+ }
2083
+
2084
+ export interface RemoveAppOptions {
2085
+ readonly name: string;
2086
+ readonly stopInstances?: boolean;
2087
+ }
2088
+
2089
+ export interface ClearAppsOptions {
2090
+ readonly stopAllInstances?: boolean;
2091
+ readonly preserveSystemApps?: boolean;
2092
+ }
2093
+
2094
+ export interface InstanceSelect {
2095
+ readonly id: string;
2096
+ }
2097
+
2098
+ // Enum Types
2099
+ export type AppType = ApplicationConfig["type"];
2100
+ export type InstanceState = "started" | "ready" | "stopped" | "failed";
2101
+
2102
+ export interface AppChangeSet {
2103
+ readonly [key: string]: any;
2104
+ }
2105
+
2106
+ export type Definition = ApplicationConfig;
2107
+
2108
+ export interface ImportResult {
2109
+ readonly imported: string[];
2110
+ readonly updated: string[];
2111
+ readonly failed: {
2112
+ readonly name: string;
2113
+ readonly error: string;
2114
+ readonly details?: Record<string, any>;
2115
+ }[];
2116
+ readonly warnings: {
2117
+ readonly name: string;
2118
+ readonly warning: string;
2119
+ readonly details?: Record<string, any>;
2120
+ }[];
2121
+ }
2122
+
2123
+ // Re-export common types from legacy namespace for compatibility
2124
+ export import StartedByInfo = IOConnectDesktop.AppManager.StartedByInfo;
2125
+ }
2126
+
2127
+ /**
2128
+ * @intro
2129
+ * **Platform API** provides system-level operations like restart, shutdown, and shutdown event handling.
2130
+ * It offers a clean interface for managing platform lifecycle events.
2131
+ *
2132
+ * The Platform API is accessible through the `io.platform` object.
2133
+ */
2134
+ namespace Platform {
2135
+ /**
2136
+ * Platform API for system-level operations.
2137
+ */
2138
+ export interface API {
2139
+ /**
2140
+ * Restart the application/platform.
2141
+ * @param options Optional settings for the restart operation.
2142
+ */
2143
+ restart(options?: ExitOptions): Promise<void>;
2144
+
2145
+ /**
2146
+ * Shutdown the application/platform.
2147
+ * @param options Optional settings for the shutdown operation.
2148
+ */
2149
+ shutdown(options?: ExitOptions): Promise<void>;
2150
+
2151
+ /**
2152
+ * Register a callback to be invoked when the platform is shutting down.
2153
+ * @param callback Function to be called during shutdown. Should return a Promise with prevent flag.
2154
+ * @returns Function to unsubscribe the callback.
2155
+ */
2156
+ onShuttingDown(callback: (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean }>): () => void;
2157
+ }
2158
+
2159
+ /**
2160
+ * Options for shutdown or restart operations.
2161
+ */
2162
+ export interface ExitOptions {
2163
+ /**
2164
+ * If `true`, will save the current Global Layout before shutdown/restart.
2165
+ */
2166
+ autoSave?: boolean;
2167
+
2168
+ /**
2169
+ * If `true`, will show a confirmation dialog when shutting down or restarting.
2170
+ */
2171
+ showDialog?: boolean;
2172
+
2173
+ /**
2174
+ * Optional reason for the shutdown/restart.
2175
+ */
2176
+ reason?: string;
2177
+ }
2178
+
2179
+ /**
2180
+ * Arguments passed to shutdown event handlers.
2181
+ */
2182
+ export interface ShuttingDownEventArgs {
2183
+ /**
2184
+ * If `true`, the platform is restarting rather than shutting down.
2185
+ */
2186
+ restarting: boolean;
2187
+
2188
+ /**
2189
+ * Information about the interop instance that initiated the shutdown.
2190
+ */
2191
+ initiator?: IOConnectDesktop.Interop.Instance;
2192
+
2193
+ /**
2194
+ * Reason for the shutdown.
2195
+ */
2196
+ reason?: string;
2197
+ }
2198
+ }
2199
+
1697
2200
  /**
1698
2201
  * @intro
1699
2202
  * **io.Connect Desktop** provides a way for apps to programmatically capture screenshots of the available monitors, of windows and window groups.
@@ -2129,7 +2632,7 @@ export declare namespace IOConnectDesktop {
2129
2632
  * Notifies when a Layout is renamed.
2130
2633
  * @param callback Callback function for handling the event.
2131
2634
  * Receives as a first argument the `Layout` object describing the renamed Layout.
2132
- * Receives as a second argument an object with a `name` property holding the previous Layout name.
2635
+ * Receives as a second optional argument an object with a `name` property holding the previous Layout name (if any).
2133
2636
  */
2134
2637
  onRenamed(callback: (layout: Layout, previous: { name: string }) => void): UnsubscribeFunction;
2135
2638
 
@@ -2491,6 +2994,14 @@ export declare namespace IOConnectDesktop {
2491
2994
  */
2492
2995
  setActivityContext?: boolean;
2493
2996
 
2997
+ /**
2998
+ * If `true`, Workspaces saved in a Global Layout will be restored in their original (unmodified) state when the Global Layout is restored.
2999
+ * If `false`, Workspaces will be restored in the exact state in which they were when the Global Layout was saved.
3000
+ * This will override the `"restoreWorkspacesByReference"` property specified in the definition of the Workspaces App.
3001
+ * Defaults to the value of the `"restoreWorkspacesByReference"` property specified in the Workspaces App definition.
3002
+ * @since io.Connect Desktop 10.0
3003
+ */
3004
+ restoreWorkspacesByReference?: boolean;
2494
3005
  /**
2495
3006
  * Only if the type is `"Activity"` and `activityId` is set.
2496
3007
  * With this you can specify that certain window types should not be restored.
@@ -2862,13 +3373,14 @@ export declare namespace IOConnectDesktop {
2862
3373
  focus?: boolean;
2863
3374
 
2864
3375
  /**
2865
- * If `true`, the window will have move areas and the user will be able to move it. Valid only for io.Connect Windows with `mode` set to `"html"`.
3376
+ * If `true`, the window will have move areas and the user will be able to move it.
3377
+ * Valid only for HTML and frameless io.Connect Windows.
2866
3378
  * @default true
2867
3379
  */
2868
3380
  hasMoveAreas?: boolean;
2869
3381
 
2870
3382
  /**
2871
- * If `true`, the user will be able to resize the window by dragging its borders. Valid only for io.Connect Windows with `mode` set to `"html"`.
3383
+ * If `true`, the user will be able to resize the window by dragging its borders.
2872
3384
  * @default true
2873
3385
  */
2874
3386
  hasSizeAreas?: boolean;
@@ -3113,12 +3625,14 @@ export declare namespace IOConnectDesktop {
3113
3625
  enabled?: boolean;
3114
3626
 
3115
3627
  /**
3116
- * Type of the Channel Selector to show on the io.Connect Windows. A single Channel Selector (default) allows the window to join a single Channel
3117
- * to which it can subscribe and publish data unrestrictedly. A directional single Channel Selector allows the window to join a single Channel,
3118
- * but also enables the user to restrict the window from publishing or from subscribing to the current Channel.
3628
+ * Type of the Channel Selector to show on the io.Connect Windows.
3629
+ * The single Channel Selector (default) allows the window to join a single Channel to which it can subscribe and publish data unrestrictedly.
3630
+ * The directional single Channel Selector allows the window to join a single Channel, but also enables the user to restrict the window from publishing or from subscribing to the current Channel.
3631
+ * The multi Channel Selector allows the window to join multiple Channels simultaneously to which it can subscribe and publish data unrestrictedly.
3632
+ * The directional multi Channel Selector allows the window to join multiple Channels, but also enables the user to restrict the window from publishing or from subscribing to the currently joined Channels.
3119
3633
  * @default "single"
3120
3634
  */
3121
- type?: "single" | "directionalSingle";
3635
+ type?: "single" | "directionalSingle" | "multi" | "directionalMulti";
3122
3636
 
3123
3637
  /**
3124
3638
  * Name of the Channel to which the window will be joined by default when it's started.
@@ -3543,12 +4057,88 @@ export declare namespace IOConnectDesktop {
3543
4057
  options: FlydownOptions;
3544
4058
  }
3545
4059
 
4060
+ /**
4061
+ * Options for creating a popup window. The created window will be frameless and hidden.
4062
+ */
4063
+ export interface CreatePopupOptions {
4064
+ /**
4065
+ * Distance of the top left window corner from the left edge of the screen in pixels.
4066
+ * @default 0
4067
+ */
4068
+ left?: number;
4069
+
4070
+ /**
4071
+ * Distance of the top left window corner from the top edge of the screen in pixels.
4072
+ * @default 0
4073
+ */
4074
+ top?: number;
4075
+
4076
+ /**
4077
+ * Window width in pixels.
4078
+ * @default 600
4079
+ */
4080
+ width?: number;
4081
+
4082
+ /**
4083
+ * Window height in pixels.
4084
+ * @default 600
4085
+ */
4086
+ height?: number;
4087
+
4088
+ /**
4089
+ * If `true`, the window will have rounded corners.
4090
+ */
4091
+ roundedCorners?: boolean;
4092
+
4093
+ /**
4094
+ * If `true`, the user will be able to resize the window by dragging its borders.
4095
+ * @default false
4096
+ */
4097
+ hasSizeAreas?: boolean;
4098
+
4099
+ /**
4100
+ * If `true`, the window will have move areas and the user will be able to move it.
4101
+ * @default true
4102
+ */
4103
+ hasMoveAreas?: boolean;
4104
+
4105
+ /**
4106
+ * If `true`, the window will be transparent.
4107
+ * @default false
4108
+ */
4109
+ transparent?: boolean;
4110
+
4111
+ /**
4112
+ * If `true`, the window styles will be copied from the parent window.
4113
+ * @default true
4114
+ */
4115
+ copyStyles?: boolean;
4116
+ }
4117
+
4118
+ /**
4119
+ * Describes the result from creating a popup window via the `createPopup()` method.
4120
+ */
4121
+ export interface CreatePopupResult {
4122
+ /**
4123
+ * The browser window instance of the created popup window.
4124
+ * Can be used to manipulate the DOM content of the created popup window.
4125
+ */
4126
+ browserWindow: Window;
4127
+
4128
+ /**
4129
+ * The io.Connect Window instance of the created popup window.
4130
+ * Can be used to extract the window ID and pass it to the `showPopup()` method in order to display the popup window.
4131
+ */
4132
+ ioConnectWindow: IOConnectWindow;
4133
+ }
4134
+
3546
4135
  /**
3547
4136
  * Options for creating popup windows.
3548
4137
  */
3549
4138
  export interface PopupOptions {
3550
4139
  /**
3551
4140
  * ID of the window which will be used as a popup window.
4141
+ * As of **io.Connect Desktop** 10.0, the popup window must be a frameless window.
3552
4142
  */
3553
4143
  windowId: string;
3554
4144
 
@@ -3568,6 +4158,13 @@ export declare namespace IOConnectDesktop {
3568
4158
  */
3569
4159
  targetLocation: PopupTargetLocation;
3570
4160
 
4161
+ /**
4162
+ * If `true`, the popup window will gain focus when shown and will hide automatically when it loses focus. If `false`, the popup window won't be on focus when shown and won't hide automatically if it gains and loses focus afterwards. If you set this to `false`, you will be responsible for implementing the conditions and the mechanism for hiding/closing the popup window.
4163
+ * @default true
4164
+ * @since io.Connect Desktop 10.0
4165
+ */
4166
+ focus?: boolean;
4167
+
3571
4168
  /**
3572
4169
  * Horizontal offset from the target bounds (applied only to `left` and `right` target locations).
3573
4170
  */
@@ -3817,14 +4414,13 @@ export declare namespace IOConnectDesktop {
3817
4414
  export interface WindowConfiguration {
3818
4415
  /**
3819
4416
  * If `true`, the window will have move areas and the user will be able to move it.
3820
- * Valid only for io.Connect Windows with `mode` set to `"html"`.
4417
+ * Valid only for HTML and frameless io.Connect Windows.
3821
4418
  * @default true
3822
4419
  */
3823
4420
  hasMoveAreas?: boolean;
3824
4421
 
3825
4422
  /**
3826
4423
  * If `true`, the user will be able to resize the window by dragging its borders.
3827
- * Valid only for io.Connect Windows with `mode` set to `"html"`.
3828
4424
  * @default true
3829
4425
  */
3830
4426
  hasSizeAreas?: boolean;
@@ -3889,6 +4485,7 @@ export declare namespace IOConnectDesktop {
3889
4485
  * If `true`, the window icon will appear in the taskbar.",
3890
4486
  * @since io.Connect Desktop 9.9
3891
4487
  */
4488
+
3892
4489
  showInTaskbar?: boolean;
3893
4490
 
3894
4491
  /**
@@ -4198,7 +4795,7 @@ export declare namespace IOConnectDesktop {
4198
4795
  /**
4199
4796
  * New bounds for the io.Connect Window. If this is provided, the `restoreBounds` property will be ignored.
4200
4797
  */
4201
- newBounds?: Partial<Bounds>;
4798
+ newBounds?: Bounds;
4202
4799
  }
4203
4800
 
4204
4801
  /**
@@ -4217,22 +4814,22 @@ export declare namespace IOConnectDesktop {
4217
4814
  /**
4218
4815
  * Window neighbors on the left side of the io.Connect Window.
4219
4816
  */
4220
- leftNeighbours: IOConnectWindow[];
4817
+ left: IOConnectWindow[];
4221
4818
 
4222
4819
  /**
4223
4820
  * Window neighbors on top of the io.Connect Window.
4224
4821
  */
4225
- topNeighbours: IOConnectWindow[];
4822
+ top: IOConnectWindow[];
4226
4823
 
4227
4824
  /**
4228
4825
  * Window neighbors on the right side of the io.Connect Window.
4229
4826
  */
4230
- rightNeighbours: IOConnectWindow[];
4827
+ right: IOConnectWindow[];
4231
4828
 
4232
4829
  /**
4233
4830
  * Window neighbors to the bottom of the io.Connect Window.
4234
4831
  */
4235
- bottomNeighbours: IOConnectWindow[];
4832
+ bottom: IOConnectWindow[];
4236
4833
  }
4237
4834
 
4238
4835
  /**
@@ -4720,6 +5317,7 @@ export declare namespace IOConnectDesktop {
4720
5317
  */
4721
5318
  value?: string;
4722
5319
  }
5320
+
4723
5321
  /**
4724
5322
  * Options for dragging a window.
4725
5323
  */
@@ -4738,6 +5336,38 @@ export declare namespace IOConnectDesktop {
4738
5336
  y: number;
4739
5337
  }
4740
5338
  }
5339
+
5340
+ /**
5341
+ * Position of the docked window on the screen - top, bottom, left or right.
5342
+ */
5343
+ export type DockingPosition = "top" | "left" | "right" | "bottom";
5344
+
5345
+ /**
5346
+ * Docking configuration for a window.
5347
+ */
5348
+ export interface DockingConfig {
5349
+ /**
5350
+ * If `true`, will enable docking the window to a screen edge.
5351
+ */
5352
+ enabled: boolean;
5353
+ /**
5354
+ * If `true`, the window will claim the area it occupies on the screen when docked, in effect, reducing the working area of the screen.
5355
+ */
5356
+ claimScreenArea?: boolean;
5357
+ /**
5358
+ * Allowed positions for docking the window. Default is [ "top" ].
5359
+ */
5360
+ allowedPositions?: DockingPosition[];
5361
+ /**
5362
+ * Width in pixels for the window when docked at the left or the right screen edge.
5363
+ */
5364
+ width?: number;
5365
+ /**
5366
+ * Height in pixels for the window when docked at the top or the bottom screen edge.
5367
+ */
5368
+ height?: number;
5369
+ }
5370
+
4741
5371
  /**
4742
5372
  * Describes a docked window.
4743
5373
  */
@@ -4749,7 +5379,7 @@ export declare namespace IOConnectDesktop {
4749
5379
  /**
4750
5380
  * Position of the docked window on the screen - top, bottom, left or right.
4751
5381
  */
4752
- position?: string;
5382
+ position?: DockingPosition;
4753
5383
  /**
4754
5384
  * If `true`, the docked window claims the area it occupies on the screen, in effect, reducing the working area of the screen.
4755
5385
  */
@@ -4763,11 +5393,44 @@ export declare namespace IOConnectDesktop {
4763
5393
  /**
4764
5394
  * Position of the docked window on the screen - top, bottom, left or right.
4765
5395
  */
4766
- position: "top" | "bottom" | "left" | "right";
5396
+ position: DockingPosition;
4767
5397
  /**
4768
5398
  * If `true`, the docked window will claim the area it occupies on the screen, in effect, reducing the working area of the screen.
5399
+ * @default false
4769
5400
  */
4770
5401
  claimScreenArea?: boolean;
5402
+ /**
5403
+ * Width in pixels for the window when docked at the left or the right screen edge.
5404
+ * @since io.Connect Desktop 10.0
5405
+ */
5406
+ width?: number;
5407
+ /**
5408
+ * Height in pixels for the window when docked at the top or the bottom screen edge.
5409
+ * @since io.Connect Desktop 10.0
5410
+ */
5411
+ height?: number;
5412
+ /**
5413
+ * If `true`, the last known bounds of the io.Connect Window will be saved unless the window has already been docked.
5414
+ * This allows the window to be restored using these saved bounds when undocking via the `undock()` method.
5415
+ * @default false
5416
+ * @since io.Connect Desktop 10.0
5417
+ */
5418
+ saveBounds?: boolean;
5419
+ }
5420
+
5421
+ /**
5422
+ * Settings for undocking the window.
5423
+ */
5424
+ export interface UndockingOptions {
5425
+ /**
5426
+ * If `true`, the io.Connect Window will be restored to its last known bounds saved in the `dock()` method if `saveBounds` has been set to `true`.
5427
+ */
5428
+ restoreBounds?: boolean;
5429
+
5430
+ /**
5431
+ * New bounds for the io.Connect Window. If this is provided, the `restoreBounds` property will be ignored.
5432
+ */
5433
+ newBounds?: Bounds;
4771
5434
  }
4772
5435
 
4773
5436
  /**
@@ -4876,8 +5539,9 @@ export declare namespace IOConnectDesktop {
4876
5539
  close(options?: CloseOptions): Promise<void>;
4877
5540
 
4878
5541
  /**
4879
- * Creates a popup window.
4880
- * @param config Options for creating a popup window.
5542
+ * Shows a popup window.
5543
+ * As of **io.Connect Desktop** 10.0, the popup window must be a frameless window.
5544
+ * @param config Options for showing a popup window.
4881
5545
  * @since io.Connect Desktop 9.3
4882
5546
  */
4883
5547
  showPopup(config: PopupOptions): Promise<void>;
@@ -4910,7 +5574,7 @@ export declare namespace IOConnectDesktop {
4910
5574
  * Notifies when the window group is about to be closed.
4911
5575
  * @param callback Callback function for handling the event. Returns a `Promise` that will be awaited before the window group is closed. The timeout for waiting is 30 seconds. A function for preventing the closing is passed to the callback as a parameter.
4912
5576
  */
4913
- onClosing(callback: (prevent: (options?: PreventClosingOptions) => void) => Promise<void>): void;
5577
+ onClosing(callback: (prevent: (options?: PreventClosingOptions) => void) => Promise<void>): UnsubscribeFunction;
4914
5578
  }
4915
5579
 
4916
5580
  /**
@@ -4968,9 +5632,17 @@ export declare namespace IOConnectDesktop {
4968
5632
  createFlydown(targetWindowId: string, config: FlydownOptions): Promise<Flydown>;
4969
5633
 
4970
5634
  /**
4971
- * Creates a popup window.
4972
- * @param targetWindowId ID of the window for which to create the popup.
4973
- * @param config Options for creating a popup window.
5635
+ * Creates a window to be used as a popup window. The created window will be frameless and hidden.
5636
+ * @param options Options for creating a popup window.
5637
+ * @since io.Connect Desktop 10.0
5638
+ */
5639
+ createPopup(options: CreatePopupOptions): Promise<CreatePopupResult>;
5640
+
5641
+ /**
5642
+ * Shows a popup window.
5643
+ * As of **io.Connect Desktop** 10.0, the popup window must be a frameless window.
5644
+ * @param targetWindowId ID of the window for which to show the popup.
5645
+ * @param config Options for showing a popup window.
4974
5646
  */
4975
5647
  showPopup(targetWindowId: string, config: PopupOptions): Promise<void>;
4976
5648
 
@@ -5113,6 +5785,11 @@ export declare namespace IOConnectDesktop {
5113
5785
  */
5114
5786
  application: AppManager.Application | undefined;
5115
5787
 
5788
+ /**
5789
+ * Name of the app associated with the current window. Can be `undefined` if the window wasn't started as an app.
5790
+ */
5791
+ appName: string | undefined;
5792
+
5116
5793
  /**
5117
5794
  * Title of the current window.
5118
5795
  */
@@ -5643,7 +6320,8 @@ export declare namespace IOConnectDesktop {
5643
6320
 
5644
6321
  /**
5645
6322
  * Shows a popup window.
5646
- * @param config Options for the popup window.
6323
+ * As of **io.Connect Desktop** 10.0, the popup window must be a frameless window.
6324
+ * @param config Options for showing a popup window.
5647
6325
  */
5648
6326
  showPopup(config: PopupOptions): Promise<IOConnectWindow>;
5649
6327
 
@@ -5726,6 +6404,11 @@ export declare namespace IOConnectDesktop {
5726
6404
  */
5727
6405
  getContext(): Promise<any>;
5728
6406
 
6407
+ /**
6408
+ * Retrieves the application associated with the current window.
6409
+ */
6410
+ getApplication(): Promise<Apps.Application | undefined>;
6411
+
5729
6412
  /**
5730
6413
  * Sets the window context.
5731
6414
  */
@@ -5775,10 +6458,16 @@ export declare namespace IOConnectDesktop {
5775
6458
  getConfiguration(): Promise<WindowConfiguration>;
5776
6459
 
5777
6460
  /**
5778
- * Retrieves the current Channel of the window, if any.
6461
+ * Retrieves the name of the currently joined Channel, if any.
5779
6462
  */
5780
6463
  getChannel(): Promise<string | undefined>;
5781
6464
 
6465
+ /**
6466
+ * Retrieves the names of all currently joined Channels, if any.
6467
+ * @since io.Connect Desktop 10.0
6468
+ */
6469
+ getChannels(): Promise<string[]> | undefined;
6470
+
5782
6471
  /**
5783
6472
  * Enables moving files from a web page to the OS when a user starts dragging a web page element.
5784
6473
  * Based on the Electron [Native File Drag & Drop](https://www.electronjs.org/docs/latest/tutorial/native-file-drag-drop) functionality.
@@ -5855,6 +6544,19 @@ export declare namespace IOConnectDesktop {
5855
6544
  */
5856
6545
  getDockingPlacement(): Promise<DockingPlacement>;
5857
6546
 
6547
+ /**
6548
+ * Sets the docking configuration for the window. This will override the docking configuration specified in the app definition.
6549
+ * @param config Docking settings.
6550
+ * @since io.Connect Desktop 10.0
6551
+ */
6552
+ setDockingConfig(config: DockingConfig): Promise<void>;
6553
+
6554
+ /**
6555
+ * Retrieves the current docking configuration for the window as specified in the app definition or as previously set via the `setDockingConfig()` method.
6556
+ * @since io.Connect Desktop 10.0
6557
+ */
6558
+ getDockingConfig(): Promise<DockingConfig>;
6559
+
5858
6560
  /**
5859
6561
  * Docks the window at the specified position.
5860
6562
  * @param options Options for docking the window.
@@ -5862,6 +6564,13 @@ export declare namespace IOConnectDesktop {
5862
6564
  */
5863
6565
  dock(options: DockingOptions): Promise<DockingPlacement>;
5864
6566
 
6567
+ /**
6568
+ * Undocks the window if it is already docked.
6569
+ * @param options Options for undocking the window.
6570
+ * @since io.Connect Desktop 10.0
6571
+ */
6572
+ undock(options?: UndockingOptions): Promise<void>;
6573
+
5865
6574
  /**
5866
6575
  * Notifies when a window is attached to the current window.
5867
6576
  * @param callback Callback function for handling the event.
@@ -6018,7 +6727,7 @@ export declare namespace IOConnectDesktop {
6018
6727
  * before the window is closed. The timeout for waiting is subject to configuration in **io.Connect Desktop**.
6019
6728
  * A function for preventing the closing is passed to the callback as a parameter.
6020
6729
  */
6021
- onClosing(callback: (prevent: (options?: PreventClosingOptions) => void) => Promise<void>): void;
6730
+ onClosing(callback: (prevent: (options?: PreventClosingOptions) => void) => Promise<void>): UnsubscribeFunction;
6022
6731
 
6023
6732
  /**
6024
6733
  * Notifies when the window is about to be refreshed.
@@ -6026,7 +6735,7 @@ export declare namespace IOConnectDesktop {
6026
6735
  * before the window is refreshed. The timeout for waiting is subject to configuration in **io.Connect Desktop**.
6027
6736
  * A function for preventing the refresh is passed to the callback as a parameter.
6028
6737
  */
6029
- onRefreshing(callback: (prevent: () => void) => Promise<void>): void;
6738
+ onRefreshing(callback: (prevent: () => void) => Promise<void>): UnsubscribeFunction;
6030
6739
 
6031
6740
  /**
6032
6741
  * Notifies when the zoom factor is changed.
@@ -6050,7 +6759,7 @@ export declare namespace IOConnectDesktop {
6050
6759
  * Notifies when the window is about to be navigated to a new URL.
6051
6760
  * @param callback Callback function for handling the event.
6052
6761
  */
6053
- onNavigating(callback: (args: { newUrl: string }) => Promise<void>): void;
6762
+ onNavigating(callback: (args: { newUrl: string }) => Promise<void>): UnsubscribeFunction;
6054
6763
 
6055
6764
  /**
6056
6765
  * Notifies when the window docking placement is changed.
@@ -6373,7 +7082,7 @@ export declare namespace IOConnectDesktop {
6373
7082
  /**
6374
7083
  * Notifies when the current window joins or leaves a Channel. Returns an unsubscribe function.
6375
7084
  * It's recommended to use the `onChannelsChanged()` method instead, which can handle Channel changes both in single and in multi Channel mode.
6376
- * @param callback Callback function for handling the event. Receives as an argument the name of the Channel which the window has joined or left.
7085
+ * @param callback Callback function for handling the event. Receives as an argument the name of the newly joined Channel. If the window leaves a Channel without joining a new one, the argument will be `undefined`.
6377
7086
  */
6378
7087
  onChanged(callback: (channel: string) => void): () => void;
6379
7088
 
@@ -6613,7 +7322,7 @@ export declare namespace IOConnectDesktop {
6613
7322
  * Whether the current app has registered a hotkey.
6614
7323
  * @param hotkey The name of the hotkey you want to check.
6615
7324
  */
6616
- isRegistered(hotkey: string): void;
7325
+ isRegistered(hotkey: string): boolean;
6617
7326
  }
6618
7327
  }
6619
7328
 
@@ -6661,14 +7370,14 @@ export declare namespace IOConnectDesktop {
6661
7370
  * @param callback Callback function for handling the event. Receives an object describing the added Intent handler as an argument.
6662
7371
  * @since io.Connect Desktop 9.6
6663
7372
  */
6664
- onHandlerAdded(callback: (handler: IOConnectDesktop.Intents.IntentHandler) => void, intentName: string): UnsubscribeFunction;
7373
+ onHandlerAdded(callback: (handler: IOConnectDesktop.Intents.IntentHandler, intentName: string) => void): UnsubscribeFunction;
6665
7374
 
6666
7375
  /**
6667
7376
  * Notifies when a handler for an Intent is removed. Returns an unsubscribe function.
6668
7377
  * @param callback Callback function for handling the event. Receives an object describing the removed Intent handler as an argument.
6669
7378
  * @since io.Connect Desktop 9.6
6670
7379
  */
6671
- onHandlerRemoved(callback: (handler: IOConnectDesktop.Intents.IntentHandler) => void, intentName: string): UnsubscribeFunction;
7380
+ onHandlerRemoved(callback: (handler: IOConnectDesktop.Intents.IntentHandler, intentName: string) => void): UnsubscribeFunction;
6672
7381
 
6673
7382
  /**
6674
7383
  * Registers an Intent handler. If your app is already registered as an Intent handler through its configuration,
@@ -7765,7 +8474,7 @@ export declare namespace IOConnectDesktop {
7765
8474
  enabled?: boolean;
7766
8475
  /**
7767
8476
  * Interval in milliseconds for which the notifications will be snoozed.
7768
- * @default 600000
8477
+ * @default 60000
7769
8478
  */
7770
8479
  duration?: number;
7771
8480
  };
@@ -7774,11 +8483,6 @@ export declare namespace IOConnectDesktop {
7774
8483
  * If `true`, will enable showing a notification badge on the tray menu icon, in the "Notifications" section of the io.Connect launcher, and on the taskbar icon of the io.Connect launcher (or your shell app).
7775
8484
  */
7776
8485
  showNotificationBadge?: boolean;
7777
-
7778
- /**
7779
- * If `true`, the Notification Panel will be hidden automatically when it loses focus.
7780
- */
7781
- autoHidePanel?: boolean;
7782
8486
  }
7783
8487
 
7784
8488
  /**
@@ -7830,7 +8534,7 @@ export declare namespace IOConnectDesktop {
7830
8534
  * Notifies when the theme is changed.
7831
8535
  * @param callback Callback function for handling the event.
7832
8536
  */
7833
- onChanged(callback: (theme: IOConnectDesktop.Themes.Theme) => any): void;
8537
+ onChanged(callback: (theme: IOConnectDesktop.Themes.Theme) => any): UnsubscribeFunction;
7834
8538
  }
7835
8539
 
7836
8540
  /**