API Reference
This section documents all public functions and types in aggregator-toy.
Pipeline Creation
- createPipeline - Create a new pipeline builder
Pipeline Methods
Grouping
- groupBy - Group items by key properties
Aggregates
- sum - Sum a numeric property
- count - Count items
- min / max - Track minimum/maximum values
- average - Compute running average
- pickByMin / pickByMax - Select item by min/max value
- commutativeAggregate - Custom aggregate
Scoping
- in - Scope operations to nested paths
Property Management
- defineProperty - Add computed properties
- dropProperty - Remove properties
Types
KeyedArray
typescript
type KeyedArray<T> = { key: string; value: T }[];The fundamental data structure for grouped data.
Pipeline
typescript
interface Pipeline<T> {
add(key: string, item: T): void;
remove(key: string): void;
}The built pipeline interface for adding and removing items.
TypeDescriptor
typescript
interface TypeDescriptor {
arrays: ArrayDescriptor[];
}
interface ArrayDescriptor {
name: string;
type: TypeDescriptor;
}Describes the nested structure of the pipeline output.