/** * A molecule layout engine. * * This module transforms the SMILES syntax tree into a set of rendering * instructions. A rendering instruction is an object indicating what type of * thing to render (e.g. text or line), where to render it, and any other style * properties needed. * * For instance, an oxygen atom might be rendered as * {type: "text", value: "O", pos: [0, 0], idx: "1,0"} */ /** * Compute the layout for a single atom. * * Args: * atom: the atom node for which layout is being created, as returned from * convertTree; the computed position of this atom is added to this * object in place, in addition to being returned in the layout * instruction. * atoms: the list of all atoms, as returned from convertTree, used to * position this atom appropriately relative to its neighbors * bonds: the list of all bonds, as returned from convertTree, used to * determine the geometry based on bond type * rotationAngle: a constant rotation for the whole molecule (in degrees) * * Return: * a rendering instruction for the atom, containing a type (text), the text * to render, the position, and the atom index */ declare function atomLayout(atom: any, atoms: any, bonds: ReadonlyArray, rotationAngle: number): any; /** * Compute the layout for a bond between two atoms. * * Args: * bond: the bond node for which the layout is being computed, as returned * by convertTree * atoms: the list of all atoms returned by convertTree, which should * already have been processed for layout and thus have positions set * * Return: * a rendering instruction for the bond containing a type * (line:{single,double,triple}) and the line's endpoints */ declare function bondLayout(bond: any, atoms: any): any; /** * Convert the parse tree output by the parser into an ordered list of atoms * and bonds to render. * * Args: * atoms: the output list of atoms that we're in the process of building. * This should be the empty list if not being called recursively. * bonds: the output list of bonds that we're in the process of building. * This should be the empty list if not being called recursively. * tree: the parse tree generated by the SMILES parser module. * * Return: * the final value of atoms and bonds, which are lists of all the atom * nodes and bond nodes, respectively, that need to be rendered. */ declare function convertTree(atoms: any, bonds: any, tree: any): [any, any]; /** * Compute an array of rendering instructions from the parse tree of a molecule. * * Args: * tree: the parse tree as returned by the SMILES parser module * rotationAngle: a global rotation (in degrees) to be applied to the whole * molecule; this is manually adjustable in the widget. * * Return: * an array of rendering instructions for all the atoms and bonds in the * molecule suitable for processing by the renderer */ declare function layout(tree: any, rotationAngle: any): any; declare const _default: { layout: typeof layout; _atomLayout: typeof atomLayout; _bondLayout: typeof bondLayout; _bondLength: number; _convertTree: typeof convertTree; }; export default _default;