Skip to content

Commit

Permalink
#4311 - Macro: Send monomer library from Ketcher to Indigo upon monom…
Browse files Browse the repository at this point in the history
…ers import/export
  • Loading branch information
ilya-asiyuk-epam committed Apr 30, 2024
1 parent 0c4e90a commit 264904f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
import { IKetMacromoleculesContent } from 'ketcher-core';

// TODO add typings for Indigo standalone object
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down Expand Up @@ -184,6 +185,7 @@ export type OutputMessage<T> =
export interface InputMessage<T> {
type: Command;
data: T;
monomerLibrary?: IKetMacromoleculesContent;
}

export interface OutputMessageWrapper<T = string> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import {
StructService,
StructServiceOptions,
getLabelRenderModeForIndigo,
CoreEditor,
} from 'ketcher-core';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down Expand Up @@ -304,9 +305,12 @@ class IndigoService implements StructService {
options: commandOptions,
};

const monomerLibrary =
CoreEditor.provideEditorInstance().monomersLibraryParsedJson;
const inputMessage: InputMessage<ConvertCommandData> = {
type: Command.Convert,
data: commandData,
monomerLibrary,
};

this.EE.removeListener(WorkerEvent.Convert, action);
Expand Down

0 comments on commit 264904f

Please sign in to comment.