/** * Copyright (c) 2019-2026 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal * @author Alexander Rose */ import { PluginContext } from '../../../mol-plugin/context.js'; import { StateTransformer } from '../../../mol-state/index.js'; import { ColorTheme } from '../../../mol-theme/color.js'; import { SizeTheme } from '../../../mol-theme/size.js'; import { ParamDefinition as PD } from '../../../mol-util/param-definition.js'; import { StructureRepresentationPresetProvider } from '../../builder/structure/representation-preset.js'; import { StatefulPluginComponent } from '../../component.js'; import { StructureSelectionQuery } from '../../helpers/structure-selection-query.js'; import { StructureRepresentation3D } from '../../transforms/representation.js'; import { StructureHierarchyRef, StructureComponentRef, StructureRef, StructureRepresentationRef } from './hierarchy-state.js'; import { Clip } from '../../../mol-util/clip.js'; export { StructureComponentManager }; interface StructureComponentManagerState { options: StructureComponentManager.Options; } declare class StructureComponentManager extends StatefulPluginComponent { plugin: PluginContext; readonly events: { optionsUpdated: import("rxjs").Subject; }; get currentStructures(): readonly StructureRef[]; get pivotStructure(): StructureRef | undefined; _setSnapshotState(options: StructureComponentManager.Options): void; setOptions(options: StructureComponentManager.Options): Promise; private updateReprParams; private updateInterationProps; applyPreset

(structures: ReadonlyArray, provider: P, params?: StructureRepresentationPresetProvider.Params

): Promise; private syncPreset; clear(structures: ReadonlyArray): Promise; selectThis(components: ReadonlyArray): void; canBeModified(ref: StructureHierarchyRef): boolean; modifyByCurrentSelection(components: ReadonlyArray, action: StructureComponentManager.ModifyAction): Promise; toggleVisibility(components: ReadonlyArray, reprPivot?: StructureRepresentationRef): void; removeRepresentations(components: ReadonlyArray, pivot?: StructureRepresentationRef): Promise | undefined; updateRepresentations(components: ReadonlyArray, pivot: StructureRepresentationRef, params: StateTransformer.Params): Promise; /** * To update theme for all selected structures, use * plugin.dataTransaction(async () => { * for (const s of structure.hierarchy.selection.structures) await updateRepresentationsTheme(s.componets, ...); * }, { canUndo: 'Update Theme' }); */ updateRepresentationsTheme(components: ReadonlyArray, params: StructureComponentManager.UpdateThemeParams): Promise | undefined; updateRepresentationsTheme(components: ReadonlyArray, params: (c: StructureComponentRef, r: StructureRepresentationRef) => StructureComponentManager.UpdateThemeParams): Promise | undefined; addRepresentation(components: ReadonlyArray, type: string): Promise | undefined; private tryFindComponent; add(params: StructureComponentManager.AddParams, structures?: ReadonlyArray): Promise; applyTheme(params: StructureComponentManager.ThemeParams, structures?: ReadonlyArray): Promise; private modifyComponent; updateLabel(component: StructureComponentRef, label: string): void; private get dataState(); private clearComponents; constructor(plugin: PluginContext); } declare namespace StructureComponentManager { const OptionsParams: { hydrogens: PD.Select<"all" | "hide-all" | "only-polar">; visualQuality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">; ignoreLight: PD.BooleanParam; materialStyle: PD.Group>; clipObjects: PD.Group[]; }>>; interactions: PD.Group; contacts: PD.Normalize<{ lineOfSightDistFactor: /*elided*/ any; }>; }>>; interior: PD.Group; substanceStrength: number; }>>; }; type Options = PD.Values; function getAddParams(plugin: PluginContext, params?: { pivot?: StructureRef; allowNone: boolean; hideSelection?: boolean; checkExisting?: boolean; }): { selection: PD.Select; representation: PD.Select; options: PD.Group>; }; type AddParams = { selection: StructureSelectionQuery; options: { checkExisting: boolean; label: string; }; representation: string; }; function getThemeParams(plugin: PluginContext, pivot: StructureRef | StructureComponentRef | undefined): { selection: PD.Select; action: PD.Mapped, "color"> | PD.NamedParams, "emissive"> | PD.NamedParams; }>, "material"> | PD.NamedParams, "transparency"> | PD.NamedParams, "clipping"> | PD.NamedParams, "resetColor"> | PD.NamedParams, "resetMaterial">>; representations: PD.MultiSelect; }; type ThemeParams = PD.Values>; function getRepresentationTypes(plugin: PluginContext, pivot: StructureRef | StructureComponentRef | undefined): [string, string][]; type ModifyAction = 'union' | 'subtract' | 'intersect'; interface UpdateThemeParams { /** * this works for any theme name (use 'name as any'), but code completion will break */ color?: C | 'default'; colorParams?: ColorTheme.BuiltInParams; size?: S | 'default'; sizeParams?: SizeTheme.BuiltInParams; } }