state.ts 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import { PluginCommand } from './command';
  7. import { Transform, State } from 'mol-state';
  8. import { StateAction } from 'mol-state/action';
  9. export const SetCurrentObject = PluginCommand<{ state: State, ref: Transform.Ref }>();
  10. export const ApplyAction = PluginCommand<{ state: State, action: StateAction.Instance, ref?: Transform.Ref }>();
  11. export const Update = PluginCommand<{ state: State, tree: State.Tree | State.Builder }>();
  12. // export const UpdateObject = PluginCommand<{ ref: Transform.Ref, params: any }>('ms-data', 'update-object');
  13. export const RemoveObject = PluginCommand<{ state: State, ref: Transform.Ref }>();
  14. export const ToggleExpanded = PluginCommand<{ state: State, ref: Transform.Ref }>({ isImmediate: true });
  15. export const ToggleVisibility = PluginCommand<{ state: State, ref: Transform.Ref }>({ isImmediate: true });
  16. export const Snapshots = {
  17. Add: PluginCommand<{ name?: string, description?: string }>({ isImmediate: true }),
  18. Remove: PluginCommand<{ id: string }>({ isImmediate: true }),
  19. Apply: PluginCommand<{ id: string }>({ isImmediate: true }),
  20. Clear: PluginCommand<{ }>({ isImmediate: true }),
  21. Upload: PluginCommand<{ name?: string, description?: string, serverUrl: string }>({ isImmediate: true }),
  22. Fetch: PluginCommand<{ url: string }>()
  23. }