From a51359068f34d27b8aeaf3a08c66425322334619 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sat, 14 Jun 2014 12:21:16 -0700 Subject: [PATCH] Flesh out externs file --- externs/cosmopolite.js | 107 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/externs/cosmopolite.js b/externs/cosmopolite.js index 7345701..48c8fd4 100644 --- a/externs/cosmopolite.js +++ b/externs/cosmopolite.js @@ -40,7 +40,10 @@ Cosmopolite.typeMessage; Cosmopolite.typeSubject; -/** @typedef {(Cosmopolite.typeSubject|string|number)} */ +/** + * @see https://www.cosmopolite.org/reference#subject + * @typedef {(Cosmopolite.typeSubject|string|number)} + */ Cosmopolite.typeSubjectLoose; @@ -58,6 +61,28 @@ function Cosmopolite( opt_callbacks, opt_urlPrefix, opt_namespace, opt_trackingID) {} +/** + * @see https://www.cosmopolite.org/reference#shutdown + */ +Cosmopolite.prototype.shutdown = function() {}; + + +/** + * @see https://www.cosmopolite.org/reference#getProfile + * @return {Promise} + * @nosideeffects + */ +Cosmopolite.prototype.getProfile = function() {}; + + +/** + * @see https://www.cosmopolite.org/reference#currentProfile + * @const + * @nosideeffects + */ +Cosmopolite.prototype.currentProfile = function() {}; + + /** * @see https://www.cosmopolite.org/reference#subscribe * @param {Cosmopolite.typeSubjectLoose|Array.} @@ -68,3 +93,83 @@ function Cosmopolite( */ Cosmopolite.prototype.subscribe = function(subjects, opt_messages, opt_lastID) {}; + + +/** + * @see https://www.cosmopolite.org/reference#unsubscribe + * @param {Cosmopolite.typeSubjectLoose} subject + * @return {Promise} + */ +Cosmopolite.prototype.unsubscribe = function(subject) {}; + + +/** + * @see https://www.cosmopolite.org/reference#sendMessage + * @param {Cosmopolite.typeSubjectLoose} subject + * @param {!*} message + * @return {Promise} + */ +Cosmopolite.prototype.sendMessage = function(subject, message) {}; + + +/** + * @see https://www.cosmopolite.org/reference#getMessages + * @param {Cosmopolite.typeSubjectLoose} subject + * @return {Array.} + * @const + * @nosideeffects + */ +Cosmopolite.prototype.getMessages = function(subject) {}; + + +/** + * @see https://www.cosmopolite.org/reference#getLastMessage + * @param {Cosmopolite.typeSubjectLoose} subject + * @return {?Cosmopolite.typeMessage} + * @const + * @nosideeffects + */ +Cosmopolite.prototype.getLastMessage = function(subject) {}; + + +/** + * @see https://www.cosmopolite.org/reference#pin_method + * @param {Cosmopolite.typeSubjectLoose} subject + * @param {!*} message + * @return {Promise} + */ +Cosmopolite.prototype.pin = function(subject, message) {}; + + +/** + * @see https://www.cosmopolite.org/reference#unpin + * @param {string} id + * @return {Promise} + */ +Cosmopolite.prototype.unpin = function(id) {}; + + +/** + * @see https://www.cosmopolite.org/reference#getPins + * @param {Cosmopolite.typeSubjectLoose} subject + * @return {Array.} + * @const + * @nosideeffects + */ +Cosmopolite.prototype.getPins = function(subject) {}; + + +/** + * @see https://www.cosmopolite.org/reference#trackEvent + * @param {...*} var_args + */ +Cosmopolite.prototype.trackEvent = function(var_args) {}; + + +/** + * @see https://www.cosmopolite.org/reference#uuid + * @return {string} + * @const + * @nosideeffects + */ +Cosmopolite.prototype.uuid = function() {};