blob: baf19cb8edb6c1d4943e6c481e9fef83ce1cc38a [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001/* 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. */
18var 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 */
33CS.env = function() {};
34
35/**
36 * Like relativeBaseUrl, but a full URL preceded by http://code.google.com
37 * @type {string}
38 */
39CS.env.prototype.absoluteBaseUrl;
40
41/**
42 * Path to versioned static assets (mostly js and css).
43 * @type {string}
44 */
45CS.env.prototype.appVersion;
46
47/**
48 * Request token for the logged-in user, or null for the anonymous user.
49 * @type {?string}
50 */
51CS.env.prototype.token;
52
53/**
54 * Email address of the logged-in user, or null for anon.
55 * @type {?string}
56 */
57CS.env.prototype.loggedInUserEmail;
58
59/**
60 * Url to the logged-in user's profile, or null for anon.
61 * @type {?string}
62 */
63CS.env.prototype.profileUrl;
64
65/**
66 * CS.env specialization for browsing project pages.
67 * @interface
68 * @extends {CS.env}
69 */
70CS.project_env = function() {};
71
72/** @type {string} */
73CS.project_env.prototype.projectName;