UNPKG

molstar

Version:

A comprehensive macromolecular library.

798 lines (797 loc) 30.1 kB
/** * Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> * @author Alexander Rose <alexander.rose@weirdbyte.de> */ import { Ccp4File } from '../mol-io/reader/ccp4/schema'; import { CifFile } from '../mol-io/reader/cif'; import { DcdFile } from '../mol-io/reader/dcd/parser'; import { Dsn6File } from '../mol-io/reader/dsn6/schema'; import { PlyFile } from '../mol-io/reader/ply/schema'; import { PsfFile } from '../mol-io/reader/psf/parser'; import { ShapeProvider } from '../mol-model/shape/provider'; import { Coordinates as _Coordinates, Model as _Model, Structure as _Structure, Trajectory as _Trajectory, StructureElement, Topology as _Topology } from '../mol-model/structure'; import { Volume as _Volume } from '../mol-model/volume'; import { PluginBehavior } from '../mol-plugin/behavior/behavior'; import { Representation } from '../mol-repr/representation'; import { ShapeRepresentation } from '../mol-repr/shape/representation'; import { StructureRepresentation, StructureRepresentationState } from '../mol-repr/structure/representation'; import { VolumeRepresentation } from '../mol-repr/volume/representation'; import { StateObject, StateTransformer } from '../mol-state'; import { CubeFile } from '../mol-io/reader/cube/parser'; import { DxFile } from '../mol-io/reader/dx/parser'; import { Color } from '../mol-util/color/color'; import { Asset } from '../mol-util/assets'; export declare type TypeClass = 'root' | 'data' | 'prop'; export declare namespace PluginStateObject { export type Any = StateObject<any, TypeInfo>; export type TypeClass = 'Root' | 'Group' | 'Data' | 'Object' | 'Representation3D' | 'Behavior'; export interface TypeInfo { name: string; typeClass: TypeClass; } export const Create: <D = {}>(type: TypeInfo) => { new (data: D, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: D; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: D; }; }; export function isRepresentation3D(o?: Any): o is StateObject<Representation3DData<Representation.Any>, TypeInfo>; export function isBehavior(o?: Any): o is StateObject<PluginBehavior, TypeInfo>; export interface Representation3DData<T extends Representation.Any, S = any> { repr: T; sourceData: S; } export function CreateRepresentation3D<T extends Representation.Any, S = any>(type: { name: string; }): { new (data: Representation3DData<T, S>, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<T, S>; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<T, S>; }; }; export function CreateBehavior<T extends PluginBehavior>(type: { name: string; }): { new (data: T, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: T; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: T; }; }; const Root_base: { new (data: {}, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: {}; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: {}; }; }; export class Root extends Root_base { } const Group_base: { new (data: {}, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: {}; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: {}; }; }; export class Group extends Group_base { } export namespace Data { const String_base: { new (data: string, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: string; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: string; }; }; export class String extends String_base { } const Binary_base: { new (data: Uint8Array, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Uint8Array; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Uint8Array; }; }; export class Binary extends Binary_base { } export type BlobEntry = { id: string; } & ({ kind: 'string'; data: string; } | { kind: 'binary'; data: Uint8Array; }); export type BlobData = BlobEntry[]; const Blob_base: { new (data: BlobData, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: BlobData; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: BlobData; }; }; export class Blob extends Blob_base { } export {}; } export namespace Format { const Json_base: { new (data: any, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: any; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: any; }; }; export class Json extends Json_base { } const Cif_base: { new (data: CifFile, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: CifFile; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: CifFile; }; }; export class Cif extends Cif_base { } const Cube_base: { new (data: CubeFile, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: CubeFile; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: CubeFile; }; }; export class Cube extends Cube_base { } const Psf_base: { new (data: PsfFile, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: PsfFile; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: PsfFile; }; }; export class Psf extends Psf_base { } const Ply_base: { new (data: PlyFile, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: PlyFile; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: PlyFile; }; }; export class Ply extends Ply_base { } const Ccp4_base: { new (data: Ccp4File, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Ccp4File; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Ccp4File; }; }; export class Ccp4 extends Ccp4_base { } const Dsn6_base: { new (data: Dsn6File, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Dsn6File; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Dsn6File; }; }; export class Dsn6 extends Dsn6_base { } const Dx_base: { new (data: DxFile, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: DxFile; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: DxFile; }; }; export class Dx extends Dx_base { } export type BlobEntry = { id: string; } & ({ kind: 'json'; data: unknown; } | { kind: 'string'; data: string; } | { kind: 'binary'; data: Uint8Array; } | { kind: 'cif'; data: CifFile; } | { kind: 'pdb'; data: CifFile; } | { kind: 'gro'; data: CifFile; } | { kind: 'dcd'; data: DcdFile; } | { kind: 'ccp4'; data: Ccp4File; } | { kind: 'dsn6'; data: Dsn6File; } | { kind: 'dx'; data: DxFile; } | { kind: 'ply'; data: PlyFile; } | { kind: 'custom'; data: unknown; tag: string; }); export type BlobData = BlobEntry[]; const Blob_base_1: { new (data: BlobData, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: BlobData; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: BlobData; }; }; export class Blob extends Blob_base_1 { } export {}; } export namespace Molecule { const Coordinates_base: { new (data: _Coordinates, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Coordinates; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Coordinates; }; }; export class Coordinates extends Coordinates_base { } const Topology_base: { new (data: _Topology, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Topology; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Topology; }; }; export class Topology extends Topology_base { } const Model_base: { new (data: _Model, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Model; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Model; }; }; export class Model extends Model_base { } const Trajectory_base: { new (data: _Trajectory, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Trajectory; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Trajectory; }; }; export class Trajectory extends Trajectory_base { } const Structure_base: { new (data: _Structure, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Structure; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Structure; }; }; export class Structure extends Structure_base { } export namespace Structure { const Representation3D_base: { new (data: Representation3DData<StructureRepresentation<any>, _Structure>, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<StructureRepresentation<any>, _Structure>; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<StructureRepresentation<any>, _Structure>; }; }; export class Representation3D extends Representation3D_base { } export interface Representation3DStateData { repr: StructureRepresentation<any>; /** used to restore state when the obj is removed */ initialState: Partial<StructureRepresentationState>; state: Partial<StructureRepresentationState>; info?: unknown; } const Representation3DState_base: { new (data: Representation3DStateData, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DStateData; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DStateData; }; }; export class Representation3DState extends Representation3DState_base { } export interface SelectionEntry { key: string; groupId?: string; loci: StructureElement.Loci; } const Selections_base: { new (data: readonly SelectionEntry[], props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: readonly SelectionEntry[]; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: readonly SelectionEntry[]; }; }; export class Selections extends Selections_base { } export {}; } export {}; } export namespace Volume { export interface LazyInfo { url: string | Asset.Url; isBinary: boolean; format: string; entryId?: string | string[]; isovalues: { type: 'absolute' | 'relative'; value: number; color: Color; alpha?: number; volumeIndex?: number; }[]; } const Data_base: { new (data: _Volume, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Volume; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: _Volume; }; }; export class Data extends Data_base { } const Lazy_base: { new (data: LazyInfo, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: LazyInfo; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: LazyInfo; }; }; export class Lazy extends Lazy_base { } const Representation3D_base_1: { new (data: Representation3DData<VolumeRepresentation<any>, _Volume>, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<VolumeRepresentation<any>, _Volume>; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<VolumeRepresentation<any>, _Volume>; }; }; export class Representation3D extends Representation3D_base_1 { } export {}; } export namespace Shape { const Provider_base: { new (data: ShapeProvider<any, any, any>, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: ShapeProvider<any, any, any>; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: ShapeProvider<any, any, any>; }; }; export class Provider extends Provider_base { } const Representation3D_base_2: { new (data: Representation3DData<ShapeRepresentation<any, any, any>, unknown>, props?: { label: string; description?: string | undefined; } | undefined): { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<ShapeRepresentation<any, any, any>, unknown>; }; type: TypeInfo; is(obj?: StateObject<any, StateObject.Type<any>> | undefined): obj is { id: import("../mol-util/uuid").UUID; type: TypeInfo; label: string; description?: string | undefined; data: Representation3DData<ShapeRepresentation<any, any, any>, unknown>; }; }; export class Representation3D extends Representation3D_base_2 { } export {}; } export {}; } export declare namespace PluginStateTransform { const CreateBuiltIn: <A extends StateObject<any, StateObject.Type<any>>, B extends StateObject<any, StateObject.Type<any>>, P extends {} = {}>(definition: StateTransformer.Definition<A, B, P>) => StateTransformer<A, B, P>; const BuiltIn: StateTransformer.Builder.Root; }