import { IDisposable, IEventEmitter } from '@stoplight/lifecycle'; import { GraphOperationResult, IAddNodeOperation, IGraphPatchResult, IMoveNodeOperation, IPatchSourceNodePropOperation, IRemoveNodeOperation, ISetSourceNodePropOperation } from '../graph/dom'; import { Node } from '../graph/nodes'; import { GraphiteError, ITraceData } from '../types'; export interface INotifier extends IDisposable, GraphiteEmitter { } export declare type GraphiteEmitter = IEventEmitter; export declare enum GraphiteEvent { DidPatch = 1, DidAddNode = 2, DidMoveNode = 3, DidRemoveNode = 4, DidChangeSourceNode = 5, DidSetSourceNodeProp = 6, DidPatchSourceNodeProp = 7, DidUpdateNodeUri = 8, DidUpdateSourceMapNodeData = 9, DidUpdateSourceMapNodeResolved = 10, DidError = 11, DidPatchSourceNodePropComplete = 12, DidIndexNode = 13, DidAddSourceMapNode = 14 } export interface INodeChange { node: Node; change: ISetSourceNodePropOperation | IPatchSourceNodePropOperation; } export interface IGraphiteEvents { [GraphiteEvent.DidPatch]: (patch: IGraphPatchResult) => void; [GraphiteEvent.DidAddNode]: (result: GraphOperationResult) => void; [GraphiteEvent.DidIndexNode]: (result: GraphOperationResult) => void; [GraphiteEvent.DidMoveNode]: (result: GraphOperationResult) => void; [GraphiteEvent.DidRemoveNode]: (result: GraphOperationResult) => void; [GraphiteEvent.DidChangeSourceNode]: (result: INodeChange) => void; [GraphiteEvent.DidSetSourceNodeProp]: (result: GraphOperationResult) => void; [GraphiteEvent.DidPatchSourceNodeProp]: (result: GraphOperationResult) => void; [GraphiteEvent.DidPatchSourceNodePropComplete]: (result: GraphOperationResult) => void; [GraphiteEvent.DidUpdateNodeUri]: (result: { id: string; oldUri?: string; newUri: string; trace?: ITraceData; }) => void; [GraphiteEvent.DidUpdateSourceMapNodeData]: (result: { id: string; oldValue?: any; newValue: any; trace?: ITraceData; }) => void; [GraphiteEvent.DidUpdateSourceMapNodeResolved]: (result: { id: string; oldValue?: any; newValue: any; trace?: ITraceData; }) => void; [GraphiteEvent.DidError]: (result: { error: GraphiteError; }) => void; [GraphiteEvent.DidAddSourceMapNode]: (result: Pick, 'node' | 'trace'>) => void; }