import React, { type ComponentType, type ReactNode } from 'react'; import { type ButtonProps } from '../../components/Button'; import type { DeriveWorkspaceNavigation } from './workspaceNavigationAdapter'; import type { PropsWithChildren } from 'react'; import type { Thread } from 'stream-chat'; import type { DuplicateEntityPolicy, LayoutController, LayoutSlotBinding, ResolveDuplicateEntity, SlotName } from './layoutController/layoutControllerTypes'; import type { ChatViewSlotFallbackProps, ChatViewSlotRenderers, LayoutDescriptor } from './slotBinding'; export * from './slotBinding'; export type { SlotKindDefinition, SlotKindRegistry } from './slotRegistry'; export { defaultSlotKindRegistry } from './slotRegistry'; export type ChatView = 'channels' | 'threads'; export type ChatViewBuiltinLayout = 'nav-rail-entity-list-workspace'; export type ChatViewProps = PropsWithChildren<{ /** * Overrides members of the {@link WorkspaceNavigation} that ChatView provides. Receives the * SDK-derived navigation and returns only the members to replace. Must be referentially stable. */ deriveWorkspaceNavigation?: DeriveWorkspaceNavigation; /** * ID of the dialog manager ChatView hosts inside its `.str-chat` root. Dialogs opened by view * content resolve to it, so their overlays get the `.str-chat`-scoped CSS. Omit for a local, * unregistered manager. */ dialogManagerId?: string; duplicateEntityPolicy?: DuplicateEntityPolicy; layout?: ChatViewBuiltinLayout; layoutController?: LayoutController; layouts?: LayoutDescriptor[]; resolveDuplicateEntity?: ResolveDuplicateEntity; /** * Rendered by the built-in workspace layout in a slot with nothing bound. A layout whose slots * are all blank shows {@link ChatViewEmptyPlaceholder}. */ SlotFallback?: ComponentType; /** Per-slot {@link ChatViewProps.SlotFallback}. */ slotFallbackComponents?: Partial>>; slotRenderers?: ChatViewSlotRenderers; /** * Content per view. Only the active view's node renders, in a plain `
` whose `id` comes * from `chatViewPanelIds`; its slots come from the matching `layouts` descriptor. */ views?: Partial>; /** Optional per-view navigation action slot resolvers. */ viewActionSlotResolvers?: Partial>; }>; export type ChatViewNavigationAction = 'openChannel' | 'openThread'; export type ResolveViewActionTargetSlotArgs = { action: ChatViewNavigationAction; activeView: ChatView; availableSlots: SlotName[]; requestedSlot?: SlotName; slotBindings: Record; slotNames?: SlotName[]; }; export type ResolveViewActionTargetSlot = (args: ResolveViewActionTargetSlotArgs) => SlotName | undefined; export type ViewActionSlotResolvers = Partial>; type ChatViewContextValue = { activeView: ChatView; layoutController: LayoutController; registerViewActionSlotResolvers: (view: ChatView, resolvers?: ViewActionSlotResolvers) => void; resolveActionTargetSlot: (view: ChatView, args: ResolveViewActionTargetSlotArgs) => SlotName | undefined; setActiveView: (cv: ChatView) => void; }; export declare const ChatViewContext: React.Context; export declare const useChatViewContext: () => ChatViewContextValue; export declare const ChatView: { ({ children, deriveWorkspaceNavigation, dialogManagerId, duplicateEntityPolicy, layout, layoutController, layouts: layoutsProp, resolveDuplicateEntity, SlotFallback, slotFallbackComponents, slotRenderers, viewActionSlotResolvers: viewActionSlotResolversProp, views, }: ChatViewProps): import("react/jsx-runtime").JSX.Element; Selector: ({ iconOnly, itemSet, }: ChatViewSelectorProps) => import("react/jsx-runtime").JSX.Element; }; /** * Activates the thread while the window is visible and focused, and releases it otherwise. * * @param params.activeThread - Thread to activate. Does nothing when undefined. */ export declare const useActiveThread: ({ activeThread }: { activeThread?: Thread; }) => void; export declare const ChatViewSelectorButton: ({ ActiveIcon, children, className, Icon, iconOnly, isActive, text, ...props }: ButtonProps & { ActiveIcon?: ComponentType; iconOnly?: boolean; Icon?: ComponentType; isActive?: boolean; text?: string; }) => import("react/jsx-runtime").JSX.Element; export type ChatViewSelectorItemProps = { iconOnly?: boolean; }; export declare const ChatViewChannelsSelectorButton: ({ iconOnly, }: ChatViewSelectorItemProps) => import("react/jsx-runtime").JSX.Element; export declare const ChatViewThreadsSelectorButton: ({ iconOnly, }: ChatViewSelectorItemProps) => import("react/jsx-runtime").JSX.Element; export type ChatViewSelectorItem = { Component: React.ComponentType; type: string & {}; }; export type ChatViewSelectorEntry = ChatViewSelectorItem; export type ChatViewSelectorProps = { iconOnly?: boolean; itemSet?: ChatViewSelectorEntry[]; }; export declare const defaultChatViewSelectorItemSet: ChatViewSelectorEntry[]; //# sourceMappingURL=ChatView.d.ts.map