Last active
December 16, 2015 16:19
-
-
Save lambdabaa/5462724 to your computer and use it in GitHub Desktop.
Super awesome cal sync interface
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
/** | |
* Called when we get events for the first time or when we get a delta. | |
* @param {Calendar.ResourceType} resourceType | |
* @param {Calendar.Resource.Authorizer} authorizer | |
* @param {Function} cb Will get called with Array.<Calendar.Resource> | |
*/ | |
on = function(resourceType, authorizer, cb); | |
/** | |
* Unsubscribe. | |
* @param {Calendar.ResourceType} resourceType | |
* @param {Calendar.Resource.Authorizer} authorizer | |
* @param {Function} cb Will get called with Array.<Calendar.Resource> | |
*/ | |
off = function(resourceType, authorizer, cb); | |
/** | |
* Update this resource. | |
* @param {Calendar.Resource} resource | |
* @param {Calendar.Resource.Authorizer} authorizer | |
* @param {Function} cb Will be called possibly with an error object. | |
* @return {Calendar.Resource.Pending} | |
*/ | |
update = function(resource, authorizer, cb); | |
/** | |
* Delete this resource. | |
* @param {Calendar.Resource} resource | |
* @param {Calendar.Resource.Authorizer} authorizer | |
* @param {Function} cb Will be called possibly with an error object. | |
* @return {Calendar.Resource.Pending} | |
*/ | |
delete = function(resource, authorizer, cb); | |
/** @constructor */ | |
Calendar.Resource = function() {}; | |
/** @constructor */ | |
Calendar.Resource.Authorizer = function() { | |
... | |
}; | |
/** @constructor */ | |
Calendar.Resource.Pending = function() {}; | |
Calendar.Resource.Pending.prototype = { | |
abort: function() {}, | |
... | |
}; | |
Calendar.ResourceType = { | |
CALENDARS: 'calendars', | |
EVENTS: 'events', | |
... | |
}; |
Author
lambdabaa
commented
Apr 25, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment