Colocate buffer types in buffer/Types.ts
The import/no-cycle refactor had moved IBuffer, IBufferSet, and related cell/line types into src/common/Types.ts, with buffer/Types.ts only re-exporting them. That inverted the natural module boundary and made buffer code depend on the top-level types hub. Define buffer-owned types in buffer/Types.ts instead: - CharData, IExtendedAttrs, IAttributeData, ICellData, IBufferLine - IMarker, IBuffer, IBufferSet, BufferIndex Restore UnderlineStyle to buffer/Constants.ts (used by IExtendedAttrs) and remove those definitions from Types.ts. buffer/Types.ts imports only what it needs from outside the buffer layer: ICircularList and ICharset from Types, IDisposable from Lifecycle, IEvent from Event, and UnderlineStyle from Constants. Types.ts does not import buffer/Types.ts, so the previous Types <-> buffer cycle stays broken. Update imports across common, browser, headless, addons, and tests to use common/buffer/Types for buffer types rather than common/Types. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,9 +4,8 @@
|
||||
*/
|
||||
|
||||
import { Disposable } from '../Lifecycle';
|
||||
import { IAttributeData, IBufferLine } from '../Types';
|
||||
import { IAttributeData, IBuffer, IBufferLine, IBufferSet } from '../buffer/Types';
|
||||
import { BufferSet } from '../buffer/BufferSet';
|
||||
import { IBuffer, IBufferSet } from '../buffer/Types';
|
||||
import { IBufferService, ILogService, IOptionsService, type IBufferResizeEvent } from './Services';
|
||||
import { Emitter } from '../Event';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { assert } from 'chai';
|
||||
import { DecorationLineCache, DecorationService } from './DecorationService';
|
||||
import { IMarker } from '../Types';
|
||||
import { IMarker } from '../buffer/Types';
|
||||
import { Disposable } from '../Lifecycle';
|
||||
import { Emitter } from '../Event';
|
||||
import { MockLogService, MockBufferService, MockOptionsService } from '../TestUtils.test';
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* @license MIT
|
||||
*/
|
||||
import { IBufferService, IOscLinkService } from './Services';
|
||||
import { IMarker, IOscLinkData } from '../Types';
|
||||
import { IOscLinkData } from '../Types';
|
||||
import { IMarker } from '../buffer/Types';
|
||||
|
||||
export class OscLinkService implements IOscLinkService {
|
||||
public serviceBrand: any;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
*/
|
||||
|
||||
import type { IDecoration, IDecorationOptions, ILinkHandler, ILogger, IWindowsPty, IOverviewRulerOptions } from '@xterm/xterm';
|
||||
import { CoreMouseEncoding, CoreMouseEventType, CursorInactiveStyle, CursorStyle, IAttributeData, ICharset, IColor, ICoreMouseEvent, ICoreMouseProtocol, IDecPrivateModes, IDisposable, IKittyKeyboardState, IModes, IOscLinkData, IWindowOptions } from '../Types';
|
||||
import { IBuffer, IBufferSet } from '../buffer/Types';
|
||||
import { CoreMouseEncoding, CoreMouseEventType, CursorInactiveStyle, CursorStyle, ICharset, IColor, ICoreMouseEvent, ICoreMouseProtocol, IDecPrivateModes, IDisposable, IKittyKeyboardState, IModes, IOscLinkData, IWindowOptions } from '../Types';
|
||||
import { IAttributeData, IBuffer, IBufferSet } from '../buffer/Types';
|
||||
import { createDecorator, IServiceIdentifier } from './ServiceRegistry';
|
||||
import type { Emitter, IEvent } from '../Event';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user