-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include automatically generated declarations
- Loading branch information
James Lees
committed
Feb 11, 2020
1 parent
fcfb007
commit 255e7d7
Showing
116 changed files
with
1,208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Pusher from './src/core/pusher' | ||
import { Authorizer, AuthOptions, AuthorizerGenerator } from './src/core/auth/options'; | ||
import { Options } from './src/core/options' | ||
import Channel from './src/core/channels/channel'; | ||
import Runtime from './src/runtimes/interface' | ||
|
||
export { | ||
Options, | ||
AuthOptions, | ||
AuthorizerGenerator, | ||
Authorizer, | ||
Channel, | ||
Runtime, | ||
} | ||
export default Pusher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare var Dependencies: {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Pusher from '../../../src/core/pusher'; | ||
export default class PusherIntegration extends Pusher { | ||
static Integration: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import AbstractRuntime from 'runtimes/interface'; | ||
interface AuthTransport { | ||
(context: AbstractRuntime, socketId: string, callback: Function): void; | ||
} | ||
interface AuthTransports { | ||
[index: string]: AuthTransport; | ||
} | ||
export { AuthTransport, AuthTransports }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Channel from '../channels/channel'; | ||
export interface AuthOptions { | ||
params: any; | ||
headers: any; | ||
} | ||
export interface Authorizer { | ||
authorize(socketId: string, callback: Function): any; | ||
} | ||
export interface AuthorizerGenerator { | ||
(channel: Channel, options: AuthorizerOptions): Authorizer; | ||
} | ||
export interface AuthorizerOptions { | ||
authTransport: 'ajax' | 'jsonp'; | ||
auth: AuthOptions; | ||
authorizer: AuthorizerGenerator; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Channel from '../channels/channel'; | ||
import { AuthTransports } from './auth_transports'; | ||
import { AuthOptions, AuthorizerOptions, Authorizer } from './options'; | ||
export default class PusherAuthorizer implements Authorizer { | ||
static authorizers: AuthTransports; | ||
channel: Channel; | ||
type: string; | ||
options: AuthorizerOptions; | ||
authOptions: AuthOptions; | ||
constructor(channel: Channel, options: AuthorizerOptions); | ||
composeQuery(socketId: string): string; | ||
authorize(socketId: string, callback: Function): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default function encode(s: any): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { default as EventsDispatcher } from '../events/dispatcher'; | ||
import Pusher from '../pusher'; | ||
import { PusherEvent } from '../connection/protocol/message-types'; | ||
export default class Channel extends EventsDispatcher { | ||
name: string; | ||
pusher: Pusher; | ||
subscribed: boolean; | ||
subscriptionPending: boolean; | ||
subscriptionCancelled: boolean; | ||
constructor(name: string, pusher: Pusher); | ||
authorize(socketId: string, callback: Function): any; | ||
trigger(event: string, data: any): boolean; | ||
disconnect(): void; | ||
handleEvent(event: PusherEvent): void; | ||
handleSubscriptionSucceededEvent(event: PusherEvent): void; | ||
subscribe(): void; | ||
unsubscribe(): void; | ||
cancelSubscription(): void; | ||
reinstateSubscription(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Channel from './channel'; | ||
interface ChannelTable { | ||
[index: string]: Channel; | ||
} | ||
export default ChannelTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Channel from './channel'; | ||
import ChannelTable from './channel_table'; | ||
import Pusher from '../pusher'; | ||
export default class Channels { | ||
channels: ChannelTable; | ||
constructor(); | ||
add(name: string, pusher: Pusher): Channel; | ||
all(): Channel[]; | ||
find(name: string): Channel; | ||
remove(name: string): Channel; | ||
disconnect(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import PrivateChannel from './private_channel'; | ||
import Dispatcher from '../events/dispatcher'; | ||
import { PusherEvent } from '../connection/protocol/message-types'; | ||
export default class EncryptedChannel extends PrivateChannel { | ||
key: Uint8Array; | ||
authorize(socketId: string, callback: Function): void; | ||
trigger(event: string, data: any): boolean; | ||
handleEvent(event: PusherEvent): void; | ||
private handleEncryptedEvent; | ||
emitJSON(eventName: string, data?: any): Dispatcher; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default class Members { | ||
members: any; | ||
count: number; | ||
myID: any; | ||
me: any; | ||
constructor(); | ||
get(id: string): any; | ||
each(callback: Function): void; | ||
setMyID(id: string): void; | ||
onSubscription(subscriptionData: any): void; | ||
addMember(memberData: any): any; | ||
removeMember(memberData: any): any; | ||
reset(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
interface Metadata { | ||
user_id?: string; | ||
} | ||
export default Metadata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import PrivateChannel from './private_channel'; | ||
import Members from './members'; | ||
import Pusher from '../pusher'; | ||
import { PusherEvent } from '../connection/protocol/message-types'; | ||
export default class PresenceChannel extends PrivateChannel { | ||
members: Members; | ||
constructor(name: string, pusher: Pusher); | ||
authorize(socketId: string, callback: Function): void; | ||
handleEvent(event: PusherEvent): void; | ||
handleInternalEvent(event: PusherEvent): void; | ||
handleSubscriptionSucceededEvent(event: PusherEvent): void; | ||
disconnect(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Channel from './channel'; | ||
export default class PrivateChannel extends Channel { | ||
authorize(socketId: string, callback: Function): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export declare var getGlobalConfig: () => { | ||
wsHost: string; | ||
wsPort: number; | ||
wssPort: number; | ||
wsPath: string; | ||
httpHost: string; | ||
httpPort: number; | ||
httpsPort: number; | ||
httpPath: string; | ||
statsHost: string; | ||
authEndpoint: string; | ||
authTransport: string; | ||
activityTimeout: number; | ||
pongTimeout: number; | ||
unavailableTimeout: number; | ||
}; | ||
export declare var getClusterConfig: (clusterName: any) => { | ||
wsHost: string; | ||
httpHost: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import HandshakePayload from './handshake/handshake_payload'; | ||
import Action from './protocol/action'; | ||
export interface ErrorCallbacks { | ||
tls_only: (result: Action | HandshakePayload) => void; | ||
refused: (result: Action | HandshakePayload) => void; | ||
backoff: (result: Action | HandshakePayload) => void; | ||
retry: (result: Action | HandshakePayload) => void; | ||
} | ||
export interface HandshakeCallbacks { | ||
connected: (handshake: HandshakePayload) => void; | ||
} | ||
export interface ConnectionCallbacks { | ||
message: (message: any) => void; | ||
ping: () => void; | ||
activity: () => void; | ||
error: (error: any) => void; | ||
closed: () => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { default as EventsDispatcher } from '../events/dispatcher'; | ||
import TransportConnection from '../transports/transport_connection'; | ||
import Socket from '../socket'; | ||
export default class Connection extends EventsDispatcher implements Socket { | ||
id: string; | ||
transport: TransportConnection; | ||
activityTimeout: number; | ||
constructor(id: string, transport: TransportConnection); | ||
handlesActivityChecks(): boolean; | ||
send(data: any): boolean; | ||
send_event(name: string, data: any, channel?: string): boolean; | ||
ping(): void; | ||
close(): void; | ||
private bindListeners; | ||
private handleCloseEvent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { default as EventsDispatcher } from '../events/dispatcher'; | ||
import { OneOffTimer as Timer } from '../utils/timers'; | ||
import Connection from './connection'; | ||
import Strategy from '../strategies/strategy'; | ||
import StrategyRunner from '../strategies/strategy_runner'; | ||
import Timeline from '../timeline/timeline'; | ||
import ConnectionManagerOptions from './connection_manager_options'; | ||
import { ErrorCallbacks, HandshakeCallbacks, ConnectionCallbacks } from './callbacks'; | ||
export default class ConnectionManager extends EventsDispatcher { | ||
key: string; | ||
options: ConnectionManagerOptions; | ||
state: string; | ||
connection: Connection; | ||
usingTLS: boolean; | ||
timeline: Timeline; | ||
socket_id: string; | ||
unavailableTimer: Timer; | ||
activityTimer: Timer; | ||
retryTimer: Timer; | ||
activityTimeout: number; | ||
strategy: Strategy; | ||
runner: StrategyRunner; | ||
errorCallbacks: ErrorCallbacks; | ||
handshakeCallbacks: HandshakeCallbacks; | ||
connectionCallbacks: ConnectionCallbacks; | ||
constructor(key: string, options: any); | ||
connect(): void; | ||
send(data: any): boolean; | ||
send_event(name: string, data: any, channel?: string): boolean; | ||
disconnect(): void; | ||
isUsingTLS(): boolean; | ||
private startConnecting; | ||
private abortConnecting; | ||
private disconnectInternally; | ||
private updateStrategy; | ||
private retryIn; | ||
private clearRetryTimer; | ||
private setUnavailableTimer; | ||
private clearUnavailableTimer; | ||
private sendActivityCheck; | ||
private resetActivityCheck; | ||
private stopActivityCheck; | ||
private buildConnectionCallbacks; | ||
private buildHandshakeCallbacks; | ||
private buildErrorCallbacks; | ||
private setConnection; | ||
private abandonConnection; | ||
private updateState; | ||
private shouldRetry; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Timeline from '../timeline/timeline'; | ||
import Strategy from '../strategies/strategy'; | ||
interface ConnectionManagerOptions { | ||
timeline: Timeline; | ||
getStrategy: (StrategyOptions: any) => Strategy; | ||
unavailableTimeout: number; | ||
pongTimeout: number; | ||
activityTimeout: number; | ||
} | ||
export default ConnectionManagerOptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import TransportConnection from '../../transports/transport_connection'; | ||
import Action from '../protocol/action'; | ||
import Connection from '../connection'; | ||
interface HandshakePayload extends Action { | ||
transport: TransportConnection; | ||
connection?: Connection; | ||
} | ||
export default HandshakePayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import TransportConnection from '../../transports/transport_connection'; | ||
export default class Handshake { | ||
transport: TransportConnection; | ||
callback: (HandshakePayload: any) => void; | ||
onMessage: Function; | ||
onClosed: Function; | ||
constructor(transport: TransportConnection, callback: (HandshakePayload: any) => void); | ||
close(): void; | ||
private bindListeners; | ||
private unbindListeners; | ||
private finish; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
interface Action { | ||
action: string; | ||
id?: string; | ||
activityTimeout?: number; | ||
error?: any; | ||
} | ||
export default Action; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
interface PusherEvent { | ||
event: string; | ||
channel?: string; | ||
data?: any; | ||
user_id?: string; | ||
} | ||
export { PusherEvent }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Action from './action'; | ||
import { PusherEvent } from './message-types'; | ||
declare const Protocol: { | ||
decodeMessage: (messageEvent: MessageEvent) => PusherEvent; | ||
encodeMessage: (event: PusherEvent) => string; | ||
processHandshake: (messageEvent: MessageEvent) => Action; | ||
getCloseAction: (closeEvent: any) => string; | ||
getCloseError: (closeEvent: any) => any; | ||
}; | ||
export default Protocol; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export interface DefaultConfig { | ||
VERSION: string; | ||
PROTOCOL: number; | ||
host: string; | ||
ws_port: number; | ||
wss_port: number; | ||
ws_path: string; | ||
sockjs_host: string; | ||
sockjs_http_port: number; | ||
sockjs_https_port: number; | ||
sockjs_path: string; | ||
stats_host: string; | ||
channel_auth_endpoint: string; | ||
channel_auth_transport: string; | ||
activity_timeout: number; | ||
pong_timeout: number; | ||
unavailable_timeout: number; | ||
cdn_http?: string; | ||
cdn_https?: string; | ||
dependency_suffix?: string; | ||
} | ||
declare var Defaults: DefaultConfig; | ||
export default Defaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export declare class BadEventName extends Error { | ||
constructor(msg?: string); | ||
} | ||
export declare class RequestTimedOut extends Error { | ||
constructor(msg?: string); | ||
} | ||
export declare class TransportPriorityTooLow extends Error { | ||
constructor(msg?: string); | ||
} | ||
export declare class TransportClosed extends Error { | ||
constructor(msg?: string); | ||
} | ||
export declare class UnsupportedFeature extends Error { | ||
constructor(msg?: string); | ||
} | ||
export declare class UnsupportedTransport extends Error { | ||
constructor(msg?: string); | ||
} | ||
export declare class UnsupportedStrategy extends Error { | ||
constructor(msg?: string); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
interface Callback { | ||
fn: Function; | ||
context: any; | ||
} | ||
export default Callback; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Callback from './callback'; | ||
import CallbackTable from './callback_table'; | ||
export default class CallbackRegistry { | ||
_callbacks: CallbackTable; | ||
constructor(); | ||
get(name: string): Callback[]; | ||
add(name: string, callback: Function, context: any): void; | ||
remove(name?: string, callback?: Function, context?: any): void; | ||
private removeCallback; | ||
private removeAllCallbacks; | ||
} |
Oops, something went wrong.