Migrate index.js to use Typescript (#129)

* Migrate index.js to use Typescript

* Fix tests
This commit is contained in:
Ben Schumacher 2020-09-24 09:42:36 +02:00 committed by GitHub
parent 18d30b50bc
commit d9532472eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 326 additions and 101 deletions

23
webapp/src/index.tsx Normal file
View file

@ -0,0 +1,23 @@
import {Store, Action} from 'redux';
import {GlobalState} from 'mattermost-redux/types/store';
import manifest from './manifest';
// eslint-disable-next-line import/no-unresolved
import {PluginRegistry} from './types/mattermost-webapp';
export default class Plugin {
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
public async initialize(registry: PluginRegistry, store: Store<GlobalState, Action<Record<string, unknown>>>) {
// @see https://developers.mattermost.com/extend/plugins/webapp/reference/
}
}
declare global {
interface Window {
registerPlugin(id: string, plugin: Plugin): void
}
}
window.registerPlugin(manifest.id, new Plugin());