From 8f39a876c37e60ef70b88b42d02be9a6aa544d11 Mon Sep 17 00:00:00 2001 From: Kris West Date: Mon, 21 Jun 2021 11:27:36 +0100 Subject: [PATCH] Consolidate Listener with other types in documentation --- docs/api/overview.md | 2 +- docs/api/ref/Channel.md | 3 +- docs/api/ref/DesktopAgent.md | 4 +-- docs/api/ref/Listener.md | 31 ------------------ docs/api/ref/Types.md | 24 ++++++++++++++ .../version-1.2/api/overview.md | 2 +- .../version-1.2/api/ref/Channel.md | 6 ++-- .../version-1.2/api/ref/DesktopAgent.md | 4 +-- .../version-1.2/api/ref/Listener.md | 32 ------------------- .../version-1.2/api/ref/Types.md | 24 ++++++++++++++ .../version-1.2-sidebars.json | 1 - 11 files changed, 59 insertions(+), 74 deletions(-) delete mode 100644 docs/api/ref/Listener.md delete mode 100644 website/versioned_docs/version-1.2/api/ref/Listener.md diff --git a/docs/api/overview.md b/docs/api/overview.md index 78aa4e028..11d302f1d 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -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 diff --git a/docs/api/ref/Channel.md b/docs/api/ref/Channel.md index 7db4b6111..7db58a683 100644 --- a/docs/api/ref/Channel.md +++ b/docs/api/ref/Channel.md @@ -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) @@ -118,7 +119,7 @@ instrumentListener.unsubscribe(); ``` #### See also -* [`Listener`](Listener) +* [`Listener`](Types#listener) * [`ContextHandler`](Types#contexthandler) * [`broadcast`](#broadcast) * [`getCurrentContext`](#getcurrentcontext) diff --git a/docs/api/ref/DesktopAgent.md b/docs/api/ref/DesktopAgent.md index 44f424bf0..c4a8eb0b6 100644 --- a/docs/api/ref/DesktopAgent.md +++ b/docs/api/ref/DesktopAgent.md @@ -68,7 +68,7 @@ const contactListener = fdc3.addContextListener('fdc3.contact', contact => { ... ``` #### See also -* [`Listener`](Listener) +* [`Listener`](Types#listener) * [`Context`](Types#context) @@ -89,7 +89,7 @@ const listener = fdc3.addIntentListener('StartChat', context => { ``` #### See also -* [`Listener`](Listener) +* [`Listener`](Types#listener) * [`Context`](Types#context) diff --git a/docs/api/ref/Listener.md b/docs/api/ref/Listener.md deleted file mode 100644 index 32c3d3647..000000000 --- a/docs/api/ref/Listener.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -id: Listener -sidebar_label: Listener -title: Listener -hide_title: true ---- -# `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; -} -``` - -## Methods - -### `unsubscribe` - -```ts -unsubscribe(): void; -``` - -Allows an application to unsubscribe from listening to intents or context broadcasts. - -#### See also -* [`DesktopAgent.addIntentListener`](DestkopAgent#addintentlistener) -* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener) -* [`Channel.addContextListener`](Channel#addcontextlistener) -* [`ContextHandler`](Types#contexthandler) diff --git a/docs/api/ref/Types.md b/docs/api/ref/Types.md index e320aa644..3b11a4fc2 100644 --- a/docs/api/ref/Types.md +++ b/docs/api/ref/Types.md @@ -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 diff --git a/website/versioned_docs/version-1.2/api/overview.md b/website/versioned_docs/version-1.2/api/overview.md index 983f0254c..3838f5f48 100644 --- a/website/versioned_docs/version-1.2/api/overview.md +++ b/website/versioned_docs/version-1.2/api/overview.md @@ -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 diff --git a/website/versioned_docs/version-1.2/api/ref/Channel.md b/website/versioned_docs/version-1.2/api/ref/Channel.md index c34d10256..42c15d977 100644 --- a/website/versioned_docs/version-1.2/api/ref/Channel.md +++ b/website/versioned_docs/version-1.2/api/ref/Channel.md @@ -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) @@ -119,7 +120,7 @@ instrumentListener.unsubscribe(); ``` #### See also -* [`Listener`](Listener) +* [`Listener`](Types#listener) * [`ContextHandler`](Types#contexthandler) * [`broadcast`](#broadcast) * [`getCurrentContext`](#getcurrentcontext) @@ -198,5 +199,4 @@ try { #### See also * [`ChannelError`](Errors#channelerror) * [`broadcast`](#broadcast) -* [`addContextListener`](#addcontextlistener) - +* [`addContextListener`](#addcontextlistener) \ No newline at end of file diff --git a/website/versioned_docs/version-1.2/api/ref/DesktopAgent.md b/website/versioned_docs/version-1.2/api/ref/DesktopAgent.md index 3a6f06d41..d433dc71f 100644 --- a/website/versioned_docs/version-1.2/api/ref/DesktopAgent.md +++ b/website/versioned_docs/version-1.2/api/ref/DesktopAgent.md @@ -69,7 +69,7 @@ const contactListener = fdc3.addContextListener('fdc3.contact', contact => { ... ``` #### See also -* [`Listener`](Listener) +* [`Listener`](Types#listener) * [`Context`](Types#context) @@ -90,7 +90,7 @@ const listener = fdc3.addIntentListener('StartChat', context => { ``` #### See also -* [`Listener`](Listener) +* [`Listener`](Types#listener) * [`Context`](Types#context) diff --git a/website/versioned_docs/version-1.2/api/ref/Listener.md b/website/versioned_docs/version-1.2/api/ref/Listener.md deleted file mode 100644 index a67b03071..000000000 --- a/website/versioned_docs/version-1.2/api/ref/Listener.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: version-1.2-Listener -sidebar_label: Listener -title: Listener -hide_title: true -original_id: Listener ---- -# `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; -} -``` - -## Methods - -### `unsubscribe` - -```ts -unsubscribe(): void; -``` - -Allows an application to unsubscribe from listening to intents or context broadcasts. - -#### See also -* [`DesktopAgent.addIntentListener`](DestkopAgent#addintentlistener) -* [`DesktopAgent.addContextListener`](DesktopAgent#addcontextlistener) -* [`Channel.addContextListener`](Channel#addcontextlistener) -* [`ContextHandler`](Types#contexthandler) diff --git a/website/versioned_docs/version-1.2/api/ref/Types.md b/website/versioned_docs/version-1.2/api/ref/Types.md index 5d56c97e0..c0f0fcd6d 100644 --- a/website/versioned_docs/version-1.2/api/ref/Types.md +++ b/website/versioned_docs/version-1.2/api/ref/Types.md @@ -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 diff --git a/website/versioned_sidebars/version-1.2-sidebars.json b/website/versioned_sidebars/version-1.2-sidebars.json index c942d1b46..f2e0f18eb 100644 --- a/website/versioned_sidebars/version-1.2-sidebars.json +++ b/website/versioned_sidebars/version-1.2-sidebars.json @@ -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",