import { StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../../types/graph'; /** * An instance of the [[lastItem]] node. * See the [[lastItem]] documentation to find out more. */ export interface LastItemNode extends StatelessGraphNode<'lastItem', LastItemNodeProperties> { } /** * A definition of the [[lastItem]] node. * See the [[lastItem]] documentation to find out more. */ export interface LastItemNodeDefinition extends StatelessNodeDefinition<'lastItem', LastItemNodeProperties> { } export interface LastItemNodeProperties { } /** * The implementation of the [[lastItem]] node. * See the [[lastItem]] documentation to learn more. */ export declare const LastItemNodeType: StatelessNodeType<'lastItem', LastItemNodeProperties>; /** * Creates a new instance of a [[lastItem]] node, which is a type of collection transform used when taking * the last item out of a collection. * It also comes with a shorthand version to be used in the [ref](_utils_ref_.html#ref). See the **References to * items in collections** example from the [ref](_utils_ref_.html#ref) documentation. * * * @example **Take last item (using transform)** * ```js * import muster, { entries, query, ref, lastItem, withTransforms } from '@dws/muster'; * * const app = muster({ * numbers: [1, 2, 3, 4, 5], * }); * * const item = await app.resolve(query(ref('numbers'), withTransforms([ * lastItem(), * ], entries()))); * // item === [5] * ``` * This example shows how to use the [[lastItem]] transform to take the last item out of a * collection. */ export declare function lastItem(): LastItemNodeDefinition;