@interopio/workspaces-api 4.1.1-beta.0 → 4.1.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/workspaces.d.ts CHANGED
@@ -167,9 +167,11 @@ export namespace IOConnectWorkspaces {
167
167
  positionIndex?: number;
168
168
 
169
169
  /**
170
- * Controls the users ability to activate the Workspaces frame when the workspace is restored.
171
- * *Available only in **io.Connect Desktop**.*
170
+ * If `true`, the Workspaces Frame instance containing the restored Workspace will be activated.
171
+ * This means that the Workspaces Frame window will gain focus, will be restored to its normal state (e.g., if it has been previously minimized),
172
+ * and will be brought in front of other existing windows.
172
173
  * Defaults to the configuration passed in the `workspaces.json` file or to `false`.
174
+ * *Available only in **io.Connect Desktop**.*
173
175
  */
174
176
  activateFrame?: boolean;
175
177
 
@@ -180,16 +182,54 @@ export namespace IOConnectWorkspaces {
180
182
  allowSystemHibernation?: boolean;
181
183
  }
182
184
 
183
- /** An object containing the bounds of a frame */
184
- export interface FrameBounds {
185
- top: number;
186
- left: number;
185
+ /**
186
+ * Settings for showing a previously hidden Workspaces Frame instance.
187
+ */
188
+ export interface FrameShowConfig {
189
+
190
+ /**
191
+ * If `true`, the Workspaces Frame instance will be activated. This means that the Workspaces Frame window will gain focus,
192
+ * will be restored to its normal state (e.g., if it has been previously minimized), and will be brought in front of other existing windows.
193
+ * @default false
194
+ */
195
+ activate?: boolean;
196
+ }
197
+
198
+ /**
199
+ * Describes the size of an io.Connect window.
200
+ */
201
+ export interface Size {
202
+
203
+ /**
204
+ * Window width in pixels.
205
+ */
187
206
  width: number;
207
+
208
+ /**
209
+ * Window height in pixels.
210
+ */
188
211
  height: number;
189
212
  }
190
213
 
214
+ /**
215
+ * Describes the bounds of a Workspaces Frame.
216
+ */
217
+ export interface FrameBounds extends Size {
218
+
219
+ /**
220
+ * Distance of the top left window corner from the top edge of the screen in pixels.
221
+ */
222
+ top: number;
223
+
224
+ /**
225
+ * Distance of the top left window corner from the left edge of the screen in pixels.
226
+ */
227
+ left: number;
228
+ }
229
+
191
230
  /** An object describing the possible settings when defining a new frame. */
192
231
  export interface NewFrameConfig {
232
+
193
233
  /** An object describing the possible settings when defining a new frame. */
194
234
  bounds?: {
195
235
  top?: number;
@@ -197,6 +237,15 @@ export namespace IOConnectWorkspaces {
197
237
  width?: number;
198
238
  height?: number;
199
239
  };
240
+
241
+ /**
242
+ * If `true`, the newly created Workspaces Frame instance will be visible.
243
+ * *Available only in **io.Connect Desktop**.*
244
+ * @since io.Connect Desktop 9.9.5
245
+ * @default true
246
+ */
247
+ isVisible?: boolean;
248
+
200
249
  /** A string which will be used as an id of the new frame. The call will reject if a frame with id already exists */
201
250
  frameId?: string;
202
251
  }
@@ -227,16 +276,16 @@ export namespace IOConnectWorkspaces {
227
276
 
228
277
  /**
229
278
  * Options for closing a Frame.
230
- * *Available only for **io.Connect Desktop**.*
279
+ * *Available only in **io.Connect Desktop**.*
231
280
  * @since io.Connect Desktop 9.9
232
281
  */
233
282
  export interface FrameCloseOptions {
234
- /**
235
- * If `true`, will allow preventing the operation for closing the Frame.
283
+ /**
284
+ * If `true`, will allow preventing the operation for closing the Frame.
236
285
  */
237
286
  allowPrevent?: boolean;
238
- /**
239
- * If `true`, will show a dialog for the user to confirm or cancel closing the Frame.
287
+ /**
288
+ * If `true`, will show a dialog for the user to confirm or cancel closing the Frame.
240
289
  */
241
290
  showDialog?: boolean;
242
291
  }
@@ -662,9 +711,10 @@ export namespace IOConnectWorkspaces {
662
711
 
663
712
  export interface FrameTargetingOptions {
664
713
  /**
665
- * If `true`, the frame will be activated when the operation is executed.
666
- * *Available only in **io.Connect Desktop**.*
714
+ * If `true`, the targeted Workspaces Frame instance will be activated. This means that the Workspaces Frame window will gain focus,
715
+ * will be restored to its normal state (e.g., if it has been previously minimized), and will be brought in front of other existing windows.
667
716
  * Defaults to the configuration passed in the `workspaces.json` file or to `false`.
717
+ * *Available only in **io.Connect Desktop**.*
668
718
  */
669
719
  activate?: boolean;
670
720
 
@@ -827,6 +877,170 @@ export namespace IOConnectWorkspaces {
827
877
  isInitialized: boolean;
828
878
  }
829
879
 
880
+ /**
881
+ * Type of the dialog to show. Can be either a predefined io.Connect dialog type, or a custom one.
882
+ *
883
+ * - `YesNo` - dialog with "Yes" and "No" buttons;
884
+ * - `YesNoCancel` - dialog with "Yes", "No" and "Cancel" buttons;
885
+ * - `OkCancel` - dialog with "OK" and "Cancel" buttons;
886
+ * - `Ok` - dialog with an "OK" button;
887
+ * - `Custom` - custom dialog;
888
+ * - `SingleInputDialog` - dialog with a text input field;
889
+ */
890
+ export const enum DialogType {
891
+ YesNo = "YesNo",
892
+ YesNoCancel = "YesNoCancel",
893
+ OkCancel = "OkCancel",
894
+ Ok = "Ok",
895
+ Custom = "Custom",
896
+ SingleInputDialog = "SingleInputDialog"
897
+ }
898
+
899
+ /**
900
+ * Mode for the dialog.
901
+ *
902
+ * - `WindowContainer` - only the container (e.g., the Workspaces Frame) of the window that is showing the dialog will be blocked for user interaction.
903
+ * - `Global` - all visible containers (including frameless io.Connect Windows) will be blocked. All windows within a blocked container will be blocked too.
904
+ */
905
+ export const enum DialogMode {
906
+ WindowContainer = "WindowContainer",
907
+ Global = "Global"
908
+ }
909
+
910
+ /**
911
+ * Options for showing a dialog from the Workspaces Frame.
912
+ */
913
+ export interface FrameDialogOptions {
914
+
915
+ /**
916
+ * Mode for the dialog.
917
+ */
918
+ mode?: DialogMode;
919
+
920
+ /**
921
+ * Type of the dialog to show. Can be either a predefined io.Connect dialog type, or a custom one.
922
+ */
923
+ type: DialogType | string;
924
+
925
+ /**
926
+ * Size for the dialog to show.
927
+ */
928
+ size?: Size;
929
+
930
+ /**
931
+ * Message to the user that the dialog will contain.
932
+ */
933
+ message: string;
934
+
935
+ /**
936
+ * Title for the message that will be displayed in the dialog.
937
+ */
938
+ messageTitle?: string;
939
+
940
+ /**
941
+ * If `true`, the user will be able to move the dialog.
942
+ * @default true
943
+ */
944
+ movable?: boolean;
945
+
946
+ /**
947
+ * If `true`, the io.Connect Window containing the dialog will be transparent.
948
+ * @default false
949
+ */
950
+ transparent?: boolean;
951
+
952
+ /**
953
+ * Title for the dialog that will be displayed in the dialog header.
954
+ */
955
+ title?: string;
956
+
957
+ /**
958
+ * Context data that can be used by a custom dialog.
959
+ */
960
+ context?: unknown;
961
+
962
+ /**
963
+ * Name for the affirmative response button.
964
+ */
965
+ affirmativeButtonName?: string;
966
+
967
+ /**
968
+ * If `true`, the affirmative response button will be shown in the dialog.
969
+ * The default value is for custom dialogs, as predefined dialog types have different defaults.
970
+ * @default false
971
+ */
972
+ showAffirmativeButton?: boolean;
973
+
974
+ /**
975
+ * Name for the canceling button.
976
+ */
977
+ cancelButtonName?: string;
978
+
979
+ /**
980
+ * If `true`, the canceling button will be shown in the dialog.
981
+ * The default value is for custom dialogs, as predefined dialog types have different defaults.
982
+ * @default false
983
+ */
984
+ showCancelButton?: boolean;
985
+
986
+ /**
987
+ * Name for the negative response button.
988
+ */
989
+ negativeButtonName?: string;
990
+
991
+ /**
992
+ * If `true`, the negative response button will be shown in the dialog.
993
+ * The default value is for custom dialogs, predefined dialog types have different defaults.
994
+ * @default false
995
+ */
996
+ showNegativeButton?: boolean;
997
+
998
+ /**
999
+ * Determines which dialog button to be the default one.
1000
+ * The action tied to the default button will be executed when the user presses `ENTER` when no button is active
1001
+ * (i.e., when the buttons aren't on focus and none is selected).
1002
+ */
1003
+ defaultAction?: "affirmative" | "negative" | "cancel";
1004
+
1005
+ /**
1006
+ * Interval in seconds after which the dialog will close automatically.
1007
+ * If `showTimer` is set to `true`, a countdown timer will be displayed in the dialog,
1008
+ * otherwise the dialog will close silently without a warning for the user.
1009
+ * If the user doesn't interact with the dialog before the timer expires,
1010
+ * the `action` property of the `DialogResult` object will be set to `"expired"`.
1011
+ */
1012
+ timerDuration?: number;
1013
+
1014
+ /**
1015
+ * If `true`, a countdown timer will be shown in the dialog, warning the user that the dialog will close automatically after the specified time.
1016
+ * You must also specify a value for `timerDuration`, otherwise a timer won't be shown.
1017
+ * @default false
1018
+ */
1019
+ showTimer?: boolean;
1020
+
1021
+ /**
1022
+ * The amount of characters that can be entered in the input field of a `SingleInputDialog`.
1023
+ */
1024
+ inputMaxLength?: number;
1025
+
1026
+ /**
1027
+ * String pattern that serves as a regular expression for validating the input from the user in a `SingleInputDialog`.
1028
+ * If such pattern is specified and the input doesn't match it, an error will be displayed and the input field
1029
+ * will indicate visually that the user input is invalid.
1030
+ */
1031
+ inputPattern?: string;
1032
+
1033
+ /**
1034
+ * Error message to be displayed if the user input doesn't match the specified validation pattern for a `SingleInputDialog`.
1035
+ */
1036
+ inputPatternErrorMessage?: string;
1037
+
1038
+ /**
1039
+ * Placeholder that will be displayed in the input field of a `SingleInputDialog`.
1040
+ */
1041
+ inputPlaceholder?: string;
1042
+ }
1043
+
830
1044
  /**
831
1045
  * Describes a Frame (a Workspaces App instance).
832
1046
  */
@@ -900,15 +1114,15 @@ export namespace IOConnectWorkspaces {
900
1114
  init(config: FrameInitializationConfig): Promise<void>;
901
1115
 
902
1116
  /**
903
- * Retrieves the taskbar icon of the `Frame` instance.
904
- * *Available only for **io.Connect Desktop**.*
1117
+ * Retrieves the taskbar icon of the `Frame` instance.
1118
+ * *Available only in **io.Connect Desktop**.*
905
1119
  * @since io.Connect Desktop 9.9
906
1120
  */
907
1121
  getIcon(): Promise<Icon>;
908
1122
 
909
1123
  /**
910
1124
  * Sets the taskbar icon of the `Frame` instance.
911
- * *Available only for **io.Connect Desktop**.*
1125
+ * *Available only in **io.Connect Desktop**.*
912
1126
  * @param icon New icon to be displayed in the taskbar for the `Frame` instance. The icon must be encoded as a Base64 string.
913
1127
  * @since io.Connect Desktop 9.9
914
1128
  */
@@ -929,6 +1143,27 @@ export namespace IOConnectWorkspaces {
929
1143
  */
930
1144
  getConstraints(): Promise<FrameConstraints>;
931
1145
 
1146
+ /**
1147
+ * Retrieves the current visibility state of the Workspaces Frame instance.
1148
+ * *Available only in **io.Connect Desktop**.*
1149
+ * @since io.Connect Desktop 9.9.5
1150
+ */
1151
+ isVisible(): Promise<boolean>;
1152
+
1153
+ /**
1154
+ * Shows the Workspaces Frame instance if it has been previously hidden.
1155
+ * *Available only in **io.Connect Desktop**.*
1156
+ * @since io.Connect Desktop 9.9.5
1157
+ */
1158
+ show(config?: FrameShowConfig): Promise<void>;
1159
+
1160
+ /**
1161
+ * Hides the Workspaces Frame instance if it's currently visible.
1162
+ * *Available only in **io.Connect Desktop**.*
1163
+ * @since io.Connect Desktop 9.9.5
1164
+ */
1165
+ hide(): Promise<void>;
1166
+
932
1167
  /**
933
1168
  * Opens a new workspace in this frame by restoring a previously saved workspace layout.
934
1169
  * @param name The name of a saved workspace layout, which will be restored.
@@ -943,11 +1178,18 @@ export namespace IOConnectWorkspaces {
943
1178
  */
944
1179
  createWorkspace(definition: WorkspaceDefinition, config?: WorkspaceCreateConfig): Promise<Workspace>;
945
1180
 
946
- /**
1181
+ /**
1182
+ * Shows a dialog with a title, message, and response buttons to the user.
1183
+ * *Available only in **io.Connect Desktop**.*
1184
+ * @since io.Connect Desktop 10.0
1185
+ */
1186
+ showDialog<T>(options: FrameDialogOptions): Promise<T>;
1187
+
1188
+ /**
947
1189
  * Notifies when the Frame is about to be closed.
948
- * *Available only for io.Connect Desktop.*
949
- * @param callback Callback function for handling the event. Receives as an argument an object with options for closing the Frame.
950
- * @since io.Connect Desktop 9.9
1190
+ * *Available only in **io.Connect Desktop**.*
1191
+ * @param callback Callback function for handling the event. Receives as an argument an object with options for closing the Frame.
1192
+ * @since io.Connect Desktop 9.9
951
1193
  */
952
1194
  onClosing(callback: (options: FrameClosingData) => void | Promise<void>): Promise<Unsubscribe>;
953
1195