-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
291 lines (252 loc) · 9.24 KB
/
index.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
declare module '@jetbrains/teamcity-api' {
import type {
ButtonType,
IconButtonType,
SvgIconType,
BuildNumberType,
ContentPanelType,
EntityPathType,
RouterLinkType,
RouterButtonType,
ServiceMessageType,
} from '@jetbrains/teamcity-api/types/components'
import type {
RestServiceType,
AlertServiceType,
HintsServiceType,
} from '@jetbrains/teamcity-api/types/services'
import type {
RequestTextType,
RequestJSONType,
} from '@jetbrains/teamcity-api/types/services/REST'
import type {
Alert,
AlertKey,
AlertType,
} from '@jetbrains/teamcity-api/types/services/AlertService'
export type {
ButtonProps,
BuildNumberProps,
ContentPanelProps,
EntityPathProps,
RouterLinkProps,
RouterButtonProps,
ServiceMessageProps,
} from '@jetbrains/teamcity-api/types/components'
type RenderType = <P extends {} | null | undefined>(elementOrId: HTMLElement | string, Type: React.ComponentType<P>, props: P) => void
type UtilsType = {
requestText: RequestTextType
requestJSON: RequestJSONType
isSakuraUI: () => boolean
resolveRelativeURL: (relativePath: string, params?: {}, hash?: string) => string
addMarkdownAlert: (source: string, type?: AlertType, timeout?: number | null, options?: Partial<Alert>) => AlertKey
}
type ComponentsType = {
readonly Button: ButtonType
readonly IconButton: IconButtonType
readonly SvgIcon: SvgIconType
readonly BuildNumber: BuildNumberType
readonly ContentPanel: ContentPanelType
readonly EntityPath: EntityPathType
readonly RouterLink: RouterLinkType
readonly RouterButton: RouterButtonType
readonly ServiceMessage: ServiceMessageType
}
type ServicesType = {
readonly AlertService: AlertServiceType
readonly HintsService: HintsServiceType
readonly REST: RestServiceType
}
export type PlaceIdList = {
SAKURA_HEADER_NAVIGATION_AFTER: "SAKURA_HEADER_NAVIGATION_AFTER"
SAKURA_HEADER_USERNAME_BEFORE: "SAKURA_HEADER_USERNAME_BEFORE"
SAKURA_HEADER_RIGHT: "SAKURA_HEADER_RIGHT"
SAKURA_FOOTER_RIGHT: "SAKURA_FOOTER_RIGHT"
SAKURA_BEFORE_CONTENT: "SAKURA_BEFORE_CONTENT"
SAKURA_SIDEBAR_TOP: "SAKURA_SIDEBAR_TOP"
SAKURA_PROJECT_LINKS: "SAKURA_PROJECT_LINKS"
SAKURA_PROJECT_TRENDS: "SAKURA_PROJECT_TRENDS"
SAKURA_BUILD_CONFIGURATION_TREND_CARD: "SAKURA_BUILD_CONFIGURATION_TREND_CARD"
SAKURA_PROJECT_BUILDS: "SAKURA_PROJECT_BUILDS"
SAKURA_BUILD_CONFIGURATION_BUILDS: "SAKURA_BUILD_CONFIGURATION_BUILDS"
SAKURA_BUILD_CONFIGURATION_BRANCHES: "SAKURA_BUILD_CONFIGURATION_BRANCHES"
SAKURA_BUILD_CONFIGURATION_CHANGE_LOG: "SAKURA_BUILD_CONFIGURATION_CHANGE_LOG"
SAKURA_BUILD_CHANGES: "SAKURA_BUILD_CHANGES"
SAKURA_BUILD_LINE_EXPANDED: "SAKURA_BUILD_LINE_EXPANDED"
SAKURA_BUILD_OVERVIEW: 'SAKURA_BUILD_OVERVIEW'
SAKURA_GUIDES_OVERVIEW: 'SAKURA_GUIDES_OVERVIEW'
SAKURA_CUSTOM_AGENTS_COUNTER: 'SAKURA_CUSTOM_AGENTS_COUNTER'
SAKURA_QUEUE_ACTIONS: 'SAKURA_QUEUE_ACTIONS'
SAKURA_TEST_DETAILS_ACTIONS: 'SAKURA_TEST_DETAILS_ACTIONS'
SAKURA_AGENTS_TOOLBAR: 'SAKURA_AGENTS_TOOLBAR'
SAKURA_AGENT_ACTIONS: 'SAKURA_AGENT_ACTIONS'
SAKURA_AFTER_AGENT_INFO: 'SAKURA_AFTER_AGENT_INFO'
SAKURA_TOOL_PANEL_FOOTER: 'SAKURA_TOOL_PANEL_FOOTER'
SAKURA_DEBUG_PANEL: 'SAKURA_DEBUG_PANEL'
// Classic UI PlaceID Containers
HEADER_RIGHT: "HEADER_RIGHT"
BEFORE_CONTENT: "BEFORE_CONTENT"
PROJECT_FRAGMENT: "PROJECT_FRAGMENT"
PROJECT_STATS_FRAGMENT: "PROJECT_STATS_FRAGMENT"
BUILD_CONF_STATISTICS_FRAGMENT: "BUILD_CONF_STATISTICS_FRAGMENT"
BUILD_RESULTS_FRAGMENT: "BUILD_RESULTS_FRAGMENT"
BUILD_RESULTS_BUILD_PROBLEM: "BUILD_RESULTS_BUILD_PROBLEM"
TAB_PLUGIN_CONTAINER: "TAB_PLUGIN_CONTAINER"
}
export type PlaceId = keyof PlaceIdList
export type UnsubscribeFromLifecycle = () => void
export type PluginCallback = (context: PluginContext) => unknown
export type PluginOptions = {
containerTagName?: string
containerClassNames?: string | Array<string>
debug?: boolean
}
export type PluginConstructorArguments = {
readonly name: string
readonly content: string | HTMLElement | React.ComponentType<any>
readonly options?: PluginOptions
readonly onCreate?: () => unknown
readonly onContentUpdate?: PluginCallback
readonly onContextUpdate?: PluginCallback
readonly onMount?: PluginCallback
readonly onUnmount?: PluginCallback
readonly onDelete?: PluginCallback
}
export type PluginContext = {
location: {
readonly projectId?: string | null | undefined
readonly buildId?: string | null | undefined
readonly buildTypeId?: string | null | undefined
readonly agentId?: string | null | undefined
readonly agentPoolId?: string | null | undefined
readonly agentTypeId?: string | null | undefined
readonly testRunId?: string | null | undefined
}
}
interface PluginCommon {
debug: boolean
name: string
placeId: PlaceId
content: string | HTMLElement | React.ComponentType<any>
}
export interface PluginCallbacks extends PluginCommon {
readonly onCreate: (callback: () => unknown) => () => void
readonly onMount: (callback: PluginCallback) => UnsubscribeFromLifecycle
readonly onContextUpdate: (callback: PluginCallback) => UnsubscribeFromLifecycle
readonly onUnmount: (callback: PluginCallback) => UnsubscribeFromLifecycle
readonly onDelete: (callback: PluginCallback) => UnsubscribeFromLifecycle
}
export interface PluginInterface extends PluginCallbacks {
options: PluginOptions
content: string | HTMLElement | React.ComponentType<any>
container: HTMLElement | void
readonly mount: () => void
readonly unmount: () => void
readonly updateContext: (context: PluginContext) => void
replaceContent(content: string | HTMLElement | React.ComponentType<any>): void
registerEventHandler(element: HTMLElement, event: string, callback: () => unknown): void
}
type PluginType = {
new (placeId: PlaceId | Array<PlaceId>, args: PluginConstructorArguments): PluginInterface
placeIds: PlaceIdList
}
type TabPluginType = {
new (args: PluginConstructorArguments): PluginInterface
placeIds: PlaceIdList
}
export interface PluginRegistry {
searchByPlaceId(placeId: PlaceId, pluginName?: string): (PluginInterface | null | undefined) | Array<PluginInterface>
findUniquePlugin(placeId: PlaceId, pluginName: string): PluginInterface | null | undefined
search(pluginName: string): Array<PluginInterface>
}
export type TeamCityAPIType = {
render: RenderType
Components: ComponentsType
Services: ServicesType
utils: UtilsType
Plugin: PluginType
TabPlugin: TabPluginType
pluginRegistry: PluginRegistry
}
export var render: RenderType
export var utils: UtilsType
export var pluginRegistry: PluginRegistry
export var Services: ServicesType
export var Components: ComponentsType
export var Plugin: PluginType
export var TabPlugin: TabPluginType
import * as React from 'react'
export {React}
import * as ReactDOM from 'react-dom'
export {ReactDOM}
import * as ReactDOMClient from 'react-dom/client'
export {ReactDOMClient}
const TeamCityAPI: TeamCityAPIType
export default TeamCityAPI
}
declare module '@jetbrains/teamcity-api/plugin' {
import {Plugin} from '@jetbrains/teamcity-api'
export default Plugin
}
declare module '@jetbrains/teamcity-api/tab-plugin' {
import {TabPlugin} from '@jetbrains/teamcity-api'
export default TabPlugin
}
declare module '@jetbrains/teamcity-api/plugin-registry' {
import {pluginRegistry} from '@jetbrains/teamcity-api'
export default pluginRegistry
}
declare module '@jetbrains/teamcity-api/components' {
import {Components} from '@jetbrains/teamcity-api'
import type {
BuildNumberType,
ContentPanelType,
EntityPathType,
RouterButtonType,
RouterLinkType,
ServiceMessageType,
} from '@jetbrains/teamcity-api/types/components'
export const BuildNumber: BuildNumberType
export const ContentPanel: ContentPanelType
export const EntityPath: EntityPathType
export const RouterButton: RouterButtonType
export const RouterLink: RouterLinkType
export const ServiceMessage: ServiceMessageType
export {
BuildNumberProps,
ContentPanelProps,
EntityPathProps,
RouterButtonProps,
RouterLinkProps,
ServiceMessageProps,
} from '@jetbrains/teamcity-api/types/components'
export default Components
}
declare module '@jetbrains/teamcity-api/services' {
import {Services} from '@jetbrains/teamcity-api'
import {
RestServiceType,
AlertServiceType,
HintsServiceType,
} from '@jetbrains/teamcity-api/types/services'
export const REST: RestServiceType
export const AlertService: AlertServiceType
export const HintsService: HintsServiceType
export default Services
}
declare module '@jetbrains/teamcity-api/utils' {
import {utils} from '@jetbrains/teamcity-api'
export default utils
}
declare module '@jetbrains/teamcity-api/react' {
import * as module from 'react'
export default module
}
declare module '@jetbrains/teamcity-api/react-dom' {
import * as module from 'react-dom'
export default module
}
declare module '@jetbrains/teamcity-api/react-dom/client' {
import * as module from 'react-dom/client'
export default module
}