cdeops 10.6.2-alpha.0 → 10.6.2-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client.d.ts +238 -246
  2. package/package.json +2 -2
package/client.d.ts CHANGED
@@ -2,52 +2,51 @@
2
2
  /// <reference path="./src/cdeops.proposed.d.ts"/>
3
3
 
4
4
  declare module 'cdeops/client' {
5
-
6
- import {
7
- OrganizationResource,
8
- RelativePattern,
9
- GlobPattern,
10
- LogLevel,
11
- Uri as URI,
12
- Unsubscribable,
13
- Subscribable,
14
- Workspace,
15
- ConfigurationTarget,
16
- OrganizationConfiguration,
17
- configuration,
18
- organization,
19
- commands,
20
- } from 'cdeops';
21
-
22
- export {
23
- OrganizationResource,
24
- RelativePattern,
25
- GlobPattern,
26
- URI,
27
- LogLevel,
28
- Unsubscribable,
29
- Subscribable,
30
- Workspace,
31
- ConfigurationTarget,
32
- OrganizationConfiguration,
33
- configuration,
34
- organization,
35
- commands,
36
- }
37
-
38
- export interface DocumentFilter {
39
- /** A language id, such as `typescript` or `*`. */
40
- language?: string;
41
-
42
- /** A URI scheme, such as `file` or `untitled`. */
43
- scheme?: string;
44
-
45
- /** A glob pattern, such as `*.{ts,js}`. */
46
- pattern?: string;
47
-
48
- /** A base URI (e.g. root URI of a workspace folder) that the document must be within. */
49
- baseUri?: URL | string;
50
- }
5
+ import {
6
+ OrganizationResource,
7
+ RelativePattern,
8
+ GlobPattern,
9
+ LogLevel,
10
+ Uri as URI,
11
+ Unsubscribable,
12
+ Subscribable,
13
+ Workspace,
14
+ ConfigurationTarget,
15
+ OrganizationConfiguration,
16
+ configuration,
17
+ organization,
18
+ commands,
19
+ } from 'cdeops';
20
+
21
+ export {
22
+ OrganizationResource,
23
+ RelativePattern,
24
+ GlobPattern,
25
+ URI,
26
+ LogLevel,
27
+ Unsubscribable,
28
+ Subscribable,
29
+ Workspace,
30
+ ConfigurationTarget,
31
+ OrganizationConfiguration,
32
+ configuration,
33
+ organization,
34
+ commands,
35
+ };
36
+
37
+ export interface DocumentFilter {
38
+ /** A language id, such as `typescript` or `*`. */
39
+ language?: string;
40
+
41
+ /** A URI scheme, such as `file` or `untitled`. */
42
+ scheme?: string;
43
+
44
+ /** A glob pattern, such as `*.{ts,js}`. */
45
+ pattern?: string;
46
+
47
+ /** A base URI (e.g. root URI of a workspace folder) that the document must be within. */
48
+ baseUri?: URL | string;
49
+ }
51
50
 
52
51
  /**
53
52
  * A document selector is the combination of one or many document filters.
@@ -56,7 +55,7 @@ declare module 'cdeops/client' {
56
55
  *
57
56
  * @example let sel: DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }];
58
57
  */
59
- export type DocumentSelector = (string | DocumentFilter)[]
58
+ export type DocumentSelector = (string | DocumentFilter)[];
60
59
 
61
60
  /**
62
61
  * A document selector is the combination of one or many document filters.
@@ -65,27 +64,27 @@ declare module 'cdeops/client' {
65
64
  *
66
65
  * @example let sel: DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }];
67
66
  */
68
- export type DocumentSelector = (string | DocumentFilter)[]
67
+ export type DocumentSelector = (string | DocumentFilter)[];
69
68
 
70
- /**
71
- * A panel view created by {@link sourcegraph.app.createPanelView}.
72
- */
73
- export interface PanelView extends Unsubscribable {
69
+ /**
70
+ * A panel view created by {@link sourcegraph.app.createPanelView}.
71
+ */
72
+ export interface PanelView extends Unsubscribable {
74
73
  /**
75
74
  * The title of the panel view.
76
75
  */
77
- title: string
76
+ title: string;
78
77
 
79
78
  /**
80
79
  * The content to show in the panel view. Markdown is supported.
81
80
  */
82
- content: string
81
+ content: string;
83
82
 
84
83
  /**
85
84
  * The priority of this panel view. A higher value means that the item is shown near the beginning (usually
86
85
  * the left side).
87
86
  */
88
- priority: number
87
+ priority: number;
89
88
 
90
89
  /**
91
90
  * Display the results of the location provider (with the given ID) in this panel below the
@@ -95,26 +94,26 @@ declare module 'cdeops/client' {
95
94
  *
96
95
  * @internal
97
96
  */
98
- component: { locationProvider: string } | null
99
- }
97
+ component: { locationProvider: string } | null;
98
+ }
100
99
 
101
- /**
100
+ /**
102
101
  * A style for a {@link TextDocumentDecoration}.
103
102
  */
104
103
  export interface ThemableDecorationStyle {
105
104
  /** The CSS background-color property value for the line. */
106
- backgroundColor?: string
105
+ backgroundColor?: string;
107
106
 
108
107
  /** The CSS border property value for the line. */
109
- border?: string
108
+ border?: string;
110
109
 
111
110
  /** The CSS border-color property value for the line. */
112
- borderColor?: string
111
+ borderColor?: string;
113
112
 
114
113
  /** The CSS border-width property value for the line. */
115
- borderWidth?: string
114
+ borderWidth?: string;
116
115
  }
117
- /**
116
+ /**
118
117
  * A text document decoration changes the appearance of a range in the document and/or adds other content to
119
118
  * it.
120
119
  */
@@ -124,204 +123,197 @@ declare module 'cdeops/client' {
124
123
  * only applied only on the start line, and the entire line. Multiline
125
124
  * and intra-line ranges are not supported.
126
125
  */
127
- range: Range
126
+ range: Range;
128
127
 
129
128
  /**
130
129
  * If true, the decoration applies to all lines in the range (inclusive), even if not all characters on the
131
130
  * line are included.
132
131
  */
133
- isWholeLine?: boolean
132
+ isWholeLine?: boolean;
134
133
 
135
134
  /** Content to display after the range. */
136
- after?: DecorationAttachmentRenderOptions
135
+ after?: DecorationAttachmentRenderOptions;
137
136
 
138
137
  /** Overwrite style for light themes. */
139
- light?: ThemableDecorationStyle
138
+ light?: ThemableDecorationStyle;
140
139
 
141
140
  /** Overwrite style for dark themes. */
142
- dark?: ThemableDecorationStyle
141
+ dark?: ThemableDecorationStyle;
143
142
  }
144
143
 
145
-
146
- /**
147
- * A style for {@link BadgeAttachmentRenderOptions}.
148
- */
149
- export interface ThemableBadgeAttachmentStyle {
144
+ /**
145
+ * A style for {@link BadgeAttachmentRenderOptions}.
146
+ */
147
+ export interface ThemableBadgeAttachmentStyle {
150
148
  /**
151
149
  * The icon (a base64-encoded image icon) to display next to the wrapped value.
152
150
  *
153
151
  * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
154
152
  */
155
- icon?: string
153
+ icon?: string;
156
154
 
157
155
  /**
158
156
  * The CSS background-color property value for the attachment.
159
157
  *
160
158
  * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
161
159
  */
162
- backgroundColor?: string
160
+ backgroundColor?: string;
163
161
 
164
162
  /**
165
163
  * The CSS color property value for the attachment.
166
164
  *
167
165
  * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
168
166
  */
169
- color?: string
170
- }
167
+ color?: string;
168
+ }
171
169
 
172
- /** An attachment adds content to a hover tooltip or result in a locations panel. */
173
- export interface BadgeAttachmentRenderOptions extends ThemableBadgeAttachmentStyle {
174
- /** Predefined icons for badge attachments */
175
- kind: 'info' | 'error' | 'warning'
170
+ /** An attachment adds content to a hover tooltip or result in a locations panel. */
171
+ export interface BadgeAttachmentRenderOptions extends ThemableBadgeAttachmentStyle {
172
+ /** Predefined icons for badge attachments */
173
+ kind: 'info' | 'error' | 'warning';
176
174
 
177
- /** Tooltip text to display when hovering over the attachment. */
178
- hoverMessage?: string
175
+ /** Tooltip text to display when hovering over the attachment. */
176
+ hoverMessage?: string;
179
177
 
180
- /** If set, the attachment becomes a link with this destination URL. */
181
- linkURL?: string
178
+ /** If set, the attachment becomes a link with this destination URL. */
179
+ linkURL?: string;
182
180
 
183
181
  /**
184
182
  * Overwrite style for light themes.
185
183
  *
186
184
  * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
187
185
  */
188
- light?: ThemableBadgeAttachmentStyle
186
+ light?: ThemableBadgeAttachmentStyle;
189
187
 
190
188
  /**
191
189
  * Overwrite style for dark themes.
192
190
  *
193
191
  * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
194
192
  */
195
- dark?: ThemableBadgeAttachmentStyle
196
- }
197
-
198
- /**
199
- * A wrapper around a providable type (currently hover and locations) with additional
200
- * context to enable displaying badges next to the wrapped result value in the UI.
201
- */
202
- export type Badged<T extends object> = T & {
203
- badge?: BadgeAttachmentRenderOptions
204
- }
193
+ dark?: ThemableBadgeAttachmentStyle;
194
+ }
205
195
 
196
+ /**
197
+ * A wrapper around a providable type (currently hover and locations) with additional
198
+ * context to enable displaying badges next to the wrapped result value in the UI.
199
+ */
200
+ export type Badged<T extends object> = T & {
201
+ badge?: BadgeAttachmentRenderOptions;
202
+ };
206
203
 
207
204
  /**
208
205
  * A hover represents additional information for a symbol or word. Hovers are rendered in a tooltip-like
209
206
  * widget.
210
207
  */
211
- export interface Hover {
208
+ export interface Hover {
212
209
  /**
213
210
  * The contents of this hover.
214
211
  */
215
- contents: MarkupContent
212
+ contents: MarkupContent;
216
213
 
217
214
  /**
218
215
  * The range to which this hover applies. When missing, the editor will use the range at the current
219
216
  * position or the current position itself.
220
217
  */
221
- range?: Range
218
+ range?: Range;
222
219
 
223
220
  /**
224
221
  * Alerts that should be shown in this hover.
225
222
  */
226
- alerts?: Badged<HoverAlert>[]
227
- }
223
+ alerts?: Badged<HoverAlert>[];
224
+ }
228
225
 
229
- export interface HoverAlert {
226
+ export interface HoverAlert {
230
227
  /**
231
228
  * Text content to be shown on hovers. Since the alert is displayed inline,
232
229
  * multiparagraph content will be rendered on one line. It's recommended to
233
230
  * provide a brief message here, and place futher details in the badge or
234
231
  * provide a link.
235
232
  */
236
- summary: MarkupContent
233
+ summary: MarkupContent;
237
234
 
238
235
  /**
239
236
  * When an alert has a dismissal type, dismissing it will prevent all alerts
240
237
  * of that type from being shown. If no type is provided, the alert is not
241
238
  * dismissible.
242
239
  */
243
- type?: string
244
- }
245
-
246
- export interface ContextValues {
247
- [key: string]: string | number | boolean | null
248
- }
249
-
250
- /**
251
- * Internal API for Cdeops extensions. ost of those wil be removed for the beta release of Cdeops
252
- * extensions. They are necessary now due to limitations in the extension API and its implementation tha will
253
- * be addressed in the beta release.
254
- *
255
- * @internal
256
- * @hidden
257
- */
258
- export namespace internal {
259
- /**
260
- * Returns a promise that resolve when all pending messages have been sent to the client.
261
- * It helps enforce serialization of messages.
262
- *
263
- * @internal
264
- */
265
- export function sync(): Promise<void>;
266
-
267
-
268
- /**
269
- * Updates context values for use in context expressions and contribution labels.
270
- *
271
- * @param updates The updates to apply to the context. If a context property's value is null, it is deleted from the
272
- * context.
273
- */
274
- export function updateContext(updates: ContextValues): void;
275
-
276
-
277
- export const cdeopsURL: URI
278
-
279
-
280
-
281
- export const clientApplication: 'cdeops' | 'other'
282
-
283
- /**
284
- * Server api
285
- */
286
- export const serverApi: any
287
-
288
-
289
- /**
290
- * gql
291
- */
292
- export const gql: any
293
- }
294
-
295
- /**
296
- * The extension context is passed to the extension's activate function and contains utilities for
297
- * extension lifecycle.
298
- */
299
- export interface ExtensionContext {
300
- /**
301
- * An object that maintains subscriptions to resources that should be freed when the extension is
302
- * deactivated.
303
- *
304
- * When an extension is deactivated, first its exported `deactivate` function is called (if one exists).
305
- * The `deactivate` function may be async, in which case deactivation blocks on it finishing. Next,
306
- * regardless of whether the `deactivate` function finished successfully or rejected with an error, all
307
- * unsubscribables passed to {@link ExtensionContext#subscriptions#add} are unsubscribed from.
308
- *
309
- * (An extension is deactivated when the user disables it, or after an arbitary time period if
310
- * activationEvents no longer evaluated to true.)
311
- */
312
- subscriptions: {
313
- /**
314
- * Mark a resource's teardown function to be called when the extension is deactivated.
315
- *
316
- * @param unsubscribable An {@link Unsubscribable} that frees (unsubscribes from) a resource, or a
317
- * plan function that deos the same. Async functions are not supported. (If deactivation requires
318
- * async operations, make the `deactivate` function async; that is supported.)
319
- */
320
- add: (unsubscribe: Unsubscribable | (() => void)) => void;
321
- }
322
- }
323
-
324
- /**
240
+ type?: string;
241
+ }
242
+
243
+ export interface ContextValues {
244
+ [key: string]: string | number | boolean | null;
245
+ }
246
+
247
+ /**
248
+ * Internal API for Cdeops extensions. ost of those wil be removed for the beta release of Cdeops
249
+ * extensions. They are necessary now due to limitations in the extension API and its implementation tha will
250
+ * be addressed in the beta release.
251
+ *
252
+ * @internal
253
+ * @hidden
254
+ */
255
+ export namespace internal {
256
+ /**
257
+ * Returns a promise that resolve when all pending messages have been sent to the client.
258
+ * It helps enforce serialization of messages.
259
+ *
260
+ * @internal
261
+ */
262
+ export function sync(): Promise<void>;
263
+
264
+ /**
265
+ * Updates context values for use in context expressions and contribution labels.
266
+ *
267
+ * @param updates The updates to apply to the context. If a context property's value is null, it is deleted from the
268
+ * context.
269
+ */
270
+ export function updateContext(updates: ContextValues): void;
271
+
272
+ export const cdeopsURL: URI;
273
+
274
+ export const clientApplication: 'cdeops' | 'other';
275
+
276
+ /**
277
+ * Server api
278
+ */
279
+ export const serverApi: any;
280
+
281
+ /**
282
+ * gql
283
+ */
284
+ export const gql: any;
285
+ }
286
+
287
+ /**
288
+ * The extension context is passed to the extension's activate function and contains utilities for
289
+ * extension lifecycle.
290
+ */
291
+ export interface ExtensionContext {
292
+ /**
293
+ * An object that maintains subscriptions to resources that should be freed when the extension is
294
+ * deactivated.
295
+ *
296
+ * When an extension is deactivated, first its exported `deactivate` function is called (if one exists).
297
+ * The `deactivate` function may be async, in which case deactivation blocks on it finishing. Next,
298
+ * regardless of whether the `deactivate` function finished successfully or rejected with an error, all
299
+ * unsubscribables passed to {@link ExtensionContext#subscriptions#add} are unsubscribed from.
300
+ *
301
+ * (An extension is deactivated when the user disables it, or after an arbitary time period if
302
+ * activationEvents no longer evaluated to true.)
303
+ */
304
+ subscriptions: {
305
+ /**
306
+ * Mark a resource's teardown function to be called when the extension is deactivated.
307
+ *
308
+ * @param unsubscribable An {@link Unsubscribable} that frees (unsubscribes from) a resource, or a
309
+ * plan function that deos the same. Async functions are not supported. (If deactivation requires
310
+ * async operations, make the `deactivate` function async; that is supported.)
311
+ */
312
+ add: (unsubscribe: Unsubscribable | (() => void)) => void;
313
+ };
314
+ }
315
+
316
+ /**
325
317
  * Namespace for dealing with commands. In short, a command is a function with a
326
318
  * unique identifier. The function is sometimes also called _command handler_.
327
319
  *
@@ -357,64 +349,64 @@ declare module 'cdeops/client' {
357
349
  * }
358
350
  * ```
359
351
  */
360
- export namespace commands {
361
- /**
362
- * Registers a command that can be invoked via a keyboard shortcut,
363
- * a menu item, an action, or directly.
364
- *
365
- * Registering a command with an existing command identifier twice
366
- * will cause an error.
367
- *
368
- * @param command A unique identifier for the command.
369
- * @param callback A command handler function.
370
- * @param thisArg The `this` context used when invoking the handler function.
371
- * @return Disposable which unregisters this command on disposal.
372
- */
373
- export function registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;
374
-
375
- /**
376
- * Registers a text editor command that can be invoked via a keyboard shortcut,
377
- * a menu item, an action, or directly.
378
- *
379
- * Text editor commands are different from ordinary [commands](#commands.registerCommand) as
380
- * they only execute when there is an active editor when the command is called. Also, the
381
- * command handler of an editor command has access to the active editor and to an
382
- * [edit](#TextEditorEdit)-builder.
383
- *
384
- * @param command A unique identifier for the command.
385
- * @param callback A command handler function with access to an [editor](#TextEditor) and an [edit](#TextEditorEdit).
386
- * @param thisArg The `this` context used when invoking the handler function.
387
- * @return Disposable which unregisters this command on disposal.
388
- */
389
- export function registerTextEditorCommand(
390
- command: string,
391
- callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void,
392
- thisArg?: any,
393
- ): Disposable;
394
-
395
- /**
396
- * Executes the command denoted by the given command identifier.
397
- *
398
- * * *Note 1:* When executing an editor command not all types are allowed to
399
- * be passed as arguments. Allowed are the primitive types `string`, `boolean`,
400
- * `number`, `undefined`, and `null`, as well as [`Position`](#Position), [`Range`](#Range), [`Uri`](#Uri) and [`Location`](#Location).
401
- * * *Note 2:* There are no restrictions when executing commands that have been contributed
402
- * by extensions.
403
- *
404
- * @param command Identifier of the command to execute.
405
- * @param rest Parameters passed to the command function.
406
- * @return A promise that resolves to the returned value of the given command. `undefined` when
407
- * the command handler function doesn't return anything.
408
- */
409
- export function executeCommand<T>(command: string, ...rest: any[]): Promise<T | undefined>;
410
-
411
- /**
412
- * Retrieve the list of all available commands. Commands starting an underscore are
413
- * treated as internal commands.
414
- *
415
- * @param filterInternal Set `true` to not see internal commands (starting with an underscore)
416
- * @return Promise that resolves to a list of command ids.
417
- */
418
- export function getCommands(filterInternal?: boolean): Promise<string[]>;
419
- }
420
- }
352
+ export namespace commands {
353
+ /**
354
+ * Registers a command that can be invoked via a keyboard shortcut,
355
+ * a menu item, an action, or directly.
356
+ *
357
+ * Registering a command with an existing command identifier twice
358
+ * will cause an error.
359
+ *
360
+ * @param command A unique identifier for the command.
361
+ * @param callback A command handler function.
362
+ * @param thisArg The `this` context used when invoking the handler function.
363
+ * @return Disposable which unregisters this command on disposal.
364
+ */
365
+ export function registerCommand(command: string, callback: (...args: any[]) => any, thisArg?: any): Disposable;
366
+
367
+ /**
368
+ * Registers a text editor command that can be invoked via a keyboard shortcut,
369
+ * a menu item, an action, or directly.
370
+ *
371
+ * Text editor commands are different from ordinary [commands](#commands.registerCommand) as
372
+ * they only execute when there is an active editor when the command is called. Also, the
373
+ * command handler of an editor command has access to the active editor and to an
374
+ * [edit](#TextEditorEdit)-builder.
375
+ *
376
+ * @param command A unique identifier for the command.
377
+ * @param callback A command handler function with access to an [editor](#TextEditor) and an [edit](#TextEditorEdit).
378
+ * @param thisArg The `this` context used when invoking the handler function.
379
+ * @return Disposable which unregisters this command on disposal.
380
+ */
381
+ export function registerTextEditorCommand(
382
+ command: string,
383
+ callback: (textEditor: TextEditor, edit: TextEditorEdit, ...args: any[]) => void,
384
+ thisArg?: any,
385
+ ): Disposable;
386
+
387
+ /**
388
+ * Executes the command denoted by the given command identifier.
389
+ *
390
+ * * *Note 1:* When executing an editor command not all types are allowed to
391
+ * be passed as arguments. Allowed are the primitive types `string`, `boolean`,
392
+ * `number`, `undefined`, and `null`, as well as [`Position`](#Position), [`Range`](#Range), [`Uri`](#Uri) and [`Location`](#Location).
393
+ * * *Note 2:* There are no restrictions when executing commands that have been contributed
394
+ * by extensions.
395
+ *
396
+ * @param command Identifier of the command to execute.
397
+ * @param rest Parameters passed to the command function.
398
+ * @return A promise that resolves to the returned value of the given command. `undefined` when
399
+ * the command handler function doesn't return anything.
400
+ */
401
+ export function executeCommand<T>(command: string, ...rest: any[]): Promise<T | undefined>;
402
+
403
+ /**
404
+ * Retrieve the list of all available commands. Commands starting an underscore are
405
+ * treated as internal commands.
406
+ *
407
+ * @param filterInternal Set `true` to not see internal commands (starting with an underscore)
408
+ * @return Promise that resolves to a list of command ids.
409
+ */
410
+ export function getCommands(filterInternal?: boolean): Promise<string[]>;
411
+ }
412
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdeops",
3
- "version": "10.6.2-alpha.0",
3
+ "version": "10.6.2-alpha.3",
4
4
  "description": "Cdecode - Extension API: build extensions that enhance coding experience in your cdeops editor",
5
5
  "license": "Apache-2.0",
6
6
  "author": "CDMBase LLC",
@@ -29,5 +29,5 @@
29
29
  "publishConfig": {
30
30
  "access": "public"
31
31
  },
32
- "gitHead": "6b8b156d4ee37b3402efc73e78c1bb6ca605eb92"
32
+ "gitHead": "16cb517e6e9b4ba825e3cb28af8b18cb7077f0fe"
33
33
  }