Skip to content

Commit

Permalink
Merge pull request #1 from donbasuno/patch-1
Browse files Browse the repository at this point in the history
Patch 1
  • Loading branch information
donbasuno authored Mar 11, 2019
2 parents f09f559 + b867fd2 commit e880755
Show file tree
Hide file tree
Showing 20 changed files with 128 additions and 134 deletions.
59 changes: 30 additions & 29 deletions docs/api/DesktopAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A Desktop Agent can be connected to one or more App Directories and will use dir
### `open`

```typescript
open(name: string, context?: Context): Promise<void>;
open(name: string, context?: Context): Promise<void>;
```

Launches/links to an app by name.
Expand All @@ -26,11 +26,11 @@ If opening errors, it returns an `Error` with a string from the [`OpenError`](Op

#### Example
```javascript
//no context
await agent.open('myApp');
//with context
await agent.open('myApp', context);
//no context
await agent.open('myApp');

//with context
await agent.open('myApp', context);
```

#### See also
Expand All @@ -54,24 +54,25 @@ This can be used to raise the intent against a specific app.

#### Examples
```javascript
// I know 'StartChat' exists as a concept, and want to know more about it ...
const appIntent = await agent.findIntent("StartChat");
// returns a single AppIntent:
// {
// intent: { name: "StartChat", displayName: "Chat" },
// apps: [{ name: "Skype" }, { name: "Symphony" }, { name: "Slack" }]
// }

// raise the intent against a particular app
await agent.raiseIntent(appIntent.intent.name, context, appIntent.apps[0].name);
```
// I know 'StartChat' exists as a concept, and want to know more about it ...
const appIntent = await agent.findIntent("StartChat");
// returns a single AppIntent:
// {
// intent: { name: "StartChat", displayName: "Chat" },
// apps: [{ name: "Skype" }, { name: "Symphony" }, { name: "Slack" }]
// }

// raise the intent against a particular app
await agent.raiseIntent(appIntent.intent.name, context, appIntent.apps[0].name);
```

#### See also
* [`ResolveError`](Errors#ResolveError)

### `findIntentsByContext`

```typescript
findIntentsByContext(context: Context): Promise<Array<AppIntent>>;
findIntentsByContext(context: Context): Promise<Array<AppIntent>>;
```

Find all the avalable intents for a particular context.
Expand Down Expand Up @@ -117,15 +118,15 @@ Publishes context to other apps on the desktop.

#### Examples
```javascript
agent.broadcast(context);
agent.broadcast(context);
```
#### See also
* [addContextListener](#addcontextlistener)

### `raiseIntent`

```typescript
raiseIntent(intent: string, context: Context, target?: string): Promise<IntentResolution>;
raiseIntent(intent: string, context: Context, target?: string): Promise<IntentResolution>;
```
Raises an intent to the desktop agent to resolve.
#### Examples
Expand All @@ -140,7 +141,7 @@ agent.raiseIntent("StartChat", newContext, intentR.source);

### `addIntentListener`
```typescript
addIntentListener(intent: string, handler: (context: Context) => void): Listener;
addIntentListener(intent: string, handler: (context: Context) => void): Listener;
```
Adds a listener for incoming Intents from the Agent.
#### See also
Expand All @@ -149,7 +150,7 @@ agent.raiseIntent("StartChat", newContext, intentR.source);

### `addContextListener`
```typescript
addContextListener(handler: (context: Context) => void): Listener;
addContextListener(handler: (context: Context) => void): Listener;
```
Adds a listener for incoming context broadcast from the Desktop Agent.

Expand Down Expand Up @@ -207,13 +208,13 @@ interface IntentResolution {
IntentResolution provides a standard format for data returned upon resolving an intent.

#### Example
```javascript
//resolve a "Chain" type intent
var intentR = await agent.raiseIntent("intentName", context);
//resolve a "Client-Service" type intent with data response
var intentR = await agent.raiseIntent("intentName", context);
var dataR = intentR.data;
```
```javascript
//resolve a "Chain" type intent
var intentR = await agent.raiseIntent("intentName", context);
//resolve a "Client-Service" type intent with data response
var intentR = await agent.raiseIntent("intentName", context);
var dataR = intentR.data;
```

#### See also
* [`DesktopAgent.raiseIntent`](#raiseintent)
Expand Down
6 changes: 3 additions & 3 deletions docs/api/api-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ hide_title: true
# API Overview

FDC3 API standards support the following goals:
- Create consistent developer interface for working with FDC3
- Create a consistent developer interface for working with FDC3
- Standardize interfaces for reference implementations
- Standardize interfaces between Desktop Agents

The role of FDC3 API standards is to establish a baseline interface for interoperability between applications. Because FDC3 is largely an agreement between existing platforms and applications - standards should be optimized for ease of adoption rather than functional completeness. Functionality absent from a FDC3 specification is in no way commentary its importance.
The role of FDC3 API standards is to establish a baseline interface for interoperability between applications. Because FDC3 is largely an agreement between existing platforms and applications - standards should be optimized for ease of adoption rather than functional completeness. Functionality absent from a FDC3 specification is in no way a commentary its importance.

The focus on the API working group has been to create a small but consistent API, the following docs go through the components and API's in detail
The focus on the API working group has been to create a small but consistent API, the following docs go through the components and API's in detail.
Loading

0 comments on commit e880755

Please sign in to comment.