forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobals.d.ts
152 lines (122 loc) · 3.8 KB
/
globals.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
interface PageError {
statusCode: number
statusText: string
error: string
errorID: string
}
interface Window {
pageError?: PageError
context: SourcegraphContext
MonacoEnvironment: {
getWorkerUrl(moduleId: string, label: string): string
}
}
/**
* Represents user properties that are guaranteed to both (1) be set if the user is signed in,
* and (2) not change over a user session
*/
interface ImmutableUser {
readonly UID: number
}
type DeployType = 'kubernetes' | 'docker-container' | 'docker-compose' | 'pure-docker' | 'dev'
/**
* Defined in cmd/frontend/internal/app/jscontext/jscontext.go JSContext struct
*/
interface SourcegraphContext
extends Pick<Required<import('./schema/site.schema').SiteConfiguration>, 'experimentalFeatures'> {
xhrHeaders: { [key: string]: string }
csrfToken: string
userAgentIsBot: boolean
/**
* Whether the user is authenticated. Use authenticatedUser in ./auth.ts to obtain information about the user.
*/
readonly isAuthenticatedUser: boolean
readonly sentryDSN: string | null
/** Externally accessible URL for Sourcegraph (e.g., https://sourcegraph.com or http://localhost:3080). */
externalURL: string
/** URL path to image/font/etc. assets on server */
assetsRoot: string
version: string
/**
* Debug is whether debug mode is enabled.
*/
debug: boolean
sourcegraphDotComMode: boolean
/**
* siteID is the identifier of the Sourcegraph site.
*/
siteID: string
/** The GraphQL ID of the Sourcegraph site. */
siteGQLID: GQL.ID
/**
* Whether the site needs to be initialized.
*/
needsSiteInit: boolean
/**
* Emails support enabled
*/
emailEnabled: boolean
/**
* A subset of the site configuration. Not all fields are set.
*/
site: Pick<
import('./schema/site.schema').SiteConfiguration,
'auth.public' | 'update.channel' | 'campaigns.readAccess.enabled'
>
/** Whether access tokens are enabled. */
accessTokensAllow: 'all-users-create' | 'site-admin-create' | 'none'
/** Whether the reset-password flow is enabled. */
resetPasswordEnabled: boolean
/**
* Likely running within a Docker container under a Mac host OS.
*/
likelyDockerOnMac: boolean
/**
* Whether or not the server needs to restart in order to apply a pending
* configuration change.
*/
needServerRestart: boolean
/**
* The kind of deployment.
*/
deployType: DeployType
/** Whether signup is allowed on the site. */
allowSignup: boolean
/** Authentication provider instances in site config. */
authProviders?: {
displayName: string
isBuiltin: boolean
authenticationURL?: string
}[]
/** Custom branding for the homepage and search icon. */
branding?: {
/** The URL of the favicon to be used for your instance */
favicon?: string
/** Override style for light themes */
light?: BrandAssets
/** Override style for dark themes */
dark?: BrandAssets
/** Prevents the icon in the top-left corner of the screen from spinning. */
disableSymbolSpin?: boolean
brandName: string
}
/** The publishable key for the billing service (Stripe). */
billingPublishableKey?: string
}
interface BrandAssets {
/** The URL to the logo used on the homepage */
logo?: string
/** The URL to the symbol used as the search icon */
symbol?: string
}
/**
* For Web Worker entrypoints using Webpack's worker-loader.
*
* See https://github.com/webpack-contrib/worker-loader#integrating-with-typescript.
*/
declare module 'worker-loader?*' {
class WebpackWorker extends Worker {
constructor()
}
export default WebpackWorker
}