import { IMetroRunInputForProcessing } from "../../runs/interfaces/IMetroRunInputForProcessing";
import { PositionDto } from "../../../../../schema-definitions/vehicle-positions/models/PositionDto";
import { IPositionDto } from "../../../../../schema-definitions/vehicle-positions/models/interfaces/IPositionDto";
import { IScheduleDto } from "../../../../../schema-definitions/vehicle-positions/redis/interfaces/IGtfsRunTripCacheDto";
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
import Sequelize from "@golemio/core/dist/shared/sequelize";
import { IUpdateRunsGtfsTripInput } from "../interfaces/IUpdateRunsGtfsTripInput";
import { ITripPositions } from "./interfaces/PositionRepositoryInterfaces";
export declare class PositionsRepository extends PostgresModel implements IModel {
    protected tripsModel: Sequelize.ModelCtor<any>;
    constructor();
    /**
     * Get all trips with positions for given trip ids. Positions are ordered by created_at instead of origin_timestamp
     *   to ensure they are processed by the same order they are created
     *   (sometimes TCP common positions are received out of order)
     *
     * Example of processing of mismatched TCP common positions:
     *   Batch 1 - TCP position (event T) with origin_timestamp 10:00:01, created_at 10:00:04, not last position
     *     (position is at_stop, last stop sequence is 2, delay at last stop is null, is not served to the output API)
     *   Batch 1 - TCP position (event O) with origin_timestamp 10:00:00, created_at 10:00:05, last position
     *     (position is on_track, last stop sequence is 2, delay at last stop is 10 and is served to the output API)
     *   Batch 2 - TCP position (event T) with origin_timestamp 10:01:00, created_at 10:01:04, last position
     *     (position is on_track, last stop sequence is 2, delay at last stop is 10 and is served to the output API)
     *   Batch 3 - TCP position (event 0) with origin_timestamp 10:01:40, created_at 10:01:44, last position
     *     (position is on_track, last stop sequence is 3, delay at last stop is 20 and is served to the output API)
     */
    getPositionsForUpdateDelay: (tripIds: string[]) => Promise<ITripPositions[]>;
    upsertCommonRunPosition: ({ run, run_message }: IUpdateRunsGtfsTripInput, gtfsTrip: IScheduleDto, isCurrent?: boolean) => Promise<IPositionDto>;
    upsertMetroRunPosition: (runInput: IMetroRunInputForProcessing, gtfsTrip: IScheduleDto, isCurrent?: boolean) => Promise<IPositionDto>;
    deleteNHoursOldData: (hours: number) => Promise<number>;
    createEntity: (positionDto: Partial<IPositionDto>) => Promise<PositionDto>;
    /**
     * Invalidate positions for trips with stop sequence greater than given stop sequence
     * Used when a vehicle repeats some part of the trip
     * @param tripWithStopSequenceTuples - array of tuples with trip id and stop sequence
     * @returns number of invalidated positions
     */
    invalidatePositionsAfterStopSequence: (tripWithStopSequenceTuples: Array<[string, number]>) => Promise<number>;
}
