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

Consolidate Listener with other types in documentation #404

Merged
merged 1 commit into from
Jul 21, 2021
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
2 changes: 1 addition & 1 deletion docs/api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The focus of the FDC3 Standard Working Group has been to create a small but cons
- [`window.fdc3`](ref/Globals#windowfdc3-object) global object and [`fdc3Ready`](ref/Globals#fdc3ready-event) event, for accessing FDC3 operations globally
- [`DesktopAgent`](ref/DesktopAgent) interface, which exposes FDC3 operations
- [`Channel`](ref/Channel) interface, for subscribing to specific context channels
- [`Listener`](ref/Listener) interface, which allows unsubscribing intent or context listeners
- [`Listener`](ref/Types#listener) interface, which allows unsubscribing intent or context listeners

## Usage

Expand Down
3 changes: 2 additions & 1 deletion docs/api/ref/Channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ interface Channel {
#### See also

* [`Context`](Types#context)
* [`Listener`](Types#listener)
* [`DesktopAgent.getSystemChannels`](DesktopAgent#getsystemchannels)
* [`DesktopAgent.getOrCreateChannel`](DesktopAgent#getorcreatechannel)
* [`DesktopAgent.joinChannel`](DesktopAgent#joinchannel)
Expand Down Expand Up @@ -118,7 +119,7 @@ instrumentListener.unsubscribe();
```

#### See also
* [`Listener`](Listener)
* [`Listener`](Types#listener)
* [`ContextHandler`](Types#contexthandler)
* [`broadcast`](#broadcast)
* [`getCurrentContext`](#getcurrentcontext)
Expand Down
4 changes: 2 additions & 2 deletions docs/api/ref/DesktopAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const contactListener = fdc3.addContextListener('fdc3.contact', contact => { ...
```

#### See also
* [`Listener`](Listener)
* [`Listener`](Types#listener)
* [`Context`](Types#context)


Expand All @@ -89,7 +89,7 @@ const listener = fdc3.addIntentListener('StartChat', context => {
```

#### See also
* [`Listener`](Listener)
* [`Listener`](Types#listener)
* [`Context`](Types#context)


Expand Down
31 changes: 0 additions & 31 deletions docs/api/ref/Listener.md

This file was deleted.

24 changes: 24 additions & 0 deletions docs/api/ref/Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ Used when attaching listeners for context broadcasts and raised intents.
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
* [`Channel.addContextListener`](Channel#addcontextlistener)

## `Listener`

A Listener object is returned when an application subscribes to intents or context broadcasts via the [`addIntentListener`](#addintentlistener) or [`addContextListener`](#addcontextlistener) methods on the [DesktopAgent](DesktopAgent) object.

```typescript
interface Listener {
unsubscribe(): void;
}
```
#### `unsubscribe`

```ts
unsubscribe(): void;
```

Allows an application to unsubscribe from listening to intents or context broadcasts.

#### See also
* [`DesktopAgent.addIntentListener`](DesktopAgent#addintentlistener)
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
* [`Channel.addContextListener`](Channel#addcontextlistener)
* [`ContextHandler`](Types#contexthandler)


## `TargetApp`

```typescript
Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-1.2/api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The focus of the FDC3 Standard Working Group has been to create a small but cons
- [`window.fdc3`](ref/Globals#windowfdc3-object) global object and [`fdc3Ready`](ref/Globals#fdc3ready-event) event, for accessing FDC3 operations globally
- [`DesktopAgent`](ref/DesktopAgent) interface, which exposes FDC3 operations
- [`Channel`](ref/Channel) interface, for subscribing to specific context channels
- [`Listener`](ref/Listener) interface, which allows unsubscribing intent or context listeners
- [`Listener`](ref/Types#listener) interface, which allows unsubscribing intent or context listeners

## Usage

Expand Down
6 changes: 3 additions & 3 deletions website/versioned_docs/version-1.2/api/ref/Channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface Channel {
#### See also

* [`Context`](Types#context)
* [`Listener`](Types#listener)
* [`DesktopAgent.getSystemChannels`](DesktopAgent#getsystemchannels)
* [`DesktopAgent.getOrCreateChannel`](DesktopAgent#getorcreatechannel)
* [`DesktopAgent.joinChannel`](DesktopAgent#joinchannel)
Expand Down Expand Up @@ -119,7 +120,7 @@ instrumentListener.unsubscribe();
```

#### See also
* [`Listener`](Listener)
* [`Listener`](Types#listener)
* [`ContextHandler`](Types#contexthandler)
* [`broadcast`](#broadcast)
* [`getCurrentContext`](#getcurrentcontext)
Expand Down Expand Up @@ -198,5 +199,4 @@ try {
#### See also
* [`ChannelError`](Errors#channelerror)
* [`broadcast`](#broadcast)
* [`addContextListener`](#addcontextlistener)

* [`addContextListener`](#addcontextlistener)
4 changes: 2 additions & 2 deletions website/versioned_docs/version-1.2/api/ref/DesktopAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const contactListener = fdc3.addContextListener('fdc3.contact', contact => { ...
```

#### See also
* [`Listener`](Listener)
* [`Listener`](Types#listener)
* [`Context`](Types#context)


Expand All @@ -90,7 +90,7 @@ const listener = fdc3.addIntentListener('StartChat', context => {
```

#### See also
* [`Listener`](Listener)
* [`Listener`](Types#listener)
* [`Context`](Types#context)


Expand Down
32 changes: 0 additions & 32 deletions website/versioned_docs/version-1.2/api/ref/Listener.md

This file was deleted.

24 changes: 24 additions & 0 deletions website/versioned_docs/version-1.2/api/ref/Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@ Used when attaching listeners for context broadcasts and raised intents.
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
* [`Channel.addContextListener`](Channel#addcontextlistener)

## `Listener`

A Listener object is returned when an application subscribes to intents or context broadcasts via the [`addIntentListener`](#addintentlistener) or [`addContextListener`](#addcontextlistener) methods on the [DesktopAgent](DesktopAgent) object.

```typescript
interface Listener {
unsubscribe(): void;
}
```
#### `unsubscribe`

```ts
unsubscribe(): void;
```

Allows an application to unsubscribe from listening to intents or context broadcasts.

#### See also
* [`DesktopAgent.addIntentListener`](DesktopAgent#addintentlistener)
* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener)
* [`Channel.addContextListener`](Channel#addcontextlistener)
* [`ContextHandler`](Types#contexthandler)


## `TargetApp`

```typescript
Expand Down
1 change: 0 additions & 1 deletion website/versioned_sidebars/version-1.2-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"ids": [
"version-1.2-api/ref/DesktopAgent",
"version-1.2-api/ref/Channel",
"version-1.2-api/ref/Listener",
"version-1.2-api/ref/Globals",
"version-1.2-api/ref/Types",
"version-1.2-api/ref/Metadata",
Expand Down