UNPKG

molstar

Version:

A comprehensive macromolecular library.

26 lines (25 loc) 1.24 kB
/** * Copyright (c) 2019-2022 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> * @author David Sehnal <david.sehnal@gmail.com> */ import { StringLike } from '../../mol-io/common/string-like'; import { PluginContext } from '../../mol-plugin/context'; import { StateObjectRef } from '../../mol-state'; import { FileNameInfo } from '../../mol-util/file-info'; import { PluginStateObject } from '../objects'; export interface DataFormatProvider<P = any, R = any, V = any> { label: string; description: string; category?: string; stringExtensions?: string[]; binaryExtensions?: string[]; isApplicable?(info: FileNameInfo, data: StringLike | Uint8Array): boolean; parse(plugin: PluginContext, data: StateObjectRef<PluginStateObject.Data.Binary | PluginStateObject.Data.String>, params?: P): Promise<R>; visuals?(plugin: PluginContext, data: R): Promise<V> | undefined; } export declare function DataFormatProvider<P extends DataFormatProvider>(provider: P): P; type CifVariants = 'dscif' | 'segcif' | 'coreCif' | -1; export declare function guessCifVariant(info: FileNameInfo, data: Uint8Array | StringLike): CifVariants; export {};