123456789101112131415161718192021222324252627282930313233343536373839 |
- /**
- * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
- *
- * @author David Sehnal <david.sehnal@gmail.com>
- */
- import { StateAction } from 'mol-state/action';
- import { Transformer } from 'mol-state';
- import { StateTransformParameters } from './ui/state/common';
- import { PluginLayoutStateProps } from './layout';
- export { PluginSpec }
- interface PluginSpec {
- actions: PluginSpec.Action[],
- behaviors: PluginSpec.Behavior[],
- initialLayout?: PluginLayoutStateProps
- }
- namespace PluginSpec {
- export interface Action {
- action: StateAction | Transformer,
- customControl?: StateTransformParameters.Class,
- autoUpdate?: boolean
- }
- export function Action(action: StateAction | Transformer, params?: { customControl?: StateTransformParameters.Class, autoUpdate?: boolean }): Action {
- return { action, customControl: params && params.customControl, autoUpdate: params && params.autoUpdate };
- }
- export interface Behavior {
- transformer: Transformer,
- defaultParams?: any
- }
- export function Behavior<T extends Transformer>(transformer: T, defaultParams?: Transformer.Params<T>): Behavior {
- return { transformer, defaultParams };
- }
- }
|