import type { StreamInstance } from '../instance.js' import type { Topic } from '../types.js' export interface UnsubscribeInput { readonly topics: readonly Topic[] } export interface UnsubscribeOutput { unsubscribed: Topic[] } export type Unsubscribe = ( input: Readonly ) => Promise export const createUnsubscribe = ( instance: Readonly ): Unsubscribe => { return async ({ topics }) => { return instance.request({ method: 'unsubscribe', params: { topics }, }) } }