AboutSupportDeveloper GuideVersion 38.126.83.74

Object representing a context channel.

interface Channel {
    displayMetadata?: OpenFin.FDC3.v1_2.DisplayMetadata;
    id: string;
    type: string;
    addContextListener(handler): OpenFin.FDC3.v1_2.Listener;
    addContextListener(contextType, handler): OpenFin.FDC3.v1_2.Listener;
    broadcast(context): void;
    getCurrentContext(contextType?): Promise<null | OpenFin.FDC3.v1_2.Context>;
}

Properties

displayMetadata?: OpenFin.FDC3.v1_2.DisplayMetadata

Channels may be visualized and selectable by users. DisplayMetadata may be used to provide hints on how to see them. For app channels, displayMetadata would typically not be present

id: string

Constant that uniquely identifies this channel.

type: string

Uniquely defines each channel type.

Methods

  • Broadcasts the given context on this channel. This is equivalent to joining the channel and then calling the top-level FDC3 broadcast function.

    Note that this function can be used without first joining the channel, allowing applications to broadcast on channels that they aren't a member of.

    Channel implementations should ensure that context messages broadcast by an application on a channel should not be delivered back to that same application if they are joined to the channel.

    Error with a string from the ChannelError enumeration.

    Parameters

    Returns void

  • Returns the last context that was broadcast on this channel. All channels initially have no context, until a context is broadcast on the channel. If there is not yet any context on the channel, this method will return null.

    The context of a channel will be captured regardless of how the context is broadcasted on this channel - whether using the top-level FDC3 broadcast function, or using the channel-level broadcast function on this object.

    Optionally a contextType can be provided, in which case the current context of the matching type will be returned (if any). Desktop agent implementations may decide to record contexts by type, in which case it will be possible to get the most recent context of the type specified, but this is not guaranteed.

    Error with a string from the ChannelError enumeration.

    Parameters

    • Optional contextType: string

    Returns Promise<null | OpenFin.FDC3.v1_2.Context>