import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[test]] node. * See the [[test]] documentation to find out more. */ export interface TestNode extends StatelessGraphNode<'test', TestNodeProperties> { } /** * A definition of the [[test]] node. * See the [[test]] documentation to find out more. */ export interface TestNodeDefinition extends StatelessNodeDefinition<'test', TestNodeProperties> { } export interface TestNodeProperties { regex: NodeDefinition; subject: NodeDefinition; } /** * The implementation of the [[test]] node. * See the [[test]] documentation to learn more. */ export declare const TestNodeType: StatelessNodeType<'test', TestNodeProperties>; /** * Creates a new instance of a [[test]] node, which is used when checking if a given regular expression matches a given * subject. It works in a similar way to `RegExp.test` from JavaScript. * * * @example **Check if a regex matches a string** * ```js * import muster, { regex, test } from '@dws/muster'; * * const app = muster({}); * * await app.resolve(test(regex(/\d+/), '1')); * // === true * * await app.resolve(test(regex(/\d+/), '123')); * // === true * * await app.resolve(test(regex(/\d+/), 'asdf')); * // === false * ``` */ export declare function test(regex: NodeLike, subject: NodeLike): TestNodeDefinition; export declare function isTestNodeDefinition(value: NodeDefinition): value is TestNodeDefinition;