Repository navigation
Expand file tree
/
Copy pathcontext.ts
More file actions
59 lines (53 loc) · 2.24 KB
/
Copy pathcontext.ts
File metadata and controls
59 lines (53 loc) · 2.24 KB
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
import { Subscribable } from 'rxjs'
import { GraphQLResult } from './graphql/graphql'
import * as GQL from './graphql/schema'
import { UpdateExtensionSettingsArgs } from './settings/edit'
import { SettingsCascadeOrError } from './settings/settings'
/**
* Description of the context in which extensions-client-common is running, and platform-specific hooks.
*/
export interface Context {
/**
* An observable that emits whenever the settings cascade changes (including when any individual subject's
* settings change).
*/
readonly settingsCascade: Subscribable<SettingsCascadeOrError>
/**
* Update the settings for the subject.
*/
updateSettings(subject: GQL.ID, args: UpdateExtensionSettingsArgs): Promise<void>
/**
* Sends a request to the Sourcegraph GraphQL API and returns the response.
*
* @template R The GraphQL result type
* @param request The GraphQL request (query or mutation)
* @param variables An object whose properties are GraphQL query name-value variable pairs
* @param mightContainPrivateInfo 🚨 SECURITY: Whether or not sending the GraphQL request to Sourcegraph.com
* could leak private information such as repository names.
* @return Observable that emits the result or an error if the HTTP request failed
*/
queryGraphQL<R extends GQL.IQuery | GQL.IMutation>(
request: string,
variables?: { [name: string]: any },
mightContainPrivateInfo?: boolean
): Subscribable<GraphQLResult<R>>
/**
* Sends a batch of LSP requests to the Sourcegraph LSP gateway API and returns the result.
*
* @param requests An array of LSP requests (with methods `initialize`, the (optional) request, `shutdown`,
* `exit`).
* @return Observable that emits the result and then completes, or an error if the request fails. The value is
* an array of LSP responses.
*/
queryLSP(requests: object[]): Subscribable<object[]>
/**
* Forces the currently displayed tooltip, if any, to update its contents.
*/
forceUpdateTooltip(): void
}
/**
* React partial props for components needing the extensions context.
*/
export interface ExtensionsContextProps {
extensionsContext: Context
}