Start of cosmopolite externs.

This commit is contained in:
Ian Gulliver
2014-06-14 11:00:35 -07:00
parent ffc597f222
commit fb0d695d6e
2 changed files with 40 additions and 0 deletions

31
externs/cosmopolite.js Normal file
View File

@@ -0,0 +1,31 @@
/**
* @fileoverview Definitions for Cosmopolite API. Details of the API are at:
* https://www.cosmopolite.org/reference
*
* @externs
* @author ian@cosmopolite.org (Ian Gulliver)
*/
/**
* @see https://www.cosmopolite.org/reference#constructor
* @constructor
* @param {?Cosmopolite.typeCallbacks=} opt_callbacks
* @param {?string=} opt_urlPrefix
* @param {?string=} opt_namespace
* @param {?string=} opt_trackingID
* @nosideeffects
*/
function Cosmopolite(
opt_callbacks, opt_urlPrefix, opt_namespace, opt_trackingID) {}
/**
* @see https://www.cosmopolite.org/reference#subscribe
* @param {Cosmopolite.typeSubjectLoose|Array.<Cosmopolite.typeSubjectLoose>}
* subjects
* @param {?number=} opt_messages
* @param {?number=} opt_lastID
* @return {Promise|Array.<Promise>}
*/
Cosmopolite.prototype.subscribe =
function(subjects, opt_messages, opt_lastID) {};