@interopio/desktop 6.16.0 → 6.16.2

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
@@ -271,7 +271,7 @@ export declare namespace IOConnectDesktop {
271
271
  * - application state synchronization via Activity context management functions;
272
272
  * - intra-Activity application collaboration via Activity Interop extension functions;
273
273
  *
274
- * The Activities API is accessible through the `io.activities` object.
274
+ * The Activities API is accessible via the `io.activities` object.
275
275
  */
276
276
  namespace Activities {
277
277
 
@@ -974,9 +974,9 @@ export declare namespace IOConnectDesktop {
974
974
  *
975
975
  * - *Instance* - a running copy of an app. The App Management API provides facilities for starting/stopping app instances and tracking app-related events.
976
976
  *
977
- * The App Management API is accessible through the `io.appManager` object.
977
+ * The App Management API is accessible via the [`io.appManager`](#API) object.
978
978
  *
979
- * @deprecated The AppManager API is deprecated. Use the new Apps API (`io.apps`) instead.
979
+ * > ⚠️ *Note that the App Management API has been deprecated and will be entirely removed in a future release. Use the Apps API accessible via the [`io.apps`](../apps/index.html#API) object instead.*
980
980
  */
981
981
  namespace AppManager {
982
982
  /**
@@ -1676,9 +1676,10 @@ export declare namespace IOConnectDesktop {
1676
1676
  export type Roles = "Full" | "ReadWrite" | "ReadOnly";
1677
1677
 
1678
1678
  /**
1679
- * App definition.
1679
+ * App definition. All available app definition properties are described in the `application.json` JSON schema of **io.Connect Desktop**.
1680
1680
  */
1681
- export type Definition = ApplicationConfig
1681
+ export interface Definition extends ApplicationConfig {
1682
+ }
1682
1683
 
1683
1684
  /**
1684
1685
  * Describes an Intent.
@@ -1712,103 +1713,116 @@ export declare namespace IOConnectDesktop {
1712
1713
  }
1713
1714
 
1714
1715
  /**
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.
1716
+ * @intro
1717
+ * > ⚠️ *Note that the Apps API is still an experimental feature. This means that it may have hidden issues and may be subject to changes in future releases.*
1718
+ * >
1719
+ * > The Apps API is designed to replace the legacy App Management API accessible via the [`io.appManager`](../app%20management/index.html#API) object.
1720
+ * > The legacy App Management API is still supported, but will be entirely removed in a future release. It's highly recommended to migrate to the new Apps API.*
1721
+ *
1722
+ * The Apps API provides a modern, fully asynchronous way to manage **io.Connect Desktop** apps. It offers abstractions for:
1723
+ *
1724
+ * - App - a program as a logical entity, registered in **io.Connect Desktop** with some metadata (name, description, icon, etc.)
1725
+ * and with all the configuration needed to spawn one or more instances of it.
1726
+ * The Apps API provides facilities for retrieving app metadata and for detecting when an app is started.
1727
+ *
1728
+ * - Instance - a running copy of an app. The Apps API provides facilities for starting/stopping app instances and tracking app-related events.
1729
+ *
1730
+ * The Apps API is accessible via the [`io.apps`](#API) object.
1731
+ *
1732
+ * *Available since io.Connect Desktop 10.0.*
1717
1733
  */
1718
1734
  namespace Apps {
1735
+
1719
1736
  /**
1720
- * App Management API.
1737
+ * Apps API.
1721
1738
  */
1722
1739
  export interface API {
1740
+
1723
1741
  /**
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.
1742
+ * Provides access to the current app instance.
1726
1743
  */
1727
1744
  readonly my: My;
1728
1745
 
1729
1746
  /**
1730
- * App registry for managing app definitions and metadata.
1747
+ * Object that that can be used for managing app definitions.
1731
1748
  */
1732
1749
  readonly registry: AppRegistry;
1733
1750
 
1734
1751
  /**
1735
- * Instance manager for controlling running app instances.
1752
+ * Object that can be used for managing running app instances.
1736
1753
  */
1737
1754
  readonly instances: InstanceManager;
1738
1755
  }
1739
1756
 
1740
1757
  /**
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.
1758
+ * Provides access to the current app instance.
1743
1759
  */
1744
1760
  export interface My {
1761
+
1745
1762
  /**
1746
- * The current application instance.
1763
+ * Describes the current app instance.
1747
1764
  */
1748
1765
  readonly instance: ApplicationInstance;
1749
1766
 
1750
1767
  /**
1751
- * My application name.
1768
+ * The name of the current app.
1752
1769
  */
1753
1770
  readonly appName: string;
1754
1771
  }
1755
1772
 
1756
1773
  /**
1757
- * App registry for managing app definitions and metadata.
1774
+ * Object that can be used for managing app definitions.
1758
1775
  */
1759
1776
  export interface AppRegistry {
1777
+
1760
1778
  /**
1761
- * API for handling app definitions at runtime.
1762
- * The API methods operate only on in-memory app definitions.
1779
+ * Object that can be used for handling app definitions dynamically.
1763
1780
  */
1764
1781
  readonly inMemory: InMemoryStore;
1765
1782
 
1766
1783
  /**
1767
- * Retrieves an app definition by name.
1768
- * @param options Options for retrieving the app definition.
1784
+ * Retrieves an app by name.
1785
+ * @param options Options for retrieving the app.
1769
1786
  */
1770
1787
  get(options: GetAppOptions): Promise<Application | null>;
1771
1788
 
1772
1789
  /**
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.
1790
+ * Retrieves all available apps. You can also provide an optional filter to refine the result.
1791
+ * @param filter Filter for retrieving apps.
1776
1792
  */
1777
1793
  getMany(filter?: AppFilter): Promise<Application[]>;
1778
1794
 
1779
1795
  /**
1780
- * Checks if an app exists and is available.
1796
+ * Checks if an app exists in the app registry.
1781
1797
  * @param name The name of the app to check.
1782
1798
  */
1783
1799
  has(name: string): Promise<boolean>;
1784
1800
 
1785
1801
  /**
1786
- * Subscribes to app addition events.
1787
- * @param handler Handler for app addition events.
1788
- * @returns A promise that resolves to an unsubscribe function.
1802
+ * Notifies when an app has been registered in the environment. Returns an unsubscribe function.
1803
+ * @param handler Callback function for handling the event. Receives as an argument an object describing the added app.
1789
1804
  */
1790
1805
  onAdded(handler: AppEventHandler<AppAddedEvent>): Promise<UnsubscribeFunction>;
1791
1806
 
1792
1807
  /**
1793
- * Subscribes to app removal events.
1794
- * @param handler Handler for app removal events.
1795
- * @returns A promise that resolves to an unsubscribe function.
1808
+ * Notifies when an app has been removed from the environment. Returns an unsubscribe function.
1809
+ * @param handler Callback function for handling the event. Receives as an argument the name of the removed app.
1796
1810
  */
1797
1811
  onRemoved(handler: AppEventHandler<AppRemovedEvent>): Promise<UnsubscribeFunction>;
1798
1812
 
1799
1813
  /**
1800
- * Subscribes to app update events.
1801
- * @param handler Handler for app update events.
1802
- * @returns A promise that resolves to an unsubscribe function.
1814
+ * Notifies when an app has been updated. Returns an unsubscribe function.
1815
+ * @param handler Callback function for handling the event. Receives as an argument an object describing the updated app and the new values of the updated app properties.
1803
1816
  */
1804
1817
  onUpdated(handler: AppEventHandler<AppUpdatedEvent>): Promise<UnsubscribeFunction>;
1805
1818
 
1806
1819
  }
1807
1820
 
1808
1821
  /**
1809
- * Instance manager for controlling running app instances.
1822
+ * Object that can be used for managing running app instances.
1810
1823
  */
1811
1824
  export interface InstanceManager {
1825
+
1812
1826
  /**
1813
1827
  * Starts a new app instance.
1814
1828
  * @param options Options for starting the app instance.
@@ -1822,33 +1836,32 @@ export declare namespace IOConnectDesktop {
1822
1836
  stop(options: StopInstanceOptions): Promise<void>;
1823
1837
 
1824
1838
  /**
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.
1839
+ * Waits for an app instance to be fully initialized.
1840
+ * @param options Filter for selecting an app instance.
1828
1841
  */
1829
1842
  waitForReady(options: InstanceSelect): Promise<void>;
1830
1843
 
1831
1844
  /**
1832
- * Retrieves an app instance by ID.
1833
- * @param options Options for selecting the instance.
1845
+ * Retrieves an app instance.
1846
+ * @param options Filter for selecting an app instance.
1834
1847
  */
1835
1848
  get(options: InstanceSelect): Promise<ApplicationInstance | null>;
1836
1849
 
1837
1850
  /**
1838
- * Retrieves all running app instances with optional filtering.
1839
- * @param filter Optional filter criteria for instances.
1851
+ * Retrieves all running app instances. You can also provide an optional filter to refine the result.
1852
+ * @param filter Filter for retrieving app instances.
1840
1853
  */
1841
1854
  getMany(filter?: InstanceFilter): Promise<ApplicationInstance[]>;
1842
1855
 
1843
1856
  /**
1844
- * Retrieves the state of an app instance.
1845
- * @param options Options for selecting the instance.
1857
+ * Retrieves the current state of an app instance.
1858
+ * @param options Filter for selecting an app instance.
1846
1859
  */
1847
1860
  getState(options: InstanceSelect): Promise<InstanceState>;
1848
1861
 
1849
1862
  /**
1850
1863
  * Retrieves the context of an app instance.
1851
- * @param options Options for selecting the instance.
1864
+ * @param options Filter for selecting an app instance.
1852
1865
  */
1853
1866
  getContext(options: InstanceSelect): Promise<Record<string, any>>;
1854
1867
 
@@ -1859,339 +1872,681 @@ export declare namespace IOConnectDesktop {
1859
1872
  restart(options: RestartInstanceOptions): Promise<ApplicationInstance>;
1860
1873
 
1861
1874
  /**
1862
- * Subscribes to instance started events.
1863
- * @param handler Handler for instance started events.
1864
- * @returns A promise that resolves to an unsubscribe function.
1875
+ * Notifies when an app instance has been started. Returns an unsubscribe function.
1876
+ * @param handler Callback function for handling the event. Receives as an argument an object describing the started app instance.
1865
1877
  */
1866
1878
  onStarted(handler: InstanceEventHandler<InstanceStartedEvent>): Promise<UnsubscribeFunction>;
1867
1879
 
1868
1880
  /**
1869
- * Subscribes to instance stopped events.
1870
- * @param handler Handler for instance stopped events.
1871
- * @returns A promise that resolves to an unsubscribe function.
1881
+ * Notifies when an app instance has been stopped. Returns an unsubscribe function.
1882
+ * @param handler Callback function for handling the event. Receives as an argument an object describing the stopped app instance and a reason (optional) for stopping the instance.
1872
1883
  */
1873
1884
  onStopped(handler: InstanceEventHandler<InstanceStoppedEvent>): Promise<UnsubscribeFunction>;
1874
1885
 
1875
1886
  /**
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.
1887
+ * Notifies when the current state an app instance has been changed. Returns an unsubscribe function.
1888
+ * @param handler Callback function for handling the event. Receives as an argument an object describing the app instance and its new state.
1879
1889
  */
1880
1890
  onStateChanged(handler: InstanceEventHandler<InstanceStateChangedEvent>): Promise<UnsubscribeFunction>;
1881
1891
  }
1882
1892
 
1883
1893
  /**
1884
- * API for handling app definitions at runtime.
1885
- * The API methods operate only on in-memory app definitions.
1894
+ * Object that can be used for handling app definitions dynamically. The described methods operate only on in-memory app definitions.
1886
1895
  */
1887
1896
  export interface InMemoryStore {
1897
+
1888
1898
  /**
1889
1899
  * Imports the provided collection of app definitions.
1890
- * @param definitions A collection of app definition objects to be imported.
1900
+ * @param definitions Array of app definition objects to be imported in the in-memory store.
1891
1901
  * @param mode Mode for importing app definitions. Use `"replace"` (default) to replace all existing in-memory app definitions.
1892
1902
  * Use `"merge"` to update the existing ones and add new ones.
1893
1903
  */
1894
1904
  import(definitions: Definition[], mode?: "replace" | "merge"): Promise<ImportResult>;
1895
1905
 
1896
1906
  /**
1897
- *
1898
- * Checks if an app definition exists in the in-memory store.
1899
- * @param name The name of the app definition to check.
1907
+ * Checks if an app definition is available in the in-memory store.
1908
+ * @param name The name of the app for whose definition to check.
1900
1909
  */
1901
1910
  has(name: string): Promise<boolean>;
1902
1911
 
1903
1912
  /**
1904
1913
  * Removes an app definition from the in-memory store.
1905
- * @param options Remove options.
1914
+ * @param options Options for removing an app definition.
1906
1915
  */
1907
1916
  remove(options: RemoveAppOptions): Promise<void>;
1908
1917
 
1909
1918
  /**
1910
- * Removes all app definitions from the in-memory store.
1911
- * @param options Clear options.
1919
+ * Clears all app definitions from the in-memory store.
1920
+ * @param options Options for clearing app definitions.
1912
1921
  */
1913
1922
  clear(options?: ClearAppsOptions): Promise<void>;
1914
1923
  }
1915
1924
 
1916
- // Event Types
1917
- export type AppAddedEvent = { app: ApplicationCore; };
1918
- export type AppRemovedEvent = { appName: string; };
1919
- export type AppUpdatedEvent = { app: ApplicationCore; changes: AppChangeSet };
1925
+ /**
1926
+ * Describes the argument received by the callback function for handling the app added event.
1927
+ */
1928
+ export interface AppAddedEvent {
1929
+
1930
+ /**
1931
+ * Describes the app that has been added to the environment.
1932
+ */
1933
+ app: ApplicationCore;
1934
+ }
1935
+
1936
+ /**
1937
+ * Describes the argument received by the callback function for handling the app removed event.
1938
+ */
1939
+ export interface AppRemovedEvent {
1940
+
1941
+ /**
1942
+ * The name of the app that has been removed from the environment.
1943
+ */
1944
+ appName: string;
1945
+ }
1946
+
1947
+ /**
1948
+ * Describes the argument received by the callback function for handling the app updated event.
1949
+ */
1950
+ export interface AppUpdatedEvent {
1951
+
1952
+ /**
1953
+ * Describes the app that has been updated.
1954
+ */
1955
+ app: ApplicationCore;
1956
+
1957
+ /**
1958
+ * Object with key/value pairs describing the updated app properties and their new values.
1959
+ */
1960
+ changes: AppChangeSet;
1961
+ }
1962
+
1963
+ /**
1964
+ * Describes the argument received by the callback function for handling the instance started event.
1965
+ */
1966
+ export interface InstanceStartedEvent {
1967
+
1968
+ /**
1969
+ * Describes the app instance that has been started.
1970
+ */
1971
+ instance: ApplicationInstance;
1972
+ }
1920
1973
 
1921
- export type InstanceStartedEvent = { instance: ApplicationInstance; };
1922
- export type InstanceStoppedEvent = { instance: ApplicationInstance; reason?: string; };
1923
- export type InstanceStateChangedEvent = { instance: ApplicationInstance; state: InstanceState }
1974
+ /**
1975
+ * Describes the argument received by the callback function for handling the instance stopped event.
1976
+ */
1977
+ export interface InstanceStoppedEvent {
1978
+
1979
+ /**
1980
+ * Describes the app instance that has been stopped.
1981
+ */
1982
+ instance: ApplicationInstance;
1983
+
1984
+ /**
1985
+ * Reason for stopping the app instance.
1986
+ */
1987
+ reason?: string;
1988
+ }
1924
1989
 
1925
- // Event Handlers
1990
+ /**
1991
+ * Describes the argument received by the callback function for handling the instance state changed event.
1992
+ */
1993
+ export interface InstanceStateChangedEvent {
1994
+
1995
+ /**
1996
+ * Describes the app instance whose state has changed.
1997
+ */
1998
+ instance: ApplicationInstance;
1999
+
2000
+ /**
2001
+ * The current state of the app instance.
2002
+ */
2003
+ state: InstanceState;
2004
+ }
2005
+
2006
+ /**
2007
+ * Handler for app events.
2008
+ */
1926
2009
  export type AppEventHandler<T> = (event: T) => void;
2010
+
2011
+ /**
2012
+ * Handler for app instance events.
2013
+ */
1927
2014
  export type InstanceEventHandler<T> = (event: T) => void;
1928
2015
 
2016
+ /**
2017
+ * Describes the basic properties of an app.
2018
+ */
1929
2019
  export interface ApplicationCore {
2020
+
2021
+ /**
2022
+ * Name of the app.
2023
+ */
1930
2024
  readonly name: string;
2025
+
2026
+ /**
2027
+ * Type of the app.
2028
+ */
1931
2029
  readonly type: AppType;
2030
+
2031
+ /**
2032
+ * Title of the app.
2033
+ */
1932
2034
  readonly title?: string;
2035
+
2036
+ /**
2037
+ * Version of the app.
2038
+ */
1933
2039
  readonly version?: string;
2040
+
2041
+ /**
2042
+ * Description of the app.
2043
+ */
1934
2044
  readonly description?: string;
2045
+
2046
+ /**
2047
+ * Icon URL or the icon of the app in Base64 format.
2048
+ */
1935
2049
  readonly icon?: string;
2050
+
2051
+ /**
2052
+ * URL of the app icon.
2053
+ */
1936
2054
  readonly iconURL?: string;
2055
+
2056
+ /**
2057
+ * Keywords for the app.
2058
+ */
1937
2059
  readonly keywords?: string[];
2060
+
2061
+ /**
2062
+ * Flag indicating whether the app will be auto started on platform startup.
2063
+ */
1938
2064
  readonly autoStart?: boolean;
2065
+
2066
+ /**
2067
+ * Flag indicating whether multiple instances of the app are allowed.
2068
+ */
1939
2069
  readonly allowMultiple?: boolean;
2070
+
2071
+ /**
2072
+ * Flag indicating whether the app is running as a hidden window.
2073
+ */
1940
2074
  readonly isHidden?: boolean;
2075
+
2076
+ /**
2077
+ * Flag indicating whether the app is a shell app for the platform.
2078
+ */
1941
2079
  readonly isShell?: boolean;
2080
+
2081
+ /**
2082
+ * Flag indicating whether the app is part of the in-memory store.
2083
+ */
1942
2084
  readonly isInMemory?: boolean;
1943
2085
  }
1944
2086
 
1945
- // Core Data Types
2087
+ /**
2088
+ * Describes an app.
2089
+ */
1946
2090
  export interface Application extends ApplicationCore {
2091
+
2092
+ /**
2093
+ * Provides access to the FDC3 app definition if this is an FDC3 app.
2094
+ */
1947
2095
  fdc3?: Record<string, any>;
2096
+
2097
+ /**
2098
+ * Provides access to the custom properties specified in the app definition if such exist.
2099
+ */
1948
2100
  customProperties?: Record<string, any>;
2101
+
2102
+ /**
2103
+ * Provides access to the entire app definition.
2104
+ */
1949
2105
  definition?: Definition;
2106
+
2107
+ /**
2108
+ * Array of objects describing all currently available app instances.
2109
+ */
1950
2110
  instances?: ApplicationInstance[];
1951
2111
  }
1952
2112
 
2113
+ /**
2114
+ * Describes an app instance.
2115
+ */
1953
2116
  export interface ApplicationInstance {
2117
+
2118
+ /**
2119
+ * ID of the app instance.
2120
+ */
1954
2121
  id: string;
2122
+
2123
+ /**
2124
+ * Name of the app as specified in its definition to which the instance belongs.
2125
+ */
1955
2126
  appName: string;
2127
+
2128
+ /**
2129
+ * Timestamp of when the app instance was started.
2130
+ */
1956
2131
  startedAt: Date;
2132
+
2133
+ /**
2134
+ * Describes how the current app instance was started and provides details about the app that started it.
2135
+ */
1957
2136
  startedBy: StartedByInfo;
1958
- interopInstance?: Promise<IOConnectDesktop.Interop.Instance>;
2137
+
2138
+ /**
2139
+ * Provides access to the Interop instance of the current app instance.
2140
+ */
2141
+ interopInstance?: IOConnectDesktop.Interop.Instance;
2142
+
2143
+ /**
2144
+ * Process ID of the current app instance.
2145
+ */
1959
2146
  pid?: number;
1960
2147
  }
1961
2148
 
1962
- // Filter Types
2149
+ /**
2150
+ * Filter for retrieving apps.
2151
+ */
1963
2152
  export interface AppFilter extends AppDataOptions {
2153
+
2154
+ /**
2155
+ * Array of app names as specified in the respective app definitions.
2156
+ */
1964
2157
  readonly names?: string[];
2158
+
2159
+ /**
2160
+ * Array of app types as specified in the respective app definitions.
2161
+ */
1965
2162
  readonly types?: AppType[];
2163
+
2164
+ /**
2165
+ * If `true`, the result will include only apps that are specified as hidden in their app definitions.
2166
+ */
1966
2167
  readonly isHidden?: boolean;
2168
+
2169
+ /**
2170
+ * If `true`, the result will include only FDC3 app definitions.
2171
+ */
1967
2172
  readonly isFdc3Definition?: boolean;
2173
+
2174
+ /**
2175
+ * If `true`, the result will include only apps from the in-memory app store.
2176
+ */
1968
2177
  readonly isInMemory?: boolean;
2178
+
2179
+ /**
2180
+ * Array of keywords as specified in the respective app definitions.
2181
+ */
1969
2182
  readonly keywords?: string[];
2183
+
2184
+ /**
2185
+ * Custom properties as specified in the respective app definition.
2186
+ */
1970
2187
  readonly customProperties?: Record<string, any>;
1971
2188
  }
1972
2189
 
2190
+ /**
2191
+ * Filter for retrieving app instances.
2192
+ */
1973
2193
  export interface InstanceFilter {
2194
+
2195
+ /**
2196
+ * Array of app instance IDs.
2197
+ */
1974
2198
  readonly ids?: string[];
2199
+
2200
+ /**
2201
+ * Array of app names as specified in the respective app definitions.
2202
+ * Using this as a filter will include in the result all currently available instances of the specified apps.
2203
+ */
1975
2204
  readonly appNames?: string[];
2205
+
2206
+ /**
2207
+ * Only the app instances started after the specified timestamp will be included in the result.
2208
+ */
1976
2209
  readonly startedAfter?: Date;
2210
+
2211
+ /**
2212
+ * Only the app instances started before the specified timestamp will be included in the result.
2213
+ */
1977
2214
  readonly startedBefore?: Date;
1978
2215
  }
1979
2216
 
1980
- // Options Types
2217
+ /**
2218
+ * Options for retrieving apps.
2219
+ */
1981
2220
  export interface GetAppOptions extends AppSelect, AppDataOptions {
1982
2221
  }
1983
2222
 
2223
+ /**
2224
+ * Options for selecting apps.
2225
+ */
1984
2226
  export interface AppSelect {
2227
+
2228
+ /**
2229
+ * Name of the app as specified in its app definition.
2230
+ */
1985
2231
  readonly name: string;
1986
2232
  }
1987
2233
 
2234
+ /**
2235
+ * Options for selecting or filtering apps.
2236
+ */
1988
2237
  export interface AppDataOptions {
2238
+
1989
2239
  /**
1990
- * If true, the app definition will be included in the result.
2240
+ * If `true`, the app definition will be included in the result.
1991
2241
  * @default false
1992
2242
  */
1993
2243
  readonly includeDefinition?: boolean;
2244
+
1994
2245
  /**
1995
- * If true, the app instances will be included in the result.
2246
+ * If `true`, all currently available app instances will be included in the result.
1996
2247
  * @default true
1997
2248
  */
1998
2249
  readonly includeInstances?: boolean;
1999
2250
  }
2000
2251
 
2252
+ /**
2253
+ * Options for starting an app instance.
2254
+ */
2001
2255
  export interface StartAppOptions {
2256
+
2257
+ /**
2258
+ * Name of the app to start as specified in its app definition.
2259
+ */
2002
2260
  readonly name: string;
2261
+
2003
2262
  /**
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.
2263
+ * Context to pass to the started app instance.
2264
+ * If not provided, the context from the app definition will be used if such exists.
2265
+ * Otherwise, this will be set to an empty object.
2007
2266
  */
2008
2267
  readonly context?: Record<string, any>;
2268
+
2009
2269
  /**
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.
2270
+ * Key/value pairs of app definition overrides to apply when starting the app instance.
2271
+ * The values of the app definition properties specified here will override the values of the respective properties in the already existing app definition.
2013
2272
  */
2014
2273
  readonly definitionOverride?: Record<string, any>;
2274
+
2015
2275
  /**
2016
- * The timeout for the start operation in milliseconds.
2276
+ * Interval in milliseconds to wait for starting the app instance.
2017
2277
  * @default 120000
2018
2278
  */
2019
2279
  readonly timeout?: number;
2280
+
2020
2281
  /**
2021
- * If true, the app will attempt to reuse an existing instance if available.
2282
+ * If `true`, the platform will attempt to reuse an existing instance of the specified app if such is available.
2022
2283
  * @default false
2023
2284
  */
2024
2285
  readonly reuseInstance?: boolean;
2025
2286
  }
2026
2287
 
2288
+ /**
2289
+ * Options for stopping an app instance.
2290
+ */
2027
2291
  export interface StopInstanceOptions {
2292
+
2028
2293
  /**
2029
2294
  * The ID of the instance to stop.
2030
2295
  */
2031
2296
  readonly id: string;
2297
+
2032
2298
  /**
2033
- * If true, the instance will be forcefully stopped without waiting for it to gracefully shut down.
2299
+ * If `true`, the instance will be forcefully stopped without waiting for it to gracefully shut down.
2034
2300
  * @default false
2035
2301
  */
2036
2302
  readonly force?: boolean;
2303
+
2037
2304
  /**
2038
- * The timeout for the stop operation in milliseconds.
2305
+ * Interval in milliseconds to wait for stopping the app instance.
2039
2306
  * @default 30000
2040
2307
  */
2041
2308
  readonly timeout?: number;
2309
+
2042
2310
  /**
2043
- * Optional reason for stopping the instance.
2311
+ * Reason for stopping the app instance.
2044
2312
  */
2045
2313
  readonly reason?: string;
2046
2314
  }
2047
2315
 
2316
+ /**
2317
+ * Options for restarting an app instance.
2318
+ */
2048
2319
  export interface RestartInstanceOptions {
2320
+
2049
2321
  /**
2050
2322
  * The ID of the instance to restart.
2051
2323
  */
2052
2324
  readonly id: string;
2325
+
2053
2326
  /**
2054
2327
  * 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.
2328
+ * If you provide `"preserve"` as a value, the context of the original instance will be reused.
2329
+ * If you provide `"clear"` as a value, the context of the restarted instance will reset to an empty object.
2058
2330
  * @default "preserve"
2059
2331
  */
2060
2332
  readonly context?: Record<string, any> | "preserve" | "clear";
2333
+
2061
2334
  /**
2062
- * If true, the original app definition is used for the restarted instance.
2335
+ * If `true`, the original app definition will be used for the restarted instance.
2063
2336
  * @default false
2064
2337
  */
2065
2338
  readonly useOriginalDefinition?: boolean;
2339
+
2066
2340
  /**
2067
- * The timeout for the restart operation.
2341
+ * Interval in milliseconds to wait for restarting the app instance.
2068
2342
  * @default 120000
2069
2343
  */
2070
2344
  readonly timeout?: number;
2071
2345
  }
2072
2346
 
2347
+ /**
2348
+ * @ignore
2349
+ */
2073
2350
  export interface ImportOptions {
2074
2351
  readonly mode?: "replace" | "merge";
2075
2352
  readonly validateOnly?: boolean;
2076
2353
  readonly skipInvalid?: boolean;
2077
2354
  }
2078
2355
 
2356
+ /**
2357
+ * @ignore
2358
+ */
2079
2359
  export interface ExportOptions {
2080
2360
  readonly includeConfiguration?: boolean;
2081
2361
  readonly includeMetadata?: boolean;
2082
2362
  }
2083
2363
 
2364
+ /**
2365
+ * Options for removing and app definition from the in-memory store.
2366
+ */
2084
2367
  export interface RemoveAppOptions {
2368
+
2369
+ /**
2370
+ * Name of the app whose definition to remove.
2371
+ */
2085
2372
  readonly name: string;
2373
+
2374
+ /**
2375
+ * If `true`, all currently running instances of the app will be stopped.
2376
+ * @default false
2377
+ */
2086
2378
  readonly stopInstances?: boolean;
2087
2379
  }
2088
2380
 
2381
+ /**
2382
+ * Options for clearing all app definitions from the in-memory store.
2383
+ */
2089
2384
  export interface ClearAppsOptions {
2385
+
2386
+ /**
2387
+ * If `true`, all currently running instances of all apps from the in-memory store will be stopped.
2388
+ * @default false
2389
+ */
2090
2390
  readonly stopAllInstances?: boolean;
2391
+
2392
+ /**
2393
+ * @ignore
2394
+ * If `true`, the definitions of all system apps will be preserved after clearing the in-memory store.
2395
+ * @default false
2396
+ */
2091
2397
  readonly preserveSystemApps?: boolean;
2092
2398
  }
2093
2399
 
2400
+ /**
2401
+ * Options for selecting an app instance.
2402
+ */
2094
2403
  export interface InstanceSelect {
2404
+
2405
+ /**
2406
+ * ID of the app instance.
2407
+ */
2095
2408
  readonly id: string;
2096
2409
  }
2097
2410
 
2098
- // Enum Types
2099
- export type AppType = ApplicationConfig["type"];
2411
+ /**
2412
+ * Type of the app.
2413
+ */
2414
+ export type AppType = "window" | "activity" | "exe" | "node" | "workspaces" | "webGroup" | "clickonce" | "citrix" | "childWindow";
2415
+
2416
+ /**
2417
+ * Current state of the app instance.
2418
+ */
2100
2419
  export type InstanceState = "started" | "ready" | "stopped" | "failed";
2101
2420
 
2421
+ /**
2422
+ * Object with key/value pairs describing the updated app properties and their new values.
2423
+ */
2102
2424
  export interface AppChangeSet {
2425
+
2426
+ /**
2427
+ * Kay/value pair holding the name of the updated app property and its new value respectively.
2428
+ */
2103
2429
  readonly [key: string]: any;
2104
2430
  }
2105
2431
 
2106
- export type Definition = ApplicationConfig;
2432
+ /**
2433
+ * App definition object. All available app definition properties are described in the `application.json` JSON schema of **io.Connect Desktop**.
2434
+ */
2435
+ export interface Definition extends ApplicationConfig {
2436
+ }
2107
2437
 
2438
+ /**
2439
+ * Describes the result from importing app definitions at runtime.
2440
+ */
2108
2441
  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
- }[];
2442
+
2443
+ /**
2444
+ * Array of names of the successfully imported apps as specified in their definitions.
2445
+ */
2446
+ imported: string[];
2447
+
2448
+ /**
2449
+ * Array of objects describing any errors from importing the app definitions.
2450
+ */
2451
+ errors: { app: string; error: string }[];
2121
2452
  }
2122
2453
 
2123
- // Re-export common types from legacy namespace for compatibility
2124
- export import StartedByInfo = IOConnectDesktop.AppManager.StartedByInfo;
2454
+ /**
2455
+ * Describes how the current app instance was started and provides details about the app that started it.
2456
+ */
2457
+ export interface StartedByInfo {
2458
+
2459
+ /**
2460
+ * Indicates how the current app instance was started. Apps can be started by other apps, by a raised Intent, or can be auto started by the system.
2461
+ */
2462
+ startedBy: "application" | "intent" | "autoStart";
2463
+
2464
+ /**
2465
+ * Name of the app that started the current app instance.
2466
+ */
2467
+ applicationName: string;
2468
+
2469
+ /**
2470
+ * ID of the app instance that started the current app instance.
2471
+ */
2472
+ instanceID: string;
2473
+ }
2125
2474
  }
2126
2475
 
2127
2476
  /**
2128
2477
  * @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.
2478
+ * The Platform API provides facilities for managing system-level events like restarting or shutting down the io.Connect platform.
2479
+ *
2480
+ * The Platform API is accessible via the [`io.platform`](#API) object.
2131
2481
  *
2132
- * The Platform API is accessible through the `io.platform` object.
2482
+ * *Available since io.Connect Desktop 10.0.*
2133
2483
  */
2134
2484
  namespace Platform {
2485
+
2135
2486
  /**
2136
- * Platform API for system-level operations.
2487
+ * Platform API.
2137
2488
  */
2138
2489
  export interface API {
2490
+
2139
2491
  /**
2140
- * Restart the application/platform.
2141
- * @param options Optional settings for the restart operation.
2492
+ * Restarts the io.Connect platform.
2493
+ * @param options Settings for the restart operation.
2142
2494
  */
2143
2495
  restart(options?: ExitOptions): Promise<void>;
2144
2496
 
2145
2497
  /**
2146
- * Shutdown the application/platform.
2147
- * @param options Optional settings for the shutdown operation.
2498
+ * Shuts down the io.Connect platform.
2499
+ * @param options Settings for the shutdown operation.
2148
2500
  */
2149
2501
  shutdown(options?: ExitOptions): Promise<void>;
2150
2502
 
2151
2503
  /**
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.
2504
+ * Notifies when the io.Connect platform is about to be shut down or restarted.
2505
+ * @param callback Callback function for handling the event. You can use this callback to execute custom code
2506
+ * before the platform shuts down or restarts. The available time for the execution of your code is 60 seconds.
2507
+ * To prevent the platform shutdown or restart, the callback must resolve with an object with a `prevent` property set to `true`.
2155
2508
  */
2156
2509
  onShuttingDown(callback: (args: ShuttingDownEventArgs) => Promise<{ prevent: boolean }>): () => void;
2157
2510
  }
2158
2511
 
2159
2512
  /**
2160
- * Options for shutdown or restart operations.
2513
+ * Options for platform shutdown or restart.
2161
2514
  */
2162
2515
  export interface ExitOptions {
2516
+
2163
2517
  /**
2164
- * If `true`, will save the current Global Layout before shutdown/restart.
2518
+ * If `true`, will save the current Global Layout before shutdown or restart of the platform.
2165
2519
  */
2166
2520
  autoSave?: boolean;
2167
2521
 
2168
2522
  /**
2169
- * If `true`, will show a confirmation dialog when shutting down or restarting.
2523
+ * If `true`, will show a confirmation dialog when shutting down or restarting the platform.
2170
2524
  */
2171
2525
  showDialog?: boolean;
2172
2526
 
2173
2527
  /**
2174
- * Optional reason for the shutdown/restart.
2528
+ * Reason for the platform shutdown or restart.
2175
2529
  */
2176
2530
  reason?: string;
2177
2531
  }
2178
2532
 
2179
2533
  /**
2180
- * Arguments passed to shutdown event handlers.
2534
+ * Describes the argument received by the callback function for handling the platform shutdown event.
2181
2535
  */
2182
2536
  export interface ShuttingDownEventArgs {
2537
+
2183
2538
  /**
2184
- * If `true`, the platform is restarting rather than shutting down.
2539
+ * Flag indicating whether the platform is being restarted.
2185
2540
  */
2186
2541
  restarting: boolean;
2187
2542
 
2188
2543
  /**
2189
- * Information about the interop instance that initiated the shutdown.
2544
+ * Information about the Interop instance that has initiated the platform shutdown or restart.
2190
2545
  */
2191
2546
  initiator?: IOConnectDesktop.Interop.Instance;
2192
2547
 
2193
2548
  /**
2194
- * Reason for the shutdown.
2549
+ * Reason for the platform shutdown or restart.
2195
2550
  */
2196
2551
  reason?: string;
2197
2552
  }
@@ -2202,7 +2557,7 @@ export declare namespace IOConnectDesktop {
2202
2557
  * **io.Connect Desktop** provides a way for apps to programmatically capture screenshots of the available monitors, of windows and window groups.
2203
2558
  * Based on custom logic, you can capture one or all monitors in order to save a snapshot of the visual state at a given moment.
2204
2559
  *
2205
- * The Displays API is accessible through the `io.displays` object.
2560
+ * The Displays API is accessible via the [`io.displays`](#API) object.
2206
2561
  */
2207
2562
  namespace Displays {
2208
2563
  /**
@@ -2420,7 +2775,7 @@ export declare namespace IOConnectDesktop {
2420
2775
  *
2421
2776
  * The Layouts library supports different types of Layouts - Global, App Default, Workspace.
2422
2777
  *
2423
- * The Layouts API is accessible through the `io.layouts` object.
2778
+ * The Layouts API is accessible via the [`io.layouts`](#API) object.
2424
2779
  */
2425
2780
  namespace Layouts {
2426
2781
 
@@ -3172,7 +3527,7 @@ export declare namespace IOConnectDesktop {
3172
3527
  * - From an end user perspective, there is no difference between web or native windows.
3173
3528
  * - Feature parity is provided by the different technology adapters.
3174
3529
  *
3175
- * The Window Management API is accessible through the `io.windows` object.
3530
+ * The Window Management API is accessible via the [`io.windows`](#API) object.
3176
3531
  */
3177
3532
  namespace Windows {
3178
3533
 
@@ -6896,7 +7251,7 @@ export declare namespace IOConnectDesktop {
6896
7251
  * instructing them to work over the same shared data object.
6897
7252
  * When apps are on the same Channel, they share a context data object which they can monitor and/or update.
6898
7253
  *
6899
- * The Channels API is accessible through the `io.channels` object.
7254
+ * The Channels API is accessible via the [`io.channels`](#API) object.
6900
7255
  */
6901
7256
  namespace Channels {
6902
7257
 
@@ -7273,7 +7628,7 @@ export declare namespace IOConnectDesktop {
7273
7628
  * when a key combination is pressed by the user regardless of whether or not the app is on focus.
7274
7629
  * Hotkeys are useful for web apps that don't have access to system resources and can't register global shortcuts.
7275
7630
  *
7276
- * The Hotkeys API is accessible through the `io.hotkeys` object.
7631
+ * The Hotkeys API is accessible via the [`io.hotkeys`](#API) object.
7277
7632
  */
7278
7633
  namespace Hotkeys {
7279
7634
  /**
@@ -7338,7 +7693,7 @@ export declare namespace IOConnectDesktop {
7338
7693
  * In other cases, you may want to present the user with several options for executing an action or handling data from the current app.
7339
7694
  * The Intents API makes all that possible by enabling apps to register, find and raise Intents.
7340
7695
  *
7341
- * The Intents API is accessible through the `io.intents` object.
7696
+ * The Intents API is accessible via the [`io.intents`](#API) object.
7342
7697
  */
7343
7698
  namespace Intents {
7344
7699
  /**
@@ -7875,7 +8230,7 @@ export declare namespace IOConnectDesktop {
7875
8230
  * The Notifications API allows you to raise notifications, handle notification and action clicks via Interop methods,
7876
8231
  * control the Notification Panel and subscribe for notification events.
7877
8232
  *
7878
- * The Notifications API is accessible through the `io.notifications` object.
8233
+ * The Notifications API is accessible via the [`io.notifications`](#API) object.
7879
8234
  */
7880
8235
  export namespace Notifications {
7881
8236
  /**
@@ -8507,7 +8862,7 @@ export declare namespace IOConnectDesktop {
8507
8862
  * **io.Connect Desktop** has two built-in themes - **Day** and **Night**.
8508
8863
  * You can control the themes programmatically by using the Themes API.
8509
8864
  *
8510
- * The Themes API is accessible through the `io.themes` object.
8865
+ * The Themes API is accessible via the [`io.themes`](#API) object.
8511
8866
  */
8512
8867
  export namespace Themes {
8513
8868
  /**
@@ -8562,7 +8917,7 @@ export declare namespace IOConnectDesktop {
8562
8917
  * The App Preferences API provides methods for updating, replacing and clearing user settings stored for the current or a specific app,
8563
8918
  * as well as for all apps of the current user.
8564
8919
  *
8565
- * The App Preferences API is accessible through the `io.prefs` object.
8920
+ * The App Preferences API is accessible via the [`io.prefs`](#API) object.
8566
8921
  */
8567
8922
  export namespace Preferences {
8568
8923
 
@@ -8738,7 +9093,7 @@ export declare namespace IOConnectDesktop {
8738
9093
  * The Cookies API enables your web app to manage cookies. You can get a list of cookies by applying a filter
8739
9094
  * that will be matched against all cookies, and also set and modify cookies, or remove cookies by name and URL.
8740
9095
  *
8741
- * The Cookies API is accessible through the `io.cookies` object.
9096
+ * The Cookies API is accessible via the [`io.cookies`](#API) object.
8742
9097
  */
8743
9098
  export namespace Cookies {
8744
9099
  /**
@@ -8921,19 +9276,24 @@ export declare namespace IOConnectDesktop {
8921
9276
  *
8922
9277
  * For an app to be able to register interception handlers, interception must be enabled in the system configuration of **io.Connect Desktop**.
8923
9278
  *
9279
+ * The Interception API is accessible via the [`io.interception`](#API) object.
9280
+ *
8924
9281
  * *Available since io.Connect Desktop 9.6.*
8925
9282
  */
8926
9283
  export namespace Interception {
9284
+
8927
9285
  /**
8928
9286
  * Interception API.
8929
9287
  * @since io.Connect Desktop 9.6
8930
9288
  */
8931
9289
  export interface API {
9290
+
8932
9291
  /**
8933
9292
  * Registers an interception handler. It's possible to register only a single interception handler per platform operation within an API domain.
8934
9293
  * @param config Object containing the interception handler to register and settings describing the platform operations to intercept.
8935
9294
  */
8936
9295
  register(config: InterceptionRegistrationConfig): Promise<void>;
9296
+
8937
9297
  /**
8938
9298
  * Unregisters all interception handlers for the specified platform operations.
8939
9299
  * @param config Object specifying the platform operations which to stop intercepting.
@@ -8945,12 +9305,14 @@ export declare namespace IOConnectDesktop {
8945
9305
  * Settings for registering an interception handler for the targeted platform operations.
8946
9306
  */
8947
9307
  export interface InterceptionRegistrationConfig {
9308
+
8948
9309
  /**
8949
9310
  * Method implementation to be registered as a handler for the specified platform operations.
8950
9311
  * It's possible to register only a single interception handler per platform operation within an API domain.
8951
9312
  * @param message Object describing the intercepted platform operation.
8952
9313
  */
8953
9314
  handler: (message: InterceptionMessage) => Promise<InterceptionResponse | void>;
9315
+
8954
9316
  /**
8955
9317
  * List of objects each describing a platform operation to intercept.
8956
9318
  */
@@ -8961,6 +9323,7 @@ export declare namespace IOConnectDesktop {
8961
9323
  * Settings for unregistering the interception handlers for the targeted platform operations.
8962
9324
  */
8963
9325
  export interface InterceptionUnregistrationConfig {
9326
+
8964
9327
  /**
8965
9328
  * List of objects each describing a platform operation which to stop intercepting.
8966
9329
  */
@@ -8971,22 +9334,27 @@ export declare namespace IOConnectDesktop {
8971
9334
  * Describes an intercepted platform operation.
8972
9335
  */
8973
9336
  export interface InterceptionMessage {
9337
+
8974
9338
  /**
8975
9339
  * The io.Connect API domain in which the platform operation has been intercepted.
8976
9340
  */
8977
9341
  domain: string;
9342
+
8978
9343
  /**
8979
9344
  * The io.Connect platform operation that has been intercepted.
8980
9345
  */
8981
9346
  operation: string;
9347
+
8982
9348
  /**
8983
9349
  * ID of the app that has invoked the platform operation. Can be used for tracking purposes.
8984
9350
  */
8985
9351
  callerId: string;
9352
+
8986
9353
  /**
8987
9354
  * Specifies whether the platform operation has been intercepted before or after the execution of its default implementation.
8988
9355
  */
8989
9356
  phase: "before" | "after";
9357
+
8990
9358
  /**
8991
9359
  * In the `"before"` phase, this property will contain the arguments with which the calling app has invoked the intercepted operation.
8992
9360
  * In the `"after"` phase, this property will contain the result returned from executing the default platform implementation of the intercepted operation
@@ -9003,11 +9371,13 @@ export declare namespace IOConnectDesktop {
9003
9371
  * the platform will return the already calculated result.
9004
9372
  */
9005
9373
  export interface InterceptionResponse {
9374
+
9006
9375
  /**
9007
9376
  * Arguments with which to proceed the execution of the intercepted platform operation.
9008
9377
  * This property is taken into account only when the platform operation is intercepted before the execution of its default implementation.
9009
9378
  */
9010
9379
  operationArgs?: any[];
9380
+
9011
9381
  /**
9012
9382
  * Result from the platform operation. Use this property to return a result from your interception handler
9013
9383
  * when the platform operation has been intercepted after the execution of its default implementation.
@@ -9021,15 +9391,18 @@ export declare namespace IOConnectDesktop {
9021
9391
  * Describes a platform operation to intercept and provides settings for its interception.
9022
9392
  */
9023
9393
  export interface Interception {
9394
+
9024
9395
  /**
9025
9396
  * io.Connect API domain of the platform operation.
9026
9397
  */
9027
9398
  domain: string | "all";
9399
+
9028
9400
  /**
9029
9401
  * Name of the io.Connect platform operation within the specified io.Connect API domain.
9030
9402
  * Set to `"all"` to intercept all operations within the domain.
9031
9403
  */
9032
9404
  operation: string | "all";
9405
+
9033
9406
  /**
9034
9407
  * Specifies whether to intercept the platform operation before or after the execution of its default implementation.
9035
9408
  * Set to `"all"` to intercept the platform operation both before and after the execution of its default implementation.