import type { ArrayShape, ArrayValue, AxisMapping, ComplexType, Dataset, NumArray, NumArrayDataset, NumericType, ScalarShape, ScaleType, StringType, } from '@h5web/shared'; export type NxAttribute = | 'NX_class' | 'signal' | 'interpretation' | 'axes' | 'default' | 'long_name' | 'units' | 'SILX_style' | 'auxiliary_signals'; export interface DatasetInfo { label: string; unit: string | undefined; } interface DatasetDef< T extends NumericType | ComplexType = NumericType | ComplexType > extends DatasetInfo { dataset: Dataset; } type WithError = T & { errorDataset?: NumArrayDataset; }; export type AuxDef = WithError>; export type AxisDef = DatasetDef; export interface SilxStyle { signalScaleType?: ScaleType; axisScaleTypes?: AxisMapping; } export interface NxData< T extends NumericType | ComplexType = NumericType | ComplexType > { titleDataset?: Dataset; signalDef: WithError>; auxDefs: AuxDef[]; axisDefs: AxisMapping; silxStyle: SilxStyle; } export interface NxValues { title: string; signal: ArrayValue; errors?: NumArray; auxValues: NumArray[]; auxErrors: (NumArray | undefined)[]; axisValues: AxisMapping; }