@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
37 lines (36 loc) • 1.91 kB
TypeScript
import { Fragment, Mark, Node as PMNode, Schema } from '../../';
/**
* Deduce a set of marks from a style declaration.
*/
export declare function marksFromStyle(schema: Schema<any, any>, style: CSSStyleDeclaration): Mark[];
/**
* Create a fragment by adding a set of marks to each node.
*/
export declare function addMarks(fragment: Fragment, marks: Mark[]): Fragment;
/**
*
* Traverse the DOM node and build an array of the breadth-first-search traversal
* through the tree.
*
* Detection of supported vs unsupported content happens at this stage. Unsupported
* nodes do not have their children traversed. Doing this avoids attempting to
* decode unsupported content descendents into ProseMirror nodes.
*/
export declare function findTraversalPath(roots: Node[]): Node[];
/**
* Return an array containing the child nodes in a fragment.
*
* @param fragment
*/
export declare function children(fragment: Fragment): PMNode[];
export declare function getAcName(node: Element): string | undefined;
export declare function getNodeName(node: Node): string;
export declare function getAcParameter(node: Element, parameter: string): string | null;
export declare function getAcTagContent(node: Element, tagName: string): string | null;
export declare function getAcTagChildNodes(node: Element, tagName: string): NodeList | null;
export declare function getAcTagNode(node: Element, tagName: string): Element | null;
export declare function getMacroAttribute(node: Element, attribute: string): string;
export declare function getMacroParameters(node: Element): any;
export declare function createCodeFragment(schema: Schema<any, any>, codeContent: string, language?: string | null, title?: string | null): Fragment;
export declare function hasClass(node: Element, className: string): boolean;
export declare function getContent(node: Node, convertedNodes: WeakMap<Node, Fragment | PMNode>): Fragment;