react-cheminfo 0.69.0 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -2
- package/lib/about/core/providers.d.ts +6 -0
- package/lib/about/core/providers.d.ts.map +1 -1
- package/lib/about/core/providers.js +7 -0
- package/lib/about/core/providers.js.map +1 -1
- package/lib/about/ui/AboutProvidedBy.js +34 -0
- package/lib/about/ui/AboutProvidedBy.js.map +1 -1
- package/lib/chart/ui/useChartPointer.d.ts +9 -1
- package/lib/chart/ui/useChartPointer.d.ts.map +1 -1
- package/lib/chart/ui/useChartPointer.js +11 -3
- package/lib/chart/ui/useChartPointer.js.map +1 -1
- package/lib/credits/core/credits.d.ts +41 -0
- package/lib/credits/core/credits.d.ts.map +1 -1
- package/lib/credits/core/credits.js +50 -0
- package/lib/credits/core/credits.js.map +1 -1
- package/lib/download/core/drawingMarkup.d.ts +8 -1
- package/lib/download/core/drawingMarkup.d.ts.map +1 -1
- package/lib/download/core/drawingMarkup.js +13 -1
- package/lib/download/core/drawingMarkup.js.map +1 -1
- package/lib/download/core/figurePng.d.ts +14 -0
- package/lib/download/core/figurePng.d.ts.map +1 -1
- package/lib/download/core/figurePng.js +21 -6
- package/lib/download/core/figurePng.js.map +1 -1
- package/lib/download/core/figureSvg.d.ts.map +1 -1
- package/lib/download/core/figureSvg.js +5 -3
- package/lib/download/core/figureSvg.js.map +1 -1
- package/lib/download/core/figureTarget.d.ts +13 -0
- package/lib/download/core/figureTarget.d.ts.map +1 -1
- package/lib/download/core/figureTarget.js +25 -5
- package/lib/download/core/figureTarget.js.map +1 -1
- package/lib/download/core/svgBounds.d.ts +15 -0
- package/lib/download/core/svgBounds.d.ts.map +1 -1
- package/lib/download/core/svgBounds.js +20 -0
- package/lib/download/core/svgBounds.js.map +1 -1
- package/lib/download/core/svgToPng.d.ts.map +1 -1
- package/lib/download/core/svgToPng.js +4 -2
- package/lib/download/core/svgToPng.js.map +1 -1
- package/lib/format/core/relativeTime.d.ts +8 -3
- package/lib/format/core/relativeTime.d.ts.map +1 -1
- package/lib/format/core/relativeTime.js +19 -7
- package/lib/format/core/relativeTime.js.map +1 -1
- package/lib/host/core/connectHost.d.ts +25 -34
- package/lib/host/core/connectHost.d.ts.map +1 -1
- package/lib/host/core/connectHost.js +43 -89
- package/lib/host/core/connectHost.js.map +1 -1
- package/lib/host/core/hostOutputs.d.ts +58 -0
- package/lib/host/core/hostOutputs.d.ts.map +1 -0
- package/lib/host/core/hostOutputs.js +151 -0
- package/lib/host/core/hostOutputs.js.map +1 -0
- package/lib/host/core/index.d.ts +9 -3
- package/lib/host/core/index.d.ts.map +1 -1
- package/lib/host/core/index.js +4 -1
- package/lib/host/core/index.js.map +1 -1
- package/lib/host/core/irKinds.d.ts +124 -0
- package/lib/host/core/irKinds.d.ts.map +1 -0
- package/lib/host/core/irKinds.js +46 -0
- package/lib/host/core/irKinds.js.map +1 -0
- package/lib/host/core/kinds.d.ts +13 -5
- package/lib/host/core/kinds.d.ts.map +1 -1
- package/lib/host/core/kinds.js +11 -5
- package/lib/host/core/kinds.js.map +1 -1
- package/lib/host/core/protocol.d.ts +50 -7
- package/lib/host/core/protocol.d.ts.map +1 -1
- package/lib/host/core/protocol.js +10 -6
- package/lib/host/core/protocol.js.map +1 -1
- package/lib/host/core/selectInputs.d.ts +37 -0
- package/lib/host/core/selectInputs.d.ts.map +1 -0
- package/lib/host/core/selectInputs.js +110 -0
- package/lib/host/core/selectInputs.js.map +1 -0
- package/lib/host/testing/sciPeaks.d.ts +31 -0
- package/lib/host/testing/sciPeaks.d.ts.map +1 -1
- package/lib/host/testing/sciPeaks.js +73 -0
- package/lib/host/testing/sciPeaks.js.map +1 -1
- package/lib/host/testing/standInHost.d.ts +9 -1
- package/lib/host/testing/standInHost.d.ts.map +1 -1
- package/lib/host/testing/standInHost.js +19 -1
- package/lib/host/testing/standInHost.js.map +1 -1
- package/lib/host/ui/useHostConnection.d.ts +13 -5
- package/lib/host/ui/useHostConnection.d.ts.map +1 -1
- package/lib/host/ui/useHostConnection.js +4 -3
- package/lib/host/ui/useHostConnection.js.map +1 -1
- package/lib/host-testing.d.ts +2 -2
- package/lib/host-testing.d.ts.map +1 -1
- package/lib/host-testing.js +2 -2
- package/lib/host-testing.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/ir/core/handPicking.d.ts +58 -0
- package/lib/ir/core/handPicking.d.ts.map +1 -0
- package/lib/ir/core/handPicking.js +130 -0
- package/lib/ir/core/handPicking.js.map +1 -0
- package/lib/ir/core/index.d.ts +3 -0
- package/lib/ir/core/index.d.ts.map +1 -1
- package/lib/ir/core/index.js +3 -0
- package/lib/ir/core/index.js.map +1 -1
- package/lib/ir/core/irBandState.d.ts +57 -0
- package/lib/ir/core/irBandState.d.ts.map +1 -0
- package/lib/ir/core/irBandState.js +119 -0
- package/lib/ir/core/irBandState.js.map +1 -0
- package/lib/ir/core/irCommands.d.ts +11 -0
- package/lib/ir/core/irCommands.d.ts.map +1 -1
- package/lib/ir/core/irCommands.js +6 -0
- package/lib/ir/core/irCommands.js.map +1 -1
- package/lib/ir/core/irPeaks.d.ts +28 -0
- package/lib/ir/core/irPeaks.d.ts.map +1 -0
- package/lib/ir/core/irPeaks.js +66 -0
- package/lib/ir/core/irPeaks.js.map +1 -0
- package/lib/ir/core/irReducer.d.ts +8 -0
- package/lib/ir/core/irReducer.d.ts.map +1 -1
- package/lib/ir/core/irReducer.js +15 -32
- package/lib/ir/core/irReducer.js.map +1 -1
- package/lib/ir/core/irSpectrum.d.ts +15 -0
- package/lib/ir/core/irSpectrum.d.ts.map +1 -1
- package/lib/ir/core/irSpectrum.js.map +1 -1
- package/lib/ir/core/irState.d.ts +9 -6
- package/lib/ir/core/irState.d.ts.map +1 -1
- package/lib/ir/core/irState.js +10 -6
- package/lib/ir/core/irState.js.map +1 -1
- package/lib/ir/core/pickBands.d.ts +14 -0
- package/lib/ir/core/pickBands.d.ts.map +1 -1
- package/lib/ir/core/pickBands.js +39 -33
- package/lib/ir/core/pickBands.js.map +1 -1
- package/lib/ir/core/ramanBands.d.ts +9 -1
- package/lib/ir/core/ramanBands.d.ts.map +1 -1
- package/lib/ir/core/ramanBands.js +2 -2
- package/lib/ir/core/ramanBands.js.map +1 -1
- package/lib/ir/core/spectrumBands.d.ts +46 -0
- package/lib/ir/core/spectrumBands.d.ts.map +1 -0
- package/lib/ir/core/spectrumBands.js +98 -0
- package/lib/ir/core/spectrumBands.js.map +1 -0
- package/lib/ir/ui/BandRow.d.ts +5 -0
- package/lib/ir/ui/BandRow.d.ts.map +1 -1
- package/lib/ir/ui/BandRow.js +4 -3
- package/lib/ir/ui/BandRow.js.map +1 -1
- package/lib/ir/ui/BandsPanel.d.ts +5 -0
- package/lib/ir/ui/BandsPanel.d.ts.map +1 -1
- package/lib/ir/ui/BandsPanel.js +36 -16
- package/lib/ir/ui/BandsPanel.js.map +1 -1
- package/lib/ir/ui/BandsToolbar.d.ts +9 -0
- package/lib/ir/ui/BandsToolbar.d.ts.map +1 -0
- package/lib/ir/ui/BandsToolbar.js +61 -0
- package/lib/ir/ui/BandsToolbar.js.map +1 -0
- package/lib/ir/ui/IrCanvas.d.ts +2 -1
- package/lib/ir/ui/IrCanvas.d.ts.map +1 -1
- package/lib/ir/ui/IrCanvas.js +19 -5
- package/lib/ir/ui/IrCanvas.js.map +1 -1
- package/lib/ir/ui/IrChart.d.ts.map +1 -1
- package/lib/ir/ui/IrChart.js +8 -1
- package/lib/ir/ui/IrChart.js.map +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js +1 -1
- package/lib/ir/ui/IrDocumentationDialog.js.map +1 -1
- package/lib/ir/ui/IrEditor.d.ts +4 -2
- package/lib/ir/ui/IrEditor.d.ts.map +1 -1
- package/lib/ir/ui/IrEditor.js.map +1 -1
- package/lib/ir/ui/IrShell.d.ts.map +1 -1
- package/lib/ir/ui/IrShell.js +6 -0
- package/lib/ir/ui/IrShell.js.map +1 -1
- package/lib/ir/ui/IrStatusBar.d.ts.map +1 -1
- package/lib/ir/ui/IrStatusBar.js +1 -1
- package/lib/ir/ui/IrStatusBar.js.map +1 -1
- package/lib/ir/ui/IrToolbar.d.ts +4 -3
- package/lib/ir/ui/IrToolbar.d.ts.map +1 -1
- package/lib/ir/ui/IrToolbar.js +5 -4
- package/lib/ir/ui/IrToolbar.js.map +1 -1
- package/lib/ir/ui/VibrationalEditor.d.ts +2 -1
- package/lib/ir/ui/VibrationalEditor.d.ts.map +1 -1
- package/lib/ir/ui/VibrationalEditor.js.map +1 -1
- package/lib/ir/ui/irActions.d.ts +5 -0
- package/lib/ir/ui/irActions.d.ts.map +1 -1
- package/lib/ir/ui/irActions.js +6 -0
- package/lib/ir/ui/irActions.js.map +1 -1
- package/lib/ir/ui/irChartProps.d.ts +4 -1
- package/lib/ir/ui/irChartProps.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.d.ts +5 -11
- package/lib/ir/ui/useIrEditor.d.ts.map +1 -1
- package/lib/ir/ui/useIrEditor.js +17 -18
- package/lib/ir/ui/useIrEditor.js.map +1 -1
- package/lib/locales/de.json +63 -0
- package/lib/locales/en.json +63 -0
- package/lib/locales/es.json +63 -0
- package/lib/locales/fr.json +63 -0
- package/lib/locales/it.json +63 -0
- package/lib/mass/core/analyseSpectrum.d.ts +85 -0
- package/lib/mass/core/analyseSpectrum.d.ts.map +1 -0
- package/lib/mass/core/analyseSpectrum.js +101 -0
- package/lib/mass/core/analyseSpectrum.js.map +1 -0
- package/lib/mass/core/ascendingTrace.d.ts +24 -0
- package/lib/mass/core/ascendingTrace.d.ts.map +1 -0
- package/lib/mass/core/ascendingTrace.js +57 -0
- package/lib/mass/core/ascendingTrace.js.map +1 -0
- package/lib/mass/core/centroidPeaks.d.ts +77 -0
- package/lib/mass/core/centroidPeaks.d.ts.map +1 -0
- package/lib/mass/core/centroidPeaks.js +62 -0
- package/lib/mass/core/centroidPeaks.js.map +1 -0
- package/lib/mass/core/detectMassFormat.d.ts +24 -0
- package/lib/mass/core/detectMassFormat.d.ts.map +1 -0
- package/lib/mass/core/detectMassFormat.js +105 -0
- package/lib/mass/core/detectMassFormat.js.map +1 -0
- package/lib/mass/core/downloadSpectra.d.ts +24 -0
- package/lib/mass/core/downloadSpectra.d.ts.map +1 -0
- package/lib/mass/core/downloadSpectra.js +35 -0
- package/lib/mass/core/downloadSpectra.js.map +1 -0
- package/lib/mass/core/fromJcamp.d.ts +46 -0
- package/lib/mass/core/fromJcamp.d.ts.map +1 -0
- package/lib/mass/core/fromJcamp.js +123 -0
- package/lib/mass/core/fromJcamp.js.map +1 -0
- package/lib/mass/core/fromText.d.ts +30 -0
- package/lib/mass/core/fromText.d.ts.map +1 -0
- package/lib/mass/core/fromText.js +39 -0
- package/lib/mass/core/fromText.js.map +1 -0
- package/lib/mass/core/index.d.ts +70 -0
- package/lib/mass/core/index.d.ts.map +1 -0
- package/lib/mass/core/index.js +42 -0
- package/lib/mass/core/index.js.map +1 -0
- package/lib/mass/core/jcampTechnique.d.ts +38 -0
- package/lib/mass/core/jcampTechnique.d.ts.map +1 -0
- package/lib/mass/core/jcampTechnique.js +70 -0
- package/lib/mass/core/jcampTechnique.js.map +1 -0
- package/lib/mass/core/labelStackBox.d.ts +49 -0
- package/lib/mass/core/labelStackBox.d.ts.map +1 -0
- package/lib/mass/core/labelStackBox.js +44 -0
- package/lib/mass/core/labelStackBox.js.map +1 -0
- package/lib/mass/core/labelledPeaks.d.ts +79 -0
- package/lib/mass/core/labelledPeaks.d.ts.map +1 -0
- package/lib/mass/core/labelledPeaks.js +74 -0
- package/lib/mass/core/labelledPeaks.js.map +1 -0
- package/lib/mass/core/loadMassSpectra.d.ts +57 -0
- package/lib/mass/core/loadMassSpectra.d.ts.map +1 -0
- package/lib/mass/core/loadMassSpectra.js +45 -0
- package/lib/mass/core/loadMassSpectra.js.map +1 -0
- package/lib/mass/core/loadedMassSpectrum.d.ts +42 -0
- package/lib/mass/core/loadedMassSpectrum.d.ts.map +1 -0
- package/lib/mass/core/loadedMassSpectrum.js +15 -0
- package/lib/mass/core/loadedMassSpectrum.js.map +1 -0
- package/lib/mass/core/massCommands.d.ts +170 -0
- package/lib/mass/core/massCommands.d.ts.map +1 -0
- package/lib/mass/core/massCommands.js +95 -0
- package/lib/mass/core/massCommands.js.map +1 -0
- package/lib/mass/core/massDomain.d.ts +121 -0
- package/lib/mass/core/massDomain.d.ts.map +1 -0
- package/lib/mass/core/massDomain.js +179 -0
- package/lib/mass/core/massDomain.js.map +1 -0
- package/lib/mass/core/massEditorApi.d.ts +65 -0
- package/lib/mass/core/massEditorApi.d.ts.map +1 -0
- package/lib/mass/core/massEditorApi.js +10 -0
- package/lib/mass/core/massEditorApi.js.map +1 -0
- package/lib/mass/core/massFormat.d.ts +78 -0
- package/lib/mass/core/massFormat.d.ts.map +1 -0
- package/lib/mass/core/massFormat.js +168 -0
- package/lib/mass/core/massFormat.js.map +1 -0
- package/lib/mass/core/massMeta.d.ts +85 -0
- package/lib/mass/core/massMeta.d.ts.map +1 -0
- package/lib/mass/core/massMeta.js +182 -0
- package/lib/mass/core/massMeta.js.map +1 -0
- package/lib/mass/core/massReducer.d.ts +82 -0
- package/lib/mass/core/massReducer.d.ts.map +1 -0
- package/lib/mass/core/massReducer.js +163 -0
- package/lib/mass/core/massReducer.js.map +1 -0
- package/lib/mass/core/massResolution.d.ts +92 -0
- package/lib/mass/core/massResolution.d.ts.map +1 -0
- package/lib/mass/core/massResolution.js +126 -0
- package/lib/mass/core/massResolution.js.map +1 -0
- package/lib/mass/core/massSidePanels.d.ts +28 -0
- package/lib/mass/core/massSidePanels.d.ts.map +1 -0
- package/lib/mass/core/massSidePanels.js +12 -0
- package/lib/mass/core/massSidePanels.js.map +1 -0
- package/lib/mass/core/massSpectrum.d.ts +206 -0
- package/lib/mass/core/massSpectrum.d.ts.map +1 -0
- package/lib/mass/core/massSpectrum.js +41 -0
- package/lib/mass/core/massSpectrum.js.map +1 -0
- package/lib/mass/core/massState.d.ts +145 -0
- package/lib/mass/core/massState.d.ts.map +1 -0
- package/lib/mass/core/massState.js +102 -0
- package/lib/mass/core/massState.js.map +1 -0
- package/lib/mass/core/massStateEdits.d.ts +51 -0
- package/lib/mass/core/massStateEdits.d.ts.map +1 -0
- package/lib/mass/core/massStateEdits.js +90 -0
- package/lib/mass/core/massStateEdits.js.map +1 -0
- package/lib/mass/core/massSummary.d.ts +77 -0
- package/lib/mass/core/massSummary.d.ts.map +1 -0
- package/lib/mass/core/massSummary.js +174 -0
- package/lib/mass/core/massSummary.js.map +1 -0
- package/lib/mass/core/mzDecimalsSetting.d.ts +36 -0
- package/lib/mass/core/mzDecimalsSetting.d.ts.map +1 -0
- package/lib/mass/core/mzDecimalsSetting.js +42 -0
- package/lib/mass/core/mzDecimalsSetting.js.map +1 -0
- package/lib/mass/core/nearestPeak.d.ts +75 -0
- package/lib/mass/core/nearestPeak.d.ts.map +1 -0
- package/lib/mass/core/nearestPeak.js +99 -0
- package/lib/mass/core/nearestPeak.js.map +1 -0
- package/lib/mass/core/peakLabelLines.d.ts +77 -0
- package/lib/mass/core/peakLabelLines.d.ts.map +1 -0
- package/lib/mass/core/peakLabelLines.js +54 -0
- package/lib/mass/core/peakLabelLines.js.map +1 -0
- package/lib/mass/core/peakLabelPlan.d.ts +109 -0
- package/lib/mass/core/peakLabelPlan.d.ts.map +1 -0
- package/lib/mass/core/peakLabelPlan.js +143 -0
- package/lib/mass/core/peakLabelPlan.js.map +1 -0
- package/lib/mass/core/peakTable.d.ts +54 -0
- package/lib/mass/core/peakTable.d.ts.map +1 -0
- package/lib/mass/core/peakTable.js +53 -0
- package/lib/mass/core/peakTable.js.map +1 -0
- package/lib/mass/core/resolutionOf.d.ts +60 -0
- package/lib/mass/core/resolutionOf.d.ts.map +1 -0
- package/lib/mass/core/resolutionOf.js +84 -0
- package/lib/mass/core/resolutionOf.js.map +1 -0
- package/lib/mass/core/scanFilter.d.ts +25 -0
- package/lib/mass/core/scanFilter.d.ts.map +1 -0
- package/lib/mass/core/scanFilter.js +107 -0
- package/lib/mass/core/scanFilter.js.map +1 -0
- package/lib/mass/core/spectrumJcamp.d.ts +47 -0
- package/lib/mass/core/spectrumJcamp.d.ts.map +1 -0
- package/lib/mass/core/spectrumJcamp.js +167 -0
- package/lib/mass/core/spectrumJcamp.js.map +1 -0
- package/lib/mass/core/toMassSpectrum.d.ts +67 -0
- package/lib/mass/core/toMassSpectrum.d.ts.map +1 -0
- package/lib/mass/core/toMassSpectrum.js +78 -0
- package/lib/mass/core/toMassSpectrum.js.map +1 -0
- package/lib/mass/core/traceIcon.d.ts +82 -0
- package/lib/mass/core/traceIcon.d.ts.map +1 -0
- package/lib/mass/core/traceIcon.js +66 -0
- package/lib/mass/core/traceIcon.js.map +1 -0
- package/lib/mass/core/writtenResolution.d.ts +40 -0
- package/lib/mass/core/writtenResolution.d.ts.map +1 -0
- package/lib/mass/core/writtenResolution.js +77 -0
- package/lib/mass/core/writtenResolution.js.map +1 -0
- package/lib/mass/ui/MassAboutDialog.d.ts +16 -0
- package/lib/mass/ui/MassAboutDialog.d.ts.map +1 -0
- package/lib/mass/ui/MassAboutDialog.js +44 -0
- package/lib/mass/ui/MassAboutDialog.js.map +1 -0
- package/lib/mass/ui/MassCanvas.d.ts +46 -0
- package/lib/mass/ui/MassCanvas.d.ts.map +1 -0
- package/lib/mass/ui/MassCanvas.js +84 -0
- package/lib/mass/ui/MassCanvas.js.map +1 -0
- package/lib/mass/ui/MassChart.d.ts +21 -0
- package/lib/mass/ui/MassChart.d.ts.map +1 -0
- package/lib/mass/ui/MassChart.js +139 -0
- package/lib/mass/ui/MassChart.js.map +1 -0
- package/lib/mass/ui/MassCommandProvider.d.ts +15 -0
- package/lib/mass/ui/MassCommandProvider.d.ts.map +1 -0
- package/lib/mass/ui/MassCommandProvider.js +14 -0
- package/lib/mass/ui/MassCommandProvider.js.map +1 -0
- package/lib/mass/ui/MassCommandTooltip.d.ts +16 -0
- package/lib/mass/ui/MassCommandTooltip.d.ts.map +1 -0
- package/lib/mass/ui/MassCommandTooltip.js +22 -0
- package/lib/mass/ui/MassCommandTooltip.js.map +1 -0
- package/lib/mass/ui/MassDocumentationDialog.d.ts +18 -0
- package/lib/mass/ui/MassDocumentationDialog.d.ts.map +1 -0
- package/lib/mass/ui/MassDocumentationDialog.js +70 -0
- package/lib/mass/ui/MassDocumentationDialog.js.map +1 -0
- package/lib/mass/ui/MassEditor.d.ts +78 -0
- package/lib/mass/ui/MassEditor.d.ts.map +1 -0
- package/lib/mass/ui/MassEditor.js +42 -0
- package/lib/mass/ui/MassEditor.js.map +1 -0
- package/lib/mass/ui/MassHeader.d.ts +12 -0
- package/lib/mass/ui/MassHeader.d.ts.map +1 -0
- package/lib/mass/ui/MassHeader.js +20 -0
- package/lib/mass/ui/MassHeader.js.map +1 -0
- package/lib/mass/ui/MassLogo.d.ts +21 -0
- package/lib/mass/ui/MassLogo.d.ts.map +1 -0
- package/lib/mass/ui/MassLogo.js +36 -0
- package/lib/mass/ui/MassLogo.js.map +1 -0
- package/lib/mass/ui/MassPointerTracker.d.ts +44 -0
- package/lib/mass/ui/MassPointerTracker.d.ts.map +1 -0
- package/lib/mass/ui/MassPointerTracker.js +29 -0
- package/lib/mass/ui/MassPointerTracker.js.map +1 -0
- package/lib/mass/ui/MassShell.d.ts +29 -0
- package/lib/mass/ui/MassShell.d.ts.map +1 -0
- package/lib/mass/ui/MassShell.js +133 -0
- package/lib/mass/ui/MassShell.js.map +1 -0
- package/lib/mass/ui/MassSidePanel.d.ts +32 -0
- package/lib/mass/ui/MassSidePanel.d.ts.map +1 -0
- package/lib/mass/ui/MassSidePanel.js +44 -0
- package/lib/mass/ui/MassSidePanel.js.map +1 -0
- package/lib/mass/ui/MassStateProvider.d.ts +19 -0
- package/lib/mass/ui/MassStateProvider.d.ts.map +1 -0
- package/lib/mass/ui/MassStateProvider.js +16 -0
- package/lib/mass/ui/MassStateProvider.js.map +1 -0
- package/lib/mass/ui/MassStatusBar.d.ts +15 -0
- package/lib/mass/ui/MassStatusBar.d.ts.map +1 -0
- package/lib/mass/ui/MassStatusBar.js +50 -0
- package/lib/mass/ui/MassStatusBar.js.map +1 -0
- package/lib/mass/ui/MassToolbar.d.ts +24 -0
- package/lib/mass/ui/MassToolbar.d.ts.map +1 -0
- package/lib/mass/ui/MassToolbar.js +36 -0
- package/lib/mass/ui/MassToolbar.js.map +1 -0
- package/lib/mass/ui/MetadataPanel.d.ts +35 -0
- package/lib/mass/ui/MetadataPanel.d.ts.map +1 -0
- package/lib/mass/ui/MetadataPanel.js +100 -0
- package/lib/mass/ui/MetadataPanel.js.map +1 -0
- package/lib/mass/ui/MzDecimalsMenu.d.ts +28 -0
- package/lib/mass/ui/MzDecimalsMenu.d.ts.map +1 -0
- package/lib/mass/ui/MzDecimalsMenu.js +40 -0
- package/lib/mass/ui/MzDecimalsMenu.js.map +1 -0
- package/lib/mass/ui/PeakLabels.d.ts +93 -0
- package/lib/mass/ui/PeakLabels.d.ts.map +1 -0
- package/lib/mass/ui/PeakLabels.js +91 -0
- package/lib/mass/ui/PeakLabels.js.map +1 -0
- package/lib/mass/ui/PeakTable.d.ts +34 -0
- package/lib/mass/ui/PeakTable.d.ts.map +1 -0
- package/lib/mass/ui/PeakTable.js +49 -0
- package/lib/mass/ui/PeakTable.js.map +1 -0
- package/lib/mass/ui/PeaksPanel.d.ts +31 -0
- package/lib/mass/ui/PeaksPanel.d.ts.map +1 -0
- package/lib/mass/ui/PeaksPanel.js +53 -0
- package/lib/mass/ui/PeaksPanel.js.map +1 -0
- package/lib/mass/ui/SpectraPanel.d.ts +17 -0
- package/lib/mass/ui/SpectraPanel.d.ts.map +1 -0
- package/lib/mass/ui/SpectraPanel.js +76 -0
- package/lib/mass/ui/SpectraPanel.js.map +1 -0
- package/lib/mass/ui/SpectrumRow.d.ts +26 -0
- package/lib/mass/ui/SpectrumRow.d.ts.map +1 -0
- package/lib/mass/ui/SpectrumRow.js +141 -0
- package/lib/mass/ui/SpectrumRow.js.map +1 -0
- package/lib/mass/ui/SpectrumTrace.d.ts +46 -0
- package/lib/mass/ui/SpectrumTrace.d.ts.map +1 -0
- package/lib/mass/ui/SpectrumTrace.js +68 -0
- package/lib/mass/ui/SpectrumTrace.js.map +1 -0
- package/lib/mass/ui/index.d.ts +69 -0
- package/lib/mass/ui/index.d.ts.map +1 -0
- package/lib/mass/ui/index.js +42 -0
- package/lib/mass/ui/index.js.map +1 -0
- package/lib/mass/ui/massActions.d.ts +52 -0
- package/lib/mass/ui/massActions.d.ts.map +1 -0
- package/lib/mass/ui/massActions.js +62 -0
- package/lib/mass/ui/massActions.js.map +1 -0
- package/lib/mass/ui/massChartProps.d.ts +128 -0
- package/lib/mass/ui/massChartProps.d.ts.map +1 -0
- package/lib/mass/ui/massChartProps.js +14 -0
- package/lib/mass/ui/massChartProps.js.map +1 -0
- package/lib/mass/ui/massCommandContext.d.ts +36 -0
- package/lib/mass/ui/massCommandContext.d.ts.map +1 -0
- package/lib/mass/ui/massCommandContext.js +45 -0
- package/lib/mass/ui/massCommandContext.js.map +1 -0
- package/lib/mass/ui/massHostPanels.d.ts +48 -0
- package/lib/mass/ui/massHostPanels.d.ts.map +1 -0
- package/lib/mass/ui/massHostPanels.js +41 -0
- package/lib/mass/ui/massHostPanels.js.map +1 -0
- package/lib/mass/ui/massStateContext.d.ts +26 -0
- package/lib/mass/ui/massStateContext.d.ts.map +1 -0
- package/lib/mass/ui/massStateContext.js +37 -0
- package/lib/mass/ui/massStateContext.js.map +1 -0
- package/lib/mass/ui/useIntensityZoom.d.ts +20 -0
- package/lib/mass/ui/useIntensityZoom.d.ts.map +1 -0
- package/lib/mass/ui/useIntensityZoom.js +42 -0
- package/lib/mass/ui/useIntensityZoom.js.map +1 -0
- package/lib/mass/ui/useMassEditor.d.ts +52 -0
- package/lib/mass/ui/useMassEditor.d.ts.map +1 -0
- package/lib/mass/ui/useMassEditor.js +93 -0
- package/lib/mass/ui/useMassEditor.js.map +1 -0
- package/lib/mass/ui/useMassFiles.d.ts +22 -0
- package/lib/mass/ui/useMassFiles.d.ts.map +1 -0
- package/lib/mass/ui/useMassFiles.js +71 -0
- package/lib/mass/ui/useMassFiles.js.map +1 -0
- package/lib/mass/ui/useMassHandle.d.ts +15 -0
- package/lib/mass/ui/useMassHandle.d.ts.map +1 -0
- package/lib/mass/ui/useMassHandle.js +35 -0
- package/lib/mass/ui/useMassHandle.js.map +1 -0
- package/lib/mass/ui/useMassPointer.d.ts +70 -0
- package/lib/mass/ui/useMassPointer.d.ts.map +1 -0
- package/lib/mass/ui/useMassPointer.js +57 -0
- package/lib/mass/ui/useMassPointer.js.map +1 -0
- package/lib/mass/ui/useMassShortcuts.d.ts +21 -0
- package/lib/mass/ui/useMassShortcuts.d.ts.map +1 -0
- package/lib/mass/ui/useMassShortcuts.js +66 -0
- package/lib/mass/ui/useMassShortcuts.js.map +1 -0
- package/lib/mass/ui/useMassSide.d.ts +27 -0
- package/lib/mass/ui/useMassSide.d.ts.map +1 -0
- package/lib/mass/ui/useMassSide.js +45 -0
- package/lib/mass/ui/useMassSide.js.map +1 -0
- package/lib/mass/ui/useMassZoom.d.ts +92 -0
- package/lib/mass/ui/useMassZoom.d.ts.map +1 -0
- package/lib/mass/ui/useMassZoom.js +65 -0
- package/lib/mass/ui/useMassZoom.js.map +1 -0
- package/lib/mass.d.ts +16 -0
- package/lib/mass.d.ts.map +1 -0
- package/lib/mass.js +16 -0
- package/lib/mass.js.map +1 -0
- package/lib/panel/ui/PanelRail.d.ts.map +1 -1
- package/lib/panel/ui/PanelRail.js +6 -1
- package/lib/panel/ui/PanelRail.js.map +1 -1
- package/lib/slides/ui/slideSanitizeSchema.d.ts +3 -2
- package/lib/slides/ui/slideSanitizeSchema.d.ts.map +1 -1
- package/lib/slides/ui/slideSanitizeSchema.js +82 -2
- package/lib/slides/ui/slideSanitizeSchema.js.map +1 -1
- package/package.json +6 -1
- package/src/about/core/providers.ts +7 -0
- package/src/about/ui/AboutProvidedBy.tsx +49 -0
- package/src/chart/ui/useChartPointer.ts +18 -4
- package/src/credits/core/credits.ts +53 -0
- package/src/download/core/drawingMarkup.ts +18 -1
- package/src/download/core/figurePng.ts +21 -8
- package/src/download/core/figureSvg.ts +5 -2
- package/src/download/core/figureTarget.ts +28 -3
- package/src/download/core/svgBounds.ts +21 -0
- package/src/download/core/svgToPng.ts +3 -4
- package/src/format/core/relativeTime.ts +29 -7
- package/src/host/core/connectHost.ts +77 -120
- package/src/host/core/hostOutputs.ts +197 -0
- package/src/host/core/index.ts +13 -7
- package/src/host/core/irKinds.ts +92 -0
- package/src/host/core/kinds.ts +16 -6
- package/src/host/core/protocol.ts +50 -8
- package/src/host/core/selectInputs.ts +145 -0
- package/src/host/testing/sciPeaks.ts +140 -0
- package/src/host/testing/standInHost.ts +30 -5
- package/src/host/ui/useHostConnection.ts +17 -8
- package/src/host-testing.ts +4 -0
- package/src/ir/core/handPicking.ts +154 -0
- package/src/ir/core/index.ts +14 -0
- package/src/ir/core/irBandState.ts +155 -0
- package/src/ir/core/irCommands.ts +7 -0
- package/src/ir/core/irPeaks.ts +79 -0
- package/src/ir/core/irReducer.ts +27 -34
- package/src/ir/core/irSpectrum.ts +16 -0
- package/src/ir/core/irState.ts +15 -8
- package/src/ir/core/pickBands.ts +46 -39
- package/src/ir/core/ramanBands.ts +2 -2
- package/src/ir/core/spectrumBands.ts +113 -0
- package/src/ir/ui/BandRow.tsx +20 -2
- package/src/ir/ui/BandsPanel.tsx +46 -88
- package/src/ir/ui/BandsToolbar.tsx +152 -0
- package/src/ir/ui/IrCanvas.tsx +22 -11
- package/src/ir/ui/IrChart.tsx +10 -1
- package/src/ir/ui/IrDocumentationDialog.tsx +7 -0
- package/src/ir/ui/IrEditor.tsx +4 -2
- package/src/ir/ui/IrShell.tsx +5 -0
- package/src/ir/ui/IrStatusBar.tsx +4 -1
- package/src/ir/ui/IrToolbar.tsx +14 -5
- package/src/ir/ui/VibrationalEditor.tsx +2 -1
- package/src/ir/ui/irActions.ts +11 -0
- package/src/ir/ui/irChartProps.ts +4 -1
- package/src/ir/ui/useIrEditor.ts +21 -21
- package/src/locales/de.json +63 -0
- package/src/locales/en.json +63 -0
- package/src/locales/es.json +63 -0
- package/src/locales/fr.json +63 -0
- package/src/locales/it.json +63 -0
- package/src/mass/core/analyseSpectrum.ts +191 -0
- package/src/mass/core/ascendingTrace.ts +62 -0
- package/src/mass/core/centroidPeaks.ts +114 -0
- package/src/mass/core/detectMassFormat.ts +113 -0
- package/src/mass/core/downloadSpectra.ts +52 -0
- package/src/mass/core/fromJcamp.ts +151 -0
- package/src/mass/core/fromText.ts +58 -0
- package/src/mass/core/index.ts +194 -0
- package/src/mass/core/jcampTechnique.ts +87 -0
- package/src/mass/core/labelStackBox.ts +75 -0
- package/src/mass/core/labelledPeaks.ts +135 -0
- package/src/mass/core/loadMassSpectra.ts +86 -0
- package/src/mass/core/loadedMassSpectrum.ts +43 -0
- package/src/mass/core/massCommands.ts +156 -0
- package/src/mass/core/massDomain.ts +229 -0
- package/src/mass/core/massEditorApi.ts +68 -0
- package/src/mass/core/massFormat.ts +187 -0
- package/src/mass/core/massMeta.ts +239 -0
- package/src/mass/core/massReducer.ts +232 -0
- package/src/mass/core/massResolution.ts +169 -0
- package/src/mass/core/massSidePanels.ts +27 -0
- package/src/mass/core/massSpectrum.ts +220 -0
- package/src/mass/core/massState.ts +206 -0
- package/src/mass/core/massStateEdits.ts +104 -0
- package/src/mass/core/massSummary.ts +213 -0
- package/src/mass/core/mzDecimalsSetting.ts +52 -0
- package/src/mass/core/nearestPeak.ts +130 -0
- package/src/mass/core/peakLabelLines.ts +112 -0
- package/src/mass/core/peakLabelPlan.ts +246 -0
- package/src/mass/core/peakTable.ts +82 -0
- package/src/mass/core/resolutionOf.ts +100 -0
- package/src/mass/core/scanFilter.ts +119 -0
- package/src/mass/core/spectrumJcamp.ts +186 -0
- package/src/mass/core/toMassSpectrum.ts +126 -0
- package/src/mass/core/traceIcon.ts +105 -0
- package/src/mass/core/writtenResolution.ts +81 -0
- package/src/mass/ui/MassAboutDialog.tsx +89 -0
- package/src/mass/ui/MassCanvas.tsx +170 -0
- package/src/mass/ui/MassChart.tsx +266 -0
- package/src/mass/ui/MassCommandProvider.tsx +34 -0
- package/src/mass/ui/MassCommandTooltip.tsx +36 -0
- package/src/mass/ui/MassDocumentationDialog.tsx +136 -0
- package/src/mass/ui/MassEditor.tsx +130 -0
- package/src/mass/ui/MassHeader.tsx +38 -0
- package/src/mass/ui/MassLogo.tsx +84 -0
- package/src/mass/ui/MassPointerTracker.tsx +72 -0
- package/src/mass/ui/MassShell.tsx +237 -0
- package/src/mass/ui/MassSidePanel.tsx +107 -0
- package/src/mass/ui/MassStateProvider.tsx +32 -0
- package/src/mass/ui/MassStatusBar.tsx +108 -0
- package/src/mass/ui/MassToolbar.tsx +120 -0
- package/src/mass/ui/MetadataPanel.tsx +201 -0
- package/src/mass/ui/MzDecimalsMenu.tsx +86 -0
- package/src/mass/ui/PeakLabels.tsx +242 -0
- package/src/mass/ui/PeakTable.tsx +199 -0
- package/src/mass/ui/PeaksPanel.tsx +182 -0
- package/src/mass/ui/SpectraPanel.tsx +153 -0
- package/src/mass/ui/SpectrumRow.tsx +246 -0
- package/src/mass/ui/SpectrumTrace.tsx +119 -0
- package/src/mass/ui/index.ts +69 -0
- package/src/mass/ui/massActions.ts +109 -0
- package/src/mass/ui/massChartProps.ts +130 -0
- package/src/mass/ui/massCommandContext.tsx +65 -0
- package/src/mass/ui/massHostPanels.ts +71 -0
- package/src/mass/ui/massStateContext.ts +48 -0
- package/src/mass/ui/useIntensityZoom.ts +55 -0
- package/src/mass/ui/useMassEditor.ts +156 -0
- package/src/mass/ui/useMassFiles.ts +91 -0
- package/src/mass/ui/useMassHandle.ts +58 -0
- package/src/mass/ui/useMassPointer.ts +120 -0
- package/src/mass/ui/useMassShortcuts.ts +85 -0
- package/src/mass/ui/useMassSide.ts +63 -0
- package/src/mass/ui/useMassZoom.ts +157 -0
- package/src/mass.ts +16 -0
- package/src/panel/ui/PanelRail.tsx +5 -1
- package/src/slides/ui/slideSanitizeSchema.ts +86 -2
- package/styles/chrome.css +7 -0
- package/styles/slides.css +47 -0
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A tool's side of the host protocol: introduce itself to the page that
|
|
3
|
-
* frames it, take the private port that page answers with,
|
|
4
|
-
*
|
|
3
|
+
* frames it, take the private port that page answers with, serve what arrives
|
|
4
|
+
* through it, and send back what the host takes back.
|
|
5
5
|
*
|
|
6
6
|
* Free of React and of the DOM — the window is handed in — so a test drives the
|
|
7
7
|
* whole exchange with a fake host and a real `MessageChannel`.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { OUTPUT_DELAY, answerGet, createOutputPublisher, } from "./hostOutputs.js";
|
|
10
10
|
import { HELLO_TYPE, PROTOCOL_VERSION, isConnect, parseRequest, } from "./protocol.js";
|
|
11
|
+
import { selectInputs } from "./selectInputs.js";
|
|
12
|
+
export { selectInputs } from "./selectInputs.js";
|
|
11
13
|
/**
|
|
12
14
|
* Say `hello` to the host, and serve its requests once it connects.
|
|
13
15
|
*
|
|
@@ -15,22 +17,42 @@ import { HELLO_TYPE, PROTOCOL_VERSION, isConnect, parseRequest, } from "./protoc
|
|
|
15
17
|
* one replaces the first — a host that reloads its own script connects again.
|
|
16
18
|
* A document is applied once: the same one again is answered as before and
|
|
17
19
|
* changes nothing, so a host re-sending it never overwrites the user's work.
|
|
20
|
+
* Requests are served one at a time, in order, so a `get` sent after a `load`
|
|
21
|
+
* reads what that load showed, however long it took.
|
|
18
22
|
* @param options - The window, the tool, and its load function.
|
|
19
23
|
* @returns The function that stops listening and closes the port.
|
|
20
24
|
*/
|
|
21
25
|
export function connectHost(options) {
|
|
22
|
-
const { host, listen, tool, origin, build, load } = options;
|
|
26
|
+
const { host, listen, tool, origin, build, load, outputs } = options;
|
|
27
|
+
const { outputDelay = OUTPUT_DELAY } = options;
|
|
23
28
|
let port = null;
|
|
24
29
|
let appliedDocument = null;
|
|
25
30
|
let appliedUsed = [];
|
|
31
|
+
let served = Promise.resolve();
|
|
32
|
+
const publisher = outputs === undefined
|
|
33
|
+
? null
|
|
34
|
+
: createOutputPublisher(outputs, (message) => port?.postMessage(message), outputDelay);
|
|
35
|
+
const stopHearing = outputs?.subscribe(() => publisher?.changed());
|
|
26
36
|
function serve(data) {
|
|
27
37
|
const request = parseRequest(data);
|
|
28
38
|
if (request === null)
|
|
29
39
|
return;
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
served = served
|
|
41
|
+
.then(async () => {
|
|
42
|
+
const result = request.type === 'load'
|
|
43
|
+
? await applyLoad(request)
|
|
44
|
+
: answerGet(request, tool, outputs);
|
|
45
|
+
port?.postMessage(result);
|
|
46
|
+
})
|
|
47
|
+
// A request that failed must not stop the ones after it being served,
|
|
48
|
+
// and must still be seen: it is thrown again, on its own.
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
queueMicrotask(() => {
|
|
51
|
+
throw error;
|
|
52
|
+
});
|
|
53
|
+
});
|
|
32
54
|
}
|
|
33
|
-
function applyLoad(request) {
|
|
55
|
+
async function applyLoad(request) {
|
|
34
56
|
const { id, document, items } = request;
|
|
35
57
|
if (document === appliedDocument) {
|
|
36
58
|
return { type: 'result', id, ok: true, used: appliedUsed };
|
|
@@ -39,8 +61,11 @@ export function connectHost(options) {
|
|
|
39
61
|
if (!selection.ok) {
|
|
40
62
|
return { type: 'result', id, ok: false, error: selection.error };
|
|
41
63
|
}
|
|
64
|
+
// An edit still settling belongs to the document on screen, which the
|
|
65
|
+
// outputs describe only until this one replaces it.
|
|
66
|
+
publisher?.flush();
|
|
42
67
|
try {
|
|
43
|
-
load(selection.inputs);
|
|
68
|
+
await load(selection.inputs);
|
|
44
69
|
}
|
|
45
70
|
catch (error) {
|
|
46
71
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -51,11 +76,15 @@ export function connectHost(options) {
|
|
|
51
76
|
error: { code: 'unreadable', message },
|
|
52
77
|
};
|
|
53
78
|
}
|
|
79
|
+
return applied(request, selection.inputs);
|
|
80
|
+
}
|
|
81
|
+
// Nothing else runs between a load's check and this: requests are served
|
|
82
|
+
// one at a time.
|
|
83
|
+
function applied(request, inputs) {
|
|
84
|
+
const { id, document, accept = [] } = request;
|
|
54
85
|
appliedDocument = document;
|
|
55
|
-
appliedUsed =
|
|
56
|
-
|
|
57
|
-
kind: item.kind,
|
|
58
|
-
}));
|
|
86
|
+
appliedUsed = inputs.map(({ key, item }) => ({ key, kind: item.kind }));
|
|
87
|
+
publisher?.baseline(document, accept);
|
|
59
88
|
return { type: 'result', id, ok: true, used: appliedUsed };
|
|
60
89
|
}
|
|
61
90
|
const stopListening = listen((event) => {
|
|
@@ -87,85 +116,10 @@ export function connectHost(options) {
|
|
|
87
116
|
host.postMessage(hello, '*');
|
|
88
117
|
return () => {
|
|
89
118
|
stopListening();
|
|
119
|
+
stopHearing?.();
|
|
120
|
+
publisher?.stop();
|
|
90
121
|
port?.close();
|
|
91
122
|
port = null;
|
|
92
123
|
};
|
|
93
124
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Give each input of the tool one item of a request.
|
|
96
|
-
*
|
|
97
|
-
* Each input tries its kinds in its own order of preference, and takes the
|
|
98
|
-
* first item that falls under one and passes that kind's schema: the tool
|
|
99
|
-
* knows which notation serves it best, whatever order the host listed them in.
|
|
100
|
-
* An item naming another input's `key` is left to that input.
|
|
101
|
-
* @param tool - What the tool takes.
|
|
102
|
-
* @param items - What the host sent.
|
|
103
|
-
* @returns One item per input, or why an input got none.
|
|
104
|
-
*/
|
|
105
|
-
export function selectInputs(tool, items) {
|
|
106
|
-
const inputs = [];
|
|
107
|
-
for (const input of tool.inputs) {
|
|
108
|
-
const errors = [];
|
|
109
|
-
const loaded = selectInput(input, items, errors);
|
|
110
|
-
if (loaded !== null) {
|
|
111
|
-
inputs.push(loaded);
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
if (errors.length > 0) {
|
|
115
|
-
return {
|
|
116
|
-
ok: false,
|
|
117
|
-
error: {
|
|
118
|
-
code: 'invalid',
|
|
119
|
-
message: `No item for ${input.key} has the shape its kind requires, so ${tool.name} loaded nothing.`,
|
|
120
|
-
errors,
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
ok: false,
|
|
126
|
-
error: {
|
|
127
|
-
code: 'no-input',
|
|
128
|
-
message: `No item is a ${KIND_LIST.format(input.kinds)}, so ${tool.name} loaded nothing.`,
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
return { ok: true, inputs };
|
|
133
|
-
}
|
|
134
|
-
function selectInput(input, items, errors) {
|
|
135
|
-
for (const accepted of input.kinds) {
|
|
136
|
-
if (!isKnownKind(accepted))
|
|
137
|
-
continue;
|
|
138
|
-
for (const item of items) {
|
|
139
|
-
if (item.key !== undefined && item.key !== input.key)
|
|
140
|
-
continue;
|
|
141
|
-
if (!kindAccepts(accepted, item.kind))
|
|
142
|
-
continue;
|
|
143
|
-
const loaded = checkItem(input.key, accepted, item, errors);
|
|
144
|
-
if (loaded !== null)
|
|
145
|
-
return loaded;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
function checkItem(key, accepted, item, errors) {
|
|
151
|
-
const outcome = checkValue(accepted, item.value);
|
|
152
|
-
if (outcome.valid)
|
|
153
|
-
return { key, item, checked: outcome.checked };
|
|
154
|
-
for (const error of outcome.errors)
|
|
155
|
-
errors.push(`${item.kind} ${error}`);
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
function answerGet(request, tool) {
|
|
159
|
-
// Nothing goes back yet: no tool declares an output.
|
|
160
|
-
return {
|
|
161
|
-
type: 'result',
|
|
162
|
-
id: request.id,
|
|
163
|
-
ok: false,
|
|
164
|
-
error: {
|
|
165
|
-
code: 'no-output',
|
|
166
|
-
message: `${tool.name} has nothing to give back yet.`,
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const KIND_LIST = new Intl.ListFormat('en', { type: 'disjunction' });
|
|
171
125
|
//# sourceMappingURL=connectHost.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectHost.js","sourceRoot":"","sources":["../../../src/host/core/connectHost.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,
|
|
1
|
+
{"version":3,"file":"connectHost.js","sourceRoot":"","sources":["../../../src/host/core/connectHost.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,YAAY,EACZ,SAAS,EACT,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAyCjD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,OAA8B;IACxD,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACrE,MAAM,EAAE,WAAW,GAAG,YAAY,EAAE,GAAG,OAAO,CAAC;IAC/C,IAAI,IAAI,GAAuB,IAAI,CAAC;IACpC,IAAI,eAAe,GAAkB,IAAI,CAAC;IAC1C,IAAI,WAAW,GAAe,EAAE,CAAC;IACjC,IAAI,MAAM,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAE9C,MAAM,SAAS,GACb,OAAO,KAAK,SAAS;QACnB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,qBAAqB,CACnB,OAAO,EACP,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW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AAK,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO;QAC5D,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO;QACnC,IAAI,EAAE,KAAK,EAAE,CAAC;QACd,IAAI,GAAG,QAAQ,CAAC;QAChB,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3C,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAiB;QAC1B,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,gBAAgB;QACzB,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM;YACN,KAAK;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB;KACF,CAAC;IACF,2EAA2E;IAC3E,iCAAiC;IACjC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE7B,OAAO,GAAG,EAAE;QACV,aAAa,EAAE,CAAC;QAChB,WAAW,EAAE,EAAE,CAAC;QAChB,SAAS,EAAE,IAAI,EAAE,CAAC;QAClB,IAAI,EAAE,KAAK,EAAE,CAAC;QACd,IAAI,GAAG,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a tool hands back: the values a `get` asks for, and the `output` it
|
|
3
|
+
* sends when a value the host accepted changes.
|
|
4
|
+
*
|
|
5
|
+
* An `output` carries only what changed, item by item, against what the host
|
|
6
|
+
* already has: the values as they stood once its document was applied, then
|
|
7
|
+
* every value sent since. Opening a document therefore never writes it back,
|
|
8
|
+
* and a band picked on one spectrum of a sample leaves the others alone.
|
|
9
|
+
*/
|
|
10
|
+
import type { GetRequest, HostItem, OutputMessage, ResultMessage, ToolInterface } from './protocol.ts';
|
|
11
|
+
/** Where a tool's outputs are read, and how their changes are heard. */
|
|
12
|
+
export interface HostOutputs {
|
|
13
|
+
/**
|
|
14
|
+
* The value of every output now, one item each, carrying its `key` and the
|
|
15
|
+
* `id` of the item it was made from. It must already show a document once
|
|
16
|
+
* `load` has returned, or the host is sent back what it just loaded.
|
|
17
|
+
*/
|
|
18
|
+
read: () => readonly HostItem[];
|
|
19
|
+
/** Be told whenever they may have changed; the returned function stops it. */
|
|
20
|
+
subscribe: (listener: () => void) => () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* How long the outputs must stay still before a change is sent, in
|
|
24
|
+
* milliseconds: a burst of edits is one message.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OUTPUT_DELAY = 300;
|
|
27
|
+
/**
|
|
28
|
+
* Answer a `get` with the values it asks for — every output when it names
|
|
29
|
+
* none.
|
|
30
|
+
* @param request - The request.
|
|
31
|
+
* @param tool - What the tool hands back.
|
|
32
|
+
* @param outputs - Where the values are read, if anywhere.
|
|
33
|
+
* @returns The values, or `no-output` when the tool has none of those asked.
|
|
34
|
+
*/
|
|
35
|
+
export declare function answerGet(request: GetRequest, tool: ToolInterface, outputs: HostOutputs | undefined): ResultMessage;
|
|
36
|
+
/** What the connection tells the publisher, and the means to stop it. */
|
|
37
|
+
export interface OutputPublisher {
|
|
38
|
+
/** A document was applied: what the host has is what the tool now shows. */
|
|
39
|
+
baseline: (document: string, accept: readonly string[]) => void;
|
|
40
|
+
/** The outputs may have changed. */
|
|
41
|
+
changed: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Send what changed now rather than once it settles: another document is
|
|
44
|
+
* about to replace what the outputs are read from.
|
|
45
|
+
*/
|
|
46
|
+
flush: () => void;
|
|
47
|
+
/** Send nothing more. */
|
|
48
|
+
stop: () => void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Send the host what changed of the outputs it accepted, once they settle.
|
|
52
|
+
* @param outputs - Where the values are read.
|
|
53
|
+
* @param send - Posts a message to the host, when there is one.
|
|
54
|
+
* @param delay - How long the values must stay still, in milliseconds.
|
|
55
|
+
* @returns The publisher.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createOutputPublisher(outputs: HostOutputs, send: (message: OutputMessage) => void, delay: number): OutputPublisher;
|
|
58
|
+
//# sourceMappingURL=hostOutputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostOutputs.d.ts","sourceRoot":"","sources":["../../../src/host/core/hostOutputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,aAAa,EACb,aAAa,EACd,MAAM,eAAe,CAAC;AAEvB,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,EAAE,MAAM,SAAS,QAAQ,EAAE,CAAC;IAChC,8EAA8E;IAC9E,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CACjD;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,WAAW,GAAG,SAAS,GAC/B,aAAa,CAsBf;AAED,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAChE,oCAAoC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,yBAAyB;IACzB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,EACtC,KAAK,EAAE,MAAM,GACZ,eAAe,CA4CjB"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a tool hands back: the values a `get` asks for, and the `output` it
|
|
3
|
+
* sends when a value the host accepted changes.
|
|
4
|
+
*
|
|
5
|
+
* An `output` carries only what changed, item by item, against what the host
|
|
6
|
+
* already has: the values as they stood once its document was applied, then
|
|
7
|
+
* every value sent since. Opening a document therefore never writes it back,
|
|
8
|
+
* and a band picked on one spectrum of a sample leaves the others alone.
|
|
9
|
+
*/
|
|
10
|
+
import { kindAccepts } from "./kinds.js";
|
|
11
|
+
/**
|
|
12
|
+
* How long the outputs must stay still before a change is sent, in
|
|
13
|
+
* milliseconds: a burst of edits is one message.
|
|
14
|
+
*/
|
|
15
|
+
export const OUTPUT_DELAY = 300;
|
|
16
|
+
/**
|
|
17
|
+
* Answer a `get` with the values it asks for — every output when it names
|
|
18
|
+
* none.
|
|
19
|
+
* @param request - The request.
|
|
20
|
+
* @param tool - What the tool hands back.
|
|
21
|
+
* @param outputs - Where the values are read, if anywhere.
|
|
22
|
+
* @returns The values, or `no-output` when the tool has none of those asked.
|
|
23
|
+
*/
|
|
24
|
+
export function answerGet(request, tool, outputs) {
|
|
25
|
+
const { id, keys } = request;
|
|
26
|
+
const declared = new Set();
|
|
27
|
+
for (const output of tool.outputs)
|
|
28
|
+
declared.add(output.key);
|
|
29
|
+
if (outputs === undefined || declared.size === 0) {
|
|
30
|
+
return noOutput(id, `${tool.name} has nothing to give back yet.`);
|
|
31
|
+
}
|
|
32
|
+
const wanted = keys.length === 0 ? declared : new Set();
|
|
33
|
+
for (const key of keys) {
|
|
34
|
+
if (declared.has(key))
|
|
35
|
+
wanted.add(key);
|
|
36
|
+
}
|
|
37
|
+
if (wanted.size === 0) {
|
|
38
|
+
return noOutput(id, `${tool.name} has no output called ${LIST.format(keys)}.`);
|
|
39
|
+
}
|
|
40
|
+
const items = [];
|
|
41
|
+
for (const item of outputs.read()) {
|
|
42
|
+
if (item.key !== undefined && wanted.has(item.key))
|
|
43
|
+
items.push(item);
|
|
44
|
+
}
|
|
45
|
+
return { type: 'result', id, ok: true, items };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Send the host what changed of the outputs it accepted, once they settle.
|
|
49
|
+
* @param outputs - Where the values are read.
|
|
50
|
+
* @param send - Posts a message to the host, when there is one.
|
|
51
|
+
* @param delay - How long the values must stay still, in milliseconds.
|
|
52
|
+
* @returns The publisher.
|
|
53
|
+
*/
|
|
54
|
+
export function createOutputPublisher(outputs, send, delay) {
|
|
55
|
+
let document = null;
|
|
56
|
+
let accepted = new Set();
|
|
57
|
+
let known = new Map();
|
|
58
|
+
let timer;
|
|
59
|
+
function flush() {
|
|
60
|
+
timer = undefined;
|
|
61
|
+
if (document === null)
|
|
62
|
+
return;
|
|
63
|
+
const items = [];
|
|
64
|
+
for (const [identity, entry] of readAccepted(outputs, accepted)) {
|
|
65
|
+
if (known.get(identity) === entry.text)
|
|
66
|
+
continue;
|
|
67
|
+
known.set(identity, entry.text);
|
|
68
|
+
items.push(entry.item);
|
|
69
|
+
}
|
|
70
|
+
if (items.length > 0)
|
|
71
|
+
send({ type: 'output', document, items });
|
|
72
|
+
}
|
|
73
|
+
function stop() {
|
|
74
|
+
clearTimeout(timer);
|
|
75
|
+
timer = undefined;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
baseline(next, accept) {
|
|
79
|
+
stop();
|
|
80
|
+
document = next;
|
|
81
|
+
accepted = new Set(accept);
|
|
82
|
+
known = new Map();
|
|
83
|
+
for (const [identity, entry] of readAccepted(outputs, accepted)) {
|
|
84
|
+
known.set(identity, entry.text);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
changed() {
|
|
88
|
+
if (document === null || accepted.size === 0)
|
|
89
|
+
return;
|
|
90
|
+
stop();
|
|
91
|
+
timer = setTimeout(flush, delay);
|
|
92
|
+
},
|
|
93
|
+
flush() {
|
|
94
|
+
stop();
|
|
95
|
+
flush();
|
|
96
|
+
},
|
|
97
|
+
stop,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The accepted items, each under an identity that survives a re-read: its
|
|
102
|
+
* key, the id of the item it was made from, and its rank among items sharing
|
|
103
|
+
* both.
|
|
104
|
+
* @param outputs - Where the values are read.
|
|
105
|
+
* @param accepted - The keys and kinds the host takes back.
|
|
106
|
+
* @returns Each item with its value as text, by identity.
|
|
107
|
+
*/
|
|
108
|
+
function readAccepted(outputs, accepted) {
|
|
109
|
+
const entries = new Map();
|
|
110
|
+
if (accepted.size === 0)
|
|
111
|
+
return entries;
|
|
112
|
+
for (const item of outputs.read()) {
|
|
113
|
+
if (!isAccepted(item, accepted))
|
|
114
|
+
continue;
|
|
115
|
+
const base = `${item.key ?? item.kind}\n${item.id ?? ''}`;
|
|
116
|
+
let rank = 0;
|
|
117
|
+
while (entries.has(`${base}\n${rank}`))
|
|
118
|
+
rank++;
|
|
119
|
+
entries.set(`${base}\n${rank}`, {
|
|
120
|
+
item,
|
|
121
|
+
text: JSON.stringify(item.value),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return entries;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Whether the host takes an item back: `accept` names its output's key, or
|
|
128
|
+
* its kind — a kind taking every kind under it, as an input's does.
|
|
129
|
+
* @param item - The item.
|
|
130
|
+
* @param accepted - What the host takes back.
|
|
131
|
+
* @returns Whether it goes back.
|
|
132
|
+
*/
|
|
133
|
+
function isAccepted(item, accepted) {
|
|
134
|
+
if (item.key !== undefined && accepted.has(item.key))
|
|
135
|
+
return true;
|
|
136
|
+
for (const name of accepted) {
|
|
137
|
+
if (kindAccepts(name, item.kind))
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
function noOutput(id, message) {
|
|
143
|
+
return {
|
|
144
|
+
type: 'result',
|
|
145
|
+
id,
|
|
146
|
+
ok: false,
|
|
147
|
+
error: { code: 'no-output', message },
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
const LIST = new Intl.ListFormat('en', { type: 'disjunction' });
|
|
151
|
+
//# sourceMappingURL=hostOutputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostOutputs.js","sourceRoot":"","sources":["../../../src/host/core/hostOutputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAqBzC;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,OAAmB,EACnB,IAAmB,EACnB,OAAgC;IAEhC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO;QAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5D,IAAI,OAAO,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACjD,OAAO,QAAQ,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,gCAAgC,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,EAAU,CAAC;IAChE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,QAA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EAAE,aAAa,EAAE,CAAC,CAAC"}
|
package/lib/host/core/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
export type { HostConnectionOptions, HostMessageEvent
|
|
2
|
-
export { connectHost
|
|
1
|
+
export type { HostConnectionOptions, HostMessageEvent } from './connectHost.ts';
|
|
2
|
+
export { connectHost } from './connectHost.ts';
|
|
3
|
+
export type { HostOutputs, OutputPublisher } from './hostOutputs.ts';
|
|
4
|
+
export { OUTPUT_DELAY, answerGet, createOutputPublisher, } from './hostOutputs.ts';
|
|
3
5
|
export type { StructureValue } from './hostStructure.ts';
|
|
4
6
|
export { STRUCTURE_KINDS, hostStructureLoader, hostStructureSource, readHostMolecule, } from './hostStructure.ts';
|
|
7
|
+
export type { IrJdxValue, IrPeakValue, IrPeaksValue } from './irKinds.ts';
|
|
8
|
+
export { IR_JDX_SCHEMA, IR_PEAKS_SCHEMA } from './irKinds.ts';
|
|
5
9
|
export type { CheckOutcome, CheckedValue, KnownKind, MolfileValue, OclIdValue, SmilesValue, } from './kinds.ts';
|
|
6
10
|
export { checkValue, isKnownKind, kindAccepts } from './kinds.ts';
|
|
7
|
-
export type { GetRequest, HelloMessage, HostError, HostErrorCode, HostItem, HostRequest, LoadRequest, ResultMessage, ToolInput, ToolInterface, ToolOutput, UsedItem, } from './protocol.ts';
|
|
11
|
+
export type { GetRequest, HelloMessage, HostError, HostErrorCode, HostItem, HostRequest, LoadRequest, OutputMessage, ResultMessage, ToolInput, ToolInterface, ToolOutput, UsedItem, } from './protocol.ts';
|
|
8
12
|
export { CONNECT_TYPE, HELLO_TYPE, MAX_ITEMS, MAX_LABEL_LENGTH, PROTOCOL_VERSION, isConnect, parseRequest, } from './protocol.ts';
|
|
13
|
+
export type { InputSelection, LoadedInput } from './selectInputs.ts';
|
|
14
|
+
export { selectInputs } from './selectInputs.ts';
|
|
9
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,SAAS,EACT,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC9D,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAClE,YAAY,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/host/core/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export { connectHost
|
|
1
|
+
export { connectHost } from "./connectHost.js";
|
|
2
|
+
export { OUTPUT_DELAY, answerGet, createOutputPublisher, } from "./hostOutputs.js";
|
|
2
3
|
export { STRUCTURE_KINDS, hostStructureLoader, hostStructureSource, readHostMolecule, } from "./hostStructure.js";
|
|
4
|
+
export { IR_JDX_SCHEMA, IR_PEAKS_SCHEMA } from "./irKinds.js";
|
|
3
5
|
export { checkValue, isKnownKind, kindAccepts } from "./kinds.js";
|
|
4
6
|
export { CONNECT_TYPE, HELLO_TYPE, MAX_ITEMS, MAX_LABEL_LENGTH, PROTOCOL_VERSION, isConnect, parseRequest, } from "./protocol.js";
|
|
7
|
+
export { selectInputs } from "./selectInputs.js";
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/core/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/host/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,YAAY,EACZ,SAAS,EACT,qBAAqB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAS9D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAgBlE,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kinds a measured infrared spectrum travels as: the JCAMP-DX a notebook
|
|
3
|
+
* keeps with the bands picked on it, and those bands alone, which is what a
|
|
4
|
+
* tool hands back.
|
|
5
|
+
*
|
|
6
|
+
* Shaped on what SciPeaks keeps for a sample's infrared spectrum — a JCAMP-DX
|
|
7
|
+
* attachment and a `peak` list beside it — with the text of the attachment in
|
|
8
|
+
* place of its address, since a tool framed from another origin cannot fetch
|
|
9
|
+
* what the notebook serves its own pages. A band is written the way SciPeaks
|
|
10
|
+
* and `ir-spectrum` write one, so what a tool hands back can be stored as it
|
|
11
|
+
* arrives.
|
|
12
|
+
*
|
|
13
|
+
* Named after pipeline's `spectra.nmr.1d.jdx`. Pipeline's own `spectra.ir` is
|
|
14
|
+
* a computed spectrum — normal modes, not a measurement — and is not one of the
|
|
15
|
+
* kinds read here.
|
|
16
|
+
*/
|
|
17
|
+
/** One band of an infrared spectrum, as SciPeaks and `ir-spectrum` write it. */
|
|
18
|
+
export interface IrPeakValue {
|
|
19
|
+
/** Where it sits, in cm⁻¹. */
|
|
20
|
+
wavenumber: number;
|
|
21
|
+
/**
|
|
22
|
+
* Its absorbance.
|
|
23
|
+
* @default read off the spectrum
|
|
24
|
+
*/
|
|
25
|
+
absorbance?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Its transmittance, as a fraction between 0 and 1 — not a percentage.
|
|
28
|
+
* @default read off the spectrum
|
|
29
|
+
*/
|
|
30
|
+
transmittance?: number;
|
|
31
|
+
/**
|
|
32
|
+
* How strong it is: `w` weak, `m` medium, `S` strong. Any other letter is
|
|
33
|
+
* worked out again from the spectrum.
|
|
34
|
+
* @default worked out from the spectrum
|
|
35
|
+
*/
|
|
36
|
+
kind?: string;
|
|
37
|
+
}
|
|
38
|
+
/** `spectra.ir.jdx`: a measured infrared spectrum and the bands picked on it. */
|
|
39
|
+
export interface IrJdxValue {
|
|
40
|
+
/** The JCAMP-DX, as text. */
|
|
41
|
+
jdx: string;
|
|
42
|
+
/**
|
|
43
|
+
* The name the notebook keeps it under, e.g. `spectra/ir/sample.jdx`.
|
|
44
|
+
* @default undefined
|
|
45
|
+
*/
|
|
46
|
+
filename?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The bands picked on it. Absent or empty, the tool picks them itself.
|
|
49
|
+
* @default undefined
|
|
50
|
+
*/
|
|
51
|
+
peaks?: IrPeakValue[];
|
|
52
|
+
}
|
|
53
|
+
/** `spectra.ir.peaks`: the bands picked on an infrared spectrum, alone. */
|
|
54
|
+
export interface IrPeaksValue {
|
|
55
|
+
/** The bands, ascending by wavenumber. */
|
|
56
|
+
peaks: IrPeakValue[];
|
|
57
|
+
}
|
|
58
|
+
/** The schema of `spectra.ir.jdx`. */
|
|
59
|
+
export declare const IR_JDX_SCHEMA: {
|
|
60
|
+
readonly type: "object";
|
|
61
|
+
readonly properties: {
|
|
62
|
+
readonly jdx: {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
};
|
|
65
|
+
readonly filename: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
};
|
|
68
|
+
readonly peaks: {
|
|
69
|
+
readonly type: "array";
|
|
70
|
+
readonly items: {
|
|
71
|
+
readonly type: "object";
|
|
72
|
+
readonly properties: {
|
|
73
|
+
readonly wavenumber: {
|
|
74
|
+
readonly type: "number";
|
|
75
|
+
};
|
|
76
|
+
readonly absorbance: {
|
|
77
|
+
readonly type: "number";
|
|
78
|
+
};
|
|
79
|
+
readonly transmittance: {
|
|
80
|
+
readonly type: "number";
|
|
81
|
+
};
|
|
82
|
+
readonly kind: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
readonly required: readonly ["wavenumber"];
|
|
87
|
+
readonly additionalProperties: false;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly required: readonly ["jdx"];
|
|
92
|
+
readonly additionalProperties: false;
|
|
93
|
+
};
|
|
94
|
+
/** The schema of `spectra.ir.peaks`. */
|
|
95
|
+
export declare const IR_PEAKS_SCHEMA: {
|
|
96
|
+
readonly type: "object";
|
|
97
|
+
readonly properties: {
|
|
98
|
+
readonly peaks: {
|
|
99
|
+
readonly type: "array";
|
|
100
|
+
readonly items: {
|
|
101
|
+
readonly type: "object";
|
|
102
|
+
readonly properties: {
|
|
103
|
+
readonly wavenumber: {
|
|
104
|
+
readonly type: "number";
|
|
105
|
+
};
|
|
106
|
+
readonly absorbance: {
|
|
107
|
+
readonly type: "number";
|
|
108
|
+
};
|
|
109
|
+
readonly transmittance: {
|
|
110
|
+
readonly type: "number";
|
|
111
|
+
};
|
|
112
|
+
readonly kind: {
|
|
113
|
+
readonly type: "string";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
readonly required: readonly ["wavenumber"];
|
|
117
|
+
readonly additionalProperties: false;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
readonly required: readonly ["peaks"];
|
|
122
|
+
readonly additionalProperties: false;
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=irKinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irKinds.d.ts","sourceRoot":"","sources":["../../../src/host/core/irKinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iFAAiF;AACjF,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAcD,sCAAsC;AACtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAShB,CAAC;AAEX,wCAAwC;AACxC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKlB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kinds a measured infrared spectrum travels as: the JCAMP-DX a notebook
|
|
3
|
+
* keeps with the bands picked on it, and those bands alone, which is what a
|
|
4
|
+
* tool hands back.
|
|
5
|
+
*
|
|
6
|
+
* Shaped on what SciPeaks keeps for a sample's infrared spectrum — a JCAMP-DX
|
|
7
|
+
* attachment and a `peak` list beside it — with the text of the attachment in
|
|
8
|
+
* place of its address, since a tool framed from another origin cannot fetch
|
|
9
|
+
* what the notebook serves its own pages. A band is written the way SciPeaks
|
|
10
|
+
* and `ir-spectrum` write one, so what a tool hands back can be stored as it
|
|
11
|
+
* arrives.
|
|
12
|
+
*
|
|
13
|
+
* Named after pipeline's `spectra.nmr.1d.jdx`. Pipeline's own `spectra.ir` is
|
|
14
|
+
* a computed spectrum — normal modes, not a measurement — and is not one of the
|
|
15
|
+
* kinds read here.
|
|
16
|
+
*/
|
|
17
|
+
const IR_PEAK_SCHEMA = {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
wavenumber: { type: 'number' },
|
|
21
|
+
absorbance: { type: 'number' },
|
|
22
|
+
transmittance: { type: 'number' },
|
|
23
|
+
kind: { type: 'string' },
|
|
24
|
+
},
|
|
25
|
+
required: ['wavenumber'],
|
|
26
|
+
additionalProperties: false,
|
|
27
|
+
};
|
|
28
|
+
/** The schema of `spectra.ir.jdx`. */
|
|
29
|
+
export const IR_JDX_SCHEMA = {
|
|
30
|
+
type: 'object',
|
|
31
|
+
properties: {
|
|
32
|
+
jdx: { type: 'string' },
|
|
33
|
+
filename: { type: 'string' },
|
|
34
|
+
peaks: { type: 'array', items: IR_PEAK_SCHEMA },
|
|
35
|
+
},
|
|
36
|
+
required: ['jdx'],
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
};
|
|
39
|
+
/** The schema of `spectra.ir.peaks`. */
|
|
40
|
+
export const IR_PEAKS_SCHEMA = {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: { peaks: { type: 'array', items: IR_PEAK_SCHEMA } },
|
|
43
|
+
required: ['peaks'],
|
|
44
|
+
additionalProperties: false,
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=irKinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"irKinds.js","sourceRoot":"","sources":["../../../src/host/core/irKinds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA8CH,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACzB;IACD,QAAQ,EAAE,CAAC,YAAY,CAAC;IACxB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,sCAAsC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;KAChD;IACD,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,wCAAwC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE;IAC/D,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
|