UNPKG

@asyncapi/react-component

Version:

A React component for AsyncAPI specification.

35 lines 1.31 kB
import React, { Component } from 'react'; import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; import { AsyncApiPlugin, ErrorObject, PropsSchema } from '../../types'; import { ConfigInterface } from '../../config'; import { PluginManager } from '../../helpers/pluginManager'; export interface AsyncApiProps { schema: PropsSchema; config?: Partial<ConfigInterface>; plugins?: AsyncApiPlugin[]; onPluginEvent?: (eventName: string, data: unknown) => void; onPluginManagerReady?: (pluginManager: PluginManager) => void; error?: ErrorObject; } interface AsyncAPIState { asyncapi?: AsyncAPIDocumentInterface; error?: ErrorObject; pm?: PluginManager; } declare class AsyncApiComponent extends Component<AsyncApiProps, AsyncAPIState> { private readonly registeredPlugins; private readonly propsPlugins; state: AsyncAPIState; constructor(props: AsyncApiProps); componentDidMount(): void; componentDidUpdate(prevProps: AsyncApiProps): void; render(): false | React.JSX.Element | null | undefined; private handler; private setupEventListeners; private cleanupEventListeners; private registerPlugins; private updatePlugins; private updateState; } export default AsyncApiComponent; //# sourceMappingURL=Standalone.d.ts.map