import type { z } from 'zod'; import type { ReferencePath } from '#src/references/types.js'; /** * Describes an item in a discriminated union array whose discriminator value * no longer matches any branch in the schema. * * This happens when a plugin that contributed a union branch is disabled — * the branch is removed from the schema but the data still contains items * with that discriminator value. */ export interface OrphanedUnionItem { /** Absolute path to the orphaned item in the data tree. */ readonly path: ReferencePath; /** The discriminator field name (e.g., 'type'). */ readonly discriminator: string; /** The discriminator value that has no matching schema branch (e.g., 'file'). */ readonly discriminatorValue: string; } /** * Walks raw data against a Zod schema and collects items in discriminated * unions whose discriminator value no longer matches any schema branch. * * This is used to detect orphaned items before `schema.parse()` is called, * which would otherwise silently strip or reject the data. * * Uses `walkDataWithSchema` with a visitor that checks each discriminated * union node for unmatched discriminator values. */ export declare function findOrphanedUnionItems(schema: z.ZodType, data: unknown): OrphanedUnionItem[]; //# sourceMappingURL=find-orphaned-union-items.d.ts.map