Skip to content

Commit

Permalink
moved more types not needed in common
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden committed Oct 25, 2023
1 parent bb03411 commit b197d77
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
6 changes: 6 additions & 0 deletions packages/notebook/src/browser/notebook-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,9 @@ export interface CellPartialInternalMetadataEditByHandle {
handle: number;
internalMetadata: NullablePartialNotebookCellInternalMetadata;
}

export interface NotebookCellOutputsSplice {
start: number;
deleteCount: number;
newOutputs: CellOutput[];
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import { ContextKeyChangeEvent } from '@theia/core/lib/browser/context-key-servi
import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
import {
CellInternalMetadataChangedEvent, CellKind, NotebookCellCollapseState, NotebookCellInternalMetadata,
NotebookCellMetadata, NotebookCellOutputsSplice, CellOutput, CellData, CellOutputItem
CellKind, NotebookCellCollapseState, NotebookCellInternalMetadata,
NotebookCellMetadata, CellOutput, CellData, CellOutputItem
} from '../../common';
import { NotebookCellOutputsSplice } from '../notebook-types';
import { NotebookCellOutputModel } from './notebook-cell-output-model';

export const NotebookCellModelFactory = Symbol('NotebookModelFactory');
Expand All @@ -51,6 +52,10 @@ interface NotebookCellContextManager {
onDidChangeContext: Event<ContextKeyChangeEvent>;
}

export interface CellInternalMetadataChangedEvent {
readonly lastRunSuccessChanged?: boolean;
}

export interface NotebookCell {
readonly uri: URI;
handle: number;
Expand Down
23 changes: 1 addition & 22 deletions packages/notebook/src/common/notebook-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { CancellationToken, Command, Event, URI } from '@theia/core';
import { Command, URI } from '@theia/core';
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
import { BinaryBuffer } from '@theia/core/lib/common/buffer';
import { UriComponents } from '@theia/core/lib/common/uri';
Expand Down Expand Up @@ -115,27 +115,6 @@ export interface NotebookContributionData {
exclusive: boolean;
}

export interface NotebookCellStatusBarItemList {
items: NotebookCellStatusBarItem[];
dispose?(): void;
}

export interface NotebookCellStatusBarItemProvider {
viewType: string;
onDidChangeStatusBarItems?: Event<void>;
provideCellStatusBarItems(uri: UriComponents, index: number, token: CancellationToken): Promise<NotebookCellStatusBarItemList | undefined>;
}

export interface NotebookCellOutputsSplice {
start: number /* start */;
deleteCount: number /* delete count */;
newOutputs: CellOutput[];
};

export interface CellInternalMetadataChangedEvent {
readonly lastRunSuccessChanged?: boolean;
}

export interface NotebookCellTextModelSplice<T> {
start: number,
deleteCount: number,
Expand Down
15 changes: 13 additions & 2 deletions packages/plugin-ext/src/main/browser/notebooks/notebooks-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { CancellationToken, DisposableCollection, Emitter } from '@theia/core';
import { CancellationToken, DisposableCollection, Emitter, Event } from '@theia/core';
import { BinaryBuffer } from '@theia/core/lib/common/buffer';
import { NotebookCellStatusBarItemList, NotebookCellStatusBarItemProvider, NotebookData, TransientOptions } from '@theia/notebook/lib/common';
import { NotebookCellStatusBarItem, NotebookData, TransientOptions } from '@theia/notebook/lib/common';
import { NotebookService } from '@theia/notebook/lib/browser';
import { Disposable } from '@theia/plugin';
import { MAIN_RPC_CONTEXT, NotebooksExt, NotebooksMain } from '../../../common';
Expand All @@ -25,6 +25,17 @@ import { NotebookDto } from './notebook-dto';
import { UriComponents } from '@theia/core/lib/common/uri';
import { HostedPluginSupport } from '../../../hosted/browser/hosted-plugin';

export interface NotebookCellStatusBarItemList {
items: NotebookCellStatusBarItem[];
dispose?(): void;
}

export interface NotebookCellStatusBarItemProvider {
viewType: string;
onDidChangeStatusBarItems?: Event<void>;
provideCellStatusBarItems(uri: UriComponents, index: number, token: CancellationToken): Promise<NotebookCellStatusBarItemList | undefined>;
}

export class NotebooksMainImpl implements NotebooksMain {

private readonly disposables = new DisposableCollection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

import * as React from '@theia/core/shared/react';
import { inject, injectable, interfaces, postConstruct } from '@theia/core/shared/inversify';
import { NotebookRendererMessagingService, CellOutputWebview, NotebookRendererRegistry, NotebookEditorWidgetService } from '@theia/notebook/lib/browser';
import { NotebookRendererMessagingService, CellOutputWebview, NotebookRendererRegistry, NotebookEditorWidgetService, NotebookCellOutputsSplice } from '@theia/notebook/lib/browser';
import { v4 } from 'uuid';
import { NotebookCellModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-model';
import { WebviewWidget } from '../../webview/webview';
import { Message, WidgetManager } from '@theia/core/lib/browser';
import { outputWebviewPreload, PreloadContext } from './output-webview-internal';
import { WorkspaceTrustService } from '@theia/workspace/lib/browser';
import { ChangePreferredMimetypeMessage, FromWebviewMessage, OutputChangedMessage } from './webview-communication';
import { CellUri, NotebookCellOutputsSplice } from '@theia/notebook/lib/common';
import { CellUri } from '@theia/notebook/lib/common';
import { Disposable, DisposableCollection, nls, QuickPickService } from '@theia/core';
import { NotebookCellOutputModel } from '@theia/notebook/lib/browser/view-model/notebook-cell-output-model';

Expand Down

0 comments on commit b197d77

Please sign in to comment.