import { NodeDefinition, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[flow]] node. * See the [[flow]] documentation to find out more. */ export interface FlowNode extends StatelessGraphNode<'flow', FlowNodeProperties> { } /** * A definition of the [[flow]] node. * See the [[flow]] documentation to find out more. */ export interface FlowNodeDefinition extends StatelessNodeDefinition<'flow', FlowNodeProperties> { } export interface FlowNodeProperties { functions: Array; } /** * The implementation of the [[flow]] node. * See the [[flow]] documentation for more information. */ export declare const FlowNodeType: StatelessNodeType<'flow', FlowNodeProperties>; /** * Creates a new instance of the [[flow]] node, which works similarly to the `flow` function from * lodash, and can be used to chain node calls. * * * @example **Using the flow node** * ```javascript * import muster, { call, flow, format, fn, ref, setResult, variable } from '@dws/muster'; * * const app = muster({ * createArticle: fn(() => * // The logic to create article goes here * // And then return article id * value('article-id') * ), * url: variable('/'), * }); * * console.log('Get the URL'); * app.resolve(ref('url')).subscribe((url) => console.log('URL:', url)); * * console.log('Call flow node'); * await app.resolve(call(flow( * ref('createArticle'), * fn((id) => setResult('url', format('/article/${id}', { id }))), * ))); * * // Console output: * // Get the URL * // URL: / * // Call flow node * // URL: /article/article-id * ``` */ export declare function flow(...functions: Array): FlowNodeDefinition; export declare function isFlowNodeDefinition(value: NodeDefinition): value is FlowNodeDefinition;