UNPKG

ketcher-core

Version:
30 lines (29 loc) 1.93 kB
/**************************************************************************** * Copyright 2021 EPAM Systems * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ import type { MonomerOrAmbiguousType, MonomerItemType } from "../types"; import { AmbiguousMonomer, Chem, Peptide, Phosphate, RNABase, Sugar, UnresolvedMonomer, UnsplitNucleotide } from "../entities"; import { KetMonomerClass } from "../constants/monomers"; /** Entity classes for concrete (non-ambiguous) monomers only. */ export declare type ConcreteMonomerEntityClass = typeof Chem | typeof Peptide | typeof Phosphate | typeof RNABase | typeof Sugar | typeof UnresolvedMonomer | typeof UnsplitNucleotide; /** All monomer entity classes, including ambiguous. */ export declare type MonomerEntityClass = ConcreteMonomerEntityClass | typeof AmbiguousMonomer; /** * Maps a monomer library item (concrete or ambiguous) to the corresponding * domain entity class and KetMonomerClass enum value. * This is a pure domain helper — it has no renderer imports. */ export declare function monomerEntityFactory(monomer: MonomerItemType): [EntityClass: ConcreteMonomerEntityClass, ketMonomerClass: KetMonomerClass]; export declare function monomerEntityFactory(monomer: MonomerOrAmbiguousType): [EntityClass: MonomerEntityClass, ketMonomerClass: KetMonomerClass];