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