Path: blob/main/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { FontInfo } from '../../../../editor/common/config/fontInfo.js';6import { NotebookCellTextModel } from '../common/model/notebookCellTextModel.js';7import { NotebookDocumentMetadata } from '../common/notebookCommon.js';89export interface NotebookLayoutInfo {10width: number;11height: number;12scrollHeight: number;13fontInfo: FontInfo;14stickyHeight: number;15listViewOffsetTop: number;16}1718export interface CellViewModelStateChangeEvent {19readonly metadataChanged?: boolean;20readonly internalMetadataChanged?: boolean;21readonly selectionChanged?: boolean;22readonly focusModeChanged?: boolean;23readonly editStateChanged?: boolean;24readonly languageChanged?: boolean;25readonly foldingStateChanged?: boolean;26readonly contentChanged?: boolean;27readonly outputIsHoveredChanged?: boolean;28readonly outputIsFocusedChanged?: boolean;29readonly cellIsHoveredChanged?: boolean;30readonly cellLineNumberChanged?: boolean;31readonly inputCollapsedChanged?: boolean;32readonly outputCollapsedChanged?: boolean;33readonly dragStateChanged?: boolean;34}3536export interface NotebookLayoutChangeEvent {37width?: boolean;38height?: boolean;39fontInfo?: boolean;40}4142export enum NotebookViewEventType {43LayoutChanged = 1,44MetadataChanged = 2,45CellStateChanged = 346}4748export class NotebookLayoutChangedEvent {49public readonly type = NotebookViewEventType.LayoutChanged;5051constructor(readonly source: NotebookLayoutChangeEvent, readonly value: NotebookLayoutInfo) {5253}54}555657export class NotebookMetadataChangedEvent {58public readonly type = NotebookViewEventType.MetadataChanged;5960constructor(readonly source: NotebookDocumentMetadata) {6162}63}6465export class NotebookCellStateChangedEvent {66public readonly type = NotebookViewEventType.CellStateChanged;6768constructor(readonly source: CellViewModelStateChangeEvent, readonly cell: NotebookCellTextModel) {6970}71}7273export type NotebookViewEvent = NotebookLayoutChangedEvent | NotebookMetadataChangedEvent | NotebookCellStateChangedEvent;747576