/*!
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project.
 */ import { columnType, DataType } from '@essex/arquero';
import { useMemo } from 'react';
export function useColumnsMetadata(table, filter) {
    return useMemo(()=>{
        const columns = table?.columnNames(filter) || [];
        const result = columns.map((col)=>{
            const type = !table || !col ? DataType.Unknown : columnType(table, col);
            return {
                columnName: col,
                type: type
            };
        });
        return result;
    }, [
        table,
        filter
    ]);
}
