Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | /* Copyright 2016 The Chromium Authors. All Rights Reserved. |
| 2 | * |
| 3 | * Use of this source code is governed by a BSD-style |
| 4 | * license that can be found in the LICENSE file or at |
| 5 | * https://developers.google.com/open-source/licenses/bsd |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * @fileoverview Defines the type of the CS_env Javascript object |
| 10 | * provided by the Codesite server. |
| 11 | * |
| 12 | * This is marked as an externs file so that any variable defined with a |
| 13 | * CS.env type will not have its properties renamed. |
| 14 | * @externs |
| 15 | */ |
| 16 | |
| 17 | /** Codesite namespace object. */ |
| 18 | var CS = {}; |
| 19 | |
| 20 | /** |
| 21 | * Javascript object holding basic information about the current page. |
| 22 | * This is defined as an interface so that we can use CS.env as a Closure |
| 23 | * type name, but it will never be implemented; rather, it will be |
| 24 | * made available on every page as the global object CS_env (see |
| 25 | * codesite/templates/demetrius/header.ezt). |
| 26 | * |
| 27 | * The type of the CS_env global object will actually be one of |
| 28 | * CS.env, CS.project_env, etc. depending on the page |
| 29 | * rendered by the server. |
| 30 | * |
| 31 | * @interface |
| 32 | */ |
| 33 | CS.env = function() {}; |
| 34 | |
| 35 | /** |
| 36 | * Like relativeBaseUrl, but a full URL preceded by http://code.google.com |
| 37 | * @type {string} |
| 38 | */ |
| 39 | CS.env.prototype.absoluteBaseUrl; |
| 40 | |
| 41 | /** |
| 42 | * Path to versioned static assets (mostly js and css). |
| 43 | * @type {string} |
| 44 | */ |
| 45 | CS.env.prototype.appVersion; |
| 46 | |
| 47 | /** |
| 48 | * Request token for the logged-in user, or null for the anonymous user. |
| 49 | * @type {?string} |
| 50 | */ |
| 51 | CS.env.prototype.token; |
| 52 | |
| 53 | /** |
| 54 | * Email address of the logged-in user, or null for anon. |
| 55 | * @type {?string} |
| 56 | */ |
| 57 | CS.env.prototype.loggedInUserEmail; |
| 58 | |
| 59 | /** |
| 60 | * Url to the logged-in user's profile, or null for anon. |
| 61 | * @type {?string} |
| 62 | */ |
| 63 | CS.env.prototype.profileUrl; |
| 64 | |
| 65 | /** |
| 66 | * CS.env specialization for browsing project pages. |
| 67 | * @interface |
| 68 | * @extends {CS.env} |
| 69 | */ |
| 70 | CS.project_env = function() {}; |
| 71 | |
| 72 | /** @type {string} */ |
| 73 | CS.project_env.prototype.projectName; |