import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../types/graph'; /** * An instance of the [[extend]] node. * See the [[extend]] documentation to find out more. */ export interface ExtendNode extends StatelessGraphNode<'extend', ExtendNodeProperties> { } /** * A definition of the [[extend]] node. * See the [[extend]] documentation to find out more. */ export interface ExtendNodeDefinition extends StatelessNodeDefinition<'extend', ExtendNodeProperties> { } export interface ExtendNodeProperties { nodes: Array; } /** * The implementation of the [[extend]]. * See the [[extend]] documentation to learn more. */ export declare const ExtendNodeType: StatelessNodeType<'extend', ExtendNodeProperties>; /** * Creates a new instance of a [[extend]] node, which is a type of a [[NodeDefinition]] used when extending a branch * with additional nodes. It can be compared to `Object.assign` but for branches. * * @example **Extend an existing branch** * ```js * import muster, { extend, key, query, ref, tree, value } from '@dws/muster'; * * const app = muster({ * user: { * firstName: 'Bob', * lastName: 'Roberson', * }, * extendedUser: extend( * ref('user'), * tree({ * age: value(29), * }), * ), * }); * * const user = await app.resolve(query(ref('extendedUser'), { * firstName: key('firstName'), * lastName: key('lastName'), * age: key('age'), * })); * // user = { * // firstName: 'Bob', * // lastName: 'Roberson', * // age: 29, * // } * ``` * This example shows how to use the [[extend]] to add additional nodes to an existing branch. */ export declare function extend(...nodes: Array): ExtendNodeDefinition; export declare function isExtendNodeDefinition(value: NodeDefinition): value is ExtendNodeDefinition;