Skip to content

Commit 40ff6e9

Browse files
author
Kartik Raj
authored
Remove private Jupyter APIs from public API types (#21761)
For microsoft/vscode-jupyter#13986
1 parent 23353bb commit 40ff6e9

File tree

4 files changed

+11
-48
lines changed

4 files changed

+11
-48
lines changed

pythonExtensionApi/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pythonExtensionApi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vscode/python-extension",
33
"description": "An API facade for the Python extension in VS Code",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"author": {
66
"name": "Microsoft Corporation"
77
},

src/client/api.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ export function buildApi(
3535
const outputChannel = serviceContainer.get<ILanguageServerOutputChannel>(ILanguageServerOutputChannel);
3636

3737
const api: PythonExtension & {
38+
/**
39+
* Internal API just for Jupyter, hence don't include in the official types.
40+
*/
41+
jupyter: {
42+
registerHooks(): void;
43+
};
44+
} & {
3845
/**
3946
* @deprecated Temporarily exposed for Pylance until we expose this API generally. Will be removed in an
4047
* iteration or two.

src/client/api/types.ts

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
import { CancellationToken, Event, Uri, WorkspaceFolder, QuickPickItem, extensions } from 'vscode';
4+
import { CancellationToken, Event, Uri, WorkspaceFolder, extensions } from 'vscode';
55

66
/*
77
* Do not introduce any breaking changes to this API.
@@ -12,9 +12,6 @@ export interface PythonExtension {
1212
* Promise indicating whether all parts of the extension have completed loading or not.
1313
*/
1414
ready: Promise<void>;
15-
jupyter: {
16-
registerHooks(): void;
17-
};
1815
debug: {
1916
/**
2017
* Generate an array of strings for commands to pass to the Python executable to launch the debugger for remote debugging.
@@ -109,47 +106,6 @@ export interface PythonExtension {
109106
};
110107
}
111108

112-
interface IJupyterServerUri {
113-
baseUrl: string;
114-
token: string;
115-
116-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
117-
authorizationHeader: any; // JSON object for authorization header.
118-
expiration?: Date; // Date/time when header expires and should be refreshed.
119-
displayName: string;
120-
}
121-
122-
type JupyterServerUriHandle = string;
123-
124-
export interface IJupyterUriProvider {
125-
readonly id: string; // Should be a unique string (like a guid)
126-
getQuickPickEntryItems(): QuickPickItem[];
127-
handleQuickPick(item: QuickPickItem, backEnabled: boolean): Promise<JupyterServerUriHandle | 'back' | undefined>;
128-
getServerUri(handle: JupyterServerUriHandle): Promise<IJupyterServerUri>;
129-
}
130-
131-
interface IDataFrameInfo {
132-
columns?: { key: string; type: ColumnType }[];
133-
indexColumn?: string;
134-
rowCount?: number;
135-
}
136-
137-
export interface IDataViewerDataProvider {
138-
dispose(): void;
139-
getDataFrameInfo(): Promise<IDataFrameInfo>;
140-
getAllRows(): Promise<IRowsResponse>;
141-
getRows(start: number, end: number): Promise<IRowsResponse>;
142-
}
143-
144-
enum ColumnType {
145-
String = 'string',
146-
Number = 'number',
147-
Bool = 'bool',
148-
}
149-
150-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
151-
type IRowsResponse = any[];
152-
153109
export type RefreshOptions = {
154110
/**
155111
* When `true`, force trigger a refresh regardless of whether a refresh was already triggered. Note this can be expensive so

0 commit comments

Comments
 (0)