preset-provider.ts 727 B

1234567891011121314151617
  1. /**
  2. * Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import { StateObject, StateObjectRef } from '../../mol-state';
  7. import { PluginContext } from '../../mol-plugin/context';
  8. import { ParamDefinition as PD } from '../../mol-util/param-definition';
  9. export interface PresetProvider<O extends StateObject = StateObject, P = any, S = {}> {
  10. id: string,
  11. display: { name: string, group?: string, description?: string },
  12. isApplicable?(a: O, plugin: PluginContext): boolean,
  13. params?(a: O | undefined, plugin: PluginContext): PD.For<P>,
  14. apply(a: StateObjectRef<O>, params: P, plugin: PluginContext): Promise<S> | S
  15. }