import { Observable } from "@apollo/client"; import { ApolloLink } from "@apollo/client/link"; import type { Consumer } from "@rails/actioncable"; type RequestResult = ApolloLink.Result, Record>; type ConnectionParams = object | ((operation: ApolloLink.Operation) => object); type SubscriptionCallbacks = { connected?: (args?: { reconnected: boolean; }) => void; disconnected?: () => void; received?: (payload: any) => void; }; type CreateChannelId = () => string; declare class ActionCableLink extends ApolloLink { cable: Consumer; channelName: string; actionName: string; connectionParams: ConnectionParams; callbacks: SubscriptionCallbacks; createChannelId: CreateChannelId; constructor(options: { cable: Consumer; createChannelId?: CreateChannelId; channelName?: string; actionName?: string; connectionParams?: ConnectionParams; callbacks?: SubscriptionCallbacks; }); request(operation: ApolloLink.Operation, _next: ApolloLink.ForwardFunction): Observable; } export default ActionCableLink;