/** * Interval conversion utilities shared between graphql-naming.ts and tests. * * NOTE: @pgpmjs/csv-to-pg has its own formatInterval() in parse.ts which * performs the same object→string conversion. That is a separate package with * its own release cycle, so we do not cross-reference it here. If interval * handling needs to be unified across packages, that would require an * architectural change (shared dependency or monorepo util package). */ /** Shape of a PostGraphile Interval object (OBJECT type in introspection). */ export interface PgInterval { years: number | null; months: number | null; days: number | null; hours: number | null; minutes: number | null; seconds: number | null; } /** * Convert a PostgreSQL interval object (from GraphQL Interval type) back to a * Postgres interval string. * e.g. { years: 0, months: 0, days: 0, hours: 1, minutes: 30, seconds: 0 } → '1:30:00' */ export declare const intervalToPostgres: (interval: Record | null) => string | null; /** * Parse a PostgreSQL interval string into the object shape that PostGraphile's * Interval type returns: { years, months, days, hours, minutes, seconds }. * * Handles formats like: * '30 days' → { years: 0, months: 0, days: 30, hours: 0, minutes: 0, seconds: 0 } * '1:30:00' → { years: 0, months: 0, days: 0, hours: 1, minutes: 30, seconds: 0 } */ export declare const parsePgInterval: (value: string) => Record;