import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; export interface NodeLikeFormatData { [key: string]: NodeLike; } export declare type FormatData = Array<[string, NodeDefinition]>; /** * An instance of the [[format]] node. * See the [[format]] documentation to find out more. */ export interface FormatNode extends StatelessGraphNode<'format', FormatNodeProperties> { } /** * A definition of the [[format]] node. * See the [[format]] documentation to find out more. */ export interface FormatNodeDefinition extends StatelessNodeDefinition<'format', FormatNodeProperties> { } export interface FormatNodeProperties { data: FormatData; format: string; } /** * The implementation of the [[format]] node. * See the [[format]] documentation to learn more. */ export declare const FormatNodeType: StatelessNodeType<'format', FormatNodeProperties>; /** * Creates a new instance of a [[format]] node, which is used converting a values of objects to string and inserts them into * another string. It uses the same syntax as the [Format Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) * from JavaScript. * * * @example **Simple format string** * ```js * import muster, { ref, format } from '@dws/muster'; * * const app = muster({ * name: 'Bob', * }); * * const greeting = await app.resolve(format('Hello, ${name}', { * name: ref('name'), * })); * // === 'Hello, Bob' * ``` * This example shows how to use the [[format]] to create a string from a given format * and a value of a graph node. */ export declare function format(format: string, data: NodeLikeFormatData): FormatNodeDefinition; export declare function isFormatNodeDefinition(value: NodeDefinition): value is FormatNodeDefinition;