mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 01:25:38 -05:00
[Notebook] Run Parameters Action openNotebook Functionality in Core (#14978)
* NotebookService update * openNotebook functionality in NbService * Add tests for RunParametersAction
This commit is contained in:
36
src/sql/workbench/services/notebook/browser/interface.ts
Normal file
36
src/sql/workbench/services/notebook/browser/interface.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as azdata from 'azdata';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IContentManager } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { IStandardKernelWithProvider } from 'sql/workbench/services/notebook/browser/models/notebookUtils';
|
||||
|
||||
export interface INotebookInput {
|
||||
defaultKernel: azdata.nb.IKernelSpec,
|
||||
connectionProfile: azdata.IConnectionProfile,
|
||||
isDirty(): boolean;
|
||||
setDirty(boolean);
|
||||
readonly notebookUri: URI;
|
||||
updateModel(): void;
|
||||
readonly editorOpenedTimestamp: number;
|
||||
readonly layoutChanged: Event<void>;
|
||||
readonly contentManager: IContentManager;
|
||||
readonly standardKernels: IStandardKernelWithProvider[];
|
||||
}
|
||||
|
||||
export function isINotebookInput(value: any): value is INotebookInput {
|
||||
if (typeof value.defaultKernel === 'object' &&
|
||||
typeof value.connectionProfile === 'object' &&
|
||||
typeof value.isDirty === 'boolean' &&
|
||||
value.notebookUri instanceof URI &&
|
||||
typeof value.editorOpenedTimestamp === 'number' &&
|
||||
typeof value.layoutChanged === 'object' &&
|
||||
typeof value.contentManager === 'object' &&
|
||||
typeof value.standardKernels === 'object') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user