import { NodeDefinition, NodeLike, StatelessGraphNode, StatelessNodeDefinition, StatelessNodeType } from '../../../types/graph'; /** * An instance of the [[skip]] node. * See the [[skip]] documentation to find out more. */ export interface SkipNode extends StatelessGraphNode<'skip', SkipNodeProperties> { } /** * A definition of the [[skip]] node. * See the [[skip]] documentation to find out more. */ export interface SkipNodeDefinition extends StatelessNodeDefinition<'skip', SkipNodeProperties> { } export interface SkipNodeProperties { offset: NodeDefinition; } /** * An implementation of the [[skip]] node. * See the [[skip]] documentation to find out more. */ export declare const SkipNodeType: StatelessNodeType<'skip', SkipNodeProperties>; /** * Creates a new instance of the [[skip]] node, which is a collection transform used to bypass a specified number of * elements in a collection and then returns the remaining elements. * * @example **Skip 3 items** * ```js * import muster, { applyTransforms, entries, query, ref, skip } from '@dws/muster'; * * const app = muster({ * numbers: applyTransforms( * [1, 2, 3, 4, 5], * [skip(3)], * ), * }); * * await app.resolve(query(ref('numbers'), entries())); // === [4, 5] * ``` * This example shows how to skip 3 items from the collection. * * @example **Skip a number of items defined by a variable** * ```js * import muster, { applyTransforms, entries, query, ref, skip, variable } from '@dws/muster'; * * const app = muster({ * skipCount: variable(4), * numbers: applyTransforms( * [1, 2, 3, 4, 5], * [skip(ref('skipCount'))], * ), * }); * * await app.resolve(query(ref('numbers'), entries())); // === [5] * ``` * This example shows that the `offset` can also be defined as a ref to another node in the graph. One thing to remember * is that the offset node must resolve to a [[value]] node containing a positive integer value. An error will be returned * when the condition is not met. */ export declare function skip(offset: NodeDefinition | NodeLike): SkipNodeDefinition;