UNPKG

pusher-js

Version:

Pusher Channels JavaScript library for browsers, React Native, NodeJS and web workers

33 lines (26 loc) 660 B
import Channel from '../channels/channel'; export interface AuthOptions { params?: any; headers?: any; } export interface AuthData { auth: string; channel_data?: string; shared_secret?: string; } export type AuthorizerCallback = ( error: Error | null, authData: AuthData ) => void; export interface Authorizer { authorize(socketId: string, callback: AuthorizerCallback): void; } export interface AuthorizerGenerator { (channel: Channel, options: AuthorizerOptions): Authorizer; } export interface AuthorizerOptions { authTransport: 'ajax' | 'jsonp'; authEndpoint: string; auth?: AuthOptions; authorizer?: AuthorizerGenerator; }