index.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // import React from 'react';
  2. import {Store, Action} from 'redux';
  3. import {GlobalState} from 'mattermost-redux/types/store';
  4. import manifest from './manifest';
  5. // eslint-disable-next-line import/no-unresolved
  6. import {PluginRegistry} from './types/mattermost-webapp';
  7. // const Icon = () => <i className='icon fa fa-plug'/>;
  8. export default class Plugin {
  9. // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
  10. public async initialize(registry: PluginRegistry, store: Store<GlobalState, Action<Record<string, unknown>>>) {
  11. // @see https://developers.mattermost.com/extend/plugins/webapp/reference/
  12. // registry.registerChannelHeaderButtonAction(
  13. //
  14. // // icon - JSX element to use as the button's icon
  15. // <Icon/>,
  16. //
  17. // // action - a function called when the button is clicked, passed the channel and channel member as arguments
  18. // // null,
  19. // () => {
  20. // alert('Hello World!');
  21. // },
  22. //
  23. // // dropdown_text - string or JSX element shown for the dropdown button description
  24. // 'Hello World',
  25. // 'Hello World',
  26. // );
  27. }
  28. }
  29. declare global {
  30. interface Window {
  31. registerPlugin(id: string, plugin: Plugin): void
  32. }
  33. }
  34. window.registerPlugin(manifest.id, new Plugin());