import { Tree } from './tree'; import { Node, Triple } from './types'; export interface FormatOptions { /** How to indent formatted strings. */ indent?: number | null; /** If `true`, put initial attributes on the first line. */ compact?: boolean; } /** * Format a `Tree` object into a PENMAN string. * * `options` consists of the following: * - `indent`: How to indent formatted strings. * - `compact`: If `true`, put initial attributes on the first line. * * @param tree - A Tree object. * @param options - Optional arguments. * @param options.indent - How to indent formatted strings. * @param options.compact - If `true`, put initial attributes on the first line. * @returns The PENMAN-serialized string of the `Tree` object. * @example * import { format } from 'penman-js'; * * console.log(format( * ['b', [['/', 'bark-01'], * [':ARG0', ['d', [['/', 'dog']]]]] * ] * )); * // (b / bark-01 * // :ARG0 (d / dog)) */ export declare const format: (tree: Tree | Node, options?: FormatOptions) => string; export interface FormatTriplesOptions { /** whether or not to indent the results, default true */ indent?: boolean; } /** * Return the formatted triple conjunction of `triples`. * * `options` consists of the following: * - `indent`: Whether or not to indent the results, default true. * * @param triples - An iterable of triples. * @param options - Optional arguments. * @param options.indent - Whether or not to indent the results, default true. * @returns The serialized triple conjunction of `triples`. * @example * import { decode, formatTriples } from 'penman-js'; * * const g = decode('(b / bark-01 :ARG0 (d / dog))'); * console.log(formatTriples(g.triples)); * // instance(b, bark-01) ^ * // ARG0(b, d) ^ * // instance(d, dog) */ export declare const formatTriples: (triples: Triple[], options?: FormatTriplesOptions) => string;