import { ContextMenuDirectory } from '../components/context-menu/context-menu.js'; export class EditorPanelDefinition { static readonly type = 'EditorPanel'; } export class FileEditorPanelDefinition { static readonly type = 'FileEditorPanel'; } export interface EditorPanel extends HTMLElement { __interfaces__: string[]; addContextMenuEntries( dir: ContextMenuDirectory ): void; } export interface FileEditorPanel extends EditorPanel { hasUnsavedChanges(): boolean; getCurrentFile(): string | null; } export function implementsInterface( el: any, def: { type: string } ): boolean { return Array.isArray( el.__interfaces__ ) && el.__interfaces__.includes( def.type ); }