Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: light touch edit #34

Merged
merged 1 commit into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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