import { Observable, Subject } from 'rxjs'; import { BaseEditor, Editor, EditorServices, EditorSpec } from './editor'; /** * Editor that connects/disconnects to/from different targets over time, such as using a React ref. */ export interface ConnectingEditor extends Editor { readonly target$: Subject; /** Can be used as a React ref to connect on mount and disconnect on unmount. */ readonly targetRef: (target: T | null) => void; } export declare type ConnectingEditorSpecCreator = (target$: Observable) => EditorSpec; export declare function createConnectingEditor(createSpec: ConnectingEditorSpecCreator): ConnectingEditor; export declare class BaseConnectingEditor extends BaseEditor implements ConnectingEditor { constructor(createSpec: ConnectingEditorSpecCreator); readonly target$: Subject; readonly targetRef: (target: T | null) => void; }