-
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.
Merge pull request #420 from pusher/bundle-ts-types
Bundle ts types
- Loading branch information
Showing
127 changed files
with
1,302 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export { | ||
AuthInfo, | ||
Authorizer, | ||
AuthOptions, | ||
AuthorizerGenerator, | ||
AuthorizerCallback, | ||
} from './types/src/core/auth/options'; | ||
export { Options } from './types/src/core/options' | ||
|
||
export {default as Channel} from './types/src/core/channels/channel'; | ||
export {default as PresenceChannel} from './types/src/core/channels/presence_channel'; | ||
export {default as Members} from './types/src/core/channels/members'; | ||
export {default as Runtime} from './types/src/runtimes/interface' | ||
export {default as ConnectionManager} from './types/src/core/connection/connection_manager' | ||
|
||
export {default} from './types/src/core/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
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
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
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
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
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
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,22 @@ | ||
import Channel from '../channels/channel'; | ||
export interface AuthOptions { | ||
params: any; | ||
headers: any; | ||
} | ||
export interface AuthData { | ||
auth: string; | ||
channel_data?: string; | ||
} | ||
export declare type AuthInfo = AuthData | string; | ||
export declare type AuthorizerCallback = (error: boolean, authInfo: AuthInfo) => void; | ||
export interface Authorizer { | ||
authorize(socketId: string, callback: AuthorizerCallback): void; | ||
} | ||
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, AuthorizerCallback } 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: AuthorizerCallback): 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 @@ | ||
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,21 @@ | ||
import { default as EventsDispatcher } from '../events/dispatcher'; | ||
import Pusher from '../pusher'; | ||
import { PusherEvent } from '../connection/protocol/message-types'; | ||
import { AuthorizerCallback } from '../auth/options'; | ||
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: AuthorizerCallback): void; | ||
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,12 @@ | ||
import PrivateChannel from './private_channel'; | ||
import Dispatcher from '../events/dispatcher'; | ||
import { PusherEvent } from '../connection/protocol/message-types'; | ||
import { AuthorizerCallback } from '../auth/options'; | ||
export default class EncryptedChannel extends PrivateChannel { | ||
key: Uint8Array; | ||
authorize(socketId: string, callback: AuthorizerCallback): 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,5 @@ | ||
import Channel from './channel'; | ||
import { AuthorizerCallback } from '../auth/options'; | ||
export default class PrivateChannel extends Channel { | ||
authorize(socketId: string, callback: AuthorizerCallback): void; | ||
} |
Oops, something went wrong.