-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix types for the echo library (#403)
* Fix wrong channel types * Add generic types * Throw an error when attempting to use encrypted channels with socket.io * Fix types for the function broadcaster * Add generic to channel types * Fix function types * Make connectors generic * Remove new keyword for function broadcasters * Fix tests * Specify return type for function broadcasters * Clean up generics * Remove unnecessary cast * Update quotes * Use NullChannel return type explicitly
- Loading branch information
1 parent
1d4bef1
commit e8491aa
Showing
20 changed files
with
157 additions
and
86 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
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,13 @@ | ||
import { NullChannel } from './null-channel'; | ||
|
||
/** | ||
* This class represents a null private channel. | ||
*/ | ||
export class NullEncryptedPrivateChannel extends NullChannel { | ||
/** | ||
* Send a whisper event to other clients in the channel. | ||
*/ | ||
whisper(eventName: string, data: any): this { | ||
return this; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { NullChannel } from './null-channel'; | ||
import { NullPrivateChannel } from './null-private-channel'; | ||
import { PresenceChannel } from './presence-channel'; | ||
|
||
/** | ||
* This class represents a null presence channel. | ||
*/ | ||
export class NullPresenceChannel extends NullChannel implements PresenceChannel { | ||
export class NullPresenceChannel extends NullPrivateChannel implements PresenceChannel { | ||
/** | ||
* Register a callback to be called anytime the member list changes. | ||
*/ | ||
here(callback: Function): NullPresenceChannel { | ||
here(callback: Function): this { | ||
return this; | ||
} | ||
|
||
/** | ||
* Listen for someone joining the channel. | ||
*/ | ||
joining(callback: Function): NullPresenceChannel { | ||
joining(callback: Function): this { | ||
return this; | ||
} | ||
|
||
/** | ||
* Send a whisper event to other clients in the channel. | ||
*/ | ||
whisper(eventName: string, data: any): NullPresenceChannel { | ||
whisper(eventName: string, data: any): this { | ||
return this; | ||
} | ||
|
||
/** | ||
* Listen for someone leaving the channel. | ||
*/ | ||
leaving(callback: Function): NullPresenceChannel { | ||
leaving(callback: Function): this { | ||
return this; | ||
} | ||
} |
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
Oops, something went wrong.