1616
1717declare module 'vscode' {
1818
19- //#region https://github.com/microsoft/vscode/issues/106410
20-
21- export interface CodeActionProvider < T extends CodeAction = CodeAction > {
22-
23- /**
24- * Given a code action fill in its [`edit`](#CodeAction.edit)-property, changes to
25- * all other properties, like title, are ignored. A code action that has an edit
26- * will not be resolved.
27- *
28- * *Note* that a code action provider that returns commands, not code actions, cannot successfully
29- * implement this function. Returning commands is deprecated and instead code actions should be
30- * returned.
31- *
32- * @param codeAction A code action.
33- * @param token A cancellation token.
34- * @return The resolved code action or a thenable that resolve to such. It is OK to return the given
35- * `item`. When no result is returned, the given `item` will be used.
36- */
37- resolveCodeAction ?( codeAction : T , token : CancellationToken ) : ProviderResult < T > ;
38- }
39-
40- //#endregion
41-
42-
4319 // #region auth provider: https://github.com/microsoft/vscode/issues/88309
4420
4521 /**
@@ -167,6 +143,31 @@ declare module 'vscode' {
167143 * provider
168144 */
169145 export function logout ( providerId : string , sessionId : string ) : Thenable < void > ;
146+
147+ /**
148+ * Retrieve a password that was stored with key. Returns undefined if there
149+ * is no password matching that key.
150+ * @param key The key the password was stored under.
151+ */
152+ export function getPassword ( key : string ) : Thenable < string | undefined > ;
153+
154+ /**
155+ * Store a password under a given key.
156+ * @param key The key to store the password under
157+ * @param value The password
158+ */
159+ export function setPassword ( key : string , value : string ) : Thenable < void > ;
160+
161+ /**
162+ * Remove a password from storage.
163+ * @param key The key the password was stored under.
164+ */
165+ export function deletePassword ( key : string ) : Thenable < void > ;
166+
167+ /**
168+ * Fires when a password is set or deleted.
169+ */
170+ export const onDidChangePassword : Event < void > ;
170171 }
171172
172173 //#endregion
@@ -741,74 +742,65 @@ declare module 'vscode' {
741742
742743 //#region file-decorations: https://github.com/microsoft/vscode/issues/54938
743744
744- // TODO@jrieken FileDecoration, FileDecorationProvider etc.
745- // TODO@jrieken Add selector notion to limit decorations to a view.
746- // TODO@jrieken Rename `Decoration.letter` to `short` so that it could be used for coverage et al.
747745
748- export class Decoration {
746+ export class FileDecoration {
749747
750748 /**
751- * A letter that represents this decoration.
749+ * A very short string that represents this decoration.
752750 */
753- letter ?: string ;
751+ badge ?: string ;
754752
755753 /**
756- * The human-readable title for this decoration.
754+ * A human-readable tooltip for this decoration.
757755 */
758- title ?: string ;
756+ tooltip ?: string ;
759757
760758 /**
761759 * The color of this decoration.
762760 */
763761 color ?: ThemeColor ;
764762
765- /**
766- * The priority of this decoration.
767- */
768- priority ?: number ;
769-
770763 /**
771764 * A flag expressing that this decoration should be
772- * propagted to its parents.
765+ * propagated to its parents.
773766 */
774- bubble ?: boolean ;
767+ propagate ?: boolean ;
775768
776769 /**
777770 * Creates a new decoration.
778771 *
779- * @param letter A letter that represents the decoration.
780- * @param title The title of the decoration.
772+ * @param badge A letter that represents the decoration.
773+ * @param tooltip The tooltip of the decoration.
781774 * @param color The color of the decoration.
782775 */
783- constructor ( letter ?: string , title ?: string , color ?: ThemeColor ) ;
776+ constructor ( badge ?: string , tooltip ?: string , color ?: ThemeColor ) ;
784777 }
785778
786779 /**
787780 * The decoration provider interfaces defines the contract between extensions and
788781 * file decorations.
789782 */
790- export interface DecorationProvider {
783+ export interface FileDecorationProvider {
791784
792785 /**
793786 * An event to signal decorations for one or many files have changed.
794787 *
795788 * @see [EventEmitter](#EventEmitter
796789 */
797- onDidChangeDecorations : Event < undefined | Uri | Uri [ ] > ;
790+ onDidChange : Event < undefined | Uri | Uri [ ] > ;
798791
799792 /**
800793 * Provide decorations for a given uri.
801794 *
802- *
803795 * @param uri The uri of the file to provide a decoration for.
804796 * @param token A cancellation token.
805797 * @returns A decoration or a thenable that resolves to such.
806798 */
807- provideDecoration ( uri : Uri , token : CancellationToken ) : ProviderResult < Decoration > ;
799+ provideFileDecoration ( uri : Uri , token : CancellationToken ) : ProviderResult < FileDecoration > ;
808800 }
809801
810802 export namespace window {
811- export function registerDecorationProvider ( provider : DecorationProvider ) : Disposable ;
803+ export function registerDecorationProvider ( provider : FileDecorationProvider ) : Disposable ;
812804 }
813805
814806 //#endregion
@@ -1259,6 +1251,27 @@ declare module 'vscode' {
12591251
12601252 export type CellOutput = CellStreamOutput | CellErrorOutput | CellDisplayOutput ;
12611253
1254+ export class NotebookCellOutputItem {
1255+
1256+ readonly mime : string ;
1257+ readonly value : unknown ;
1258+ readonly metadata ?: Record < string , string | number | boolean > ;
1259+
1260+ constructor ( mime : string , value : unknown , metadata ?: Record < string , string | number | boolean > ) ;
1261+ }
1262+
1263+ //TODO@jrieken add id?
1264+ export class NotebookCellOutput {
1265+
1266+ readonly outputs : NotebookCellOutputItem [ ] ;
1267+ readonly metadata ?: Record < string , string | number | boolean > ;
1268+
1269+ constructor ( outputs : NotebookCellOutputItem [ ] , metadata ?: Record < string , string | number | boolean > ) ;
1270+
1271+ //TODO@jrieken HACK to workaround dependency issues...
1272+ toJSON ( ) : any ;
1273+ }
1274+
12621275 export enum NotebookCellRunState {
12631276 Running = 1 ,
12641277 Idle = 2 ,
@@ -1440,14 +1453,14 @@ declare module 'vscode' {
14401453 export interface WorkspaceEdit {
14411454 replaceNotebookMetadata ( uri : Uri , value : NotebookDocumentMetadata ) : void ;
14421455 replaceNotebookCells ( uri : Uri , start : number , end : number , cells : NotebookCellData [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
1443- replaceNotebookCellOutput ( uri : Uri , index : number , outputs : CellOutput [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
1456+ replaceNotebookCellOutput ( uri : Uri , index : number , outputs : ( NotebookCellOutput | CellOutput ) [ ] , metadata ?: WorkspaceEditEntryMetadata ) : void ;
14441457 replaceNotebookCellMetadata ( uri : Uri , index : number , cellMetadata : NotebookCellMetadata , metadata ?: WorkspaceEditEntryMetadata ) : void ;
14451458 }
14461459
14471460 export interface NotebookEditorEdit {
14481461 replaceMetadata ( value : NotebookDocumentMetadata ) : void ;
14491462 replaceCells ( start : number , end : number , cells : NotebookCellData [ ] ) : void ;
1450- replaceCellOutput ( index : number , outputs : CellOutput [ ] ) : void ;
1463+ replaceCellOutput ( index : number , outputs : ( NotebookCellOutput | CellOutput ) [ ] ) : void ;
14511464 replaceCellMetadata ( index : number , metadata : NotebookCellMetadata ) : void ;
14521465 }
14531466
@@ -1497,16 +1510,6 @@ declare module 'vscode' {
14971510 */
14981511 readonly viewColumn ?: ViewColumn ;
14991512
1500- /**
1501- * Whether the panel is active (focused by the user).
1502- */
1503- readonly active : boolean ;
1504-
1505- /**
1506- * Whether the panel is visible.
1507- */
1508- readonly visible : boolean ;
1509-
15101513 /**
15111514 * Fired when the panel is disposed.
15121515 */
@@ -1685,7 +1688,7 @@ declare module 'vscode' {
16851688 /**
16861689 * Unique identifier for the backup.
16871690 *
1688- * This id is passed back to your extension in `openCustomDocument ` when opening a notebook editor from a backup.
1691+ * This id is passed back to your extension in `openNotebook ` when opening a notebook editor from a backup.
16891692 */
16901693 readonly id : string ;
16911694
@@ -1739,6 +1742,10 @@ declare module 'vscode' {
17391742 }
17401743
17411744 export interface NotebookContentProvider {
1745+ readonly options ?: NotebookDocumentContentOptions ;
1746+ readonly onDidChangeNotebookContentOptions ?: Event < NotebookDocumentContentOptions > ;
1747+ readonly onDidChangeNotebook : Event < NotebookDocumentContentChangeEvent | NotebookDocumentEditEvent > ;
1748+
17421749 /**
17431750 * Content providers should always use [file system providers](#FileSystemProvider) to
17441751 * resolve the raw content for `uri` as the resouce is not necessarily a file on disk.
@@ -1747,7 +1754,6 @@ declare module 'vscode' {
17471754 resolveNotebook ( document : NotebookDocument , webview : NotebookCommunication ) : Promise < void > ;
17481755 saveNotebook ( document : NotebookDocument , cancellation : CancellationToken ) : Promise < void > ;
17491756 saveNotebookAs ( targetResource : Uri , document : NotebookDocument , cancellation : CancellationToken ) : Promise < void > ;
1750- readonly onDidChangeNotebook : Event < NotebookDocumentContentChangeEvent | NotebookDocumentEditEvent > ;
17511757 backupNotebook ( document : NotebookDocument , context : NotebookDocumentBackupContext , cancellation : CancellationToken ) : Promise < NotebookDocumentBackup > ;
17521758 }
17531759
@@ -1840,6 +1846,7 @@ declare module 'vscode' {
18401846 ) : Disposable ;
18411847
18421848 export function createNotebookEditorDecorationType ( options : NotebookDecorationRenderOptions ) : NotebookEditorDecorationType ;
1849+ export function openNotebookDocument ( uri : Uri , viewType ?: string ) : Promise < NotebookDocument > ;
18431850 export const onDidOpenNotebookDocument : Event < NotebookDocument > ;
18441851 export const onDidCloseNotebookDocument : Event < NotebookDocument > ;
18451852 export const onDidSaveNotebookDocument : Event < NotebookDocument > ;
@@ -1848,14 +1855,6 @@ declare module 'vscode' {
18481855 * All currently known notebook documents.
18491856 */
18501857 export const notebookDocuments : ReadonlyArray < NotebookDocument > ;
1851-
1852- export const visibleNotebookEditors : NotebookEditor [ ] ;
1853- export const onDidChangeVisibleNotebookEditors : Event < NotebookEditor [ ] > ;
1854-
1855- export const activeNotebookEditor : NotebookEditor | undefined ;
1856- export const onDidChangeActiveNotebookEditor : Event < NotebookEditor | undefined > ;
1857- export const onDidChangeNotebookEditorSelection : Event < NotebookEditorSelectionChangeEvent > ;
1858- export const onDidChangeNotebookEditorVisibleRanges : Event < NotebookEditorVisibleRangesChangeEvent > ;
18591858 export const onDidChangeNotebookDocumentMetadata : Event < NotebookDocumentMetadataChangeEvent > ;
18601859 export const onDidChangeNotebookCells : Event < NotebookCellsChangeEvent > ;
18611860 export const onDidChangeCellOutputs : Event < NotebookCellOutputsChangeEvent > ;
@@ -1884,6 +1883,15 @@ declare module 'vscode' {
18841883 export function createCellStatusBarItem ( cell : NotebookCell , alignment ?: NotebookCellStatusBarAlignment , priority ?: number ) : NotebookCellStatusBarItem ;
18851884 }
18861885
1886+ export namespace window {
1887+ export const visibleNotebookEditors : NotebookEditor [ ] ;
1888+ export const onDidChangeVisibleNotebookEditors : Event < NotebookEditor [ ] > ;
1889+ export const activeNotebookEditor : NotebookEditor | undefined ;
1890+ export const onDidChangeActiveNotebookEditor : Event < NotebookEditor | undefined > ;
1891+ export const onDidChangeNotebookEditorSelection : Event < NotebookEditorSelectionChangeEvent > ;
1892+ export const onDidChangeNotebookEditorVisibleRanges : Event < NotebookEditorVisibleRangesChangeEvent > ;
1893+ }
1894+
18871895 //#endregion
18881896
18891897 //#region https://github.com/microsoft/vscode/issues/39441
@@ -2129,7 +2137,7 @@ declare module 'vscode' {
21292137 }
21302138 //#endregion
21312139
2132- //#region
2140+ //#region https://github.com/microsoft/vscode/issues/91697
21332141
21342142 export interface FileSystem {
21352143 /**
@@ -2151,24 +2159,30 @@ declare module 'vscode' {
21512159
21522160 //#endregion
21532161
2154- //#region https://github.com/microsoft/vscode/issues/105667
2162+ //#region https://github.com/microsoft/vscode/issues/103120 @alexr00
2163+ export class ThemeIcon2 extends ThemeIcon {
2164+
2165+ /**
2166+ * The id of the icon. The available icons are listed in https://microsoft.github.io/vscode-codicons/dist/codicon.html.
2167+ */
2168+ public readonly id : string ;
21552169
2156- export interface TreeView < T > {
21572170 /**
2158- * An optional human-readable description that will be rendered in the title of the view.
2159- * Setting the title description to null, undefined, or empty string will remove the title description from the view.
2171+ * Creates a reference to a theme icon.
2172+ * @param id id of the icon. The available icons are listed in https://microsoft.github.io/vscode-codicons/dist/codicon.html.
2173+ * @param color optional `ThemeColor` for the icon.
21602174 */
2161- description ? : string | undefined ;
2175+ constructor ( id : string , color ?: ThemeColor ) ;
21622176 }
21632177 //#endregion
21642178
2165- //#region https://github.com/microsoft/vscode/issues/103120 @alexr00
2166- export class ThemeIcon2 extends ThemeIcon {
2179+ //#region https://github.com/microsoft/vscode/issues/102665 Comment API @rebornix
2180+ export interface CommentThread {
21672181 /**
2168- * Returns a new `ThemeIcon` that will use the specified `ThemeColor`
2169- * @param color The `ThemeColor` to use for the icon .
2182+ * Whether the thread supports reply.
2183+ * Defaults to true .
21702184 */
2171- with ( color : ThemeColor ) : ThemeIcon2 ;
2185+ canReply : boolean ;
21722186 }
21732187 //#endregion
21742188}
0 commit comments