forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
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 DefinitelyTyped#33053 from hagl/master
Add CometD 4.0.0 types for AckExtension and TimeSyncExtension
- Loading branch information
Showing
5 changed files
with
81 additions
and
4 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,12 @@ | ||
import * as m from '..'; | ||
|
||
declare class AckExtension implements m.Extension { | ||
constructor(); | ||
|
||
incoming: m.Listener; | ||
outgoing: m.Listener; | ||
registered: (name: string, cometd: m.CometD) => void; | ||
unregistered: () => void; | ||
} | ||
|
||
export default AckExtension; |
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,40 @@ | ||
import * as m from '..'; | ||
|
||
declare class TimeSyncExtension implements m.Extension { | ||
constructor(); | ||
|
||
incoming: m.Listener; | ||
outgoing: m.Listener; | ||
registered: (name: string, cometd: m.CometD) => void; | ||
unregistered: () => void; | ||
|
||
/** | ||
* Get the estimated offset in ms from the clients clock to the | ||
* servers clock. The server time is the client time plus the offset. | ||
*/ | ||
getTimeOffset: () => number; | ||
|
||
/** | ||
* Get an array of multiple offset samples used to calculate | ||
* the offset. | ||
*/ | ||
getTimeOffsetSamples: () => [number]; | ||
|
||
/** | ||
* Get the estimated network lag in ms from the client to the server. | ||
*/ | ||
getNetworkLag: () => number; | ||
|
||
/** | ||
* Get the estimated server time in ms since the epoch. | ||
*/ | ||
getServerTime: () => number; | ||
|
||
/** | ||
* | ||
* Get the estimated server time as a Date object | ||
*/ | ||
getServerDate: () => Date; | ||
} | ||
|
||
export default TimeSyncExtension; |
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