react-table-mapping
Version:
33 lines • 1.57 kB
TypeScript
import { FieldItem, FieldItemInput, Mapping, TableMappingStateWithAction } from '../types/table-mapping';
interface UseTableMappingProps {
sources: FieldItemInput[];
targets: FieldItemInput[];
mappings: Mapping[];
onStateChange: (stateWithAction: TableMappingStateWithAction) => void;
}
declare const useTableMapping: ({ sources: sourcesFromProps, targets: targetsFromProps, mappings: mappingsFromProps, onStateChange, }: UseTableMappingProps) => {
sourceFields: FieldItem[];
targetFields: FieldItem[];
mappings: Mapping[];
redrawCount: number;
redraw: () => void;
getSourceFields: () => FieldItem[];
getTargetFields: () => FieldItem[];
getMappings: () => Mapping[];
appendSource: (source: FieldItem) => void;
removeSource: (sourceId: string) => void;
updateSourceFields: (newSourceFields: FieldItem[]) => void;
updateSourceFieldValue: (sourceId: string, fieldKey: string, newValue: string) => void;
appendTarget: (target: FieldItem) => void;
removeTarget: (targetId: string) => void;
updateTargetFields: (newTargetFields: FieldItem[]) => void;
updateTargetFieldValue: (targetId: string, fieldKey: string, newValue: string) => void;
addMapping: (sourceId: string, targetId: string) => void;
removeMapping: (mappingId: string) => void;
clearMappings: () => void;
updateMappings: (newMappings: Mapping[]) => void;
sameLineMapping: () => void;
sameNameMapping: (name: string) => void;
};
export default useTableMapping;
//# sourceMappingURL=useTableMapping.d.ts.map