UNPKG

reblock

Version:

Build interactive Slack surfaces with React

62 lines (61 loc) 1.36 kB
import Reconciler from 'react-reconciler' import type * as Slack from '@slack/bolt' import type { ReactNode } from 'react' type handler = ( event: Slack.BlockAction, client: Slack.webApi.WebClient ) => void export declare abstract class Root { children?: Rendered getChildren(): Rendered abstract publish(): void rendering: boolean timeoutID?: ReturnType<typeof setTimeout> lastPublishTime: number objectTreeModified(): void eventHandlers: Map<string, handler> findEventHandlers(): void stopRendering(): void } export type Rendered = (Instance | TextInstance)[] type Props = Record<string, unknown> export type Instance = { type: 'instance' id: string hidden: boolean element: string children: Rendered text: string | null props: Props } export type TextInstance = { type: 'text' id: string hidden: boolean text: string } type reconciler = Reconciler.Reconciler< Root, Instance, TextInstance, Instance | TextInstance, Instance | TextInstance > export declare function createContainer(root: Root): { container: unknown reconciler: Reconciler.Reconciler< Root, Instance, TextInstance, Instance | TextInstance, Instance | TextInstance > } export declare function render( element: ReactNode, reactInstance: { container: unknown reconciler: reconciler } ): void export {}