From 304e440f6f25364a4132d8dcada647c1197ced5e Mon Sep 17 00:00:00 2001 From: Cody Hansen Date: Thu, 26 Sep 2024 09:24:33 -1000 Subject: [PATCH] Added basic compilation (#1476) --- src/components/sequencing/SequenceEditor.svelte | 10 ++++++++++ src/types/sequencing.ts | 1 + 2 files changed, 11 insertions(+) diff --git a/src/components/sequencing/SequenceEditor.svelte b/src/components/sequencing/SequenceEditor.svelte index 84fd00638c..065509d109 100644 --- a/src/components/sequencing/SequenceEditor.svelte +++ b/src/components/sequencing/SequenceEditor.svelte @@ -255,6 +255,12 @@ setSequenceAdaptation(undefined); } + function compile(): void { + if (selectedOutputFormat?.compile) { + selectedOutputFormat.compile(sequenceOutput); + } + } + async function sequenceUpdateListener(viewUpdate: ViewUpdate): Promise { const sequence = viewUpdate.state.doc.toString(); disableCopyAndExport = sequence === ''; @@ -452,6 +458,10 @@ {/each} + + {#if selectedOutputFormat?.compile} + + {/if} diff --git a/src/types/sequencing.ts b/src/types/sequencing.ts index ae3bbf1828..c8e356cb05 100644 --- a/src/types/sequencing.ts +++ b/src/types/sequencing.ts @@ -41,6 +41,7 @@ export type DictionaryType = { }; export interface IOutputFormat { + compile?: (output: string) => Promise; fileExtension: string; linter?: ( diagnostics: Diagnostic[],