import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[substring]] node. * See the [[substring]] documentation to find out more. */ export interface SubstringNode extends StatelessGraphNode<'substring', SubstringNodeProperties> { } /** * A definition of the [[substring]] node. * See the [[substring]] documentation to find out more. */ export interface SubstringNodeDefinition extends StatelessNodeDefinition<'substring', SubstringNodeProperties> { } export interface SubstringNodeProperties { endIndex: NodeDefinition | undefined; startIndex: NodeDefinition; subject: NodeDefinition; } /** * The implementation of the [[substring]] node. * See the [[substring]] documentation to learn more. */ export declare const SubstringNodeType: StatelessNodeType<'substring', SubstringNodeProperties>; /** * Creates a new instance of a [[substring]] node, which is used when extracting a part of a given string. The node expects the * subject to be a [[value]] containing a string value. It also requires a startIndex, * which must be a [[value]] containing a numeric value. End index is optional and should also * be a [[value]] containing a numeric value. It works in a similar way to the * `String.substring` from JS. * * * @example **Extract a substring** * ```js * import muster, { substring } from '@dws/muster'; * * const app = muster({}); * * await app.resolve(substring( * 'Hello world', * 1, * )); * // === 'ello world' * * await app.resolve(substring( * 'Hello world', * 0, * 5, * )); * // === 'Hello' * ``` */ export declare function substring(subject: NodeLike, startIndex: NodeLike, endIndex?: NodeLike): SubstringNodeDefinition; export declare function isSubstringNodeDefinition(value: NodeDefinition): value is SubstringNodeDefinition;