/** * Copyright (c) 2020-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal * @author Panagiotis Tourlas */ import { Column } from '../../../mol-data/db.js'; import { Task } from '../../../mol-task/index.js'; import { StringLike } from '../../common/string-like.js'; import { Tokenizer } from '../common/text/tokenizer.js'; import { ReaderResult as Result } from '../result.js'; /** Subset of the MolFile V2000 format */ export interface MolFile { readonly title: string; readonly program: string; readonly comment: string; readonly atoms: { readonly count: number; readonly x: Column; readonly y: Column; readonly z: Column; readonly type_symbol: Column; readonly formal_charge: Column; }; readonly bonds: { readonly count: number; readonly atomIdxA: Column; readonly atomIdxB: Column; readonly order: Column; }; readonly formalCharges: { readonly atomIdx: Column; readonly charge: Column; }; readonly attachmentPoints?: { readonly atomIdx: number; readonly kind: number; }[]; } /** * @param key - The value found at the atom block. * @returns The actual formal charge based on the mapping. */ export declare function formalChargeMapper(key: number): 0 | 1 | 3 | 2 | -1 | -3 | -2; export declare function handleAtoms(tokenizer: Tokenizer, count: number): MolFile['atoms']; export declare function handleBonds(tokenizer: Tokenizer, count: number): MolFile['bonds']; interface FormalChargesRawData { atomIdx: Array; charge: Array; } export declare function handleFormalCharges(tokenizer: Tokenizer, lineStart: number, formalCharges: FormalChargesRawData): void; /** Call an appropriate handler based on the property type. */ export declare function handlePropertiesBlock(tokenizer: Tokenizer): { formalCharges: MolFile['formalCharges']; attachmentPoints: MolFile['attachmentPoints']; }; export declare function parseMol(data: StringLike): Task>; export {};