// If types match closely, we can use TypeScript "casting" // to convert from data repo to GraphQL schema import { ShuttleGetterRepository } from "./ShuttleGetterRepository"; import { IEta, IOrderedStop, IRoute, IShuttle, IStop } from "../../entities/ShuttleRepositoryEntities"; /** * ShuttleGetterRepository interface for data derived from Passio API. * The repository is not designed to have write locks in place. * Objects passed from/to the repository should be treated * as disposable. */ export interface ShuttleGetterSetterRepository extends ShuttleGetterRepository { // Setter methods addOrUpdateRoute(route: IRoute): Promise; addOrUpdateShuttle(shuttle: IShuttle): Promise; addOrUpdateStop(stop: IStop): Promise; addOrUpdateOrderedStop(orderedStop: IOrderedStop): Promise; addOrUpdateEta(eta: IEta): Promise; removeRouteIfExists(routeId: string): Promise; removeShuttleIfExists(shuttleId: string): Promise; removeStopIfExists(stopId: string): Promise; removeOrderedStopIfExists(stopId: string, routeId: string): Promise; removeEtaIfExists(shuttleId: string, stopId: string): Promise; clearRouteData(): Promise; clearShuttleData(): Promise; clearStopData(): Promise; clearOrderedStopData(): Promise; clearEtaData(): Promise; }