molstar
Version:
A comprehensive macromolecular library.
49 lines (48 loc) • 2.69 kB
TypeScript
/**
* Copyright (c) 2023-2025 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Adam Midlik <midlik@gmail.com>
* @author David Sehnal <david.sehnal@gmail.com>
* @author Aliaksei Chareshneu <chareshneu.tech@gmail.com>
*/
import { PluginContext } from '../../mol-plugin/context';
import { StateObjectSelector } from '../../mol-state';
import { LoadingExtension } from './load-generic';
import { AnnotationFromSourceKind, AnnotationFromUriKind } from './load-helpers';
import { MVSData } from './mvs-data';
import { MolstarNode, MolstarNodeParams, MolstarTree } from './tree/molstar/molstar-tree';
export interface MVSLoadOptions {
/** Add snapshots from MVS into current snapshot list, instead of replacing the list. */
appendSnapshots?: boolean;
/** Ignore any camera positioning from the MVS state and keep the current camera position instead, ignore any camera positioning when generating snapshots. */
keepCamera?: boolean;
/** Specifies a set of MVS-loading extensions (not a part of standard MVS specification). If undefined, apply all builtin extensions. If `[]`, do not apply builtin extensions. */
extensions?: MolstarLoadingExtension<any>[];
/** Run some sanity checks and print potential issues to the console. */
sanityChecks?: boolean;
/** Base for resolving relative URLs/URIs. May itself be a relative URL (relative to the window URL). */
sourceUrl?: string;
doNotReportErrors?: boolean;
}
/** Load a MolViewSpec (MVS) state(s) into the Mol* plugin as plugin state snapshots. */
export declare function loadMVS(plugin: PluginContext, data: MVSData, options?: MVSLoadOptions): Promise<void>;
/** Mutable context for loading a `MolstarTree`, available throughout the loading. */
export interface MolstarLoadingContext {
/** Maps `*_from_[uri|source]` nodes to annotationId they should reference */
annotationMap: Map<MolstarNode<AnnotationFromUriKind | AnnotationFromSourceKind>, string>;
/** Maps each node (on 'structure' or lower level) to its nearest 'representation' node */
nearestReprMap?: Map<MolstarNode, MolstarNode<'representation'>>;
camera: {
cameraParams?: MolstarNodeParams<'camera'>;
focuses: {
target: StateObjectSelector;
params: MolstarNodeParams<'focus'>;
}[];
};
canvas?: MolstarNodeParams<'canvas'>;
}
export declare const MolstarLoadingContext: {
create(): MolstarLoadingContext;
};
export type MolstarLoadingExtension<TExtensionContext> = LoadingExtension<MolstarTree, MolstarLoadingContext, TExtensionContext>;
export declare const BuiltinLoadingExtensions: MolstarLoadingExtension<any>[];