/** * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal * @author Alexander Rose */ import { ElementIndex, Model } from '../../mol-model/structure.js'; import { ColorTheme } from '../../mol-theme/color.js'; import { Color } from '../../mol-util/color/index.js'; import { CustomModelProperty } from './custom-model-property.js'; import { CustomProperty } from './custom-property.js'; import { LociLabelProvider } from '../../mol-plugin-state/manager/loci-label.js'; export { CustomElementProperty }; interface CustomElementProperty { propertyProvider: CustomModelProperty.Provider<{}, CustomElementProperty.Value>; colorThemeProvider?: ColorTheme.Provider<{}>; labelProvider?: LociLabelProvider; } declare namespace CustomElementProperty { type Value = Map; type Data = CustomProperty.Data>; interface Builder { label: string; name: string; getData(model: Model, ctx?: CustomProperty.Context): Data | Promise>; coloring?: { getColor: (p: T) => Color; defaultColor: Color; }; getLabel?: (p: T) => string | undefined; isApplicable?: (data: Model) => boolean; type?: 'dynamic' | 'static'; } function create(builder: Builder): CustomElementProperty; }