"use client"; import { UseTableStructureHook, UseTableStructureHookParams, UseTableStructureHookReturn } from "./types"; import { ModuleWithPermissions } from "../permissions"; import { tableGeneratorRegistry } from "./TableGeneratorRegistry"; export function registerTableGenerator( type: string | ModuleWithPermissions, hook: UseTableStructureHook, ): void { const name = typeof type === "string" ? type : type.name; tableGeneratorRegistry.register(name, hook); } export function useTableGenerator( type: ModuleWithPermissions, params: UseTableStructureHookParams, ): UseTableStructureHookReturn { return tableGeneratorRegistry.get(type.name, params); }