diff --git a/app.yaml b/app.yaml index 3910ced..78ceace 100644 --- a/app.yaml +++ b/app.yaml @@ -59,6 +59,15 @@ handlers: X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubDomains +- url: /externs + static_dir: externs + secure: always + expiration: 7d + http_headers: + X-Frame-Options: DENY + X-Content-Type-Options: nosniff + Strict-Transport-Security: max-age=31536000; includeSubDomains + pagespeed: enabled_rewriters: - InlineImages diff --git a/externs/cosmopolite.js b/externs/cosmopolite.js new file mode 100644 index 0000000..e3d770d --- /dev/null +++ b/externs/cosmopolite.js @@ -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.} + * subjects + * @param {?number=} opt_messages + * @param {?number=} opt_lastID + * @return {Promise|Array.} + */ +Cosmopolite.prototype.subscribe = + function(subjects, opt_messages, opt_lastID) {};