import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[join]] node. * See the [[join]] documentation to find out more. */ export interface JoinNode extends StatelessGraphNode<'join', JoinNodeProperties> { } /** * A definition of the [[join]] node. * See the [[join]] documentation to find out more. */ export interface JoinNodeDefinition extends StatelessNodeDefinition<'join', JoinNodeProperties> { } export interface JoinNodeProperties { operands: Array; separator: NodeDefinition; } /** * The implementation of the [[join]] node. * See the [[join]] documentation to learn more. */ export declare const JoinNodeType: StatelessNodeType<'join', JoinNodeProperties>; /** * Creates a new instance of a [[join]] node, which is used when joining a number of strings together. The node expects each * operand to be a [[value]] containing a string value. The node works in a similar way to * `Array.join` from JS. * * * @example **Join strings** * ```js * import muster, { join } from '@dws/muster'; * * const app = muster({}); * * await app.resolve(join(' ', 'Hello', 'world')); * // === 'Hello world'; * ``` * * * @example **Join array of strings** * ```js * import muster, { join, ref, value } from '@dws/muster'; * * const app = muster({ * names: value(['Bob', 'Jane', 'Kate']), * }); * * await app.resolve(join(' ', ref('names'))); * // === 'Bob Jane Kate' * ``` * * @example **Join a collection of strings** * ```js * import muster, { entries, join, joinItems, query, ref } from '@dws/muster'; * * const app = muster({ * names: ['Bob', 'Jane', 'Kate'], * }); * * await app.resolve(join(' ', query(ref('names'), entries()))); * // === 'Bob Jane Kate' * * // OR * * await app.resolve(joinItems(' ', ref('names'))); * // === 'Bob Jane Kate' * ``` */ export declare function join(separator: NodeLike, ...operands: Array): JoinNodeDefinition; /** * A helper function that creates a [[join]] node with each operand mapped to * a `query(operand, entries())`. * See the [[join]] documentation page to find out more. * * * @example **Join a collection of strings** * ```js * import muster, { entries, join, joinItems, query, ref } from '@dws/muster'; * * const app = muster({ * names: ['Bob', 'Jane', 'Kate'], * }); * * await app.resolve(joinItems(' ', ref('names'))); * // === 'Bob Jane Kate' * ``` */ export declare function joinItems(separator: NodeLike, ...collections: Array): JoinNodeDefinition; export declare function isJoinNodeDefinition(value: NodeDefinition): value is JoinNodeDefinition;