/** * Copyright (c) 2018-2026 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal * @author Alexander Rose * @author Neli Fonseca * @author Adam Midlik */ import { MVSLoadOptions } from '../../extensions/mvs/load.js'; import { StructureInteractivityOptions } from '../../extensions/plugin/interactivity.js'; import * as loaders from '../../extensions/plugin/loaders.js'; import { Volume } from '../../mol-model/volume.js'; import { BuiltInTrajectoryFormat } from '../../mol-plugin-state/formats/trajectory.js'; import { BuildInVolumeFormat } from '../../mol-plugin-state/formats/volume.js'; import { PluginUIContext } from '../../mol-plugin-ui/context.js'; import { PluginState } from '../../mol-plugin/state.js'; import { Color } from '../../mol-util/color/index.js'; import '../../mol-util/polyfill.js'; import { ViewerOptions } from './options.js'; export { PLUGIN_VERSION as version } from '../../mol-plugin/version.js'; export { consoleStats, isDebugMode, isProductionMode, isTimingMode, setDebugMode, setProductionMode, setTimingMode } from '../../mol-util/debug.js'; export type { LoadStructureOptions, LoadTrajectoryParams, VolumeIsovalueInfo } from '../../extensions/plugin/loaders.js'; export declare class Viewer { private _events; readonly plugin: PluginUIContext; constructor(plugin: PluginUIContext); static readonly instances: Viewer[]; static create(elementOrId: string | HTMLElement, options?: Partial): Promise; /** * Allows subscribing to rxjs observables in the context of the viewer. * All subscriptions will be disposed of when the viewer is destroyed. */ subscribe: (obs: import("rxjs").Observable | undefined, action: (v: T) => void) => { unsubscribe: () => void; }; setRemoteSnapshot(id: string): Promise; loadSnapshotFromUrl(url: string, type: PluginState.SnapshotType): Promise; loadStructureFromUrl(url: string, format?: BuiltInTrajectoryFormat, isBinary?: boolean, options?: loaders.LoadStructureOptions & { label?: string; }): Promise; loadAllModelsOrAssemblyFromUrl(url: string, format?: BuiltInTrajectoryFormat, isBinary?: boolean, options?: loaders.LoadStructureOptions): Promise; loadStructureFromData(data: string | number[], format: BuiltInTrajectoryFormat, options?: { dataLabel?: string; }): Promise; loadPdb(pdb: string, options?: loaders.LoadStructureOptions): Promise; /** * @deprecated Scheduled for removal in v5. Use {@link loadPdbIhm | loadPdbIhm(pdbIhm: string)} instead. */ loadPdbDev(pdbDev: string): Promise; loadPdbIhm(pdbIhm: string): Promise; loadEmdb(emdb: string, options?: { detail?: number; }): Promise; loadAlphaFoldDb(afdb: string): Promise; loadModelArchive(id: string): Promise; /** * @example Load X-ray density from volume server viewer.loadVolumeFromUrl({ url: 'https://www.ebi.ac.uk/pdbe/densities/x-ray/1tqn/cell?detail=3', format: 'dscif', isBinary: true }, [{ type: 'relative', value: 1.5, color: 0x3362B2 }, { type: 'relative', value: 3, color: 0x33BB33, volumeIndex: 1 }, { type: 'relative', value: -3, color: 0xBB3333, volumeIndex: 1 }], { entryId: ['2FO-FC', 'FO-FC'], isLazy: true }); * ********************* * @example Load EM density from volume server viewer.loadVolumeFromUrl({ url: 'https://maps.rcsb.org/em/emd-30210/cell?detail=6', format: 'dscif', isBinary: true }, [{ type: 'relative', value: 1, color: 0x3377aa }], { entryId: 'EMD-30210', isLazy: true }); */ loadVolumeFromUrl({ url, format, isBinary }: { url: string; format: BuildInVolumeFormat; isBinary: boolean; }, isovalues: loaders.VolumeIsovalueInfo[], options?: { entryId?: string | string[]; isLazy?: boolean; }): Promise; loadFullResolutionEMDBMap(emdbId: string, options: { isoValue: Volume.IsoValue; color?: Color; }): Promise; /** * @example * viewer.loadTrajectory({ * model: { kind: 'model-url', url: 'villin.gro', format: 'gro' }, * coordinates: { kind: 'coordinates-url', url: 'villin.xtc', format: 'xtc', isBinary: true }, * preset: 'all-models' // or 'default' * }); */ loadTrajectory(params: loaders.LoadTrajectoryParams): Promise<{ model: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateTransformer>, import("../../mol-state/index.js").StateObject>, any>>; coords: any; preset: { model: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; modelProperties: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; unitcell: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>> | undefined; structure: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; structureProperties: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; representation: any; } | { models?: undefined; structures?: undefined; } | { models: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>[]; structures: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>[]; } | { model: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; modelProperties: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; unitcell: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>> | undefined; structure: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; structureProperties: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; representation: any; } | { model: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; modelProperties: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; unitcell: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>> | undefined; structure: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; structureProperties: import("../../mol-state/index.js").StateObjectSelector>, import("../../mol-state/index.js").StateObject>, any>>; representation: any; } | undefined; }>; loadMvsFromUrl(url: string, format: 'mvsj' | 'mvsx', options?: MVSLoadOptions): Promise; /** Load MolViewSpec from `data`. * If `format` is 'mvsj', `data` must be a string or a Uint8Array containing a UTF8-encoded string. * If `format` is 'mvsx', `data` must be a Uint8Array or a string containing base64-encoded binary data prefixed with 'base64,'. */ loadMvsData(data: string | Uint8Array, format: 'mvsj' | 'mvsx', options?: MVSLoadOptions): Promise | import("../../mol-io/common/string-like.js").StringLike | import("../mvs-stories/index.js").MVSData>; loadFiles(files: File[]): Promise; loadUrl(url: string, format: string, isBinary?: boolean): Promise; handleResize(): void; /** * Triggers structure element selection or highlighting based on the provided * MolScript expression or StructureElement schema. Focus action will only apply to the * first structure that matches the criteria. * * If neither `expression` nor `elements` are provided, all selections/highlights * will be cleared based on the specified `action`. */ structureInteractivity(options: StructureInteractivityOptions): void; dispose(): void; }