@maxgraph/core
Version:
maxGraph is a fully client side JavaScript diagramming library that uses SVG and HTML for rendering.
36 lines (35 loc) • 1.69 kB
TypeScript
import type Cell from '../view/cell/Cell.js';
import type { AbstractGraph } from '../view/AbstractGraph.js';
import type { StyleValue } from '../types.js';
/**
* Returns a new, empty XML document.
*/
export declare const createXmlDocument: () => XMLDocument;
export declare const parseXml: (xmlString: string) => Document;
export declare const getViewXml: (graph: AbstractGraph, scale?: number, cells?: Cell[] | null, x0?: number, y0?: number) => Element | null;
/**
* Returns the XML content of the specified node.
*
* All `\n` are then replaced with the linefeed parameter value.
*
* @param node DOM node to return the XML for.
* @param linefeed Optional string that linefeed are converted into. Default is `
`.
*/
export declare const getXml: (node: Element, linefeed?: string) => string;
/**
* Returns a pretty printed string that represents the XML tree for the
* given node. This method should only be used to print XML for reading,
* use <getXml> instead to obtain a string for processing.
*
* @param node DOM node to return the XML for.
* @param tab Optional string that specifies the indentation for one level.
* @param indent Optional string that represents the current indentation.
* @param newline Optional string that represents a linefeed.
* @param ns Optional string that represents the target namespace URI.
*/
export declare const getPrettyXml: (node: Element | null, tab?: string, indent?: string, newline?: string, ns?: string | null) => string;
/**
* Returns the first node where attr equals value.
* This implementation does not use XPath.
*/
export declare const findNode: (node: Element, attr: string, value: StyleValue) => Element | null;