import type { ACSExportOptions, CustomWorkspaces, ExportPreferences, ExportSettings, MoleculeView, MultipleSpectraAnalysisPreferences, NMRiumPanelPreferences, PanelPreferencesType, PanelsPreferences, PrintPageOptions, WorkSpaceSource, Workspace } from '@zakodium/nmrium-core'; import type { Reducer } from 'react'; import type { SplitPaneSize } from 'react-science/ui'; import type { NMRiumPreferences, NMRiumWorkspace } from '../../main/index.js'; import type { ActionType } from '../types/ActionType.js'; import type { MatrixGenerationActions } from './actions/matrixGeneration.js'; export declare const WORKSPACES_KEYS: { componentKey: string; nmriumKey: string; }; export interface Settings { version: number; workspaces: Record; currentWorkspace: NMRiumWorkspace; } type InitPreferencesAction = ActionType<'INIT_PREFERENCES', { preferences: NMRiumPreferences | undefined; display?: NMRiumPreferences; workspace: NMRiumWorkspace | undefined; customWorkspaces: CustomWorkspaces | undefined; currentWorkspace: Settings['currentWorkspace'] | undefined; }>; type SetPreferencesAction = ActionType<'SET_PREFERENCES', Partial> | ActionType<'SET_PREFERENCES'>; export type SetPanelsPreferencesAction = ActionType<'SET_PANELS_PREFERENCES', { key: keyof PanelsPreferences; value: any; }>; export type SetWorkspaceAction = ActionType<'SET_WORKSPACE', { workspaceSource: 'any'; workspace: string; } | { workspaceSource: 'nmriumFile'; data: Workspace; }>; export type WorkspaceAction = ActionType<'REMOVE_WORKSPACE' | 'SET_ACTIVE_WORKSPACE', { workspace: string; }>; export type AddWorkspaceAction = ActionType<'ADD_WORKSPACE', { workspaceKey: string; data?: Omit; }>; export type ApplyGeneralPreferences = ActionType<'APPLY_GENERAL_PREFERENCES', { data: WorkspaceWithSource; }>; export type AnalyzeSpectraAction = ActionType<'ANALYZE_SPECTRA', { start: number; end: number; nucleus: string; columnKey?: string; }>; export type CutSpectraAnalysisAction = ActionType<'CUT_SPECTRA_ANALYSIS', { x: number; nucleus: string; }>; export type ChangeAnalysisColumnValueKeyAction = ActionType<'CHANGE_ANALYSIS_COLUMN_VALUE_KEY', { columnKey: string; valueKey: string; nucleus: string; }>; export type DeleteAnalysisColumn = ActionType<'DELETE_ANALYSIS_COLUMN', { columnKey: string; nucleus: string; }>; export type SetSpectraAnalysisPanelPreferencesAction = ActionType<'SET_SPECTRA_ANALYSIS_PREFERENCES', { nucleus: string; data: MultipleSpectraAnalysisPreferences; }>; export type SetVerticalSplitterPositionAction = ActionType<'SET_VERTICAL_SPLITTER_POSITION', { value: SplitPaneSize; }>; export type ChangeInformationBlockPosition = ActionType<'CHANGE_INFORMATION_BLOCK_POSITION', { coordination: { x: number; y: number; }; }>; export type ToggleInformationBlock = ActionType<'TOGGLE_INFORMATION_BLOCK', { visible?: boolean; }>; export type ChangePrintPageSettingsAction = ActionType<'CHANGE_PRINT_PAGE_SETTINGS', PrintPageOptions>; export type ChangeExportSettingsAction = ActionType<'CHANGE_EXPORT_SETTINGS', { key: keyof ExportPreferences; options: ExportSettings; }>; export type ChangeExportACSSettingsAction = ActionType<'CHANGE_EXPORT_ACS_SETTINGS', { options: ACSExportOptions; nucleus: string; }>; export type ChangePeaksLabelPositionAction = ActionType<'CHANGE_PEAKS_LABEL_POSITION', { marginTop: number; }>; export type TogglePanelAction = ActionType<'TOGGLE_PANEL', { id: keyof NMRiumPanelPreferences; options: Partial; }>; export type ChangeDefaultMoleculeSettingsAction = ActionType<'CHANGE_DEFAULT_MOLECULE_SETTINGS', MoleculeView>; export type ToggleSplitPanelAction = ActionType<'TOGGLE_SPLIT_PANEL', { isOpen?: boolean; }>; export type PreferencesActions = InitPreferencesAction | SetPreferencesAction | SetPanelsPreferencesAction | SetWorkspaceAction | WorkspaceAction | AddWorkspaceAction | ApplyGeneralPreferences | AnalyzeSpectraAction | ChangeAnalysisColumnValueKeyAction | DeleteAnalysisColumn | SetSpectraAnalysisPanelPreferencesAction | MatrixGenerationActions | SetVerticalSplitterPositionAction | ChangeInformationBlockPosition | ToggleInformationBlock | ChangePrintPageSettingsAction | ChangeExportSettingsAction | ChangePeaksLabelPositionAction | TogglePanelAction | ChangeExportACSSettingsAction | ChangeDefaultMoleculeSettingsAction | CutSpectraAnalysisAction | ToggleSplitPanelAction; export type WorkspaceWithSource = Workspace & { source: WorkSpaceSource; }; type WorkspacesWithSource = Record; export interface PreferencesState { version: number; workspaces: WorkspacesWithSource; originalWorkspaces: WorkspacesWithSource; workspace: { current: NMRiumWorkspace; base: NMRiumWorkspace | null; }; } export declare const preferencesInitialState: PreferencesState; export declare function readSettings(): Settings; export declare function updateSettings(settings: Settings): void; export declare function initPreferencesState(state: PreferencesState): PreferencesState; declare const preferencesReducer: Reducer; export default preferencesReducer; //# sourceMappingURL=preferencesReducer.d.ts.map