import { Table } from '@elaraai/core/data'; import { EastFunction, DateTimeType, Variable, TimeUnit, CalendarUnit, RoundingMode, Expression, StringType, AggregationDefinition } from '@elaraai/core/east'; import { ELARASchema } from '@elaraai/core/schema'; /** * A {@link TimeAggregationDefinition} to define an individual time aggregation for the {@link TimeAggregatePlugin}. * * @category DataSource */ export declare type TimeAggregationDefinition = { /** the {@link Table} to aggregate */ table: Table; /** the {@link Expression} to base time groups off */ value: EastFunction; /** the {@link Variable} to contain the insert the time date value into */ variable?: Variable; /** the {@link TimeUnit} or {@link CalendarUnit} to group into */ unit: TimeUnit | CalendarUnit; /** the {@link RoundingMode} to apply in the group expression */ mode?: RoundingMode; /** the {@link Expression} to add to the group expression */ key?: Expression; /** the {@link Variable} to contain the insert the key variable into */ key_variable?: Variable; /** the collection of {@link AggregationDefinition}s to apply */ aggregations: Record; }; /** * Create a {@link TimeAggregationDefinition} to define an individual time aggregation for the {@link TimeAggregation}. * * @param definition: the desired {@link TimeAggregationDefinition}. * @return a valid {@link TimeAggregation} * * @category DataSource * @deprecated * * @example * ```typescript * // get the datasource to add to the plugin * import datasource_one from './gen/datasource_one.datasource' * // Create a time aggregation * const aggregation = TimeAggregation({ * table: datasource_one.output, * value: datasource_one.output.fields.Date, * aggregations: { * TotalQty: Sum(datasource_one.output.fields.Qty) * } * }) * ``` */ export declare function TimeAggregation(definition: TimeAggregationDefinition): TimeAggregationDefinition; /** * A {@link TimeAggregatePluginDefinition} to configure the {@link TimeAggregatePlugin}. * * @category DataSource */ export declare type TimeAggregatePluginDefinition = { /** the collection of {@link TimeAggregation}s to apply */ inputs: Record; }; /** * * Utility plugin to {@link Aggregate} values over a specified a time interval. * * @param definition: the desired {@link TimeAggregatePluginDefinition}. * @return a {@link ELARASchema} containing a {@link TimeAggregatePluginDefinition} contents * * @category DataSource * * @example * ```typescript * // get the datasource to add to the plugin * import datasource_one from './gen/datasource_one.datasource' * // create a time aggregation for a table * const plugin = TimeAggregatePlugin({ * inputs: { * One: TimeAggregation({ * table: datasource_one.output, * value: datasource_one.output.fields.Date, * aggregations: { * TotalQty: Sum(datasource_one.output.fields.Qty) * } * }) * } * }) * ``` */ export declare function TimeAggregatePlugin(config: TimeAggregatePluginDefinition): ELARASchema; //# sourceMappingURL=time_aggregation.d.ts.map