@openfin/core 32.76.10 → 32.76.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "32.76.10",
3
+ "version": "32.76.17",
4
4
  "license": "SEE LICENSE IN LICENSE.MD",
5
5
  "main": "./src/mock.js",
6
6
  "types": "./src/mock.d.ts",
package/src/OpenFin.d.ts CHANGED
@@ -3033,3 +3033,22 @@ export interface CapturePageOptions {
3033
3033
  */
3034
3034
  quality?: number;
3035
3035
  }
3036
+ /**
3037
+ * Leveraged by the following windowing apis to influence side effects of the positioning.
3038
+ * - {@link OpenFin.Window.moveBy}
3039
+ * - {@link OpenFin.Window.moveTo}
3040
+ * - {@link OpenFin.Window.setBounds}
3041
+ * - {@link OpenFin.Window.resizeBy}
3042
+ * - {@link OpenFin.Window.resizeTo}
3043
+ * @example ```js
3044
+ fin.me.setBounds({top: 50, left: 50, width: 200, height: 200}, {skipRestore: true})
3045
+ ```
3046
+ */
3047
+ export interface PositioningOptions {
3048
+ /**
3049
+ * Windows Only.
3050
+ * If set to true, will not restore a maximized window before setting the bounds.
3051
+ * This will have the effect of the maximized window staying maximized and not immediately taking this new position.
3052
+ */
3053
+ skipRestore?: boolean;
3054
+ }
@@ -912,7 +912,7 @@ export declare class _Window extends WebContents<OpenFin.WindowEvent> {
912
912
  * @return {Promise.<void>}
913
913
  * @tutorial Window.moveBy
914
914
  */
915
- moveBy(deltaLeft: number, deltaTop: number): Promise<void>;
915
+ moveBy(deltaLeft: number, deltaTop: number, positioningOptions?: OpenFin.PositioningOptions): Promise<void>;
916
916
  /**
917
917
  * Moves the window to a specified location.
918
918
  * @param { number } left The left position of the window
@@ -920,7 +920,7 @@ export declare class _Window extends WebContents<OpenFin.WindowEvent> {
920
920
  * @return {Promise.<void>}
921
921
  * @tutorial Window.moveTo
922
922
  */
923
- moveTo(left: number, top: number): Promise<void>;
923
+ moveTo(left: number, top: number, positioningOptions?: OpenFin.PositioningOptions): Promise<void>;
924
924
  /**
925
925
  * Resizes the window by a specified amount.
926
926
  * @param { number } deltaWidth The change in the width of the window
@@ -931,7 +931,7 @@ export declare class _Window extends WebContents<OpenFin.WindowEvent> {
931
931
  * @return {Promise.<void>}
932
932
  * @tutorial Window.resizeBy
933
933
  */
934
- resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFin.AnchorType): Promise<void>;
934
+ resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFin.AnchorType, positioningOptions?: OpenFin.PositioningOptions): Promise<void>;
935
935
  /**
936
936
  * Resizes the window to the specified dimensions.
937
937
  * @param { number } width The change in the width of the window
@@ -942,7 +942,7 @@ export declare class _Window extends WebContents<OpenFin.WindowEvent> {
942
942
  * @return {Promise.<void>}
943
943
  * @tutorial Window.resizeTo
944
944
  */
945
- resizeTo(width: number, height: number, anchor: OpenFin.AnchorType): Promise<void>;
945
+ resizeTo(width: number, height: number, anchor: OpenFin.AnchorType, positioningOptions?: OpenFin.PositioningOptions): Promise<void>;
946
946
  /**
947
947
  * Restores the window to its normal state (i.e., unminimized, unmaximized).
948
948
  * @return {Promise.<void>}
@@ -961,7 +961,7 @@ export declare class _Window extends WebContents<OpenFin.WindowEvent> {
961
961
  * @return {Promise.<void>}
962
962
  * @tutorial Window.setBounds
963
963
  */
964
- setBounds(bounds: Partial<OpenFin.Bounds>): Promise<void>;
964
+ setBounds(bounds: Partial<OpenFin.Bounds>, positioningOptions?: OpenFin.PositioningOptions): Promise<void>;
965
965
  /**
966
966
  * Shows the window if it is hidden.
967
967
  * @param { boolean } [force = false] Show will be prevented from showing when force is false and
@@ -1091,11 +1091,12 @@ class _Window extends main_1.WebContents {
1091
1091
  * @return {Promise.<void>}
1092
1092
  * @tutorial Window.moveBy
1093
1093
  */
1094
- moveBy(deltaLeft, deltaTop) {
1094
+ moveBy(deltaLeft, deltaTop, positioningOptions) {
1095
1095
  return this.wire
1096
1096
  .sendAction('move-window-by', {
1097
1097
  deltaLeft,
1098
1098
  deltaTop,
1099
+ positioningOptions,
1099
1100
  ...this.identity
1100
1101
  })
1101
1102
  .then(() => undefined);
@@ -1107,11 +1108,12 @@ class _Window extends main_1.WebContents {
1107
1108
  * @return {Promise.<void>}
1108
1109
  * @tutorial Window.moveTo
1109
1110
  */
1110
- moveTo(left, top) {
1111
+ moveTo(left, top, positioningOptions) {
1111
1112
  return this.wire
1112
1113
  .sendAction('move-window', {
1113
1114
  left,
1114
1115
  top,
1116
+ positioningOptions,
1115
1117
  ...this.identity
1116
1118
  })
1117
1119
  .then(() => undefined);
@@ -1126,12 +1128,13 @@ class _Window extends main_1.WebContents {
1126
1128
  * @return {Promise.<void>}
1127
1129
  * @tutorial Window.resizeBy
1128
1130
  */
1129
- resizeBy(deltaWidth, deltaHeight, anchor) {
1131
+ resizeBy(deltaWidth, deltaHeight, anchor, positioningOptions) {
1130
1132
  return this.wire
1131
1133
  .sendAction('resize-window-by', {
1132
1134
  deltaWidth: Math.floor(deltaWidth),
1133
1135
  deltaHeight: Math.floor(deltaHeight),
1134
1136
  anchor,
1137
+ positioningOptions,
1135
1138
  ...this.identity
1136
1139
  })
1137
1140
  .then(() => undefined);
@@ -1146,12 +1149,13 @@ class _Window extends main_1.WebContents {
1146
1149
  * @return {Promise.<void>}
1147
1150
  * @tutorial Window.resizeTo
1148
1151
  */
1149
- resizeTo(width, height, anchor) {
1152
+ resizeTo(width, height, anchor, positioningOptions) {
1150
1153
  return this.wire
1151
1154
  .sendAction('resize-window', {
1152
1155
  width: Math.floor(width),
1153
1156
  height: Math.floor(height),
1154
1157
  anchor,
1158
+ positioningOptions,
1155
1159
  ...this.identity
1156
1160
  })
1157
1161
  .then(() => undefined);
@@ -1178,8 +1182,10 @@ class _Window extends main_1.WebContents {
1178
1182
  * @return {Promise.<void>}
1179
1183
  * @tutorial Window.setBounds
1180
1184
  */
1181
- setBounds(bounds) {
1182
- return this.wire.sendAction('set-window-bounds', { ...bounds, ...this.identity }).then(() => undefined);
1185
+ setBounds(bounds, positioningOptions) {
1186
+ return this.wire
1187
+ .sendAction('set-window-bounds', { ...bounds, ...this.identity, positioningOptions })
1188
+ .then(() => undefined);
1183
1189
  }
1184
1190
  /**
1185
1191
  * Shows the window if it is hidden.
@@ -164,7 +164,29 @@ export interface ProtocolMap extends ProtocolMapBase {
164
164
  };
165
165
  'system-get-printers': GetterCall<OpenFin.PrinterInfo[]>;
166
166
  'system-register-shutdown-handler': VoidCall;
167
+ 'move-window-by': IdentityCall<WithPositioningOptions<{
168
+ deltaLeft: number;
169
+ deltaTop: number;
170
+ }>>;
171
+ 'move-window': IdentityCall<WithPositioningOptions<{
172
+ left: number;
173
+ top: number;
174
+ }>>;
175
+ 'resize-window-by': IdentityCall<WithPositioningOptions<{
176
+ deltaWidth: number;
177
+ deltaHeight: number;
178
+ anchor: OpenFin.AnchorType;
179
+ }>>;
180
+ 'resize-window': IdentityCall<WithPositioningOptions<{
181
+ width: number;
182
+ height: number;
183
+ anchor: OpenFin.AnchorType;
184
+ }>>;
185
+ 'set-window-bounds': IdentityCall<WithPositioningOptions<Partial<OpenFin.Bounds>>>;
167
186
  }
187
+ type WithPositioningOptions<T extends {} = {}> = T & {
188
+ positioningOptions?: OpenFin.PositioningOptions;
189
+ };
168
190
  type ApiCall<Request, Response> = {
169
191
  request: Request;
170
192
  response: Response;