import { Brand, Context, Path, SourceRef, Timestamp } from '@signalk/server-api';
import { Request } from 'express';
import { PathFilter } from './utils/path-filters';
export type AggregateMethod = Brand<string, 'aggregatemethod'>;
type ValueList = {
    path: Path;
    method: AggregateMethod;
    sourceRef?: SourceRef;
}[];
export type Datarow = [Timestamp, ...any[]];
export interface DataResult {
    context: Context;
    range: {
        from: Timestamp;
        to: Timestamp;
    };
    values: ValueList;
    data: Datarow[];
    units?: {
        converted: boolean;
        conversions: Array<{
            path: Path;
            baseUnit: string;
            targetUnit: string;
            symbol: string;
        }>;
    };
    meta?: {
        autoConfigured: boolean;
        paths: string[];
        message: string;
    };
}
export interface ValuesResponse extends DataResult {
    context: Context;
    range: {
        from: Timestamp;
        to: Timestamp;
    };
}
export type TimeRangeQueryParams = {
    duration: string;
    from?: never;
    to?: never;
} | {
    duration: string;
    from: string;
    to?: never;
} | {
    duration: string;
    to: string;
    from?: never;
} | {
    from: string;
    duration?: never;
    to?: never;
} | {
    from: string;
    to: string;
    duration?: never;
};
export type FromToContextRequest = Request<unknown, unknown, unknown, TimeRangeQueryParams & {
    start?: string;
    context?: string;
    paths?: string;
    resolution?: string;
    bbox?: string;
    radius?: string;
    convertUnits?: string;
}>;
export interface PathSpec {
    path: Path;
    queryResultName: string;
    aggregateMethod: AggregateMethod;
    aggregateFunction: string;
    smoothing?: 'sma' | 'ema';
    smoothingParam?: number;
    smoothingOnly?: boolean;
    filters: PathFilter[];
}
export {};
//# sourceMappingURL=HistoryAPI-types.d.ts.map