main

mattermost/focalboard

Last updated at: 29/12/2023 09:40

index.d.ts

TLDR

This file is the TypeScript declaration file for the mattermost-webapp module. It exports an interface called PluginRegistry which defines various methods for registering different components, actions, and event handlers in the Mattermost web application.

Methods

registerPostTypeComponent

This method is used to register a custom post type component in the Mattermost web application.

registerChannelHeaderButtonAction

This method is used to register a button action for the channel header in the Mattermost web application.

registerChannelIntroButtonAction

This method is used to register a button action for the channel introduction in the Mattermost web application.

registerCustomRoute

This method is used to register a custom route in the Mattermost web application.

registerProductRoute

This method is used to register a product route in the Mattermost web application.

unregisterComponent

This method is used to unregister a component in the Mattermost web application.

registerProduct

This method is used to register a product in the Mattermost web application.

registerPostWillRenderEmbedComponent

This method is used to register a post will render embed component in the Mattermost web application.

registerWebSocketEventHandler

This method is used to register a WebSocket event handler in the Mattermost web application.

unregisterWebSocketEventHandler

This method is used to unregister a WebSocket event handler in the Mattermost web application.

registerAppBarComponent

This method is used to register an app bar component in the Mattermost web application.

registerRightHandSidebarComponent

This method is used to register a right-hand sidebar component in the Mattermost web application.

registerRootComponent

This method is used to register a root component in the Mattermost web application.

registerInsightsHandler

This method is used to register an insights handler in the Mattermost web application.

registerSiteStatisticsHandler

This method is used to register a site statistics handler in the Mattermost web application.

registerActionAfterChannelCreation

This method is used to register an action to be performed after channel creation in the Mattermost web application.

END

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {Channel, ChannelMembership} from 'mattermost-redux/types/channels'

export interface PluginRegistry {
    registerPostTypeComponent(typeName: string, component: React.ElementType)
    registerChannelHeaderButtonAction(icon: React.Element, action: () => void, dropdownText: string, tooltipText: string)
    registerChannelIntroButtonAction(icon: React.Element, action: () => void, tooltipText: string)
    registerCustomRoute(route: string, component: React.ElementType)
    registerProductRoute(route: string, component: React.ElementType)
    unregisterComponent(componentId: string)
    registerProduct(baseURL: string, switcherIcon: string, switcherText: string, switcherLinkURL: string, mainComponent: React.ElementType, headerCentreComponent: React.ElementType, headerRightComponent?: React.ElementType, showTeamSidebar: boolean)
    registerPostWillRenderEmbedComponent(match: (embed: {type: string, data: any}) => void, component: any, toggleable: boolean)
    registerWebSocketEventHandler(event: string, handler: (e: any) => void)
    unregisterWebSocketEventHandler(event: string)
    registerAppBarComponent(iconURL: string, action: (channel: Channel, member: ChannelMembership) => void, tooltipText: React.ReactNode)
    registerRightHandSidebarComponent(component: React.ElementType, title: React.Element)
    registerRootComponent(component: React.ElementType)
    registerInsightsHandler(handler: (timeRange: string, page: number, perPage: number, teamId: string, insightType: string) => void)
    registerSiteStatisticsHandler(handler: () => void)

    registerActionAfterChannelCreation(component: React.Element)

    // Add more if needed from https://developers.mattermost.com/extend/plugins/webapp/reference
}