Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiril Popov committed May 31, 2017
1 parent 5e6e4cd commit ca5ae28
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 35 deletions.
8 changes: 3 additions & 5 deletions packages/api-specification/api/confluence.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ someWindow.on('boundsChanged', function(bounds){
or iterate the windows when the layout should be saved
```javascript
ssf.windows.all.forEach(function(window){
var boundsToSave = window.bounds;
var boundsToSave = window.getBounds();
});
```
## [Activity API](https://symphonyoss.atlassian.net/wiki/display/WGDWAPI/Activity+API)
Expand Down Expand Up @@ -78,10 +78,8 @@ ssf.system.captureAllWindows({imageSize: {width: 100, height: 100}})

});

// capture specific window only
ssf.system.captureWindow(windowId);
// same as
var window = ...
// Capture specific window (this goes throught the window API)
var window = ssf.windows.current;
window.capture();
```

Expand Down
13 changes: 6 additions & 7 deletions packages/api-specification/api/messages.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* Currently this is based on OpenFin InterApplicationBus
* http://cdn.openfin.co/jsdocs/stable/fin.desktop.InterApplicationBus.html
* Currently this is based on OpenFin InterApplicationBus - http://cdn.openfin.co/jsdocs/stable/fin.desktop.InterApplicationBus.html
*
* TBD - Request/response and streaming
*/
export interface MessagesAPI{
send(destinationUuid: string, topic: string, message: string|object): void;
publish(topic: string, message: string|object);

subscribe(destinationUuid: string, topic: string, listener: Function): void;
unsubscribe(windowId: string, topic: string, listener: Function): void;
send(windowId: string, topic :string, message: string|object): void;
subscribe(windowId: string, topic :string, listener: Function): void;
unsubscribe(windowId: string, topic :string, listener: Function): void;
}
7 changes: 0 additions & 7 deletions packages/api-specification/api/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ export interface SystemAPI {

captureAllDisplays: (options?: CaptureOptions) => Promise<DisplayImageData>;

/**
* Capture specific window
* @param windowId
* @param options
*/
captureWindow: (windowId: string, options?: CaptureOptions) => Promise<WindowImageData>;

/**
* Capture all windows in a separate images
* @param options
Expand Down
44 changes: 28 additions & 16 deletions packages/api-specification/api/windows.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Bounds, UnsubscribeFunction} from "./common";
import {Base64ImageData, CaptureOptions} from "./system";
import EventEmitter = NodeJS.EventEmitter;

export interface WindowsAPI {

Expand Down Expand Up @@ -39,6 +40,7 @@ export interface WindowsAPI {
onWindowBoundsChanged(callback: (window: Window, bounds: Bounds) => void): UnsubscribeFunction;
}

/** Window options used to open a new window **/
export interface WindowOptions {
/**
* Default window title.
Expand Down Expand Up @@ -137,29 +139,29 @@ export interface WindowOptions {
transparent: boolean;
}

export interface Window {
/**
* A window running in the container.
* It implements EventEmitter which means users can subscribe for events using on, once , addEventListener etc.
* The list of events is in WindowsEvents structure;
*/
export interface Window extends EventEmitter {

constructor(options: WindowOptions);
/** Get or set the max width of the window. Might be undefined if no restrictions applied**/
maxWidth?: number;

/**
* Get or set the bounds of the window.
*/
bounds: Bounds;
/** Get or set the min width of the window. Might be undefined if no restrictions applied**/
minWidth?: number;

/**
* Get or set if the window has a shadow.
*/
hasShadow: boolean;
/** Get or set the max height of the window. Might be undefined if no restrictions applied**/
maxHeight: number;

/**
* Get or set the maximum size of the window.
*/
maximumSize: Bounds;
/** Get or set the min height of the window. Might be undefined if no restrictions applied**/
minHeight: number;

/**
* Get or set the minimum size of the window.
* Get or set if the window has a shadow.
*/
minimumSize: Bounds;
hasShadow: boolean;

/**
* Get or set the title of the window
Expand Down Expand Up @@ -223,6 +225,9 @@ export interface Window {
*/
capture(options?: CaptureOptions): Promise<Base64ImageData>;

/** Get the bounds of the window */
getBounds(): Bounds;

/**
* Get the child windows of the window.
*/
Expand Down Expand Up @@ -263,6 +268,9 @@ export interface Window {
*/
restore(): Promise<void>;

/** Set new bounds */
setBounds(bounds: Bounds);

/**
* Sets the window icon.
* @param {string} icon - The url to the image.
Expand Down Expand Up @@ -293,4 +301,8 @@ export interface Window {
* @param {string|object} message - The message to send to the window. Can be any serializable object.
*/
sendMessage(message: string | object): Promise<void>;
}

export interface WindowEvents {

}
5 changes: 5 additions & 0 deletions packages/api-specification/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ declare namespace ssf {
static unsubscribe(windowId: string, topic :string, listener: Function): void;
}

interface Interop{


}

class ScreenSnippet {
capture(): Promise<string>;
}
Expand Down

0 comments on commit ca5ae28

Please sign in to comment.