-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove PresenceMessage-related static things in tree-shakable library
- Loading branch information
1 parent
d364b86
commit f571734
Showing
9 changed files
with
97 additions
and
16 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
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 * as API from '../../../../ably'; | ||
import PresenceMessage, { fromEncoded, fromEncodedArray } from './presencemessage'; | ||
|
||
/** | ||
`DefaultPresenceMessage` is the class returned by `DefaultRest` and `DefaultRealtime`’s `PresenceMessage` static property. It introduces the static methods described in the `PresenceMessageStatic` interface of the public API of the non tree-shakable version of the library. | ||
*/ | ||
export class DefaultPresenceMessage extends PresenceMessage { | ||
static async fromEncoded(encoded: unknown, inputOptions?: API.Types.ChannelOptions): Promise<PresenceMessage> { | ||
return fromEncoded(encoded, inputOptions); | ||
} | ||
|
||
static async fromEncodedArray( | ||
encodedArray: Array<unknown>, | ||
options?: API.Types.ChannelOptions | ||
): Promise<PresenceMessage[]> { | ||
return fromEncodedArray(encodedArray, options); | ||
} | ||
} |
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,12 @@ | ||
import * as API from '../../../../ably'; | ||
import { fromEncoded, fromEncodedArray } from '../../../common/lib/types/presencemessage'; | ||
|
||
// The type assertions for the decode* functions below are due to https://github.com/ably/ably-js/issues/1421 | ||
|
||
export const decodePresenceMessage = ((obj, options) => { | ||
return fromEncoded(obj, options); | ||
}) as API.Types.PresenceMessageStatic['fromEncoded']; | ||
|
||
export const decodePresenceMessages = ((obj, options) => { | ||
return fromEncodedArray(obj, options); | ||
}) as API.Types.PresenceMessageStatic['fromEncodedArray']; |
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