import { z } from 'zod';
declare const dynamicReportNodeData: z.ZodObject<{
    nodeType: z.ZodEnum<{
        "synthetic-branch": "synthetic-branch";
        "sort-code-branch": "sort-code-branch";
        "financial-entity": "financial-entity";
    }>;
    isOpen: z.ZodBoolean;
    hebrewText: z.ZodOptional<z.ZodString>;
}, z.core.$strict>;
declare const dynamicReportNode: z.ZodObject<{
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    parent: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    text: z.ZodString;
    droppable: z.ZodBoolean;
    data: z.ZodObject<{
        nodeType: z.ZodEnum<{
            "synthetic-branch": "synthetic-branch";
            "sort-code-branch": "sort-code-branch";
            "financial-entity": "financial-entity";
        }>;
        isOpen: z.ZodBoolean;
        hebrewText: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>;
}, z.core.$strict>;
export declare const dynamicReportTemplate: z.ZodArray<z.ZodObject<{
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    parent: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    text: z.ZodString;
    droppable: z.ZodBoolean;
    data: z.ZodObject<{
        nodeType: z.ZodEnum<{
            "synthetic-branch": "synthetic-branch";
            "sort-code-branch": "sort-code-branch";
            "financial-entity": "financial-entity";
        }>;
        isOpen: z.ZodBoolean;
        hebrewText: z.ZodOptional<z.ZodString>;
    }, z.core.$strict>;
}, z.core.$strict>>;
export type DynamicReportNodeType = z.infer<typeof dynamicReportNode>;
export type DynamicReportNodeDataType = z.infer<typeof dynamicReportNodeData>;
export declare function parseTemplate(raw: string): {
    id: string | number;
    parent: string | number;
    text: string;
    droppable: boolean;
    data: {
        nodeType: "synthetic-branch" | "sort-code-branch" | "financial-entity";
        isOpen: boolean;
        hebrewText?: string | undefined;
    };
}[];
export declare function validateTemplate(raw: string): boolean;
declare const legacyDynamicReportNode: z.ZodObject<{
    id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    parent: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
    text: z.ZodString;
    droppable: z.ZodBoolean;
    data: z.ZodObject<{
        descendantSortCodes: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodNull]>>;
        descendantFinancialEntities: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodNull]>>;
        mergedSortCodes: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodNull]>>;
        sortCode: z.ZodOptional<z.ZodNumber>;
        isOpen: z.ZodBoolean;
        hebrewText: z.ZodOptional<z.ZodString>;
    }, z.core.$loose>;
}, z.core.$loose>;
type LegacyDynamicReportNode = z.infer<typeof legacyDynamicReportNode>;
/**
 * Returns true when the raw parsed node array contains at least one node
 * whose `data` object has a `descendantSortCodes` key — the hallmark of the
 * old implicit-membership format.
 */
export declare function isLegacyTemplate(nodes: unknown[]): boolean;
/**
 * Converts a legacy template (implicit-membership format) to the new
 * explicit-leaf format given the set of live financial entity IDs that belong
 * to each sort code.
 *
 * @param nodes            Parsed legacy node array (validated against the old schema)
 * @param entityBySortCode Map<sortCodeId, string[]> — entity UUIDs that belong to that sort code
 * @returns                Node array in the new explicit format (no hint arrays, explicit leaf nodes)
 */
export declare function migrateLegacyTemplate(nodes: LegacyDynamicReportNode[], entityBySortCode: Map<string | number, string[]>): DynamicReportNodeType[];
export {};
