Interface NotificationChannelType

A specific channel type as defined at https://solidproject.org/TR/2022/notifications-protocol-20221231#notification-channel-types.

All functions that take a NotificationChannel as input only need to support channels generated by an initChannel on the same class.

interface NotificationChannelType {
    completeChannel: ((channel: NotificationChannel) => Promise<void>);
    extractModes: ((channel: NotificationChannel) => Promise<AccessMap>);
    getDescription: (() => SubscriptionService);
    initChannel: ((data: Store<Quad, Quad, Quad, Quad>, credentials: Credentials) => Promise<NotificationChannel>);
    toJsonLd: ((channel: NotificationChannel) => Promise<Record<string, unknown>>);
}

Implemented by

Properties

completeChannel: ((channel: NotificationChannel) => Promise<void>)

This function will be called after the serialized channel is sent back as a response, allowing for any final actions that need to happen.

Type declaration

    • (channel): Promise<void>
    • Parameters

      Returns Promise<void>

extractModes: ((channel: NotificationChannel) => Promise<AccessMap>)

Determines which modes are required to allow the given notification channel.

Type declaration

getDescription: (() => SubscriptionService)

Returns the SubscriptionService that describes how to subscribe to this channel type.

initChannel: ((data: Store<Quad, Quad, Quad, Quad>, credentials: Credentials) => Promise<NotificationChannel>)

Validate and convert the input quads into a NotificationChannel.

Type declaration

toJsonLd: ((channel: NotificationChannel) => Promise<Record<string, unknown>>)

Converts a NotificationChannel to a serialized JSON-LD representation.

Type declaration

    • (channel): Promise<Record<string, unknown>>
    • Parameters

      Returns Promise<Record<string, unknown>>