import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[replace]] node. * See the [[replace]] documentation to find out more. */ export interface ReplaceNode extends StatelessGraphNode<'replace', ReplaceNodeProperties> { } /** * A definition of the [[replace]] node. * See the [[replace]] documentation to find out more. */ export interface ReplaceNodeDefinition extends StatelessNodeDefinition<'replace', ReplaceNodeProperties> { } export interface ReplaceNodeProperties { pattern: NodeDefinition; replacePattern: NodeDefinition; subject: NodeDefinition; } /** * The implementation of the [[replace]] node. * See the [[replace]] documentation to learn more. */ export declare const ReplaceNodeType: StatelessNodeType<'replace', ReplaceNodeProperties>; /** * Creates a new instance of a [[replace]] node, which is used for replacing a specific pattern in a given string with another * string. The node expects the subject, pattern and replacement pattern to be a [[value]] * containing a string value. It resolves to a [[value]] with a string value. * * * @example **Replace a string** * ```js * import muster, { replace } from '@dws/muster'; * * const app = muster({}); * * await app.resolve(replace( * 'world', * 'Bob', * 'Hello, world', * )); * // === 'Hello, Bob' * ``` */ export declare function replace(pattern: NodeLike, replacePattern: NodeLike, subject: NodeLike): ReplaceNodeDefinition; export declare function isReplaceNodeDefinition(value: NodeDefinition): value is ReplaceNodeDefinition;