import type { ChatView, ChatViewEntityBinding } from '../ChatView'; import type { SlotName } from '../layoutController/layoutControllerTypes'; type SlotEntityKind = ChatViewEntityBinding['kind']; type SlotEntitySourceMap = { [TKind in SlotEntityKind]: Extract['source']; }; type SlotEntitySourceByKind = SlotEntitySourceMap[TKind]; type UseSlotEntityOptions = { /** Entity kind to resolve from the slot bindings. */ kind: TKind; /** Only this slot is checked. Defaults to every slot of the view, in `availableSlots` order. */ slot?: SlotName; /** * View whose slots are read, even when another view is active. Defaults to the active view. * Needed by state that must not clear on a view switch, such as URL sync. */ view?: ChatView; }; /** * Resolves the `source` of the first slot binding of the given kind, or `undefined` when none * matches. * * @example * ```tsx * const channel = useSlotEntity({ kind: 'channel' }); * // channel is Stream Channel | undefined * ``` * * @example * ```tsx * const thread = useSlotEntity({ kind: 'thread', slot: 'main-thread' }); * // thread is Thread | undefined from that slot only * ``` * * @example * ```tsx * const list = useSlotEntity({ kind: 'channelList', slot: 'list' }); * // list is Record | undefined * ``` */ export declare const useSlotEntity: ({ kind, slot, view, }: UseSlotEntityOptions) => SlotEntitySourceByKind | undefined; /** * Like {@link useSlotEntity}, but resolves the source of the topmost layer of a slot (the last * entry of `slotLayers[slot]`) instead of its base binding, when that layer's `kind` matches. * * A layer never replaces the base binding, which {@link useSlotEntity} keeps returning. * * @example * ```tsx * const profile = useSlotTopLayerEntity({ kind: 'userProfile', slot: 'main-thread' }); * // profile is { userId } | undefined, present while a userProfile layer covers the slot * ``` */ export declare const useSlotTopLayerEntity: ({ kind, slot, view, }: UseSlotEntityOptions) => SlotEntitySourceByKind | undefined; /** * Resolves every slot binding of the given kind as `{ slot, source }` pairs, in `availableSlots` * order. * * Prefer it over `useSlotEntity` when several slots can hold the same kind, such as two channels * side by side. * * @example * ```tsx * const channels = useSlotEntities({ kind: 'channel' }); * // channels is Array<{ slot: SlotName; source: Channel }> * ``` */ export declare const useSlotEntities: ({ kind, slot, view, }: UseSlotEntityOptions) => Array<{ slot: SlotName; source: SlotEntitySourceByKind; }>; /** * The channel in `slot`. Without `slot` it is the channel of the first slot holding one, which only * suits a single-channel workspace; use {@link useSlotChannels} for several. * * @example * ```tsx * const channel = useSlotChannel({ slot: 'main' }); * ``` */ export declare const useSlotChannel: (options?: { slot?: SlotName; view?: ChatView; }) => import("stream-chat").Channel | undefined; /** * Every slot currently holding a channel, as `{ channel, slot }` pairs: one panel to render per * entry. * * @example * ```tsx * useSlotChannels().map(({ channel, slot }) => ) * ``` */ export declare const useSlotChannels: (options?: { slot?: SlotName; view?: ChatView; }) => { channel: import("stream-chat").Channel; slot: string; }[]; /** * The thread in `slot`, or in the first slot holding one when `slot` is omitted. * * @example * ```tsx * const thread = useSlotThread(); * ``` */ export declare const useSlotThread: (options?: { slot?: SlotName; view?: ChatView; }) => import("stream-chat").Thread | undefined; /** * Every slot currently holding a thread, as `{ thread, slot }` pairs: one panel to render per * entry. * * @example * ```tsx * useSlotThreads().map(({ thread, slot }) => ( * * )) * ``` */ export declare const useSlotThreads: (options?: { slot?: SlotName; view?: ChatView; }) => { slot: string; thread: import("stream-chat").Thread; }[]; export {}; //# sourceMappingURL=useSlotEntity.d.ts.map