diff --git a/knip.json b/knip.json index b4b0b610c..4b0f6accf 100644 --- a/knip.json +++ b/knip.json @@ -72,6 +72,7 @@ ], "ignoreExportsUsedInFile": true, "ignoreIssues": { - "src/components/ui/**": ["exports", "types"] + "src/components/ui/**": ["exports", "types"], + "src/lib/validations/**": ["types"] } } diff --git a/src/lib/ai/coach/types.ts b/src/lib/ai/coach/types.ts index 7752b3528..daba4b991 100644 --- a/src/lib/ai/coach/types.ts +++ b/src/lib/ai/coach/types.ts @@ -97,8 +97,6 @@ export const coachChatRequestSchema = z.object({ scope: coachScopeSchema.optional(), }); -export type CoachChatRequest = z.infer; - /** * SSE event shapes emitted by the streaming endpoint. * diff --git a/src/lib/ai/schema.ts b/src/lib/ai/schema.ts index 022023c05..a86614d44 100644 --- a/src/lib/ai/schema.ts +++ b/src/lib/ai/schema.ts @@ -67,8 +67,6 @@ export const metricSourceSchema = z.object({ n: z.number().int().nonnegative().optional(), }); -export type MetricSource = z.infer; - /** * Set of valid `referenceId` values, derived from * `MEDICAL_REFERENCES` so the two cannot drift. Validated lazily @@ -118,10 +116,6 @@ export const aiRecommendationRationaleSchema = z.object({ deviation: z.string().min(1, "rationale.deviation required"), }); -export type AIRecommendationRationale = z.infer< - typeof aiRecommendationRationaleSchema ->; - export const aiRecommendationSchema = z .object({ /** @@ -191,8 +185,6 @@ export const aiRecommendationSchema = z } }); -export type AIRecommendation = z.infer; - export const aiCitationSchema = z.object({ /** Snapshot key being cited. */ type: z.string().min(1, "citation.type required"), @@ -202,8 +194,6 @@ export const aiCitationSchema = z.object({ summary: z.string().min(1, "citation.summary required"), }); -export type AICitation = z.infer; - export const aiWarningSchema = z.object({ /** Topic — "blood_pressure", "pulse", etc. */ topic: z.string().min(1, "warning.topic required"), @@ -213,8 +203,6 @@ export const aiWarningSchema = z.object({ severity: recommendationSeveritySchema.optional(), }); -export type AIWarning = z.infer; - /** * v1.4.20 phase B1 — Daily Briefing block. * @@ -419,8 +407,6 @@ export const storyboardAnnotationSchema = z.object({ .max(400, "storyboardAnnotation.detail must be <= 400 chars"), }); -export type StoryboardAnnotation = z.infer; - export const storyboardAnnotationsSchema = z .array(storyboardAnnotationSchema) .max(20, "storyboardAnnotations can hold at most 20 entries"); diff --git a/src/lib/ai/types.ts b/src/lib/ai/types.ts index 43dece7c0..a6dd524d2 100644 --- a/src/lib/ai/types.ts +++ b/src/lib/ai/types.ts @@ -99,7 +99,6 @@ export const insightResultSchema = z.object({ }); export type InsightResult = z.infer; -export type InsightFinding = z.infer; // ─── Provider Types ──────────────────────────────────────── diff --git a/src/lib/analytics/effective-range.ts b/src/lib/analytics/effective-range.ts index 9569ec1c1..2b78bcf06 100644 --- a/src/lib/analytics/effective-range.ts +++ b/src/lib/analytics/effective-range.ts @@ -42,13 +42,6 @@ export type ThresholdMetric = | "BONE_MASS" | "OXYGEN_SATURATION"; -export interface ThresholdOverride { - min: number; - max: number; - /** Set true when the value was entered by the user (not the computed default). */ - isOverride?: boolean; -} - /** * Shape persisted in User.thresholdsJson. Any metric missing = use default. */ diff --git a/src/lib/auth/profile-update.ts b/src/lib/auth/profile-update.ts index 50b7c59a6..371ab3a14 100644 --- a/src/lib/auth/profile-update.ts +++ b/src/lib/auth/profile-update.ts @@ -21,8 +21,6 @@ const extendedProfileSchema = profileSchema.extend({ moodReminderEnabled: z.boolean().optional(), }); -export type ApplyProfileInput = z.infer; - export interface ApplyProfileResult { ok: true; user: { diff --git a/src/lib/charts/constants.ts b/src/lib/charts/constants.ts index d6494a9c2..c84345cf2 100644 --- a/src/lib/charts/constants.ts +++ b/src/lib/charts/constants.ts @@ -15,21 +15,3 @@ /** Full-size trend-card body height (non-mini chart cards on the dashboard). */ export const CHART_HEIGHT_PX = 240; - -/** - * Range-preset options for charts that expose a 7d / 30d / 90d / All - * range selector. Each entry carries the i18n keys for the visible - * label + sr-only title, plus a `points` count used by the underlying - * `HealthChart` query window. `points: 0` denotes "all data". - * - * Re-used by the GLP-1 dashboard tile so its range strip stays in - * lockstep with the rest of the trend strip. - */ -export const CHART_RANGE_PRESETS = [ - { labelKey: "charts.points7Label", titleKey: "charts.points7Title", points: 7 }, - { labelKey: "charts.points30Label", titleKey: "charts.points30Title", points: 30 }, - { labelKey: "charts.points90Label", titleKey: "charts.points90Title", points: 90 }, - { labelKey: "charts.pointsAllLabel", titleKey: "charts.pointsAllTitle", points: 0 }, -] as const; - -export type ChartRangePreset = (typeof CHART_RANGE_PRESETS)[number]; diff --git a/src/lib/medications/side-effects/validators.ts b/src/lib/medications/side-effects/validators.ts index 279ce0393..234968067 100644 --- a/src/lib/medications/side-effects/validators.ts +++ b/src/lib/medications/side-effects/validators.ts @@ -73,5 +73,3 @@ export const listSideEffectsSchema = z.object({ limit: z.coerce.number().int().min(1).max(200).optional().default(50), }); -export type CreateSideEffectInput = z.infer; -export type ListSideEffectsInput = z.infer; diff --git a/src/lib/notifications/types.ts b/src/lib/notifications/types.ts index 4b0bc9676..158d62302 100644 --- a/src/lib/notifications/types.ts +++ b/src/lib/notifications/types.ts @@ -71,22 +71,6 @@ export interface NtfyChannelConfig { authToken?: string; } -export type WebPushChannelConfig = Record; - -/** - * APNs channel config is empty by design — the per-device APNs token + - * environment live on the `Device` model, not on the channel row. The - * channel row exists so per-event preference toggles in - * `NotificationPreference` apply uniformly across all four channels. - */ -export type ApnsChannelConfig = Record; - -export type ChannelConfig = - | TelegramChannelConfig - | NtfyChannelConfig - | WebPushChannelConfig - | ApnsChannelConfig; - // ── Notification payload ── export interface NotificationPayload { diff --git a/src/lib/queries/use-analytics-query.ts b/src/lib/queries/use-analytics-query.ts index 80c6f902d..f0bcd6d61 100644 --- a/src/lib/queries/use-analytics-query.ts +++ b/src/lib/queries/use-analytics-query.ts @@ -5,7 +5,6 @@ import { useQuery, type UseQueryResult } from "@tanstack/react-query"; import { useAuth } from "@/hooks/use-auth"; import { queryKeys } from "@/lib/query-keys"; import type { DataSummary } from "@/lib/analytics/trends"; -import type { SubPageAnalyticsData } from "@/types/analytics"; /** * v1.4.33 IW2 — single TanStack-Query wrapper for `/api/analytics`. @@ -39,15 +38,6 @@ import type { SubPageAnalyticsData } from "@/types/analytics"; * stubbed on the slim path per the IW1 follow-up. */ -/** - * Strict structural subset shared between the slim slice and the thick - * default payload. Consumers that only read `summaries` should type - * the hook return as `AnalyticsSlicePayload` (or import - * `SubPageAnalyticsData` directly — same shape, kept aliased for - * call-site clarity). - */ -export type AnalyticsSlicePayload = SubPageAnalyticsData; - /** * Discriminator for the server-side slice. `undefined` (the default) * routes onto the thick payload; `"summaries"` routes onto IW1's diff --git a/src/lib/withings/webhook-handler.ts b/src/lib/withings/webhook-handler.ts index 16f645d69..dd77e1d32 100644 --- a/src/lib/withings/webhook-handler.ts +++ b/src/lib/withings/webhook-handler.ts @@ -43,10 +43,6 @@ const WITHINGS_SLEEP_APPLI = 44; const WITHINGS_ACTIVITY_QUEUE = "withings-activity-sync"; const WITHINGS_SLEEP_QUEUE = "withings-sleep-sync"; -export type WithingsWebhookAuthOutcome = - | { ok: true } - | { ok: false; reason: "missing_secret" | "mismatch" | "not_configured" }; - /** * Constant-time comparison helper. Returns false unless both inputs have * the same byte length AND match exactly.