@knime/scripting-editor 0.0.8 → 0.0.10

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.
@@ -0,0 +1,18 @@
1
+ import { editor as monaco } from './monaco-editor';
2
+ export declare class EditorService {
3
+ editor?: monaco.IStandaloneCodeEditor;
4
+ editorModel?: monaco.ITextModel;
5
+ initEditorService({ editor, editorModel, }: {
6
+ editor: monaco.IStandaloneCodeEditor;
7
+ editorModel: monaco.ITextModel;
8
+ }): void;
9
+ /**
10
+ * @returns the entire editor content or null if monaco has not yet been initialized
11
+ */
12
+ getScript(): string | null;
13
+ /**
14
+ * @returns all currently selected lines in the editor from first to last column. Also returns partly selected lines.
15
+ * Returns null if monaco has not yet been initialized.
16
+ */
17
+ getSelectedLines(): string | null;
18
+ }
@@ -2,6 +2,7 @@ import type { ConsoleText } from "./components/OutputConsole.vue";
2
2
  export type NodeSettings = {
3
3
  script: string;
4
4
  };
5
+ import { editor as monaco } from './monaco-editor';
5
6
  declare class ScriptingService {
6
7
  private _knimeService;
7
8
  private _jsonDataService;
@@ -9,6 +10,7 @@ declare class ScriptingService {
9
10
  private _settings;
10
11
  private _eventHandlers;
11
12
  private _runEventPoller;
13
+ private _editorService;
12
14
  constructor();
13
15
  private eventPoller;
14
16
  stopEventPoller(): void;
@@ -19,6 +21,10 @@ declare class ScriptingService {
19
21
  registerEventHandler(type: string, handler: (args: any) => void): void;
20
22
  registerLanguageServerEventHandler(handler: (message: string) => void): void;
21
23
  registerConsoleEventHandler(handler: (text: ConsoleText) => void): void;
24
+ sendToConsole(text: ConsoleText): void;
25
+ initEditorService(editor: monaco.IStandaloneCodeEditor, editorModel: monaco.ITextModel): void;
26
+ getScript(): string | null;
27
+ getSelectedLines(): string | null;
22
28
  }
23
29
  export type ScriptingServiceType = Pick<ScriptingService, keyof ScriptingService>;
24
30
  declare const getScriptingService: (mock?: ScriptingServiceType) => ScriptingServiceType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@knime/scripting-editor",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "description": "Shared Scripting Editor components for KNIME",
6
6
  "author": "KNIME AG, Zurich, Switzerland",
7
7
  "license": "See the file license.txt",