import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[matchPattern]] node. * See the [[matchPattern]] documentation to find out more. */ export interface MatchPatternNode extends StatelessGraphNode<'match-pattern', MatchPatternNodeProperties> { } /** * A definition of the [[matchPattern]] node. * See the [[matchPattern]] documentation to find out more. */ export interface MatchPatternNodeDefinition extends StatelessNodeDefinition<'match-pattern', MatchPatternNodeProperties> { } export interface MatchPatternNodeProperties { regex: NodeDefinition; subject: NodeDefinition; } /** * The implementation of the [[matchPattern]] node. * See the [[matchPattern]] documentation to learn more. */ export declare const MatchPatternNodeType: StatelessNodeType<'match-pattern', MatchPatternNodeProperties>; /** * Creates a new instance of a [[matchPattern]] node, which is used finding all regex matches from a given string. The node expects * the subject to be a [[value]] that contains a string value and a regex which is a * [[regex]]. It works in a similar way to the `String.match` node. The node resolves to an [[array]]. * * * @example **Getting matches** * ```js * import muster, { matchPattern, regex } from '@dws/muster'; * * const app = muster({}); * * await app.resolve(matchPattern(regex(/\d+/g), '123 321')); * // === [ * // '123', * // '321', * // ] * ``` */ export declare function matchPattern(regex: NodeLike, subject: NodeLike): MatchPatternNodeDefinition; export declare function isMatchPatternNodeDefinition(value: NodeDefinition): value is MatchPatternNodeDefinition;