1- import type { Remote , ProxyMarked } from 'comlink'
1+ import type { ProxyMarked , Remote } from 'comlink'
22import type { Unsubscribable } from 'rxjs'
33
44import type {
55 Contributions ,
66 Evaluated ,
7+ HoverMerged ,
78 Raw ,
89 TextDocumentPositionParameters ,
9- HoverMerged ,
1010} from '@sourcegraph/client-api'
1111import type { MaybeLoadingResult } from '@sourcegraph/codeintellify'
1212import type * as clientType from '@sourcegraph/extension-api-types'
1313import type { GraphQLResult } from '@sourcegraph/http-client'
14+ import type { KnownKeys , TelemetryEventParameters } from '@sourcegraph/telemetry'
1415
1516import type { DocumentHighlight , ReferenceContext } from '../codeintel/legacy-extensions/api'
1617import type { Occurrence } from '../codeintel/scip'
1718import type { ConfiguredExtension } from '../extensions/extension'
1819import type { SettingsCascade } from '../settings/settings'
19- import type { TelemetryV2Props } from '../telemetry'
2020
2121import type { SettingsEdit } from './client/services/settings'
2222import type { ExecutableExtension } from './extension/activation'
@@ -75,7 +75,6 @@ export interface FlatExtensionHostAPI extends CodeIntelExtensionHostAPI {
7575 /**
7676 * Sets the given context keys and values.
7777 * If a value is `null`, the context key is removed.
78- *
7978 * @param update Object with context keys as values
8079 */
8180 updateContext : ( update : { [ k : string ] : unknown } ) => void
@@ -89,7 +88,6 @@ export interface FlatExtensionHostAPI extends CodeIntelExtensionHostAPI {
8988 /**
9089 * Returns an observable that emits all contributions (merged) evaluated in the current model
9190 * (with the optional scope). It emits whenever there is any change.
92- *
9391 * @template T Extra allowed property value types for the {@link Context} value. See
9492 * {@link Context}'s `T` type parameter for more information.
9593 * @param scope The scope in which contributions are fetched. A scope can be a sub-component of
@@ -111,7 +109,6 @@ export interface FlatExtensionHostAPI extends CodeIntelExtensionHostAPI {
111109
112110 /**
113111 * Add a viewer.
114- *
115112 * @param viewer The description of the viewer to add.
116113 * @returns The added code viewer (which must be passed as the first argument to other
117114 * viewer methods to operate on this viewer).
@@ -125,7 +122,6 @@ export interface FlatExtensionHostAPI extends CodeIntelExtensionHostAPI {
125122
126123 /**
127124 * Sets the selections for a CodeEditor.
128- *
129125 * @param codeEditor The editor for which to set the selections.
130126 * @param selections The new selections to apply.
131127 * @throws if no editor exists with the given editor ID.
@@ -136,7 +132,6 @@ export interface FlatExtensionHostAPI extends CodeIntelExtensionHostAPI {
136132 /**
137133 * Removes a viewer.
138134 * Also removes the corresponding model if no other viewer is referencing it.
139- *
140135 * @param viewer The viewer to remove.
141136 */
142137 removeViewer ( viewer : ViewerId ) : void
@@ -176,15 +171,29 @@ export interface MainThreadAPI {
176171
177172 /**
178173 * Log an event (by sending it to the server).
179- *
180- * @deprecated use getTelemetryRecorder().recordEvent instead
174+ * @deprecated use {@link MainThreadAPI.recordEvent} instead
181175 */
182176 logEvent : ( eventName : string , eventProperties ?: any ) => void
183177
184178 /**
185- * Get a TelemetryRecorder for recording telemetry events to the server.
179+ * Record a telemetry event.
180+ *
181+ * The type signature should be kept in sync with {@link TelemetryRecorder.recordEvent}.
186182 */
187- getTelemetryRecorder : ( ) => TelemetryV2Props [ 'telemetryRecorder' ]
183+ recordEvent : (
184+ feature : string ,
185+ action : string ,
186+ parameters ?: TelemetryEventParameters <
187+ KnownKeys <
188+ string ,
189+ {
190+ [ key in string ] : number
191+ }
192+ > ,
193+ string ,
194+ string
195+ >
196+ ) => void
188197
189198 /**
190199 * Log messages from extensions in the main thread. Makes it easier to debug extensions for applications
0 commit comments