Skip to content

Commit

Permalink
moved interfaces to types (microsoft#12599)
Browse files Browse the repository at this point in the history
  • Loading branch information
techwithtim committed Jun 26, 2020
1 parent ba587d3 commit c70d8be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/client/datascience/export/exportManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { Uri } from 'vscode';
import { IFileSystem, TemporaryFile } from '../../common/platform/types';
import { ProgressReporter } from '../progress/progressReporter';
import { IDataScienceErrorHandler, INotebookModel } from '../types';
import { IExportManagerFilePicker } from './exportManagerFilePicker';
import { ExportFormat, IExport, IExportManager } from './types';
import { ExportFormat, IExport, IExportManager, IExportManagerFilePicker } from './types';

@injectable()
export class ExportManager implements IExportManager {
Expand Down
7 changes: 1 addition & 6 deletions src/client/datascience/export/exportManagerFilePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ import { Memento, SaveDialogOptions, Uri } from 'vscode';
import { IApplicationShell } from '../../common/application/types';
import { IMemento, WORKSPACE_MEMENTO } from '../../common/types';
import { ExportNotebookSettings } from '../interactive-common/interactiveWindowTypes';
import { ExportFormat } from './types';
import { ExportFormat, IExportManagerFilePicker } from './types';

// File extensions for each export method
export const PDFExtensions = { PDF: ['pdf'] };
export const HTMLExtensions = { HTML: ['html', 'htm'] };
export const PythonExtensions = { Python: ['py'] };

export const IExportManagerFilePicker = Symbol('IExportManagerFilePicker');
export interface IExportManagerFilePicker {
getExportFileLocation(format: ExportFormat, source: Uri): Promise<Uri | undefined>;
}

@injectable()
export class ExportManagerFilePicker implements IExportManagerFilePicker {
private readonly defaultExportSaveLocation = ''; // set default save location
Expand Down
5 changes: 5 additions & 0 deletions src/client/datascience/export/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ export const IExport = Symbol('IExport');
export interface IExport {
export(source: Uri, target: Uri): Promise<void>;
}

export const IExportManagerFilePicker = Symbol('IExportManagerFilePicker');
export interface IExportManagerFilePicker {
getExportFileLocation(format: ExportFormat, source: Uri): Promise<Uri | undefined>;
}
4 changes: 2 additions & 2 deletions src/client/datascience/serviceRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ import { ExportBase } from './export/exportBase';
import { ExportManager } from './export/exportManager';
import { ExportManagerDependencyChecker } from './export/exportManagerDependencyChecker';
import { ExportManagerFileOpener } from './export/exportManagerFileOpener';
import { ExportManagerFilePicker, IExportManagerFilePicker } from './export/exportManagerFilePicker';
import { ExportManagerFilePicker } from './export/exportManagerFilePicker';
import { ExportToHTML } from './export/exportToHTML';
import { ExportToPDF } from './export/exportToPDF';
import { ExportToPython } from './export/exportToPython';
import { ExportFormat, IExport, IExportManager } from './export/types';
import { ExportFormat, IExport, IExportManager, IExportManagerFilePicker } from './export/types';
import { GatherListener } from './gather/gatherListener';
import { GatherLogger } from './gather/gatherLogger';
import { DebugListener } from './interactive-common/debugListener';
Expand Down

0 comments on commit c70d8be

Please sign in to comment.