Skip to content

Commit 7ae5b80

Browse files
committed
correcting an error in the Channel type's docs (values for type field were updated in source but change must have been reverted accidentally in dos page)
1 parent 21e3555 commit 7ae5b80

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

docs/api/ref/Channel.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Channels each have a unique identifier, some display metadata and operations for
1616
interface Channel {
1717
// properties
1818
id: string;
19-
type: string;
19+
type: "user" | "app" | "private";
2020
displayMetadata?: DisplayMetadata;
2121

2222
// methods
@@ -51,10 +51,10 @@ Uniquely identifies the channel. It is either assigned by the desktop agent (Use
5151
### `type`
5252

5353
```ts
54-
public readonly type: string;
54+
public readonly type: "user" | "app" | "private";
5555
```
5656

57-
Can be _system_, _app_ or _private_.
57+
Can be _user_, _app_ or _private_.
5858

5959
### `displayMetadata`
6060

@@ -65,15 +65,18 @@ public readonly displayMetadata?: DisplayMetadata;
6565
DisplayMetadata can be used to provide display hints for User Channels intended to be visualized and selectable by end users.
6666

6767
#### See also
68+
6869
* [`DisplayMetadata`](Metadata#displaymetadata)
6970

7071
## Methods
7172

7273

7374
### `addContextListener`
75+
7476
```ts
7577
public addContextListener(contextType: string | null, handler: ContextHandler): Promise<Listener>;
7678
```
79+
7780
Adds a listener for incoming contexts of the specified _context type_ whenever a broadcast happens on this channel.
7881

7982
If, when this function is called, the channel already contains context that would be passed to the listener it is NOT called or passed this context automatically (this behavior differs from that of the [`fdc3.addContextListener`](DesktopAgent#addcontextlistener) function). Apps wishing to access to the current context of the channel should instead call the [`getCurrentContext(contextType)`](#getcurrentcontext) function.
@@ -122,6 +125,7 @@ instrumentListener.unsubscribe();
122125
```
123126

124127
#### See also
128+
125129
* [`Listener`](Types#listener)
126130
* [`ContextHandler`](Types#contexthandler)
127131
* [`broadcast`](#broadcast)
@@ -159,6 +163,7 @@ try {
159163
```
160164

161165
#### See also
166+
162167
* [`ChannelError`](Errors#channelerror)
163168
* [`getCurrentContext`](#getcurrentcontext)
164169
* [`addContextListener`](#addcontextlistener)
@@ -175,7 +180,6 @@ If no _context type_ is provided, the most recent context that was broadcast on
175180

176181
It is up to the specific Desktop Agent implementation whether and how recent contexts are stored. For example, an implementation could store context history for a channel in a single array and search through the array for the last context matching a provided type, or context could be maintained as a dictionary keyed by context types. An implementation could also choose not to support context history, in which case this method will return `null` for any context type not matching the type of the most recent context.
177182

178-
179183
If getting the current context fails, the promise will return an `Error` with a string from the [`ChannelError`](ChannelError) enumeration.
180184

181185
#### Examples
@@ -201,6 +205,7 @@ try {
201205
```
202206

203207
#### See also
208+
204209
* [`ChannelError`](Errors#channelerror)
205210
* [`broadcast`](#broadcast)
206211
* [`addContextListener`](#addcontextlistener)

src/api/Channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface Channel {
2121
* Uniquely defines each channel type.
2222
* Can be "user", "app" or "private".
2323
*/
24-
readonly type: string;
24+
readonly type: 'user' | 'app' | 'private';
2525

2626
/**
2727
* Channels may be visualized and selectable by users. DisplayMetadata may be used to provide hints on how to see them.

0 commit comments

Comments
 (0)