import { nothing, PropertyValueMap } from 'lit';
import { AppType } from '../types/app.types';
import { MessageType, MessagesResultType, MutateMessageProps } from '../types/messages.types';
import { InfiniteQueryController } from '../controllers/infinite-query-controller';
import { ReverseInfiniteScrollController } from '../controllers/infinite-scroll-controller';
import { MutationController } from '../controllers/mutation-controller';
import { Ref } from 'lit/directives/ref.js';
import { PollMutationType } from '../data/poll';
import { MarkConversationMutationType, UpdateConversationMutationType } from '../data/conversation';
import { WeavySubAppComponent } from '../classes/weavy-sub-app-component';
import { ShadowPartsController } from '../controllers/shadow-parts-controller';
import { QueryController } from '../controllers/query-controller';
import { MembersResultType } from '../types/members.types';
import { MetadataType } from '../types/lists.types';
import { TypingEventType } from '../types/typing.events';
import { MsgEditorSubmitEventType } from '../types/editor.events';
import { WyEditorMessage } from './wy-editor-message';
declare global {
    interface HTMLElementTagNameMap {
        "wy-conversation": WyConversation;
    }
}
/**
 * Displays a single conversation with a message editor and an optional start avatar.
 *
 * **Used sub components**
 *
 * - [`<wy-avatar>`](./ui/wy-avatar.ts)
 * - [`<wy-avatar-header>`](./ui/wy-avatar.ts)
 * - [`<wy-avatar-group>`](./ui/wy-avatar.ts)
 * - [`<wy-button>`](./ui/wy-button.ts)
 * - [`<wy-dropdown>`](./ui/wy-dropdown.ts)
 * - [`<wy-empty>`](./wy-empty.ts)
 * - [`<wy-editor-message>`](./wy-editor-message.ts)
 * - [`<wy-icon>`](./ui/wy-icon.ts)
 * - [`<wy-item>`](./ui/wy-item.ts)
 * - [`<wy-message>`](./wy-message.ts)
 * - [`<wy-message-typing>`](./wy-message-typing.ts)
 * - [`<wy-progress-circular>`](./ui/wy-progress-circular.ts)
 * - [`<wy-skeleton>`](./ui/wy-skeleton.ts)
 *
 * @slot empty - Content in the empty state.
 * @slot footerbar - Content in the footerbar.
 *
 * @csspart wy-pager - Pager for message infinite scroll.
 * @csspart wy-pager-top - Pager styling for top placement.
 * @csspart wy-messages - Wrapper for the conversation messages.
 * @csspart wy-pane - Pane for the empty state.
 * @csspart wy-footerbar - The footerbar where the editor is placed.
 * @csspart wy-footerbar-sticky - Styles for making the footerbar sticky.
 * @csspart wy-footerbar-floating - Styles for making the footerbar floating.
 * @csspart wy-messages - Wrapper for the messages list.
 * @csspart wy-message-date-separator - Date separator shown between message days.
 * @csspart wy-banner - Unread marker toast wrapper.
 * @csspart wy-banner-action - Modifier part for the unread marker action.
 * @csspart wy-fade - Modifier part used when fading the unread marker.
 * @csspart wy-show - Modifier part used when the unread marker is shown.
 *
 * @fires {WyActionEventType} wy-action - Emitted when an embed action button is triggered.
 * @fires {WyPreviewOpenEventType} wy-preview-open - Fired when a preview overlay is about to open.
 * @fires {WyPreviewCloseEventType} wy-preview-close - Fired when a preview overlay is closed.
 */
export declare class WyConversation extends WeavySubAppComponent {
    #private;
    static styles: import('lit').CSSResult[];
    /**
     * Controller for exporting named shadow parts.
     *
     * @internal
     */
    protected exportParts: ShadowPartsController;
    /**
     * Conversation object provided to the component (overrides AppContext).
     *
     * @type {AppType | undefined}
     */
    conversation?: AppType;
    /**
     * Id of the conversation to load and display.
     */
    conversationId?: number;
    /**
     * Any Message to edit
     */
    editMessage?: MessageType;
    /**
     * Whether to render the header area for the conversation.
     */
    header: boolean;
    /**
     * Optional instructions passed to an AI agent for the conversation.
     */
    agentInstructions?: string;
    /**
     * Placeholder text for the message editor.
     */
    placeholder?: string;
    /**
     * Position of the unread marker in the message list.
     *
     * @internal
     */
    lastReadMessagePosition: "above" | "below";
    /**
     * The id of the last read message used for rendering the unread marker.
     *
     * @internal
     */
    lastReadMessageId?: number;
    /**
     * Whether the "new messages" banner should be shown.
     *
     * @internal
     */
    showNewMessages: boolean;
    /**
     * Temporarily set when creating a conversation (optimistic UI).
     *
     * @internal
     */
    isCreatingConversation: boolean;
    /**
     * Whether to show read receipts (presence of receivers).
     *
     * @internal
     */
    showReadReceipts: boolean;
    /**
     * Optional factory to create a conversation when sending the first message.
     *
     * @internal
     * @type {(payload: Omit<MutateMessageProps, "app_id">) => Promise<AppType> | undefined}
     */
    createConversation?: (payload: Omit<MutateMessageProps, "app_id">) => Promise<AppType>;
    /**
     * Optional function to request metadata for a message before sending.
     *
     * @internal
     * @type {(payload: MutateMessageProps) => Promise<MetadataType | undefined> | undefined}
     */
    requestMetadata?: (payload: MutateMessageProps) => Promise<MetadataType | undefined>;
    /**
     * Intersection observer used to detect when the bottom sentinel is visible (for marking/scrolling).
     *
     * @internal
     */
    protected bottomObserver: IntersectionObserver | undefined;
    isPrivateChat(conversation?: AppType): boolean;
    isChatRoom(conversation?: AppType): boolean;
    /**
     * Infinite query controller for loading messages.
     *
     * @internal
     */
    protected messagesQuery: InfiniteQueryController<MessagesResultType>;
    /**
     * Query controller for loading members for the conversation.
     *
     * @internal
     */
    protected membersQuery: QueryController<MembersResultType>;
    /**
     * Mutation for marking conversation as read/unread.
     *
     * @internal
     */
    protected markConversationMutation?: MarkConversationMutationType;
    /**
     * Mutation for updating conversation properties (name/avatar).
     *
     * @internal
     */
    protected updateConversationMutation?: UpdateConversationMutationType;
    /**
     * Mutation controller for poll votes used within this conversation.
     *
     * @internal
     */
    protected pollMutation?: PollMutationType;
    /**
     * Controller for adding messages.
     *
     * @internal
     */
    protected addMessageMutation: MutationController<MessageType, Error, MutateMessageProps, unknown>;
    /**
     * Reverse infinite scroll controller (loads newest messages at bottom).
     *
     * @internal
     */
    protected infiniteScroll: ReverseInfiniteScrollController;
    /**
     * Ref to the top pager element used for loading older messages.
     *
     * @internal
     */
    protected pagerRef: Ref<HTMLElement>;
    /**
     * Ref to the bottom sentinel element used for scrolling/marking behavior.
     *
     * @internal
     */
    protected bottomRef: Ref<HTMLElement>;
    /**
     * Ref to the message editor instance.
     *
     * @internal
     */
    protected editorRef: Ref<WyEditorMessage>;
    /**
     * Whether the viewport should stay pinned to bottom on updates.
     *
     * @internal
     */
    protected shouldBeAtBottom: boolean;
    /**
     * Whether another user is currently typing.
     *
     * @internal
     */
    protected isTyping: boolean;
    /**
     * Read-only helper returning whether the viewport is currently scrolled to the bottom.
     *
     * @internal
     */
    get isAtBottom(): boolean;
    /**
     * Scroll the conversation to the bottom.
     *
     * @param smooth - Whether to perform a smooth scroll.
     * @returns Promise<void>
     *
     * @internal
     */
    scrollToBottom(smooth?: boolean): Promise<void>;
    /**
     * Handle typing indicator events from child components.
     *
     * @internal
     * @param e - Typing event
     */
    protected handleTyping(e: TypingEventType): void;
    /**
     * Submit handler for the message editor. Adds a message and optionally creates a conversation first.
     *
     * @internal
     * @param e - Editor submit event
     * @returns Promise<MessageType>
     */
    protected handleSubmit(e: MsgEditorSubmitEventType): Promise<MessageType>;
    protected handleEditLast(_e: CustomEvent): Promise<void>;
    /**
     * Set the editor text programmatically.
     *
     * @param text - Text to set in the editor.
     * @returns Promise<void>
     *
     * @internal
     */
    setEditorText(text: string): Promise<void>;
    /**
     * Set metadata on the editor instance.
     *
     * @param metadata - Optional metadata object.
     * @returns Promise<void>
     *
     * @internal
     */
    setEditorMetadata(metadata?: MetadataType): Promise<void>;
    /**
     * Select all content in the editor.
     *
     * @internal
     */
    selectAllInEditor(): Promise<void>;
    /**
     * Move the editor cursor to the end of the content.
     *
     * @internal
     */
    setCursorLastInEditor(): Promise<void>;
    /**
     * Focus the editor input.
     *
     * @internal
     */
    focusEditor(): Promise<void>;
    /**
     * Sets the conversation title when the conversation is empty, based on message text.
     *
     * @internal
     * @param name - Title string to set.
     * @returns Promise<void>
     */
    setEmptyConversationTitle(name: string): Promise<void>;
    /**
     * Realtime handler for 'message_created' events.
     *
     * Updates local cache and handles read/unread logic.
     *
     * @internal
     */
    private handleRealtimeMessage;
    /**
     * Realtime handler for added reactions. Updates message reactions cache.
     *
     * @internal
     */
    private handleRealtimeReactionAdded;
    /**
     * Realtime handler for removed reactions. Updates message reactions cache.
     *
     * @internal
     */
    private handleRealtimeReactionDeleted;
    /**
     * Realtime handler for app marked events (read receipts).
     *
     * @internal
     */
    private handleRealtimeMarked;
    /**
     * Mark the conversation as read. Respects visibility and component lifecycle.
     *
     * @param messageId - Optional message id to mark as read.
     * @returns Promise<void>
     *
     * @internal
     */
    markAsRead(messageId?: number): Promise<void>;
    /**
     * Handler bound to document visibility/scroll events that triggers markAsRead when appropriate.
     *
     * @internal
     */
    protected markAsReadHandler: () => void;
    protected willUpdate(changedProperties: PropertyValueMap<this>): Promise<void>;
    renderConversationHeader(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1> | typeof nothing;
    renderMessages(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1>;
    render(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1>;
    updated(): void;
    connectedCallback(): void;
    disconnectedCallback(): void;
}
//# sourceMappingURL=wy-conversation.d.ts.map