import { PrismaClient } from '@prisma/client'; import type { Station, Route, StationRef, AlarmWithRelations, CreateAlarmInput, CreateOnceAlarmInput, UpdateAlarmInput } from './types.js'; /** * Initialise PrismaClient singleton. * Automatically runs `prisma migrate deploy` so the DB schema is up-to-date. */ export declare function initDb(): Promise; /** Return the initialised PrismaClient. Throws if `initDb()` has not been called. */ export declare function getDb(): PrismaClient; /** Disconnect PrismaClient and reset the singleton. */ export declare function closeDb(): Promise; /** Upsert an array of stations, returning the mapped results. */ export declare function upsertStations(stations: Station[]): Promise; /** Upsert an array of routes, returning the mapped results. */ export declare function upsertRoutes(routes: Route[]): Promise; /** Find a station by id and return a lightweight StationRef. */ export declare function findStationById(stationId: string): Promise; /** Create an alarm with nested schedules and channels. */ export declare function createAlarm(input: CreateAlarmInput): Promise; /** List all alarms with their station, route, schedules, and channels. */ export declare function listAlarms(): Promise; /** Find a single alarm by id, or return null. */ export declare function findAlarm(alarmId: string): Promise; /** * Update an alarm. If `schedules` or `channels` are provided in the input * the existing child rows are deleted and recreated. */ export declare function updateAlarm(alarmId: string, input: UpdateAlarmInput): Promise; /** Delete an alarm by id. Cascading deletes handle children. */ export declare function deleteAlarm(alarmId: string): Promise; /** Create a one-time alarm (no schedules). */ export declare function createOnceAlarm(input: CreateOnceAlarmInput): Promise; /** Mark a one-time alarm as fired. */ export declare function markAlarmFired(alarmId: string): Promise; /** * List all *active* alarms whose schedule matches the given `now` timestamp. * * "Active" means: * - RECURRING: `enabled` is true and at least one schedule row matches now. * - ONCE: `enabled` is true, `firedAt` is null, and `activeUntil` is null or >= now. */ export declare function listActiveAlarms(now: Date): Promise; /** * Check whether a notification log exists for the given alarm + vehicle * combination since the provided timestamp. */ export declare function hasRecentNotification(alarmId: string, vehicleId: string, since: Date): Promise; /** Create a notification log entry. */ export declare function createNotificationLog(input: { alarmId: string; vehicleId: string; message: string; channel: string; }): Promise; //# sourceMappingURL=db.d.ts.map