import React from 'react'; import type { ReactNode } from 'react'; import type { ChatView } from './ChatView'; import type { ChatViewEntityBinding, ChatViewEntityKind, ChatViewSlotRendererProps, ChatViewSlotRenderers } from './slotBinding'; export type SlotKindDefinition = { /** * Pure renderer for this kind: it does not claim slots or read layout state. A kind may declare * only policy and leave rendering to the app's `slotRenderers` (e.g. `channel`). */ Component?: (props: ChatViewSlotRendererProps) => ReactNode; /** * Marks nav-rail lists: navigation hides and unhides them but never closes or releases them, and * default slot resolution never picks them for a binding of another kind. */ persistent?: boolean; /** * ChatView that opening a binding of this kind switches to. Without it, the binding opens in the * active view. */ view?: ChatView; }; export type SlotKindRegistry = Partial<{ [TKind in ChatViewEntityKind]: SlotKindDefinition; }>; export declare const defaultSlotKindRegistry: SlotKindRegistry; /** Merges the app's `slotRenderers` into a registry, replacing only each kind's `Component`. */ export declare const resolveSlotKindRegistry: (slotRenderers?: ChatViewSlotRenderers, base?: SlotKindRegistry) => SlotKindRegistry; /** * Whether a slot's content renders anything. React renders nothing for `null`, `undefined` and * booleans, so a renderer returning `false` (as `condition && ` does) leaves the slot * empty. */ export declare const hasSlotContent: (content: ReactNode) => content is string | number | bigint | React.ReactElement> | Iterable | React.ReactPortal | Promise> | Iterable | null | undefined>; /** * Renders the registered `Component` of the entity's kind. A missing entity, an unregistered kind * or a kind without a `Component` render nothing, leaving any fallback to the caller. */ export declare const renderSlotFromRegistry: (entity: ChatViewEntityBinding | undefined, slot: string, registry: SlotKindRegistry) => ReactNode | null; /** Whether `kind` is registered as persistent (see {@link SlotKindDefinition.persistent}). */ export declare const isPersistentSlotKind: (registry: SlotKindRegistry, kind?: ChatViewEntityKind) => boolean; export declare const resolveSlotKindView: (registry: SlotKindRegistry, kind: ChatViewEntityKind) => ChatView | undefined; export declare const SlotRegistryContext: React.Context; thread: SlotKindDefinition<"thread">; threadList: SlotKindDefinition<"threadList">; channelList: SlotKindDefinition<"channelList">; memberList: SlotKindDefinition<"memberList">; userList: SlotKindDefinition<"userList">; searchResults: SlotKindDefinition<"searchResults">; pinnedMessagesList: SlotKindDefinition<"pinnedMessagesList">; userProfile: SlotKindDefinition<"userProfile">; }>>; export declare const useSlotRegistry: () => Partial<{ channel: SlotKindDefinition<"channel">; thread: SlotKindDefinition<"thread">; threadList: SlotKindDefinition<"threadList">; channelList: SlotKindDefinition<"channelList">; memberList: SlotKindDefinition<"memberList">; userList: SlotKindDefinition<"userList">; searchResults: SlotKindDefinition<"searchResults">; pinnedMessagesList: SlotKindDefinition<"pinnedMessagesList">; userProfile: SlotKindDefinition<"userProfile">; }>; //# sourceMappingURL=slotRegistry.d.ts.map