type CGMLTextStateMachine = Omit, 'transitions'> & { states: { [id: string]: CGMLTextState; }; transitions: { [id: string]: CGMLTextTransition; }; }; type CGMLTextState = Omit & { actions: string; }; type CGMLTextTransition = Omit & { actions: string; }; type CGMLPoint = { x: number; y: number; }; type CGMLRectangle = CGMLPoint & { width: number; height: number; }; type CGMLTransitionAction = { trigger?: CGMLTransitionTrigger; action?: string; }; type CGMLBaseTrigger = { postfix?: string; condition?: string; }; type CGMLTransitionTrigger = CGMLBaseTrigger & { event?: string; }; type CGMLTrigger = CGMLBaseTrigger & { event: string; }; type CGMLBaseState = { parent?: string; name: string; bounds: CGMLRectangle; actions: Array; unsupportedDataNodes: Array; color?: string; }; type CGMLAction = { trigger: CGMLTrigger; action?: string; }; type CGMLState = { parent?: string; name: string; bounds: CGMLRectangle; actions: Array; unsupportedDataNodes: Array; color?: string; }; type CGMLTransition = { id: string; source: string; target: string; color?: string; position?: CGMLPoint; labelPosition: CGMLPoint | undefined; sourcePoint?: CGMLPoint; targetPoint?: CGMLPoint; actions: Array; unsupportedDataNodes: Array; pivot: string | undefined; }; type CGMLVertex = { parent?: string; type: string; data?: string; name?: string; position?: CGMLPoint | CGMLRectangle; }; type CGMLMeta = { id: string; values: { [id: string]: string; }; }; type CGMLComponent = { id: string; type: string; parameters: { [id: string]: string; }; order?: number; unsupportedDataNodes: CGMLDataNode[]; }; type CGMLElements = { stateMachines: { [id: string]: CGMLStateMachine; }; format: string; keys: Array; }; type CGMLTextElements = { stateMachines: { [id: string]: CGMLTextStateMachine; }; format: string; keys: Array; }; type CGMLDimensions = { width: number; height: number; }; type CGMLStateMachine = { name?: string; meta: CGMLMeta; standardVersion: string; platform?: string; states: { [id: string]: CGMLState; }; transitions: Record; components: { [id: string]: CGMLComponent; }; initialStates: { [id: string]: CGMLVertex; }; notes: { [id: string]: CGMLNote; }; finals: { [id: string]: CGMLVertex; }; choices: { [id: string]: CGMLVertex; }; terminates: { [id: string]: CGMLVertex; }; shallowHistory: { [id: string]: CGMLVertex; }; deepHistory: { [id: string]: CGMLVertex; }; unknownVertexes: { [id: string]: CGMLVertex; }; position?: CGMLPoint; dimensions?: CGMLDimensions; }; type NoteType = 'formal' | 'informal'; type CGMLNote = { name: string | undefined; position: CGMLPoint; text: string; type: NoteType; data?: string; unsupportedDataNodes: Array; }; type CGMLNode = { id: string; data?: Array; graph?: CGMLGraph; }; type CGMLEdge = { id: string; source: string; target: string; data?: Array; }; type CGMLGraph = { node: Array; edge: Array; edgedefault: string; id: string; data: CGMLDataNode[]; }; type CGMLDataNode = { key: string; content: string; rect: Array | undefined; point: Array | undefined; x?: number; y?: number; width?: number; height?: number; }; type CGMLKeyNode = { id: string; for: string; 'attr.name'?: string; 'attr.type'?: string; }; type CGMLDataNodeProcess = { [key in CGMLDataKey]: (data: CGMLDataNodeProcessArgs) => void; }; declare const CGMLDataKeys: readonly ["gFormat", "dData", "dName", "dGeometry", "dColor", "dNote", "dVertex", "dPivot", "dLabelGeometry", "dStateMachine", "dTargetPoint", "dSourcePoint"]; type CGMLDataKey = (typeof CGMLDataKeys)[number]; interface CGMLDataNodeProcessArgs { elements?: CGMLElements | CGMLTextElements; stateMachine?: CGMLStateMachine | CGMLTextStateMachine; meta?: string; node: CGMLDataNode; parentNode?: CGMLNode; state?: CGMLState | CGMLTextState; transition?: CGMLTransition | CGMLTextTransition; note?: CGMLNote; vertex?: CGMLVertex; textMode: boolean; } type XMLProperies = { version: string; encoding: string; }; type CGMLGraphmlNode = { xmlns: string; data: Array; key: Array; graph: CGMLGraph[]; }; type CGML = { '?xml': XMLProperies; graphml: CGMLGraphmlNode; }; declare function parseTrigger(trigger: string, regexes: Array): CGMLTransitionTrigger; declare function toArray(value: Type | Array): Array; declare function emptyCGMLStateMachine(): CGMLStateMachine; declare function createEmptyTextElements(): CGMLTextElements; declare function createEmptyElements(): CGMLElements; declare function serialaizeParameters(parameters: { [id: string]: string; }): string; declare function serializeMeta(meta: CGMLMeta, standardVersion: string, platform?: string): string; declare function serializeActions(actions: Array | Array): string; declare function parseCGML(graphml: string): CGMLElements; declare function exportGraphml(elements: CGMLElements): string; declare function exportTextGraphml(elements: CGMLTextElements): string; type ExportKeyNode = { '@id': string; '@for': string; '@attr.name'?: string; '@attr.type'?: string; }; type ExportRect = { '@x': number; '@y': number; '@width': number; '@height': number; }; type ExportPoint = { '@x': number; '@y': number; }; type ExportDataNode = { '@key': string; content: string; rect?: ExportRect; point?: ExportPoint; }; type ExportEdge = { '@id': string; '@source': string; '@target': string; data: Array; }; type ExportNote = { '@id': string; position: CGMLPoint; text: string; }; type ExportGraph = { '@id': string; node: Array; edge: Array; }; type ExportNode = { '@id': string; data: Array; graph?: ExportGraph; }; type ExportXMLNode = { '@version': string; '@encoding': string; }; type ExportCGMLGraphmlNode = { '@xmlns': string; data: ExportDataNode; key: ExportKeyNode[]; graph: ExportGraph[]; }; type ExportCGML = { '?xml': ExportXMLNode; graphml: ExportCGMLGraphmlNode; }; export { type CGML, type CGMLAction, type CGMLBaseState, type CGMLComponent, type CGMLDataKey, CGMLDataKeys, type CGMLDataNode, type CGMLDataNodeProcess, type CGMLDataNodeProcessArgs, type CGMLDimensions, type CGMLEdge, type CGMLElements, type CGMLGraph, type CGMLGraphmlNode, type CGMLKeyNode, type CGMLMeta, type CGMLNode, type CGMLNote, type CGMLPoint, type CGMLRectangle, type CGMLState, type CGMLStateMachine, type CGMLTextElements, type CGMLTransition, type CGMLTransitionAction, type CGMLTransitionTrigger, type CGMLTrigger, type CGMLVertex, type ExportCGML, type ExportCGMLGraphmlNode, type ExportDataNode, type ExportEdge, type ExportGraph, type ExportKeyNode, type ExportNode, type ExportNote, type ExportPoint, type ExportRect, type ExportXMLNode, type NoteType, type XMLProperies, createEmptyElements, createEmptyTextElements, emptyCGMLStateMachine, exportGraphml, exportTextGraphml, parseCGML, parseTrigger, serialaizeParameters, serializeActions, serializeMeta, toArray };