import { type AttributePredicate, type IAttribute } from "../attribute/index.js"; import { type ITotal } from "../base/totals.js"; import { type IMeasure, type MeasurePredicate } from "../measure/index.js"; import { type AttributeInBucket, type BucketItemModifications, type BucketItemReducer, type BucketPredicate, type IAttributeOrMeasure, type IBucket, type MeasureInBucket } from "./index.js"; /** * Gets all attributes matching the provided predicate from a list of buckets. * * @remarks * If no predicate is provided, then the function defaults to {@link anyAttribute} predicate - meaning all * attributes will be returned. * * @param buckets - list of buckets to get attributes from * @param predicate - attribute predicate; {@link anyAttribute} is default * @returns empty list if none match * @public */ export declare function bucketsAttributes(buckets: IBucket[], predicate?: AttributePredicate): IAttribute[]; /** * Gets all measures matching the provided predicate from a list of buckets. * * @remarks * If no predicate is provided, then the function defaults to {@link anyMeasure} predicate - meaning all * measures will be returned. * * @param buckets - list of buckets to get measures from * @param predicate - measure predicate; {@link anyMeasure} is default * @returns empty list if none match * @public */ export declare function bucketsMeasures(buckets: IBucket[], predicate?: MeasurePredicate): IMeasure[]; /** * Finds bucket matching the provided predicate in a list of buckets. * * @remarks * If no predicate is provided, then the function defaults to {@link anyBucket} predicate - meaning first * bucket in the list will be returned. * * This function also provides convenience to find bucket by local identifier - if you pass predicate as * string the function will automatically create idMatchBucket predicate. * * @param buckets - list of buckets to search * @param idOrFun - bucket predicate or string to match bucket by local identifier; {@link anyBucket} is default * @public */ export declare function bucketsFind(buckets: IBucket[], idOrFun?: string | BucketPredicate): IBucket | undefined; /** * Finds attribute matching the provided predicate in a list of buckets. * * @remarks * If found, the function returns an object that contains bucket where the matched attribute is stored, index within * that bucket and the attribute itself. * * This function also provides convenience to find attribute by local identifier - if you pass predicate as * string the function will automatically create idMatchAttribute predicate. * * @remarks See {@link AttributeInBucket} * * @param buckets - list of buckets to search * @param idOrFun - attribute predicate or string to find attribute by local identifier; defaults to {@link anyAttribute} * @returns first-found attribute matching the predicate, undefined if none match * @public */ export declare function bucketsFindAttribute(buckets: IBucket[], idOrFun?: string | AttributePredicate): AttributeInBucket | undefined; /** * Finds measure matching the provided predicate in a list of buckets. * * @remarks * If found, the function returns an object that contains bucket where the matched measure is stored, index * within that bucket and the measure itself. * * This function also provides convenience to find measure by local identifier - if you pass predicate as * string the function will automatically create idMatchMeasure predicate. * * @remarks See {@link MeasureInBucket} * * @param buckets - list of buckets to search * @param idOrFun - measure predicate or string to find measure by local identifier; defaults to {@link anyMeasure} * @returns first-found measure matching the predicate, undefined if none match * @public */ export declare function bucketsFindMeasure(buckets: IBucket[], idOrFun?: string | MeasurePredicate): MeasureInBucket | undefined; /** * Gets buckets with the provided local identifiers from a list of buckets. * * @param buckets - list of buckets to filter * @param ids - bucket identifiers * @returns empty list if none match * @public */ export declare function bucketsById(buckets: IBucket[], ...ids: string[]): IBucket[]; /** * Gets all attributes and measures from a list of buckets. * * @param buckets - buckets to work with * @returns empty list if none * @public */ export declare function bucketsItems(buckets: IBucket[]): IAttributeOrMeasure[]; /** * Gets all totals from a list of buckets * * @param buckets - buckets to work with * @returns empty list if none * @public */ export declare function bucketsTotals(buckets: IBucket[]): ITotal[]; /** * Tests whether all buckets in a list are empty (meaning neither has any items or totals defined) * * @param buckets - buckets to work with * @returns true if empty, false if not * @public */ export declare function bucketsIsEmpty(buckets: IBucket[]): boolean; /** * Creates a new array of buckets, each bucket in the array contains modified bucket items * (retrieved by applying the modifications function to the bucketItem). * * @param buckets - an array of buckets, all items of each bucket in the array are applied the modification function * @param modifications - the modification to apply to the bucket items * @returns a new array of buckets, each bucket in the array contains modified bucket items * @public */ export declare function bucketsModifyItem(buckets: IBucket[], modifications?: BucketItemModifications): IBucket[]; /** * Creates a new array of buckets, each bucket in the array contains modified bucket items * * @param buckets - an array of buckets, array is applied the modification function * @param reducer - the reducer to apply to the bucket items array * @returns a new array of buckets, each bucket in the array contains modified bucket items * @public */ export declare function bucketsReduceItem(buckets: IBucket[], reducer?: BucketItemReducer): IBucket[]; //# sourceMappingURL=bucketArray.d.ts.map